1 change: 1 addition & 0 deletions libc/test/src/__support/FPUtil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ add_libc_test(
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.fpbits_str
libc.src.__support.integer_literals
libc.src.__support.sign
)

add_fp_unittest(
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/__support/FPUtil/dyadic_float_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Float128 = LIBC_NAMESPACE::fputil::DyadicFloat<128>;
using Float192 = LIBC_NAMESPACE::fputil::DyadicFloat<192>;
using Float256 = LIBC_NAMESPACE::fputil::DyadicFloat<256>;
using Sign = LIBC_NAMESPACE::fputil::Sign;

TEST(LlvmLibcDyadicFloatTest, BasicConversions) {
Float128 x(Sign::POS, /*exponent*/ 0,
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/__support/FPUtil/fpbits_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/fpbits_str.h"
#include "src/__support/integer_literals.h"
#include "src/__support/sign.h" // Sign
#include "test/UnitTest/Test.h"

using LIBC_NAMESPACE::fputil::FPBits;
using LIBC_NAMESPACE::fputil::FPType;
using LIBC_NAMESPACE::fputil::Sign;
using LIBC_NAMESPACE::fputil::internal::FPRep;

using LIBC_NAMESPACE::operator""_u16;
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/FDimTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class FDimTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FuncPtr = T (*)(T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/FmaTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::Test {
using Func = T (*)(T, T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T min_subnormal = FPBits::min_subnormal(Sign::POS).get_val();
const T min_normal = FPBits::min_normal(Sign::POS).get_val();
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/HypotTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HypotTestTemplate : public LIBC_NAMESPACE::testing::Test {
private:
using Func = T (*)(T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using Sign = LIBC_NAMESPACE::fputil::Sign;

using StorageType = typename FPBits::StorageType;
const T nan = FPBits::quiet_nan().get_val();
const T inf = FPBits::inf().get_val();
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/ILogbTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LlvmLibcILogbTest : public LIBC_NAMESPACE::testing::Test {
template <typename T>
void test_special_numbers(typename ILogbFunc<T>::Func func) {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using Sign = LIBC_NAMESPACE::fputil::Sign;

EXPECT_EQ(FP_ILOGB0, func(FPBits::zero(Sign::POS).get_val()));
EXPECT_EQ(FP_ILOGB0, func(FPBits::zero(Sign::NEG).get_val()));
EXPECT_EQ(FP_ILOGBNAN, func(FPBits::quiet_nan().get_val()));
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/LdExpTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using NormalFloat = LIBC_NAMESPACE::fputil::NormalFloat<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/NextAfterTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ template <typename T>
class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/RIntTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class RIntTestTemplate : public LIBC_NAMESPACE::testing::Test {
private:
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/RemQuoTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ template <typename T>
class RemQuoTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/RoundToIntegerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class RoundToIntegerTestTemplate : public LIBC_NAMESPACE::testing::Test {
private:
using FPBits = LIBC_NAMESPACE::fputil::FPBits<F>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const F zero = FPBits::zero().get_val();
const F neg_zero = FPBits::zero(Sign::NEG).get_val();
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/atanhf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using LlvmLibcAtanhfTest = LIBC_NAMESPACE::testing::FPTest<float>;
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;

TEST_F(LlvmLibcAtanhfTest, SpecialNumbers) {
using Sign = LIBC_NAMESPACE::fputil::Sign;

LIBC_NAMESPACE::libc_errno = 0;
LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT);
EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::atanhf(aNaN));
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/FDimTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class FDimTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FuncPtr = T (*)(T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/FmaTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::Test {
using Func = T (*)(T, T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/smoke/HypotTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HypotTestTemplate : public LIBC_NAMESPACE::testing::Test {
using Func = T (*)(T, T);
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T nan = FPBits::quiet_nan().get_val();
const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/ILogbTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ template <typename OutType, typename InType>
class LlvmLibcILogbTest : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<InType>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

public:
typedef OutType (*Func)(InType);
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/LdExpTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class LdExpTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using NormalFloat = LIBC_NAMESPACE::fputil::NormalFloat<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/NextAfterTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ template <typename T>
class NextAfterTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/NextTowardTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class NextTowardTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using ToFPBits = LIBC_NAMESPACE::fputil::FPBits<long double>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/RIntTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class RIntTestTemplate : public LIBC_NAMESPACE::testing::Test {
private:
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/RemQuoTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ template <typename T>
class RemQuoTestTemplate : public LIBC_NAMESPACE::testing::Test {
using FPBits = LIBC_NAMESPACE::fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const T inf = FPBits::inf(Sign::POS).get_val();
const T neg_inf = FPBits::inf(Sign::NEG).get_val();
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/math/smoke/RoundToIntegerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class RoundToIntegerTestTemplate : public LIBC_NAMESPACE::testing::Test {
private:
using FPBits = LIBC_NAMESPACE::fputil::FPBits<F>;
using StorageType = typename FPBits::StorageType;
using Sign = LIBC_NAMESPACE::fputil::Sign;

const F zero = FPBits::zero(Sign::POS).get_val();
const F neg_zero = FPBits::zero(Sign::NEG).get_val();
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/smoke/atanhf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using LlvmLibcAtanhfTest = LIBC_NAMESPACE::testing::FPTest<float>;

TEST_F(LlvmLibcAtanhfTest, SpecialNumbers) {
using Sign = LIBC_NAMESPACE::fputil::Sign;

LIBC_NAMESPACE::libc_errno = 0;

LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT);
Expand Down
9 changes: 9 additions & 0 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ libc_support_library(
],
)

libc_support_library(
name = "__support_sign",
hdrs = ["src/__support/sign.h"],
deps = [
":__support_macros_properties_types",
],
)

libc_support_library(
name = "__support_uint128",
hdrs = ["src/__support/UInt128.h"],
Expand Down Expand Up @@ -734,6 +742,7 @@ libc_support_library(
deps = [
":__support_common",
":__support_cpp_bit",
":__support_sign",
":__support_cpp_type_traits",
":__support_libc_assert",
":__support_macros_attributes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ libc_test(
"//libc:__support_fputil_fp_bits",
"//libc:__support_fputil_fpbits_str",
"//libc:__support_integer_literals",
"//libc:__support_sign",
],
)

Expand Down