Skip to content

[libc][__support][bit] remove compiler has builtin checks #81679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions libc/src/__support/CPP/bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
#if LIBC_HAS_BUILTIN(__builtin_ctzs)
ADD_SPECIALIZATION(countr_zero, unsigned short, __builtin_ctzs)
#endif
#if LIBC_HAS_BUILTIN(__builtin_ctz)
ADD_SPECIALIZATION(countr_zero, unsigned int, __builtin_ctz)
#endif
#if LIBC_HAS_BUILTIN(__builtin_ctzl)
ADD_SPECIALIZATION(countr_zero, unsigned long, __builtin_ctzl)
#endif
#if LIBC_HAS_BUILTIN(__builtin_ctzll)
ADD_SPECIALIZATION(countr_zero, unsigned long long, __builtin_ctzll)
#endif

/// Count number of 0's from the most significant bit to the least
/// stopping at the first 1.
Expand All @@ -128,15 +122,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
#if LIBC_HAS_BUILTIN(__builtin_clzs)
ADD_SPECIALIZATION(countl_zero, unsigned short, __builtin_clzs)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clz)
ADD_SPECIALIZATION(countl_zero, unsigned int, __builtin_clz)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clzl)
ADD_SPECIALIZATION(countl_zero, unsigned long, __builtin_clzl)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clzll)
ADD_SPECIALIZATION(countl_zero, unsigned long long, __builtin_clzll)
#endif

#undef ADD_SPECIALIZATION

Expand Down Expand Up @@ -256,15 +244,9 @@ template <typename T, typename = cpp::enable_if_t<cpp::is_unsigned_v<T>>>
#if LIBC_HAS_BUILTIN(__builtin_clzs)
SPECIALIZE_FLZ(first_leading_zero, unsigned short, __builtin_clzs)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clz)
SPECIALIZE_FLZ(first_leading_zero, unsigned int, __builtin_clz)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clzl)
SPECIALIZE_FLZ(first_leading_zero, unsigned long, __builtin_clzl)
#endif
#if LIBC_HAS_BUILTIN(__builtin_clzll)
SPECIALIZE_FLZ(first_leading_zero, unsigned long long, __builtin_clzll)
#endif

#undef SPECIALIZE_FLZ

Expand Down