[libc-commits] [libc] [libc] Fix sqrtf128 smoke test for riscv32. (PR #129094)

via libc-commits libc-commits at lists.llvm.org
Thu Feb 27 10:17:18 PST 2025


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/129094

None

>From 6d3fb7004811491ecb20ff9d732c511402f099c9 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 27 Feb 2025 18:16:07 +0000
Subject: [PATCH] [libc] Fix sqrtf128 smoke test for riscv32.

---
 libc/test/src/math/smoke/sqrtf128_test.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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));
   }



More information about the libc-commits mailing list