[libc-commits] [PATCH] D136799: [libc] Implement a high-precision floating point class.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Dec 13 10:31:56 PST 2022


lntue marked an inline comment as done.
lntue added inline comments.


================
Comment at: libc/src/__support/UInt.h:368-369
 #endif                           // __SIZEOF_INT128__
+    if (unlikely(s == 0))
+      return;
+
----------------
michaelrj wrote:
> shouldn't this be above the `ifdef __SIZEOF_INT128__`?
I intentially put it only for non 128-bit / without builtin.  Since the built-in 128-bit shifts are quite efficient, so adding an extra check for the special case `s == 0` does not improve the performance much, but actually reduce the throughput due to extra branching.  For bigger size, the extra branching cost is much smaller compared with the work saving from avoiding all the shifting loops.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136799



More information about the libc-commits mailing list