File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ function(_get_compile_options_from_flags output_var)
28
28
elseif (LIBC_TARGET_ARCHITECTURE_IS_RISCV64 )
29
29
list (APPEND compile_options "-D__LIBC_RISCV_USE_FMA" )
30
30
endif ()
31
+ # For clang, we will build the math functions with `-fno-math-errno` so that
32
+ # __builtin_fma* will generate the fused-mutliply-add instructions. We
33
+ # don't put the control flag to the public config yet, and see if it makes
34
+ # sense to just enable this flag by default.
35
+ if (LIBC_ADD_FNO_MATH_ERRNO )
36
+ list (APPEND compile_options "-fno-math-errno" )
37
+ endif ()
31
38
endif ()
32
39
if (ADD_ROUND_OPT_FLAG )
33
40
if (LIBC_TARGET_ARCHITECTURE_IS_X86_64 )
Original file line number Diff line number Diff line change 1
1
function (_get_common_test_compile_options output_var c_test flags )
2
2
_get_compile_options_from_flags (compile_flags ${flags} )
3
3
4
+ # Remove -fno-math-errno if it was added.
5
+ if (LIBC_ADD_FNO_MATH_ERRNO )
6
+ list (REMOVE_ITEM compile_options "-fno-math-errno" )
7
+ endif ()
8
+
4
9
set (compile_options
5
10
${LIBC_COMPILE_OPTIONS_DEFAULT}
6
11
${LIBC_TEST_COMPILE_OPTIONS_DEFAULT}
You can’t perform that action at this time.
0 commit comments