Skip to content

Commit 5dc7a5e

Browse files
committed
[clang][x86] popcntintrin.h - merge the __DEFAULT_FN_ATTRS / __DEFAULT_FN_ATTRS_CONSTEXPR defines. NFC.
We only need one define - so consistently use __DEFAULT_FN_ATTRS like we do in other headers.
1 parent dda107b commit 5dc7a5e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/lib/Headers/popcntintrin.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
#define __POPCNTINTRIN_H
1212

1313
/* Define the default attributes for the functions in this file. */
14-
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("popcnt")))
15-
1614
#if defined(__cplusplus) && (__cplusplus >= 201103L)
17-
#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
15+
#define __DEFAULT_FN_ATTRS \
16+
__attribute__((__always_inline__, __nodebug__, \
17+
__target__("popcnt"))) constexpr
1818
#else
19-
#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
19+
#define __DEFAULT_FN_ATTRS \
20+
__attribute__((__always_inline__, __nodebug__, __target__("popcnt")))
2021
#endif
2122

2223
/// Counts the number of bits in the source operand having a value of 1.
@@ -29,7 +30,7 @@
2930
/// An unsigned 32-bit integer operand.
3031
/// \returns A 32-bit integer containing the number of bits with value 1 in the
3132
/// source operand.
32-
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
33+
static __inline__ int __DEFAULT_FN_ATTRS
3334
_mm_popcnt_u32(unsigned int __A)
3435
{
3536
return __builtin_popcount(__A);
@@ -46,14 +47,13 @@ _mm_popcnt_u32(unsigned int __A)
4647
/// An unsigned 64-bit integer operand.
4748
/// \returns A 64-bit integer containing the number of bits with value 1 in the
4849
/// source operand.
49-
static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
50+
static __inline__ long long __DEFAULT_FN_ATTRS
5051
_mm_popcnt_u64(unsigned long long __A)
5152
{
5253
return __builtin_popcountll(__A);
5354
}
5455
#endif /* __x86_64__ */
5556

5657
#undef __DEFAULT_FN_ATTRS
57-
#undef __DEFAULT_FN_ATTRS_CONSTEXPR
5858

5959
#endif /* __POPCNTINTRIN_H */

0 commit comments

Comments
 (0)