[libc-commits] [PATCH] D115408: [libc] Implement correctly rounded logf based on RLIBM library.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Dec 8 22:12:48 PST 2021


sivachandra added a comment.

Just a few cosmetic comments for now. Needs a rebase though to absorb a lot style changes.



================
Comment at: libc/src/math/generic/logf.cpp:38
+// which provides correct rounding for all but few exception values.  For more
+// detail about how this polynomial is obtained, check out the following paper:
+// https://people.cs.rutgers.edu/~sn349/papers/ribmall-popl-2022.pdf
----------------
s/check out/refer to


================
Comment at: libc/src/math/generic/logf.cpp:39
+// detail about how this polynomial is obtained, check out the following paper:
+// https://people.cs.rutgers.edu/~sn349/papers/ribmall-popl-2022.pdf
+
----------------
s/ribm/rlibm

Also, seems like this is a yet to be published paper. So, we should update the link when it gets published.


================
Comment at: libc/src/math/generic/logf.cpp:47
+// Lookup table for log(f) = log(1 + n*2^(-7)) where n = 0..127.
+static const double __LOG_F[128] = {
+    0x0.0000000000000p+0, 0x1.fe02a6b106788p-8, 0x1.fc0a8b0fc03e3p-7,
----------------
For this and others, when they are already in an internal namespace which has a prefix of `__`, we shouldn't use `__` prefix for globals. Also, can this be a `constexpr`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115408



More information about the libc-commits mailing list