<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 7:07 PM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Curiously, it looks like GCC is depending on definedness for 0 in its own headers: <a href="https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/lzcntintrin.h" target="_blank">https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/lzcntintrin.h</a></div><div><br></div><div>*shrug*</div></blockquote></div><br>I don't think that's really a justification for much of anything though.</div><div class="gmail_extra"><br></div><div class="gmail_extra">We should still add UBSan checks for this, and make our code correct according to the spec for these builtins.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Currently, I continue to prefer not using a builtin and instead defining the __lzcnt stuff with a ternary operator.</div></div>