[libc-commits] [libc] [libc] Fix sinf unit test failures (PR #224475)

Kewen Meng via libc-commits libc-commits at lists.llvm.org
Thu Sep 17 16:55:20 PDT 2026


https://github.com/Kewen12 updated https://github.com/llvm/llvm-project/pull/224475

>From 5efcc8a51d1a744b88f7e976b5ed70994157b329 Mon Sep 17 00:00:00 2001
From: Kewen Meng <kewen.meng at amd.com>
Date: Thu, 17 Sep 2026 17:51:58 -0500
Subject: [PATCH 1/2] [libc] sinf unit test failures

---
 libc/test/src/mathvec/CMakeLists.txt | 41 +++++++++++++++-------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/libc/test/src/mathvec/CMakeLists.txt b/libc/test/src/mathvec/CMakeLists.txt
index f776d1e0faf7a..1a49297a5d9dc 100644
--- a/libc/test/src/mathvec/CMakeLists.txt
+++ b/libc/test/src/mathvec/CMakeLists.txt
@@ -420,25 +420,28 @@ add_fp_unittest(
     FMA_OPT
 )
 
-add_fp_unittest(
-  sinf_test
-  SUITE
-    libc-mathvec-unittests
-  SRCS
-    sinf_test.cpp
-  HDRS
-    ../math/sdcomp26094.h
-  DEPENDS
-    .unit_test_wrappers
-    libc.src.math.sinf
-    libc.src.mathvec.sinf
-    libc.src.__support.FPUtil.fp_bits
-    libc.src.__support.CPP.simd
-    libc.src.__support.macros.optimization
-  FLAGS
-    ROUND_OPT
-    FMA_OPT
-)
+if(NOT LIBC_CONF_MATH_OPTIMIZATIONS MATCHES
+   "LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT")
+  add_fp_unittest(
+    sinf_test
+    SUITE
+      libc-mathvec-unittests
+    SRCS
+      sinf_test.cpp
+    HDRS
+      ../math/sdcomp26094.h
+    DEPENDS
+      .unit_test_wrappers
+      libc.src.math.sinf
+      libc.src.mathvec.sinf
+      libc.src.__support.FPUtil.fp_bits
+      libc.src.__support.CPP.simd
+      libc.src.__support.macros.optimization
+    FLAGS
+      ROUND_OPT
+      FMA_OPT
+  )
+endif()
 
 add_fp_unittest(
   sinhf_test

>From 393336ae51053d0185173b4d4e3535088afe3e90 Mon Sep 17 00:00:00 2001
From: Kewen Meng <kewen.meng at amd.com>
Date: Thu, 17 Sep 2026 18:54:49 -0500
Subject: [PATCH 2/2] removed previously added lines

---
 libc/test/src/mathvec/sinf_test.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/libc/test/src/mathvec/sinf_test.cpp b/libc/test/src/mathvec/sinf_test.cpp
index c0b95d5d86d6e..8aacf20e3c5a4 100644
--- a/libc/test/src/mathvec/sinf_test.cpp
+++ b/libc/test/src/mathvec/sinf_test.cpp
@@ -11,10 +11,6 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#include "src/__support/macros/optimization.h"
-
-// TODO: Implement bitwise reproducible float-only mathvec sinf
-#if !defined(LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT)
 #include "hdr/math_macros.h"
 #include "src/__support/CPP/simd.h"
 #include "src/__support/FPUtil/FPBits.h"
@@ -104,4 +100,3 @@ TEST_F(LlvmLibcVecSinfTest, SpecificBitPatterns) {
 }
 
 TEST_F(LlvmLibcVecSinfTest, InFloatRange) { TEST_MATHVEC_FLOAT_RANGE(SinfOp); }
-#endif // !LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT



More information about the libc-commits mailing list