117 changes: 0 additions & 117 deletions libc/src/__support/bit.h

This file was deleted.

9 changes: 5 additions & 4 deletions libc/src/__support/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_HASH_H
#define LLVM_LIBC_SRC___SUPPORT_HASH_H

#include "src/__support/CPP/bit.h" // rotl
#include "src/__support/CPP/limits.h" // numeric_limits
#include "src/__support/UInt128.h" // UInt128
#include "src/__support/bit.h" // rotate_left
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include <stdint.h> // For uint64_t

Expand Down Expand Up @@ -103,7 +104,7 @@ class HashState {
uint64_t combined =
folded_multiply(low ^ extra_keys[0], high ^ extra_keys[1]);
buffer = (buffer + pad) ^ combined;
buffer = rotate_left(buffer, ROTATE);
buffer = cpp::rotl(buffer, ROTATE);
}
LIBC_INLINE static uint64_t mix(uint64_t seed) {
HashState mixer{RANDOMNESS[0][0], RANDOMNESS[0][1], RANDOMNESS[0][2],
Expand Down Expand Up @@ -152,9 +153,9 @@ class HashState {
}
}
LIBC_INLINE uint64_t finish() {
uint64_t rot = buffer & 63;
int rot = buffer & 63;
uint64_t folded = folded_multiply(buffer, pad);
return rotate_left(folded, rot);
return cpp::rotl(folded, rot);
}
};

Expand Down
1 change: 0 additions & 1 deletion libc/src/__support/integer_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"

#include "bit.h"
#include "math_extras.h"
#include "number_pair.h"

Expand Down
17 changes: 14 additions & 3 deletions libc/src/__support/memory_size.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
//
//===----------------------------------------------------------------------===//

#include "src/__support/CPP/bit.h" // has_single_bit
#include "src/__support/CPP/limits.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/bit.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/optimization.h"
#include "src/string/memory_utils/utils.h"

