[libc-commits] [PATCH] D123440: [libc] Make expm1f correctly rounded when the targets have no FMA instructions.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 27 17:26:37 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/math/generic/expm1f.cpp:45
+  }
+#endif // LIBC_TARGET_HAS_FMA
+
----------------
Would making this unconditional to availability of fma affect the case when fma is available take a performance hit?


================
Comment at: libc/test/src/math/exhaustive/expm1f_no_fma_test.cpp:11
+
+#if defined(LIBC_TARGET_HAS_FMA)
+#undef LIBC_TARGET_HAS_FMA
----------------
This is another of those situations where having configs avoids this ugliness. Lets give it some more thought so that we can solve this problem cleanly in a more general fashion. We should not need to add a separate `expm1f_no_fma_test.cpp` and a corresponding target. Just one `expm1_test.cpp` should be built and tested in two different contexts, one with fma, another without fma.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123440



More information about the libc-commits mailing list