12
12
#include " src/__support/FPUtil/cast.h"
13
13
#include " src/__support/FPUtil/except_value_utils.h"
14
14
#include " src/__support/FPUtil/multiply_add.h"
15
+ #include " src/__support/FPUtil/rounding_mode.h"
15
16
#include " src/__support/FPUtil/sqrt.h"
16
17
#include " src/__support/common.h"
17
18
#include " src/__support/macros/config.h"
@@ -76,13 +77,10 @@ LLVM_LIBC_FUNCTION(float16, asinhf16, (float16 x)) {
76
77
// when |x| < 0x1.718p-5, asinhf16(x) = x. Adjust by 1 ULP for certain
77
78
// rounding types.
78
79
if (LIBC_UNLIKELY (x_abs < 0x29c6 )) {
79
- if (((fputil::get_round () == FE_UPWARD) ||
80
- (fputil::get_round () == FE_TOWARDZERO)) &&
81
- xf < 0 )
80
+ int rounding = fputil::quick_get_round ();
81
+ if ((rounding == FE_UPWARD || rounding == FE_TOWARDZERO) && xf < 0 )
82
82
return fputil::cast<float16>(xf + 0x1p-24f );
83
- if (((fputil::get_round () == FE_DOWNWARD) ||
84
- (fputil::get_round () == FE_TOWARDZERO)) &&
85
- xf > 0 )
83
+ if ((rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO) && xf > 0 )
86
84
return fputil::cast<float16>(xf - 0x1p-24f );
87
85
return fputil::cast<float16>(xf);
88
86
}
@@ -103,4 +101,5 @@ LLVM_LIBC_FUNCTION(float16, asinhf16, (float16 x)) {
103
101
return fputil::cast<float16>(
104
102
x_sign * log_eval (fputil::multiply_add (xf, x_sign, sqrt_term)));
105
103
}
104
+
106
105
} // namespace LIBC_NAMESPACE_DECL
0 commit comments