<div dir="ltr">On Wed, Jul 6, 2016 at 1:09 PM, Simon Pilgrim <span dir="ltr"><<a href="mailto:llvm-dev@redking.me.uk" target="_blank">llvm-dev@redking.me.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">So that patch was mainly about matching the behaviour of _mm_cvttsd_epi32 (cvttsd2si) which already did the scalar equivalent.<div><br></div><div>It turns out there is a problem if constant folding of an out of range values occurs as LangRef says it should be undefined (although it actually sets the result to zero). But the cvttsd2si/cvttps2dq/cvttpd2dq instructions guarantee that the result is actually 0x80000000.</div><div><br></div><div>I’ll prepare a reversion patch that reverts these changes (including for the scalar) and performs a fast-math only combine instead.<br></div></div></blockquote><div><br></div><div>Okay.<br><br>I just looked into it, and it turns out I screwed this up back in 2009 (r72979).  Apparently nobody noticed. :(<br></div></div><br></div><div class="gmail_extra">-Eli<br></div></div>