Skip to content

Conversation

@lntue
Copy link
Contributor

@lntue lntue commented Mar 12, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 12, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

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

1 Files Affected:

  • (modified) libc/src/math/generic/expm1f.cpp (+2-1)
diff --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index 1e44e943d9258..b2967e2516197 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -30,6 +30,7 @@ LLVM_LIBC_FUNCTION(float, expm1f, (float x)) {
   uint32_t x_u = xbits.uintval();
   uint32_t x_abs = x_u & 0x7fff'ffffU;
 
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
   // Exceptional value
   if (LIBC_UNLIKELY(x_u == 0x3e35'bec5U)) { // x = 0x1.6b7d8ap-3f
     int round_mode = fputil::quick_get_round();
@@ -37,7 +38,6 @@ LLVM_LIBC_FUNCTION(float, expm1f, (float x)) {
       return 0x1.8dbe64p-3f;
     return 0x1.8dbe62p-3f;
   }
-
 #if !defined(LIBC_TARGET_CPU_HAS_FMA_DOUBLE)
   if (LIBC_UNLIKELY(x_u == 0xbdc1'c6cbU)) { // x = -0x1.838d96p-4f
     int round_mode = fputil::quick_get_round();
@@ -46,6 +46,7 @@ LLVM_LIBC_FUNCTION(float, expm1f, (float x)) {
     return -0x1.71c882p-4f;
   }
 #endif // LIBC_TARGET_CPU_HAS_FMA_DOUBLE
+#endif // !LIBC_MATH_HAS_SKIP_ACCURATE_PASS
 
   // When |x| > 25*log(2), or nan
   if (LIBC_UNLIKELY(x_abs >= 0x418a'a123U)) {

@lntue lntue merged commit 7547ad3 into llvm:main Apr 23, 2025
18 checks passed
@lntue lntue deleted the exceptional branch April 23, 2025 05:04
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
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