[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 30 10:08:36 PDT 2025


efriedma-quic wrote:

> Oh excuse me, there's currently no target-specific behaviour. I missed the HasFallback in

HasFallback only applies to the two-argument form.

------------

I don't have a strong opinion about the names.

The whole "fallback behavior" thing was written back in the early days of clang, before we even had ubsan.  I doubt we would handle that the same way today... and I don't think we need to carry it forward to new variants.  If the user cares, they can explicitly request `__builtin_elementwise_ctz(x, 32)` or whatever.

https://github.com/llvm/llvm-project/pull/131995


More information about the cfe-commits mailing list