Functions
-
bool fenv_is_round_up ()Quick free-standing test whether fegetround() == FE_UPWARD.
Using the following observation:
1.0f + 2^-25 = 1.0f for FE_TONEAREST, FE_DOWNWARD, FE_TOWARDZERO
= 0x1.000002f for FE_UPWARD.
Defined at line 26 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/rounding_mode.h
-
bool fenv_is_round_down ()Quick free-standing test whether fegetround() == FE_DOWNWARD.
Using the following observation:
-1.0f - 2^-25 = -1.0f for FE_TONEAREST, FE_UPWARD, FE_TOWARDZERO
= -0x1.000002f for FE_DOWNWARD.
Defined at line 35 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/rounding_mode.h
-
bool fenv_is_round_to_nearest ()Quick free-standing test whether fegetround() == FE_TONEAREST.
Using the following observation:
1.5f + 2^-24 = 1.5f for FE_TONEAREST, FE_DOWNWARD, FE_TOWARDZERO
= 0x1.100002p0f for FE_UPWARD,
1.5f - 2^-24 = 1.5f for FE_TONEAREST, FE_UPWARD
= 0x1.0ffffep-1f for FE_DOWNWARD, FE_TOWARDZERO
Defined at line 46 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/rounding_mode.h
-
bool fenv_is_round_to_zero ()Quick free-standing test whether fegetround() == FE_TOWARDZERO.
Using the following observation:
1.0f + 2^-23 + 2^-24 = 0x1.000002p0f for FE_DOWNWARD, FE_TOWARDZERO
= 0x1.000004p0f for FE_TONEAREST, FE_UPWARD,
-1.0f - 2^-24 = -1.0f for FE_TONEAREST, FE_UPWARD, FE_TOWARDZERO
= -0x1.000002p0f for FE_DOWNWARD
So:
(0x1.000002p0f + 2^-24) + (-1.0f - 2^-24) = 2^-23 for FE_TOWARDZERO
= 2^-22 for FE_TONEAREST, FE_UPWARD
= 0 for FE_DOWNWARD
Defined at line 62 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/rounding_mode.h
-
int quick_get_round ()Quick free standing get rounding mode based on the above observations.
Defined at line 69 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/rounding_mode.h