[PATCH 7/8] math: Use stdbit.h instead of builtin in math_config.h
Adhemerval Zanella
adhemerval.zanella@linaro.org
Fri Oct 10 17:49:25 GMT 2025
---
sysdeps/ieee754/flt-32/math_config.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
index 6bb5c3324cc..230aee591ce 100644
--- a/sysdeps/ieee754/flt-32/math_config.h
+++ b/sysdeps/ieee754/flt-32/math_config.h
@@ -23,6 +23,7 @@
#include <math_private.h>
#include <nan-high-order-bit.h>
#include <stdint.h>
+#include <stdbit.h>
#ifndef WANT_ROUNDING
/* Correct special case results in non-nearest rounding modes. */
@@ -77,7 +78,7 @@ roundeven_finite (double x)
{
union { double f; uint64_t i; } u = {y};
union { double f; uint64_t i; } v = {y - copysign (1.0, x)};
- if (__builtin_ctzll (v.i) > __builtin_ctzll (u.i))
+ if (stdc_trailing_zeros (v.i) > stdc_trailing_zeros (u.i))
y = v.f;
}
return y;
@@ -101,8 +102,8 @@ roundevenf_finite (float x)
if (fabs (x - y) == 0.5)
{
union { float f; uint32_t i; } u = {y};
- union { float f; uint32_t i; } v = {y - copysignf (1.0, x)};
- if (__builtin_ctzl (v.i) > __builtin_ctzl (u.i))
+ union { float f; uint32_t i; } v = {y - copysignf (1.0f, x)};
+ if (stdc_trailing_zeros (v.i) > stdc_trailing_zeros (u.i))
y = v.f;
}
return y;
--
2.43.0
More information about the Libc-alpha
mailing list