15
15
#define __BMI2INTRIN_H
16
16
17
17
/* Define the default attributes for the functions in this file. */
18
- #define __DEFAULT_FN_ATTRS __attribute__ ((__always_inline__, __nodebug__, __target__(" bmi2" )))
19
-
20
18
#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
22
21
#else
23
- #define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
22
+ #define __DEFAULT_FN_ATTRS \
23
+ __attribute__ ((__always_inline__, __nodebug__, __target__(" bmi2" )))
24
24
#endif
25
25
26
26
// / Copies the unsigned 32-bit integer \a __X and zeroes the upper bits
43
43
// / \param __Y
44
44
// / The lower 8 bits specify the bit number of the lowest bit to zero.
45
45
// / \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) {
49
48
return __builtin_ia32_bzhi_si (__X, __Y);
50
49
}
51
50
@@ -73,9 +72,8 @@ _bzhi_u32(unsigned int __X, unsigned int __Y)
73
72
// / \param __Y
74
73
// / The 32-bit mask specifying where to deposit source bits.
75
74
// / \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) {
79
77
return __builtin_ia32_pdep_si (__X, __Y);
80
78
}
81
79
@@ -103,9 +101,8 @@ _pdep_u32(unsigned int __X, unsigned int __Y)
103
101
// / \param __Y
104
102
// / The 32-bit mask specifying which source bits to extract.
105
103
// / \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) {
109
106
return __builtin_ia32_pext_si (__X, __Y);
110
107
}
111
108
@@ -130,8 +127,7 @@ _pext_u32(unsigned int __X, unsigned int __Y)
130
127
// / A pointer to memory for storing the upper half of the product.
131
128
// / \returns The lower half of the product.
132
129
static __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) {
135
131
unsigned long long __res = (unsigned long long ) __X * __Y;
136
132
*__P = (unsigned int )(__res >> 32 );
137
133
return (unsigned int )__res;
@@ -159,9 +155,8 @@ _mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
159
155
// / \param __Y
160
156
// / The lower 8 bits specify the bit number of the lowest bit to zero.
161
157
// / \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) {
165
160
return __builtin_ia32_bzhi_di (__X, __Y);
166
161
}
167
162
@@ -189,9 +184,8 @@ _bzhi_u64(unsigned long long __X, unsigned long long __Y)
189
184
// / \param __Y
190
185
// / The 64-bit mask specifying where to deposit source bits.
191
186
// / \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) {
195
189
return __builtin_ia32_pdep_di (__X, __Y);
196
190
}
197
191
@@ -219,9 +213,8 @@ _pdep_u64(unsigned long long __X, unsigned long long __Y)
219
213
// / \param __Y
220
214
// / The 64-bit mask specifying which source bits to extract.
221
215
// / \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) {
225
218
return __builtin_ia32_pext_di (__X, __Y);
226
219
}
227
220
@@ -247,8 +240,7 @@ _pext_u64(unsigned long long __X, unsigned long long __Y)
247
240
// / \returns The lower half of the product.
248
241
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
249
242
_mulx_u64 (unsigned long long __X, unsigned long long __Y,
250
- unsigned long long *__P)
251
- {
243
+ unsigned long long *__P) {
252
244
unsigned __int128 __res = (unsigned __int128) __X * __Y;
253
245
*__P = (unsigned long long ) (__res >> 64 );
254
246
return (unsigned long long ) __res;
@@ -257,6 +249,5 @@ _mulx_u64 (unsigned long long __X, unsigned long long __Y,
257
249
#endif /* __x86_64__ */
258
250
259
251
#undef __DEFAULT_FN_ATTRS
260
- #undef __DEFAULT_FN_ATTRS_CONSTEXPR
261
252
262
253
#endif /* __BMI2INTRIN_H */
0 commit comments