[clang] 74cfd20 - [clang][headers][x86] Reduce clang-format warnings when updating x86 headers
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 1 10:04:54 PDT 2024
Author: Simon Pilgrim
Date: 2024-10-01T18:04:40+01:00
New Revision: 74cfd203c36d314e3a47c3e239776a1a90424531
URL: https://github.com/llvm/llvm-project/commit/74cfd203c36d314e3a47c3e239776a1a90424531
DIFF: https://github.com/llvm/llvm-project/commit/74cfd203c36d314e3a47c3e239776a1a90424531.diff
LOG: [clang][headers][x86] Reduce clang-format warnings when updating x86 headers
While adding constexpr support the CI code_formatting stage was being flooded with opening brace warnings.
Added:
Modified:
clang/lib/Headers/bmiintrin.h
clang/lib/Headers/lzcntintrin.h
clang/lib/Headers/tbmintrin.h
Removed:
################################################################################
diff --git a/clang/lib/Headers/bmiintrin.h b/clang/lib/Headers/bmiintrin.h
index 673f043ccfb307..59c5ece3977f37 100644
--- a/clang/lib/Headers/bmiintrin.h
+++ b/clang/lib/Headers/bmiintrin.h
@@ -36,8 +36,7 @@
/// bits in the operand.
/// \see _tzcnt_u16
static __inline__ unsigned short __RELAXED_FN_ATTRS
-__tzcnt_u16(unsigned short __X)
-{
+__tzcnt_u16(unsigned short __X) {
return __builtin_ia32_tzcnt_u16(__X);
}
@@ -70,8 +69,7 @@ __tzcnt_u16(unsigned short __X)
/// bits in the operand.
/// \see { _mm_tzcnt_32 _tzcnt_u32 }
static __inline__ unsigned int __RELAXED_FN_ATTRS
-__tzcnt_u32(unsigned int __X)
-{
+__tzcnt_u32(unsigned int __X) {
return __builtin_ia32_tzcnt_u32(__X);
}
@@ -87,8 +85,7 @@ __tzcnt_u32(unsigned int __X)
/// the operand.
/// \see { __tzcnt_u32 _tzcnt_u32 }
static __inline__ int __RELAXED_FN_ATTRS
-_mm_tzcnt_32(unsigned int __X)
-{
+_mm_tzcnt_32(unsigned int __X) {
return (int)__builtin_ia32_tzcnt_u32(__X);
}
@@ -123,8 +120,7 @@ _mm_tzcnt_32(unsigned int __X)
/// bits in the operand.
/// \see { _mm_tzcnt_64 _tzcnt_u64 }
static __inline__ unsigned long long __RELAXED_FN_ATTRS
-__tzcnt_u64(unsigned long long __X)
-{
+__tzcnt_u64(unsigned long long __X) {
return __builtin_ia32_tzcnt_u64(__X);
}
@@ -140,8 +136,7 @@ __tzcnt_u64(unsigned long long __X)
/// the operand.
/// \see { __tzcnt_u64 _tzcnt_u64 }
static __inline__ long long __RELAXED_FN_ATTRS
-_mm_tzcnt_64(unsigned long long __X)
-{
+_mm_tzcnt_64(unsigned long long __X) {
return (long long)__builtin_ia32_tzcnt_u64(__X);
}
@@ -192,8 +187,7 @@ _mm_tzcnt_64(unsigned long long __X)
/// operand with the one's complement of the first operand.
/// \see _andn_u32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__andn_u32(unsigned int __X, unsigned int __Y)
-{
+__andn_u32(unsigned int __X, unsigned int __Y) {
return ~__X & __Y;
}
@@ -298,8 +292,7 @@ _bextr2_u32(unsigned int __X, unsigned int __Y) {
/// the source operand.
/// \see _blsi_u32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blsi_u32(unsigned int __X)
-{
+__blsi_u32(unsigned int __X) {
return __X & -__X;
}
@@ -334,8 +327,7 @@ __blsi_u32(unsigned int __X)
/// \returns An unsigned integer containing the newly created mask.
/// \see _blsmsk_u32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blsmsk_u32(unsigned int __X)
-{
+__blsmsk_u32(unsigned int __X) {
return __X ^ (__X - 1);
}
@@ -370,8 +362,7 @@ __blsmsk_u32(unsigned int __X)
/// operand.
/// \see _blsr_u32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blsr_u32(unsigned int __X)
-{
+__blsr_u32(unsigned int __X) {
return __X & (__X - 1);
}
@@ -410,8 +401,7 @@ __blsr_u32(unsigned int __X)
/// operand with the one's complement of the first operand.
/// \see _andn_u64
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__andn_u64 (unsigned long long __X, unsigned long long __Y)
-{
+__andn_u64 (unsigned long long __X, unsigned long long __Y) {
return ~__X & __Y;
}
@@ -517,8 +507,7 @@ _bextr2_u64(unsigned long long __X, unsigned long long __Y) {
/// bits from the source operand.
/// \see _blsi_u64
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blsi_u64(unsigned long long __X)
-{
+__blsi_u64(unsigned long long __X) {
return __X & -__X;
}
@@ -553,8 +542,7 @@ __blsi_u64(unsigned long long __X)
/// \returns An unsigned 64-bit integer containing the newly created mask.
/// \see _blsmsk_u64
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blsmsk_u64(unsigned long long __X)
-{
+__blsmsk_u64(unsigned long long __X) {
return __X ^ (__X - 1);
}
@@ -589,8 +577,7 @@ __blsmsk_u64(unsigned long long __X)
/// source operand.
/// \see _blsr_u64
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blsr_u64(unsigned long long __X)
-{
+__blsr_u64(unsigned long long __X) {
return __X & (__X - 1);
}
diff --git a/clang/lib/Headers/lzcntintrin.h b/clang/lib/Headers/lzcntintrin.h
index db00474ffd3949..27509021ec2589 100644
--- a/clang/lib/Headers/lzcntintrin.h
+++ b/clang/lib/Headers/lzcntintrin.h
@@ -49,8 +49,7 @@
/// bits in the operand.
/// \see _lzcnt_u32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__lzcnt32(unsigned int __X)
-{
+__lzcnt32(unsigned int __X) {
return __builtin_ia32_lzcnt_u32(__X);
}
@@ -66,8 +65,7 @@ __lzcnt32(unsigned int __X)
/// bits in the operand.
/// \see __lzcnt32
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-_lzcnt_u32(unsigned int __X)
-{
+_lzcnt_u32(unsigned int __X) {
return __builtin_ia32_lzcnt_u32(__X);
}
@@ -99,8 +97,7 @@ _lzcnt_u32(unsigned int __X)
/// bits in the operand.
/// \see __lzcnt64
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-_lzcnt_u64(unsigned long long __X)
-{
+_lzcnt_u64(unsigned long long __X) {
return __builtin_ia32_lzcnt_u64(__X);
}
#endif
diff --git a/clang/lib/Headers/tbmintrin.h b/clang/lib/Headers/tbmintrin.h
index 48a9d07568ff27..cf92d5a7b3b0f0 100644
--- a/clang/lib/Headers/tbmintrin.h
+++ b/clang/lib/Headers/tbmintrin.h
@@ -28,56 +28,47 @@
(unsigned int)(b)))
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blcfill_u32(unsigned int __a)
-{
+__blcfill_u32(unsigned int __a) {
return __a & (__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blci_u32(unsigned int __a)
-{
+__blci_u32(unsigned int __a) {
return __a | ~(__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blcic_u32(unsigned int __a)
-{
+__blcic_u32(unsigned int __a) {
return ~__a & (__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blcmsk_u32(unsigned int __a)
-{
+__blcmsk_u32(unsigned int __a) {
return __a ^ (__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blcs_u32(unsigned int __a)
-{
+__blcs_u32(unsigned int __a) {
return __a | (__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blsfill_u32(unsigned int __a)
-{
+__blsfill_u32(unsigned int __a) {
return __a | (__a - 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__blsic_u32(unsigned int __a)
-{
+__blsic_u32(unsigned int __a) {
return ~__a | (__a - 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__t1mskc_u32(unsigned int __a)
-{
+__t1mskc_u32(unsigned int __a) {
return ~__a | (__a + 1);
}
static __inline__ unsigned int __DEFAULT_FN_ATTRS
-__tzmsk_u32(unsigned int __a)
-{
+__tzmsk_u32(unsigned int __a) {
return ~__a & (__a - 1);
}
@@ -87,56 +78,47 @@ __tzmsk_u32(unsigned int __a)
(unsigned long long)(b)))
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blcfill_u64(unsigned long long __a)
-{
+__blcfill_u64(unsigned long long __a) {
return __a & (__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blci_u64(unsigned long long __a)
-{
+__blci_u64(unsigned long long __a) {
return __a | ~(__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blcic_u64(unsigned long long __a)
-{
+__blcic_u64(unsigned long long __a) {
return ~__a & (__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blcmsk_u64(unsigned long long __a)
-{
+__blcmsk_u64(unsigned long long __a) {
return __a ^ (__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blcs_u64(unsigned long long __a)
-{
+__blcs_u64(unsigned long long __a) {
return __a | (__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blsfill_u64(unsigned long long __a)
-{
+__blsfill_u64(unsigned long long __a) {
return __a | (__a - 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__blsic_u64(unsigned long long __a)
-{
+__blsic_u64(unsigned long long __a) {
return ~__a | (__a - 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__t1mskc_u64(unsigned long long __a)
-{
+__t1mskc_u64(unsigned long long __a) {
return ~__a | (__a + 1);
}
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
-__tzmsk_u64(unsigned long long __a)
-{
+__tzmsk_u64(unsigned long long __a) {
return ~__a & (__a - 1);
}
#endif
More information about the cfe-commits
mailing list