Skip to content

[libc] Fix sqrtf128 smoke test for riscv32. #129094

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 27, 2025
Merged

[libc] Fix sqrtf128 smoke test for riscv32. #129094

merged 1 commit into from
Feb 27, 2025

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Feb 27, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/129094.diff

1 Files Affected:

  • (modified) libc/test/src/math/smoke/sqrtf128_test.cpp (+2-2)
diff --git a/libc/test/src/math/smoke/sqrtf128_test.cpp b/libc/test/src/math/smoke/sqrtf128_test.cpp
index 3b9686c4ea477..2fca74842d313 100644
--- a/libc/test/src/math/smoke/sqrtf128_test.cpp
+++ b/libc/test/src/math/smoke/sqrtf128_test.cpp
@@ -129,8 +129,8 @@ TEST_F(LlvmLibcSqrtTest, HardToRound) {
   // Then from the largest number.
   uint64_t k0 = 101904826760412362ULL;
   for (uint64_t k = k0; k > k0 - 10000; --k) {
-    UInt128 k2 = static_cast<UInt128>(k) * static_cast<UInt128>(k);
-    float128 x = static_cast<float128>(k2);
+    float128 k_f128 = static_cast<float128>(k);
+    float128 x = k_f128 * k_f128;
     float128 y = static_cast<float128>(k);
     EXPECT_FP_EQ_ALL_ROUNDING(y, LIBC_NAMESPACE::sqrtf128(x));
   }

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lntue lntue merged commit 4fd762c into llvm:main Feb 27, 2025
16 of 17 checks passed
@lntue lntue deleted the sqrtf128 branch February 27, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants