[PATCH][X86] __builtin_ctz/clz sometimed defined for zero input

Robinson, Paul Paul_Robinson at playstation.sony.com
Mon Oct 27 09:45:02 PDT 2014


> Expose the llvm.cttz /llvm.ctlz with 1 as second argument as new
> __builtin_cttz / __builtin_ctlz builtins and teach people to use those?
> 
> Joerg

So the new ones would unconditionally indicate "defined for zero" and we'd
make the old ones unconditionally indicate "undef for zero"?  That still
lets us eliminate the ForZeroUndef predicates, and if we fix lzcntintrin.h
to use the new ones that fixes the miscompile problem; but I have to wonder
about introducing a miscompile for ARM/PPC/MIPS users of the old builtin.

--paulr





More information about the cfe-commits mailing list