Skip to content

[libc] Fix build breaks caused by f16sqrtf changes #95459

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 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions libc/test/src/math/smoke/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2597,6 +2597,9 @@ add_fp_unittest(
HDRS
SqrtTest.h
DEPENDS
# The dependency on sqrtf128 is used to disable the test when float128
# support is not available.
libc.src.math.sqrtf128
libc.src.__support.FPUtil.generic.sqrt
COMPILE_OPTIONS
-O3
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdfix/ISqrtTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template <typename T> class ISqrtTest : public LIBC_NAMESPACE::testing::Test {
x_d += 1.0;
++x;
OutType result = func(x);
double expected = LIBC_NAMESPACE::fputil::sqrt(x_d);
double expected = LIBC_NAMESPACE::fputil::sqrt<double>(x_d);
testSpecificInput(x, result, expected, ERR);
}
}
Expand Down
3 changes: 2 additions & 1 deletion libc/test/src/stdfix/SqrtTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ template <typename T> class SqrtTest : public LIBC_NAMESPACE::testing::Test {
T v = LIBC_NAMESPACE::cpp::bit_cast<T>(x);
double v_d = static_cast<double>(v);
double errors = LIBC_NAMESPACE::fputil::abs(
static_cast<double>(func(v)) - LIBC_NAMESPACE::fputil::sqrt(v_d));
static_cast<double>(func(v)) -
LIBC_NAMESPACE::fputil::sqrt<double>(v_d));
if (errors > ERR) {
// Print out the failure input and output.
EXPECT_EQ(v, zero);
Expand Down
Loading