frasercrmck wrote:

> > Oh excuse me, there's currently no target-specific behaviour. I missed the 
> > HasFallback in
> 
> HasFallback only applies to the two-argument form.

Oh yes, thank you. I've fixed that now. The behaviour is unconditionally 
zero-is-undef.
> 
> 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.

The builtins are now renamed to cttz/ctlz.

@arsenm I haven't at this point updated the documentation. I note that it 
always says "It is undefined behaviour if the first argument is 0 and no second 
argument is provided.". My literal reading of this is already that it's always 
undefined behaviour for all targets (as you're requesting), but perhaps with 
the baggage of the old builtins in mind it's still not clear? What do you think?

https://github.com/llvm/llvm-project/pull/131995
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to