Skip to content

Commit 4efbf52

Browse files
[libc][__support][bit] remove compiler has builtin checks (#81679)
We only support building llvmlibc with modern compilers. https://libc.llvm.org/compiler_support.html#minimum-supported-versions All versions of the these compilers support these builtins; GCC does not support the short variants.
1 parent 8f4cd2c commit 4efbf52

File tree

1 file changed

+0
-18
lines changed
  • libc/src/__support/CPP

1 file changed

+0
-18
lines changed

libc/src/__support/CPP/bit.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
9393
#if LIBC_HAS_BUILTIN(__builtin_ctzs)
9494
ADD_SPECIALIZATION(countr_zero, unsigned short, __builtin_ctzs)
9595
#endif
96-
#if LIBC_HAS_BUILTIN(__builtin_ctz)
9796
ADD_SPECIALIZATION(countr_zero, unsigned int, __builtin_ctz)
98-
#endif
99-
#if LIBC_HAS_BUILTIN(__builtin_ctzl)
10097
ADD_SPECIALIZATION(countr_zero, unsigned long, __builtin_ctzl)
101-
#endif
102-
#if LIBC_HAS_BUILTIN(__builtin_ctzll)
10398
ADD_SPECIALIZATION(countr_zero, unsigned long long, __builtin_ctzll)
104-
#endif
10599

106100
/// Count number of 0's from the most significant bit to the least
107101
/// stopping at the first 1.
@@ -128,15 +122,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
128122
#if LIBC_HAS_BUILTIN(__builtin_clzs)
129123
ADD_SPECIALIZATION(countl_zero, unsigned short, __builtin_clzs)
130124
#endif
131-
#if LIBC_HAS_BUILTIN(__builtin_clz)
132125
ADD_SPECIALIZATION(countl_zero, unsigned int, __builtin_clz)
133-
#endif
134-
#if LIBC_HAS_BUILTIN(__builtin_clzl)
135126
ADD_SPECIALIZATION(countl_zero, unsigned long, __builtin_clzl)
136-
#endif
137-
#if LIBC_HAS_BUILTIN(__builtin_clzll)
138127
ADD_SPECIALIZATION(countl_zero, unsigned long long, __builtin_clzll)
139-
#endif
140128

141129
#undef ADD_SPECIALIZATION
142130

@@ -256,15 +244,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
256244
#if LIBC_HAS_BUILTIN(__builtin_clzs)
257245
SPECIALIZE_FLZ(first_leading_zero, unsigned short, __builtin_clzs)
258246
#endif
259-
#if LIBC_HAS_BUILTIN(__builtin_clz)
260247
SPECIALIZE_FLZ(first_leading_zero, unsigned int, __builtin_clz)
261-
#endif
262-
#if LIBC_HAS_BUILTIN(__builtin_clzl)
263248
SPECIALIZE_FLZ(first_leading_zero, unsigned long, __builtin_clzl)
264-
#endif
265-
#if LIBC_HAS_BUILTIN(__builtin_clzll)
266249
SPECIALIZE_FLZ(first_leading_zero, unsigned long long, __builtin_clzll)
267-
#endif
268250

269251
#undef SPECIALIZE_FLZ
270252

0 commit comments

Comments
 (0)