1515#define __BMI2INTRIN_H
1616
1717/* Define the default attributes for the functions in this file. */
18- #define __DEFAULT_FN_ATTRS __attribute__ ((__always_inline__, __nodebug__, __target__(" bmi2" )))
19-
2018#if defined(__cplusplus) && (__cplusplus >= 201103L)
21- #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
19+ #define __DEFAULT_FN_ATTRS \
20+ __attribute__ ((__always_inline__, __nodebug__, __target__(" bmi2" ))) constexpr
2221#else
23- #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
22+ #define __DEFAULT_FN_ATTRS \
23+ __attribute__ ((__always_inline__, __nodebug__, __target__(" bmi2" )))
2424#endif
2525
2626// / Copies the unsigned 32-bit integer \a __X and zeroes the upper bits
4343// / \param __Y
4444// / The lower 8 bits specify the bit number of the lowest bit to zero.
4545// / \returns The partially zeroed 32-bit value.
46- static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
47- _bzhi_u32 (unsigned int __X, unsigned int __Y)
48- {
46+ static __inline__ unsigned int __DEFAULT_FN_ATTRS
47+ _bzhi_u32 (unsigned int __X, unsigned int __Y) {
4948 return __builtin_ia32_bzhi_si (__X, __Y);
5049}
5150
@@ -73,9 +72,8 @@ _bzhi_u32(unsigned int __X, unsigned int __Y)
7372// / \param __Y
7473// / The 32-bit mask specifying where to deposit source bits.
7574// / \returns The 32-bit result.
76- static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
77- _pdep_u32 (unsigned int __X, unsigned int __Y)
78- {
75+ static __inline__ unsigned int __DEFAULT_FN_ATTRS
76+ _pdep_u32 (unsigned int __X, unsigned int __Y) {
7977 return __builtin_ia32_pdep_si (__X, __Y);
8078}
8179
@@ -103,9 +101,8 @@ _pdep_u32(unsigned int __X, unsigned int __Y)
103101// / \param __Y
104102// / The 32-bit mask specifying which source bits to extract.
105103// / \returns The 32-bit result.
106- static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
107- _pext_u32 (unsigned int __X, unsigned int __Y)
108- {
104+ static __inline__ unsigned int __DEFAULT_FN_ATTRS
105+ _pext_u32 (unsigned int __X, unsigned int __Y) {
109106 return __builtin_ia32_pext_si (__X, __Y);
110107}
111108
@@ -130,8 +127,7 @@ _pext_u32(unsigned int __X, unsigned int __Y)
130127// / A pointer to memory for storing the upper half of the product.
131128// / \returns The lower half of the product.
132129static __inline__ unsigned int __DEFAULT_FN_ATTRS
133- _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
134- {
130+ _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P) {
135131 unsigned long long __res = (unsigned long long ) __X * __Y;
136132 *__P = (unsigned int )(__res >> 32 );
137133 return (unsigned int )__res;
@@ -159,9 +155,8 @@ _mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
159155// / \param __Y
160156// / The lower 8 bits specify the bit number of the lowest bit to zero.
161157// / \returns The partially zeroed 64-bit value.
162- static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
163- _bzhi_u64 (unsigned long long __X, unsigned long long __Y)
164- {
158+ static __inline__ unsigned long long __DEFAULT_FN_ATTRS
159+ _bzhi_u64 (unsigned long long __X, unsigned long long __Y) {
165160 return __builtin_ia32_bzhi_di (__X, __Y);
166161}
167162
@@ -189,9 +184,8 @@ _bzhi_u64(unsigned long long __X, unsigned long long __Y)
189184// / \param __Y
190185// / The 64-bit mask specifying where to deposit source bits.
191186// / \returns The 64-bit result.
192- static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
193- _pdep_u64 (unsigned long long __X, unsigned long long __Y)
194- {
187+ static __inline__ unsigned long long __DEFAULT_FN_ATTRS
188+ _pdep_u64 (unsigned long long __X, unsigned long long __Y) {
195189 return __builtin_ia32_pdep_di (__X, __Y);
196190}
197191
@@ -219,9 +213,8 @@ _pdep_u64(unsigned long long __X, unsigned long long __Y)
219213// / \param __Y
220214// / The 64-bit mask specifying which source bits to extract.
221215// / \returns The 64-bit result.
222- static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
223- _pext_u64 (unsigned long long __X, unsigned long long __Y)
224- {
216+ static __inline__ unsigned long long __DEFAULT_FN_ATTRS
217+ _pext_u64 (unsigned long long __X, unsigned long long __Y) {
225218 return __builtin_ia32_pext_di (__X, __Y);
226219}
227220
@@ -247,8 +240,7 @@ _pext_u64(unsigned long long __X, unsigned long long __Y)
247240// / \returns The lower half of the product.
248241static __inline__ unsigned long long __DEFAULT_FN_ATTRS
249242_mulx_u64 (unsigned long long __X, unsigned long long __Y,
250- unsigned long long *__P)
251- {
243+ unsigned long long *__P) {
252244 unsigned __int128 __res = (unsigned __int128) __X * __Y;
253245 *__P = (unsigned long long ) (__res >> 64 );
254246 return (unsigned long long ) __res;
@@ -257,6 +249,5 @@ _mulx_u64 (unsigned long long __X, unsigned long long __Y,
257249#endif /* __x86_64__ */
258250
259251#undef __DEFAULT_FN_ATTRS
260- #undef __DEFAULT_FN_ATTRS_CONSTEXPR
261252
262253#endif /* __BMI2INTRIN_H */
0 commit comments