namespace LIBC_NAMESPACE {
namespace internal {
Expand All @@ -37,17 +38,26 @@ class SafeMemSize {
public:
LIBC_INLINE_VAR static constexpr size_t MAX_MEM_SIZE =
static_cast<size_t>(cpp::numeric_limits<type>::max());

LIBC_INLINE explicit SafeMemSize(size_t value)
: value(value <= MAX_MEM_SIZE ? static_cast<type>(value) : -1) {}

LIBC_INLINE static constexpr size_t offset_to(size_t val, size_t align) {
return (-val) & (align - 1);
}

LIBC_INLINE operator size_t() { return static_cast<size_t>(value); }

LIBC_INLINE bool valid() { return value >= 0; }

LIBC_INLINE SafeMemSize operator+(const SafeMemSize &other) {
type result;
if (LIBC_UNLIKELY((value | other.value) < 0))
result = -1;
result = value + other.value;
return SafeMemSize{result};
}

LIBC_INLINE SafeMemSize operator*(const SafeMemSize &other) {
type result;
if (LIBC_UNLIKELY((value | other.value) < 0))
Expand All @@ -56,11 +66,12 @@ class SafeMemSize {
result = -1;
return SafeMemSize{result};
}

LIBC_INLINE SafeMemSize align_up(size_t alignment) {
if (!is_power_of_two(alignment) || alignment > MAX_MEM_SIZE || !valid())
if (!cpp::has_single_bit(alignment) || alignment > MAX_MEM_SIZE || !valid())
return SafeMemSize{type{-1}};

type offset = LIBC_NAMESPACE::offset_to<size_t>(value, alignment);
type offset = offset_to(value, alignment);

if (LIBC_UNLIKELY(offset > static_cast<type>(MAX_MEM_SIZE) - value))
return SafeMemSize{type{-1}};
Expand Down
5 changes: 2 additions & 3 deletions libc/src/__support/str_to_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "src/__support/FPUtil/dyadic_float.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/UInt128.h"
#include "src/__support/bit.h"
#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
#include "src/__support/detailed_powers_of_ten.h"
Expand Down Expand Up @@ -69,12 +68,12 @@ template <class T> LIBC_INLINE uint32_t leading_zeroes(T inputNumber) {

template <>
LIBC_INLINE uint32_t leading_zeroes<uint32_t>(uint32_t inputNumber) {
return safe_clz(inputNumber);
return cpp::countl_zero(inputNumber);
}

template <>
LIBC_INLINE uint32_t leading_zeroes<uint64_t>(uint64_t inputNumber) {
return safe_clz(inputNumber);
return cpp::countl_zero(inputNumber);
}

LIBC_INLINE uint64_t low64(const UInt128 &num) {
Expand Down
1 change: 0 additions & 1 deletion libc/src/math/generic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ add_entrypoint_object(
.explogxf
libc.include.errno
libc.include.math
libc.src.__support.bit
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.FPUtil.fenv_impl
Expand Down
5 changes: 2 additions & 3 deletions libc/src/math/generic/powf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "src/__support/FPUtil/nearest_integer.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/FPUtil/sqrt.h" // Speedup for powf(x, 1/2) = sqrtf(x)
#include "src/__support/bit.h"
#include "src/__support/common.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY

Expand Down Expand Up @@ -392,7 +391,7 @@ LIBC_INLINE bool is_odd_integer(float x) {
uint32_t x_u = cpp::bit_cast<uint32_t>(x);
int x_e = static_cast<int>((x_u & FloatProp::EXPONENT_MASK) >>
FloatProp::MANTISSA_WIDTH);
int lsb = unsafe_ctz(x_u | FloatProp::EXPONENT_MASK);
int lsb = cpp::countr_zero(x_u | FloatProp::EXPONENT_MASK);
constexpr int UNIT_EXPONENT =
static_cast<int>(FloatProp::EXPONENT_BIAS + FloatProp::MANTISSA_WIDTH);
return (x_e + lsb == UNIT_EXPONENT);
Expand All @@ -403,7 +402,7 @@ LIBC_INLINE bool is_integer(float x) {
uint32_t x_u = cpp::bit_cast<uint32_t>(x);
int x_e = static_cast<int>((x_u & FloatProp::EXPONENT_MASK) >>
FloatProp::MANTISSA_WIDTH);
int lsb = unsafe_ctz(x_u | FloatProp::EXPONENT_MASK);
int lsb = cpp::countr_zero(x_u | FloatProp::EXPONENT_MASK);
constexpr int UNIT_EXPONENT =
static_cast<int>(FloatProp::EXPONENT_BIAS + FloatProp::MANTISSA_WIDTH);
return (x_e + lsb >= UNIT_EXPONENT);
Expand Down
22 changes: 13 additions & 9 deletions libc/src/string/memory_utils/op_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_BUILTIN_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_BUILTIN_H

#include "src/__support/CPP/type_traits.h"
#include "src/string/memory_utils/utils.h"

namespace LIBC_NAMESPACE::builtin {
Expand Down Expand Up @@ -75,7 +76,8 @@ template <size_t Size> struct Memset {
#ifdef LLVM_LIBC_HAS_BUILTIN_MEMSET_INLINE
__builtin_memset_inline(dst, value, Size);
#else
deferred_static_assert("Missing __builtin_memset_inline");
static_assert(cpp::always_false<decltype(Size)>,
"Missing __builtin_memset_inline");
(void)dst;
(void)value;
#endif
Expand Down Expand Up @@ -107,22 +109,23 @@ template <size_t Size> struct Bcmp {
using ME = Bcmp;
static constexpr size_t SIZE = Size;
LIBC_INLINE static BcmpReturnType block(CPtr, CPtr) {
deferred_static_assert("Missing __builtin_memcmp_inline");
static_assert(cpp::always_false<decltype(Size)>,
"Missing __builtin_memcmp_inline");
return BcmpReturnType::ZERO();
}

LIBC_INLINE static BcmpReturnType tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return BcmpReturnType::ZERO();
}

LIBC_INLINE static BcmpReturnType head_tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return BcmpReturnType::ZERO();
}

LIBC_INLINE static BcmpReturnType loop_and_tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return BcmpReturnType::ZERO();
}
};
Expand All @@ -133,22 +136,23 @@ template <size_t Size> struct Memcmp {
using ME = Memcmp;
static constexpr size_t SIZE = Size;
LIBC_INLINE static MemcmpReturnType block(CPtr, CPtr) {
deferred_static_assert("Missing __builtin_memcmp_inline");
static_assert(cpp::always_false<decltype(Size)>,
"Missing __builtin_memcmp_inline");
return MemcmpReturnType::ZERO();
}

LIBC_INLINE static MemcmpReturnType tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return MemcmpReturnType::ZERO();
}

LIBC_INLINE static MemcmpReturnType head_tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return MemcmpReturnType::ZERO();
}

LIBC_INLINE static MemcmpReturnType loop_and_tail(CPtr, CPtr, size_t) {
deferred_static_assert("Not implemented");
static_assert(cpp::always_false<decltype(Size)>, "Not implemented");
return MemcmpReturnType::ZERO();
}
};
Expand Down
47 changes: 8 additions & 39 deletions libc/src/string/memory_utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,21 @@

namespace LIBC_NAMESPACE {

// Allows compile time error reporting in `if constexpr` branches.
template <bool flag = false>
LIBC_INLINE void deferred_static_assert(const char *msg) {
static_assert(flag, "compilation error");
(void)msg;
}

// Return whether `value` is zero or a power of two.
LIBC_INLINE constexpr bool is_power2_or_zero(size_t value) {
return (value & (value - 1U)) == 0;
}

// Return whether `value` is a power of two.
LIBC_INLINE constexpr bool is_power2(size_t value) {
return value && is_power2_or_zero(value);
}

// Compile time version of log2 that handles 0.
LIBC_INLINE constexpr size_t log2s(size_t value) {
return (value == 0 || value == 1) ? 0 : 1 + log2s(value / 2);
}

// Returns the first power of two preceding value or value if it is already a
// power of two (or 0 when value is 0).
LIBC_INLINE constexpr size_t le_power2(size_t value) {
return value == 0 ? value : 1ULL << log2s(value);
}

// Returns the first power of two following value or value if it is already a
// power of two (or 0 when value is 0).
LIBC_INLINE constexpr size_t ge_power2(size_t value) {
return is_power2_or_zero(value) ? value : 1ULL << (log2s(value) + 1);
}

// Returns the number of bytes to substract from ptr to get to the previous
// multiple of alignment. If ptr is already aligned returns 0.
template <size_t alignment>
LIBC_INLINE uintptr_t distance_to_align_down(const void *ptr) {
static_assert(is_power2(alignment), "alignment must be a power of 2");
static_assert(cpp::has_single_bit(alignment),
"alignment must be a power of 2");
return reinterpret_cast<uintptr_t>(ptr) & (alignment - 1U);
}

// Returns the number of bytes to add to ptr to get to the next multiple of
// alignment. If ptr is already aligned returns 0.
template <size_t alignment>
LIBC_INLINE uintptr_t distance_to_align_up(const void *ptr) {
static_assert(is_power2(alignment), "alignment must be a power of 2");
static_assert(cpp::has_single_bit(alignment),
"alignment must be a power of 2");
// The logic is not straightforward and involves unsigned modulo arithmetic
// but the generated code is as fast as it can be.
return -reinterpret_cast<uintptr_t>(ptr) & (alignment - 1U);
Expand Down Expand Up @@ -265,7 +233,7 @@ LIBC_INLINE ValueType load_aligned(CPtr src) {
else if constexpr (Endian::IS_BIG)
return (value << shift) | next;
else
deferred_static_assert("Invalid endianness");
static_assert(cpp::always_false<T>, "Invalid endianness");
} else {
return value;
}
Expand Down Expand Up @@ -302,7 +270,7 @@ LIBC_INLINE void store_aligned(ValueType value, Ptr dst) {
if constexpr (sizeof...(TS) > 0)
store_aligned<ValueType, TS...>(value >> shift, dst);
} else {
deferred_static_assert("Invalid endianness");
static_assert(cpp::always_false<T>, "Invalid endianness");
}
}

Expand Down Expand Up @@ -360,7 +328,8 @@ LIBC_INLINE void align_to_next_boundary(T1 *__restrict &p1, T2 *__restrict &p2,
else if constexpr (AlignOn == Arg::P2)
align_p1_to_next_boundary<SIZE>(p2, p1, count); // swapping p1 and p2.
else
deferred_static_assert("AlignOn must be either Arg::P1 or Arg::P2");
static_assert(cpp::always_false<T1>,
"AlignOn must be either Arg::P1 or Arg::P2");
}

template <size_t SIZE> struct AlignHelper {
Expand Down
13 changes: 0 additions & 13 deletions libc/test/src/__support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ add_libc_test(
libc.src.__support.common
)


add_libc_test(
bit_test
SUITE
libc-support-tests
SRCS
bit_test.cpp
DEPENDS
libc.src.__support.bit
)


add_libc_test(
math_extras_test
SUITE
Expand All @@ -45,7 +33,6 @@ add_libc_test(
libc.src.__support.math_extras
)


add_libc_test(
high_precision_decimal_test
SUITE
Expand Down
3 changes: 2 additions & 1 deletion libc/test/src/__support/HashTable/table_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "src/__support/CPP/bit.h" // bit_ceil
#include "src/__support/HashTable/randomness.h"
#include "src/__support/HashTable/table.h"
#include "test/UnitTest/Test.h"
Expand Down Expand Up @@ -37,7 +38,7 @@ TEST(LlvmLibcTableTest, Insertion) {
for (size_t k = 0; k < 256; ++k) {
keys[k].value = LIBC_NAMESPACE::Endian::to_little_endian(k);
}
constexpr size_t CAP = next_power_of_two((sizeof(Group) + 1) * 8 / 7) / 8 * 7;
constexpr size_t CAP = cpp::bit_ceil((sizeof(Group) + 1) * 8 / 7) / 8 * 7;
static_assert(CAP + 1 < 256, "CAP is too large for this test.");
HashTable *table =
HashTable::allocate(sizeof(Group) + 1, randomness::next_random_seed());
Expand Down
67 changes: 0 additions & 67 deletions libc/test/src/__support/bit_test.cpp

This file was deleted.

11 changes: 11 additions & 0 deletions libc/test/src/__support/memory_size_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,16 @@ TEST(LlvmLibcMemSizeTest, AlignUp) {
auto max = SafeMemSize{SAFE_MEM_SIZE_TEST_LIMIT};
ASSERT_FALSE(max.align_up(8).valid());
}

TEST(LlvmLibcBlockBitTest, OffsetTo) {
ASSERT_EQ(SafeMemSize::offset_to(0, 512), 0UL);
ASSERT_EQ(SafeMemSize::offset_to(1, 512), 511UL);
ASSERT_EQ(SafeMemSize::offset_to(2, 512), 510UL);
ASSERT_EQ(SafeMemSize::offset_to(13, 1), 0UL);
ASSERT_EQ(SafeMemSize::offset_to(13, 4), 3UL);
for (unsigned int i = 0; i < 31; ++i) {
ASSERT_EQ((SafeMemSize::offset_to(i, 1u << i) + i) % (1u << i), 0UL);
}
}
} // namespace internal
} // namespace LIBC_NAMESPACE
4 changes: 2 additions & 2 deletions libc/test/src/search/hsearch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "src/__support/CPP/bit.h" // bit_ceil
#include "src/__support/HashTable/table.h"
#include "src/__support/bit.h"
#include "src/search/hcreate.h"
#include "src/search/hcreate_r.h"
#include "src/search/hdestroy.h"
Expand Down Expand Up @@ -48,7 +48,7 @@ char search_data2[] =

constexpr size_t GROUP_SIZE = sizeof(LIBC_NAMESPACE::internal::Group);
constexpr size_t CAP =
LIBC_NAMESPACE::next_power_of_two((GROUP_SIZE + 1) * 8 / 7) / 8 * 7;
LIBC_NAMESPACE::cpp::bit_ceil((GROUP_SIZE + 1) * 8 / 7) / 8 * 7;
static_assert(CAP < sizeof(search_data), "CAP too large");

TEST(LlvmLibcHSearchTest, InsertTooMany) {
Expand Down
60 changes: 0 additions & 60 deletions libc/test/src/string/memory_utils/utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,6 @@

namespace LIBC_NAMESPACE {

TEST(LlvmLibcUtilsTest, IsPowerOfTwoOrZero) {
static const cpp::array<bool, 65> kExpectedValues{
1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 0-15
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32-47
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 48-63
1 // 64
};
for (size_t i = 0; i < kExpectedValues.size(); ++i)
EXPECT_EQ(is_power2_or_zero(i), kExpectedValues[i]);
}

TEST(LlvmLibcUtilsTest, IsPowerOfTwo) {
static const cpp::array<bool, 65> kExpectedValues{
0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 0-15
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32-47
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 48-63
1 // 64
};
for (size_t i = 0; i < kExpectedValues.size(); ++i)
EXPECT_EQ(is_power2(i), kExpectedValues[i]);
}

TEST(LlvmLibcUtilsTest, Log2) {
static const cpp::array<size_t, 65> kExpectedValues{
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, // 0-15
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 16-31
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 32-47
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 48-63
6 // 64
};
for (size_t i = 0; i < kExpectedValues.size(); ++i)
EXPECT_EQ(log2s(i), kExpectedValues[i]);
}

TEST(LlvmLibcUtilsTest, LEPowerOf2) {
static const cpp::array<size_t, 65> kExpectedValues{
0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, // 0-15
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, // 16-31
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, // 32-47
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, // 48-63
64 // 64
};
for (size_t i = 0; i < kExpectedValues.size(); ++i)
EXPECT_EQ(le_power2(i), kExpectedValues[i]);
}

TEST(LlvmLibcUtilsTest, GEPowerOf2) {
static const cpp::array<size_t, 66> kExpectedValues{
0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, // 0-15
16, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, // 16-31
32, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, // 32-47
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, // 48-63
64, 128 // 64-65
};
for (size_t i = 0; i < kExpectedValues.size(); ++i)
EXPECT_EQ(ge_power2(i), kExpectedValues[i]);
}

using UINT = uintptr_t;

// Converts an offset into a pointer.
Expand Down
19 changes: 2 additions & 17 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ libc_support_library(
name = "__support_integer_utils",
hdrs = ["src/__support/integer_utils.h"],
deps = [
":__support_bit",
":__support_common",
":__support_cpp_type_traits",
":__support_math_extras",
Expand All @@ -451,7 +450,6 @@ libc_support_library(
name = "__support_uint",
hdrs = ["src/__support/UInt.h"],
deps = [
":__support_bit",
":__support_cpp_array",
":__support_cpp_limits",
":__support_cpp_optional",
Expand Down Expand Up @@ -537,8 +535,8 @@ libc_support_library(
"src/__support/str_to_float.h",
],
deps = [
":__support_bit",
":__support_common",
":__support_cpp_bit",
":__support_cpp_limits",
":__support_cpp_optional",
":__support_ctype_utils",
Expand Down Expand Up @@ -587,15 +585,6 @@ libc_support_library(
],
)

libc_support_library(
name = "__support_bit",
hdrs = ["src/__support/bit.h"],
deps = [
":__support_cpp_type_traits",
":__support_macros_attributes",
],
)

libc_support_library(
name = "__support_math_extras",
hdrs = ["src/__support/math_extras.h"],
Expand All @@ -610,8 +599,8 @@ libc_support_library(
name = "__support_fputil_generic_fmod",
hdrs = ["src/__support/FPUtil/generic/FMod.h"],
deps = [
":__support_bit",
":__support_common",
":__support_cpp_bit",
":__support_cpp_limits",
":__support_cpp_type_traits",
":__support_fputil_fenv_impl",
Expand Down Expand Up @@ -683,7 +672,6 @@ libc_support_library(
hdrs = ["src/__support/FPUtil/FPBits.h"],
textual_hdrs = ["src/__support/FPUtil/x86_64/LongDoubleBits.h"],
deps = [
":__support_bit",
":__support_common",
":__support_cpp_bit",
":__support_cpp_type_traits",
Expand Down Expand Up @@ -711,7 +699,6 @@ libc_support_library(
name = "__support_fputil_hypot",
hdrs = ["src/__support/FPUtil/Hypot.h"],
deps = [
":__support_bit",
":__support_common",
":__support_cpp_bit",
":__support_cpp_type_traits",
Expand Down Expand Up @@ -782,7 +769,6 @@ libc_support_library(
name = "__support_fputil_sqrt",
hdrs = sqrt_hdrs,
deps = [
":__support_bit",
":__support_common",
":__support_cpp_bit",
":__support_cpp_type_traits",
Expand Down Expand Up @@ -810,7 +796,6 @@ libc_support_library(
# doesn't support FMA, so they can't be compiled on their own.
textual_hdrs = fma_platform_hdrs,
deps = [
":__support_bit",
":__support_cpp_bit",
":__support_cpp_type_traits",
":__support_fputil_fenv_impl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ package(default_visibility = ["//visibility:public"])

licenses(["notice"])

libc_test(
name = "bit_test",
srcs = ["bit_test.cpp"],
deps = ["//libc:__support_bit"],
)

libc_test(
name = "math_extras_test",
srcs = ["math_extras_test.cpp"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def math_test(name, hdrs = [], deps = [], **kwargs):
srcs = [test_name + ".cpp"] + hdrs,
libc_function_deps = ["//libc:func_name".replace("func_name", name)],
deps = [
"//libc:__support_bit",
"//libc:__support_fputil_basic_operations",
"//libc:__support_fputil_fenv_impl",
"//libc:__support_fputil_float_properties",
Expand Down