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)
2828 elseif (LIBC_TARGET_ARCHITECTURE_IS_RISCV64)
2929 list (APPEND compile_options "-D__LIBC_RISCV_USE_FMA" )
3030 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 ()
3138 endif ()
3239 if (ADD_ROUND_OPT_FLAG)
3340 if (LIBC_TARGET_ARCHITECTURE_IS_X86_64)
Original file line number Diff line number Diff line change 11function (_get_common_test_compile_options output_var c_test flags )
22 _get_compile_options_from_flags(compile_flags ${flags} )
33
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+
49 set (compile_options
510 ${LIBC_COMPILE_OPTIONS_DEFAULT}
611 ${LIBC_TEST_COMPILE_OPTIONS_DEFAULT}
You can’t perform that action at this time.
0 commit comments