Skip to content

Commit 672cc84

Browse files
committed
[libc] Set -fno-math-errno for FMA
We need to set -fno-math-errno so __builtin_fma* generate the fused-multiply-add instructions rather than an fma call.
1 parent 53d6e59 commit 672cc84

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libc/src/__support/FPUtil/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ add_header_library(
122122
libc.src.__support.FPUtil.generic.fma
123123
FLAGS
124124
FMA_OPT
125+
COMPILE_OPTIONS
126+
# We need to set -fno-math-errno so __builtin_fma* generate
127+
# the fused-mutliply-add instructions rather than an fma call.
128+
-fno-math-errno
125129
)
126130

127131
add_header_library(
@@ -132,6 +136,10 @@ add_header_library(
132136
libc.src.__support.common
133137
FLAGS
134138
FMA_OPT
139+
COMPILE_OPTIONS
140+
# We need to set -fno-math-errno so __builtin_fma* generate
141+
# the fused-mutliply-add instructions rather than an fma call.
142+
-fno-math-errno
135143
)
136144

137145
add_header_library(

0 commit comments

Comments
 (0)