Skip to content
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

[libc] Use __builtin_fma(f) by default if LIBC_TARGET_CPU_HAS_FMA is defined. #91535

Merged
merged 3 commits into from
May 9, 2024

Conversation

lntue
Copy link
Contributor

@lntue lntue commented May 8, 2024

No description provided.

@llvmbot
Copy link
Collaborator

llvmbot commented May 8, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

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

2 Files Affected:

  • (modified) libc/src/__support/FPUtil/FMA.h (+1-1)
  • (modified) libc/src/__support/FPUtil/aarch64/FMA.h (+1-1)
diff --git a/libc/src/__support/FPUtil/FMA.h b/libc/src/__support/FPUtil/FMA.h
index 0e1ede02d5cc0..5d677503d2be9 100644
--- a/libc/src/__support/FPUtil/FMA.h
+++ b/libc/src/__support/FPUtil/FMA.h
@@ -16,7 +16,7 @@
 
 #if defined(LIBC_TARGET_ARCH_IS_X86_64)
 #include "x86_64/FMA.h"
-#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
+#elif defined(LIBC_TARGET_ARCH_IS_ANY_ARM)
 #include "aarch64/FMA.h"
 #elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
 #include "riscv/FMA.h"
diff --git a/libc/src/__support/FPUtil/aarch64/FMA.h b/libc/src/__support/FPUtil/aarch64/FMA.h
index 6254a0673ff42..bfcc19f82a340 100644
--- a/libc/src/__support/FPUtil/aarch64/FMA.h
+++ b/libc/src/__support/FPUtil/aarch64/FMA.h
@@ -13,7 +13,7 @@
 #include "src/__support/macros/properties/architectures.h"
 #include "src/__support/macros/properties/cpu_features.h" // LIBC_TARGET_CPU_HAS_FMA
 
-#if !defined(LIBC_TARGET_ARCH_IS_AARCH64)
+#if !defined(LIBC_TARGET_ARCH_IS_ANY_ARM)
 #error "Invalid include"
 #endif
 

@lntue lntue requested a review from rupprecht as a code owner May 9, 2024 01:34
@lntue lntue changed the title [libc] Update FMA inclusion for ARM targets. [libc] Use __builtin_fma(f) by default if LIBC_TARGET_CPU_HAS_FMA is defined. May 9, 2024
@lntue lntue requested review from gchatelet and jhuber6 May 9, 2024 01:35
Copy link

github-actions bot commented May 9, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label May 9, 2024
libc/src/__support/FPUtil/FMA.h Outdated Show resolved Hide resolved
@lntue lntue merged commit e1f279e into llvm:main May 9, 2024
4 checks passed
@lntue lntue deleted the fma branch May 9, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants