<div dir="ltr">Interesting, thank you. I expected both answers to be "unchanged" so was surprised by the zero extend in the legaliser.<div><br></div><div>The motivation here is that it's faster for us to load N bytes, apply whatever masks are necessary to reproduce the truncating store then store all N bytes. This is only a good plan if there's no change to the semantics :)</div><div><br></div><div>Are scalar integer types zero extended to the next multiple of 8 or to the next power of 2 greater than 7? For example, i17 => i24 or i17 => i32?</div><div><br></div><div>I think this means truncating stores of vector types will introduce zero bits at the end of each element instead grouping all the zeros at the end. For example, <i6 63, i6 63> writes to sixteen bits as 0b0011111100111111, not as 0b0000111111111111?</div><div><br></div><div><br></div><div>Thanks!</div><div><br></div><div>Jon</div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 6:55 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="gmail-">On 9/15/2017 5:49 AM, Jon Chesterfield via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
For example, truncating store of an i32 to i6. My assumption was that this should write the low six bits of the i32 to somewhere in memory.<br>
<br>
Should the top 24 bits of a corresponding 32 bit region of memory be unchanged, zero, undefined?<br>
</blockquote>
<br></span>
Unchanged.<span class="gmail-"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Should the two bits that would round the i6 up to a byte be preserved, zero, undefined?<br>
</blockquote>
<br></span>
Zero. Legalization will normally handle this for you, though, by transforming it to an i8 store.<span class="gmail-HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div></div></div>