<div dir="ltr"><div>So again, I'm not sure why this is the case. I know this has probably been discussed ad nauseam (as evidenced by the multiple posts asking about this, including mine), but it seems pretty clear cut that you'd want separate shl, one for logical (non-overflow) and one for arithmetic (overflow). In fact, you might want a logical, signed arith and unsigned arith, at least in the hardware. </div><div><br></div><div>I don't care if clang only produces shl, I'm more curious how to get the signed info to the backend for shl when it's not producing a nsw/nuw flag? I'm currently not sure how this would be done, is there another arch that manages this somehow?</div><div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 1:52 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What is the difference between logical and arithmetic left shift on your target? LLVM only makes that distinction for right shift, and not for left shift.</div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Nov 19, 2014 at 10:32 AM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><span><div dir="ltr"><div>I'm curious why there is not always a nsw/nuw flag with shl instruction? For example, I have a signed int I'm shifting left (want to generate an arithmetic left shift in backend for signed int shift lefts and logical for unsigned, at the moment).... but shl on a signed int does not always have nsw/nuw flag present, why is this?</div><div><br></div><div>Thank you.</div></div>
<br></span>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>