libgcc: use __builtin_clz and __builtin_ctz in libbid
authorChristophe Lyon <christophe.lyon@arm.com>
Thu, 5 May 2022 08:25:14 +0000 (09:25 +0100)
committerChristophe Lyon <christophe.lyon@arm.com>
Fri, 20 May 2022 07:36:08 +0000 (09:36 +0200)
commit5143faee0d0edfd5849c5f54677cb699bf84a5db
tree0e7320dd418f7453706f304bc137eff57ff7eb50
parent308a0af4f913243023ee52332f7cc513745c9203
libgcc: use __builtin_clz and __builtin_ctz in libbid

This patch replaces libbid's implementations of clz and ctz for 32 and
64 bits inputs which used several masks, and switches to the
corresponding builtins. This will provide a better implementation,
especially on targets with clz/ctz instructions.

2022-05-06  Christophe Lyon  <christophe.lyon@arm.com>

libgcc/config/libbid/ChangeLog:

* bid_binarydecimal.c (CLZ32_MASK16): Delete.
(CLZ32_MASK8): Delete.
(CLZ32_MASK4): Delete.
(CLZ32_MASK2): Delete.
(CLZ32_MASK1): Delete.
(clz32_nz): Use __builtin_clz.
(ctz32_1bit): Delete.
(ctz32): Use __builtin_ctz.
(CLZ64_MASK32): Delete.
(CLZ64_MASK16): Delete.
(CLZ64_MASK8): Delete.
(CLZ64_MASK4): Delete.
(CLZ64_MASK2): Delete.
(CLZ64_MASK1): Delete.
(clz64_nz): Use __builtin_clzl.
(ctz64_1bit): Delete.
(ctz64): Use __builtin_ctzl.
libgcc/config/libbid/bid_binarydecimal.c