[libc-commits] [PATCH] D117584: [libc] Specialize portion of hypot for x86_64 CPUs.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jan 18 11:56:25 PST 2022


lntue accepted this revision.
lntue added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/__support/find_leading_one.h:26
+
+#if defined(LLVM_LIBC_ARCH_X86_64)
+#include "src/__support/x86_64/find_leading_one.h"
----------------
cratonica wrote:
> lntue wrote:
> > Is the BSR instruction available for x86 also?  If so then I think LLVM_LIBC_ARCH_X86 should be better.  And if that's the case, you can just leave the implementation in the x86_64 folder, I don't think we need separate folders for x86 and x86-64.
> My understanding is that we'd be limited to 32-bit operands in that case and would therefore need to make this conditional upon both the size of the data and the architecture, which might be messier (so, x86 would drop back to the generic implementation for 64-bit numbers, or I suppose I could implement it as two BSR calls if it's possible to test this in 32-bit mode).
> 
> Happy to do whatever you think is best.
If that's the case then I'm fine with the current specialization.  We can always specialize further if there are requests for non-64-bit x86 arch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117584



More information about the libc-commits mailing list