Skip to content

Conversation

@petrhosek
Copy link
Member

We need to set -fno-math-errno so __builtin_fma* generate the fused-multiply-add instructions rather than an fma call.

We need to set -fno-math-errno so __builtin_fma* generate the
fused-multiply-add instructions rather than an fma call.
@petrhosek petrhosek added the libc label Feb 4, 2025
@petrhosek petrhosek requested a review from lntue February 4, 2025 20:07
@llvmbot
Copy link
Member

llvmbot commented Feb 4, 2025

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

We need to set -fno-math-errno so __builtin_fma* generate the fused-multiply-add instructions rather than an fma call.


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

1 Files Affected:

  • (modified) libc/src/__support/FPUtil/CMakeLists.txt (+8)
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 522b4afefd48d6..339bb58838564c 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -122,6 +122,10 @@ add_header_library(
     libc.src.__support.FPUtil.generic.fma
   FLAGS
     FMA_OPT
+  COMPILE_OPTIONS
+    # We need to set -fno-math-errno so __builtin_fma* generate
+    # the fused-mutliply-add instructions rather than an fma call.
+    -fno-math-errno
 )
 
 add_header_library(
@@ -132,6 +136,10 @@ add_header_library(
     libc.src.__support.common
   FLAGS
     FMA_OPT
+  COMPILE_OPTIONS
+    # We need to set -fno-math-errno so __builtin_fma* generate
+    # the fused-mutliply-add instructions rather than an fma call.
+    -fno-math-errno
 )
 
 add_header_library(

@petrhosek petrhosek closed this Feb 4, 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.

2 participants