Skip to content

[libc] Use raise_except_if_required for log2f. #144961

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
Jun 19, 2025
Merged

[libc] Use raise_except_if_required for log2f. #144961

merged 1 commit into from
Jun 19, 2025

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Jun 19, 2025

No description provided.

@lntue lntue requested a review from overmighty June 19, 2025 21:44
@llvmbot llvmbot added the libc label Jun 19, 2025
@lntue lntue requested a review from SchrodingerZhu June 19, 2025 21:44
@llvmbot
Copy link
Member

llvmbot commented Jun 19, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

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

1 Files Affected:

  • (modified) libc/src/math/generic/log2f.cpp (+1-1)
diff --git a/libc/src/math/generic/log2f.cpp b/libc/src/math/generic/log2f.cpp
index b25ec41f277b6..cff718eec2169 100644
--- a/libc/src/math/generic/log2f.cpp
+++ b/libc/src/math/generic/log2f.cpp
@@ -79,7 +79,7 @@ LLVM_LIBC_FUNCTION(float, log2f, (float x)) {
     }
     if (xbits.is_neg() && !xbits.is_nan()) {
       fputil::set_errno_if_required(EDOM);
-      fputil::raise_except(FE_INVALID);
+      fputil::raise_except_if_required(FE_INVALID);
       return FPBits::quiet_nan().get_val();
     }
     if (xbits.is_inf_or_nan()) {

@lntue lntue merged commit d3a2931 into llvm:main Jun 19, 2025
15 checks passed
@lntue lntue deleted the log2f branch June 19, 2025 21:51
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