[libc-commits] [PATCH] D117812: [libc] Make log2f correctly rounded for all rounding modes when FMA is not available.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jan 20 12:56:31 PST 2022


lntue added inline comments.


================
Comment at: libc/src/math/generic/log2f.cpp:121
+    break;
+  case 0x3f7d57f5U:
+    if (fputil::get_round() == FE_TOWARDZERO) {
----------------
sivachandra wrote:
> You did not need this as a special case before so why is it required now?
These 2 extra cases I got when I intentionally not using FMA for polyeval, to mimic what would happen if FMA is missing.  Another implementation option is only consider these 2 cases when FMA is missing with #ifdef.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117812



More information about the libc-commits mailing list