Skip to content

Commit 9ad027e

Browse files
committed
Use newer version for mask_trailing_ones.
1 parent bffc11f commit 9ad027e

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

libc/src/__support/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ add_header_library(
123123
libc.src.__support.CPP.type_traits
124124
libc.src.__support.macros.attributes
125125
libc.src.__support.macros.config
126-
libc.src.__support.macros.properties.compiler
127126
)
128127

129128
add_header_library(

libc/src/__support/math_extras.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "src/__support/CPP/type_traits.h" // is_unsigned_v, is_constant_evaluated
1616
#include "src/__support/macros/attributes.h" // LIBC_INLINE
1717
#include "src/__support/macros/config.h"
18-
#include "src/__support/macros/properties/compiler.h"
1918

2019
namespace LIBC_NAMESPACE_DECL {
2120

@@ -26,17 +25,13 @@ LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_unsigned_v<T>, T>
2625
mask_trailing_ones() {
2726
constexpr unsigned T_BITS = CHAR_BIT * sizeof(T);
2827
static_assert(count <= T_BITS && "Invalid bit index");
29-
#ifndef LIBC_COMPILER_IS_MSVC
30-
return count == 0 ? 0 : (T(-1) >> (T_BITS - count));
31-
#else
3228
// MSVC complains about out of range shifts.
3329
if constexpr (count == 0)
3430
return 0;
3531
else if constexpr (count >= T_BITS)
3632
return T(-1);
3733
else
3834
return T(-1) >> (T_BITS - count);
39-
#endif // !LIBC_COMPILER_IS_MSVC
4035
}
4136

4237
// Create a bitmask with the count left-most bits set to 1, and all other bits

0 commit comments

Comments
 (0)