[PATCH v1 24/35] soft-fp/: Remove _FP_STATIC_ASSERT() macro
Alejandro Colomar
alx@kernel.org
Sun Nov 9 21:53:48 GMT 2025
It's unconditionally defined as _Static_assert().
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
soft-fp/op-2.h | 2 +-
soft-fp/op-common.h | 16 ++++++++--------
soft-fp/soft-fp.h | 3 ---
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h
index 17a50ade32..3c45c50233 100644
--- a/soft-fp/op-2.h
+++ b/soft-fp/op-2.h
@@ -454,7 +454,7 @@
_p240, _q240, _r240, _s240; \
UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0; \
\
- _FP_STATIC_ASSERT ((wfracbits) >= 106 && (wfracbits) <= 120, \
+ _Static_assert ((wfracbits) >= 106 && (wfracbits) <= 120, \
"wfracbits out of range"); \
\
setfetz; \
diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h
index f8e6ded958..292443fbe5 100644
--- a/soft-fp/op-common.h
+++ b/soft-fp/op-common.h
@@ -1800,7 +1800,7 @@
if ((X##_s = ((r) < 0))) \
_FP_FROM_INT_ur = -_FP_FROM_INT_ur; \
\
- _FP_STATIC_ASSERT ((rsize) <= 2 * _FP_W_TYPE_SIZE, \
+ _Static_assert ((rsize) <= 2 * _FP_W_TYPE_SIZE, \
"rsize too large"); \
(void) (((rsize) <= _FP_W_TYPE_SIZE) \
? ({ \
@@ -1876,13 +1876,13 @@
#define _FP_EXTEND_CNAN(dfs, sfs, dwc, swc, D, S, check_nan) \
do \
{ \
- _FP_STATIC_ASSERT (_FP_FRACBITS_##dfs >= _FP_FRACBITS_##sfs, \
+ _Static_assert (_FP_FRACBITS_##dfs >= _FP_FRACBITS_##sfs, \
"destination mantissa narrower than source"); \
- _FP_STATIC_ASSERT ((_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \
+ _Static_assert ((_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \
>= _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs), \
"destination max exponent smaller" \
" than source"); \
- _FP_STATIC_ASSERT (((_FP_EXPBIAS_##dfs \
+ _Static_assert (((_FP_EXPBIAS_##dfs \
>= (_FP_EXPBIAS_##sfs \
+ _FP_FRACBITS_##sfs - 1)) \
|| (_FP_EXPBIAS_##dfs == _FP_EXPBIAS_##sfs)), \
@@ -1950,9 +1950,9 @@
#define FP_TRUNC(dfs, sfs, dwc, swc, D, S) \
do \
{ \
- _FP_STATIC_ASSERT (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \
+ _Static_assert (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \
"destination mantissa wider than source"); \
- _FP_STATIC_ASSERT (((_FP_EXPBIAS_##sfs \
+ _Static_assert (((_FP_EXPBIAS_##sfs \
>= (_FP_EXPBIAS_##dfs \
+ _FP_FRACBITS_##dfs - 1)) \
|| _FP_EXPBIAS_##sfs == _FP_EXPBIAS_##dfs), \
@@ -2042,7 +2042,7 @@
#define FP_TRUNC_COOKED(dfs, sfs, dwc, swc, D, S) \
do \
{ \
- _FP_STATIC_ASSERT (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \
+ _Static_assert (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \
"destination mantissa wider than source"); \
if (S##_c == FP_CLS_NAN) \
_FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs \
@@ -2067,7 +2067,7 @@
# define __FP_CLZ(r, x) \
do \
{ \
- _FP_STATIC_ASSERT ((sizeof (_FP_W_TYPE) == sizeof (unsigned int) \
+ _Static_assert ((sizeof (_FP_W_TYPE) == sizeof (unsigned int) \
|| (sizeof (_FP_W_TYPE) \
== sizeof (unsigned long)) \
|| (sizeof (_FP_W_TYPE) \
diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
index e13eb8e0c4..51d3b437a4 100644
--- a/soft-fp/soft-fp.h
+++ b/soft-fp/soft-fp.h
@@ -47,9 +47,6 @@
# endif
#endif
-# define _FP_STATIC_ASSERT(expr, msg) \
- _Static_assert ((expr), msg)
-
/* In the Linux kernel, some architectures have a single function that
uses different kinds of unpacking and packing depending on the
instruction being emulated, meaning it is not readily visible to
--
2.51.0
More information about the Libc-alpha
mailing list