[libc-commits] [PATCH] D124495: [libc] Implement double precision FMA for targets without FMA instructions.

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 9 16:57:08 PDT 2022

michaelrj accepted this revision.
michaelrj added a comment.
This revision is now accepted and ready to land.

overall, LGTM with a couple nits.  Also, if you're going to add a `clz` header to `FPUtil` then please add a TODO for me to change `str_to_float.h` over to using it, or alternately change it yourself.

Comment at: libc/src/__support/FPUtil/generic/FMA.h:156
+  __uint128_t prod_mant = x_mant * y_mant << 10;
+  int prod_lsb_exp =
nit: can you add something explaining why this number is 10?

Comment at: libc/src/__support/FPUtil/generic/FMA.h:186
+      if (z_shifted && sticky_bits) {
+        // Add 1 more to the subtrahend so that the sticky bits remains
+        // positive. This would simplify the rounding logic.
nit: it should either be `the sticky bits remain` or `the sticky bit remains`

  rG LLVM Github Monorepo



More information about the libc-commits mailing list