Skip to content

[libc] Fix wrong #ifdef for riscv's sqrt. #134964

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
Apr 9, 2025
Merged

[libc] Fix wrong #ifdef for riscv's sqrt. #134964

merged 1 commit into from
Apr 9, 2025

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Apr 9, 2025

No description provided.

@lntue lntue requested a review from jhuber6 April 9, 2025 02:39
@llvmbot llvmbot added the libc label Apr 9, 2025
@lntue lntue requested a review from mikhailramalho April 9, 2025 02:39
@llvmbot
Copy link
Member

llvmbot commented Apr 9, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

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

1 Files Affected:

  • (modified) libc/src/__support/FPUtil/riscv/sqrt.h (+1-1)
diff --git a/libc/src/__support/FPUtil/riscv/sqrt.h b/libc/src/__support/FPUtil/riscv/sqrt.h
index 694451d02e2b1..14a34359ee32b 100644
--- a/libc/src/__support/FPUtil/riscv/sqrt.h
+++ b/libc/src/__support/FPUtil/riscv/sqrt.h
@@ -29,7 +29,7 @@ template <> LIBC_INLINE float sqrt<float>(float x) {
 }
 #endif // LIBC_TARGET_CPU_HAS_FPU_FLOAT
 
-#if LIBC_TARGET_CPU_HAS_FPU_DOUBLE
+#ifdef LIBC_TARGET_CPU_HAS_FPU_DOUBLE
 template <> LIBC_INLINE double sqrt<double>(double x) {
   double result;
   asm("fsqrt.d %0, %1\n\t" : "=f"(result) : "f"(x));

@lntue lntue merged commit 438ade1 into llvm:main Apr 9, 2025
14 of 18 checks passed
@lntue lntue deleted the sqrt branch April 9, 2025 02:40
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 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