Use __builtin_clz to find leading 1 in generic sqrt (where possible)
authorClint Caywood <clint@clintcaywood.com>
Mon, 28 Feb 2022 22:28:11 +0000 (17:28 -0500)
committerTue Ly <lntue@google.com>
Mon, 28 Feb 2022 22:33:49 +0000 (17:33 -0500)
commit1768cb3a674ad657dd3eccd001f0a3e9a7675af6
tree2ec35ee100f95feabf42f68addb45793ac76e43c
parent215f99642485ecb23ef0b2af68a9a30c4fea195b
Use __builtin_clz to find leading 1 in generic sqrt (where possible)

__builtin_clz requires just a single instruction on x86 and arm, so this is a performance improvement.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D120579
libc/src/__support/FPUtil/generic/sqrt.h
libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h