/* Macro to test whether (on targets where psABI requires it) _BitInt
with padding bits have those filled with sign or zero extension. */
#if defined(__s390x__) || defined(__arm__) || defined(__loongarch__)
+#define BEXTC1(x, uns) \
+ do { \
+ uns _BitInt(PROMOTED_SIZE (x) * __CHAR_BIT__) __x; \
+ do_copy (&__x, &(x), sizeof (__x)); \
+ if (__x != (typeof (x)) __x) \
+ __builtin_abort (); \
+ } while (0)
+
#define BEXTC(x) \
- do { \
- if ((typeof (x)) -1 < 0) \
- { \
- _BitInt(PROMOTED_SIZE (x) * __CHAR_BIT__) __x; \
- do_copy (&__x, &(x), sizeof (__x)); \
- if (__x != (x)) \
- __builtin_abort (); \
- } \
- else \
- { \
- unsigned _BitInt(PROMOTED_SIZE (x) * __CHAR_BIT__) __x; \
- do_copy (&__x, &(x), sizeof (__x)); \
- if (__x != (x)) \
- __builtin_abort (); \
- } \
+ do { \
+ if ((typeof (x)) -1 < 0) \
+ BEXTC1 ((x), signed); \
+ else \
+ BEXTC1 ((x), unsigned); \
} while (0)
#else
#define BEXTC(x) do { (void) (x); } while (0)