[libc-commits] [libc] [libc] Use -fno-math-errno to for __builtin_fma* to generate fma instructions. (PR #124200)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Fri Jan 24 01:56:19 PST 2025


================
@@ -28,6 +28,13 @@ function(_get_compile_options_from_flags output_var)
       elseif(LIBC_TARGET_ARCHITECTURE_IS_RISCV64)
         list(APPEND compile_options "-D__LIBC_RISCV_USE_FMA")
       endif()
+      # For clang, we will build the math functions with `-fno-math-errno` so that
+      # __builtin_fma* will generate the fused-mutliply-add instructions.  We
+      # don't put the control flag to the public config yet, and see if it makes
+      # sense to just enable this flag by default.
+      if(LIBC_ADD_FNO_MATH_ERRNO)
----------------
petrhosek wrote:

Shouldn't this be `LIBC_MATH_NO_ERRNO`? Where is `LIBC_ADD_FNO_MATH_ERRNO` being set?

https://github.com/llvm/llvm-project/pull/124200


More information about the libc-commits mailing list