Skip to content

Commit 42b993d

Browse files
committed
[X86] ia32intrin.h - pull out common attributes used in cast helpers into define. NFCI.
1 parent 2d9be9e commit 42b993d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/Headers/ia32intrin.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
/* Define the default attributes for the functions in this file. */
1818
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
19+
#define __DEFAULT_FN_ATTRS_CAST __attribute__((__always_inline__))
1920
#define __DEFAULT_FN_ATTRS_SSE42 __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
2021

2122
#if defined(__cplusplus) && (__cplusplus >= 201103L)
@@ -215,7 +216,7 @@ __writeeflags(unsigned int __f)
215216
* A 32-bit float value.
216217
* \returns a 32-bit unsigned integer containing the converted value.
217218
*/
218-
static __inline__ unsigned int __attribute__((__always_inline__))
219+
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CAST
219220
_castf32_u32(float __A) {
220221
unsigned int D;
221222
__builtin_memcpy(&D, &__A, sizeof(__A));
@@ -232,7 +233,7 @@ _castf32_u32(float __A) {
232233
* A 64-bit float value.
233234
* \returns a 64-bit unsigned integer containing the converted value.
234235
*/
235-
static __inline__ unsigned long long __attribute__((__always_inline__))
236+
static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CAST
236237
_castf64_u64(double __A) {
237238
unsigned long long D;
238239
__builtin_memcpy(&D, &__A, sizeof(__A));
@@ -249,7 +250,7 @@ _castf64_u64(double __A) {
249250
* A 32-bit unsigned integer value.
250251
* \returns a 32-bit float value containing the converted value.
251252
*/
252-
static __inline__ float __attribute__((__always_inline__))
253+
static __inline__ float __DEFAULT_FN_ATTRS_CAST
253254
_castu32_f32(unsigned int __A) {
254255
float D;
255256
__builtin_memcpy(&D, &__A, sizeof(__A));
@@ -266,7 +267,7 @@ _castu32_f32(unsigned int __A) {
266267
* A 64-bit unsigned integer value.
267268
* \returns a 64-bit float value containing the converted value.
268269
*/
269-
static __inline__ double __attribute__((__always_inline__))
270+
static __inline__ double __DEFAULT_FN_ATTRS_CAST
270271
_castu64_f64(unsigned long long __A) {
271272
double D;
272273
__builtin_memcpy(&D, &__A, sizeof(__A));
@@ -440,6 +441,7 @@ __rorq(unsigned long long __X, int __C) {
440441
#define _rotwr(a,b) __rorw((a), (b))
441442

442443
#undef __DEFAULT_FN_ATTRS
444+
#undef __DEFAULT_FN_ATTRS_CAST
443445
#undef __DEFAULT_FN_ATTRS_SSE42
444446
#undef __DEFAULT_FN_ATTRS_CONSTEXPR
445447

0 commit comments

Comments
 (0)