[libc-commits] [PATCH] D115347: [libc] Optimize PolyEval for x86-64 with degree 3-6 polynomials.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Dec 8 23:16:23 PST 2021


sivachandra added inline comments.


================
Comment at: libc/src/math/generic/CMakeLists.txt:503
+  COMPILE_OPTIONS
+    -mfma
 )
----------------
sivachandra wrote:
> Can you add a comment explaining what in the implementation would be affected by this? AFAICT, we are either using the fma instructions directly, or are calling the fma related builtins. So, it is not clear to me as to why this should be required.
So I learn't that the fma related builtins require this option. The correct way to do this would be to do it this way:
1. Make a separate helper library of x86 builtin calls.
2. List `-mfma` as an `INTERFACE` compile option for that library.

Then targets depending on the helper library will automatically get the `-mfma` compile option.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115347/new/

https://reviews.llvm.org/D115347



More information about the libc-commits mailing list