[PATCH][X86] __builtin_ctz/clz sometimed defined for zero input
Chandler Carruth
chandlerc at google.com
Mon Oct 27 19:17:01 PDT 2014
On Mon, Oct 27, 2014 at 7:07 PM, Sean Silva <chisophugis at gmail.com> wrote:
> Curiously, it looks like GCC is depending on definedness for 0 in its own
> headers:
> https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/lzcntintrin.h
>
> *shrug*
>
I don't think that's really a justification for much of anything though.
We should still add UBSan checks for this, and make our code correct
according to the spec for these builtins.
Currently, I continue to prefer not using a builtin and instead defining
the __lzcnt stuff with a ternary operator.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141027/87a0003f/attachment.html>
More information about the cfe-commits
mailing list