================
@@ -48,32 +54,32 @@
_CLC_DEF _CLC_OVERLOAD float __clc_rtz(float x) {
/* Handle nan corner case */
- if (isnan(x))
+ if (__clc_isnan(x))
return x;
/* RTZ does not produce Inf for large numbers */
- if (fabs(x) > 65504.0f && !isinf(x))
- return copysign(65504.0f, x);
+ if (__clc_fabs(x) > 65504.0f && !__clc_isinf(x))
+ return __clc_copysign(65504.0f, x);
const int exp = (__clc_as_uint(x) >> 23 & 0xff) - 127;
/* Manage range rounded to +- zero explicitely */
if (exp < -24)
- return copysign(0.0f, x);
+ return __clc_copysign(0.0f, x);
/* Remove lower 13 bits to make sure the number is rounded down */
int mask = 0xffffe000;
/* Denormals cannot be flushed, and they use different bit for rounding */
if (exp < -14)
- mask <<= min(-(exp + 14), 10);
+ mask <<= __clc_min(-(exp + 14), 10);
----------------
wenju-he wrote:
> in general __clc_fmin is more optimized than __clc_min for float input
sorry, I didn't notice exp is integer.
https://github.com/llvm/llvm-project/pull/171770
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits