<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 25, 2015 at 10:38 AM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 25, 2015 at 8:30 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
> On Wed, Mar 25, 2015 at 6:20 AM, Simon Atanasyan <<a href="mailto:simon@atanasyan.com">simon@atanasyan.com</a>><br>
> wrote:<br>
>><br>
</span><span class="">>> I hope the problem has been fixed by r233186. Unfortunately using<br>
>> getRInfo does not solve the problem because in 32-bit case we extract<br>
>> too much data and touch symbol index part of r_info field.<br>
>><br>
>> So I just factor out the code that gets the "tag" into the separate<br>
>> function. That allows to keep all bit manipulation code into the<br>
>> single place and removes the warning.<br>
><br>
><br>
> This (to me - though lld isn't my project, etc) just seems to complicate the<br>
> code further - what's the point of &ing the 0xFFFFFF00 mask if you're just<br>
> shifting down 8 anyway? This hides the issue from the compiler because the<br>
> bitwise & does integer promotion (so the char is promoted to int, then<br>
> and-ed, then shifted, so the shift is over an int instead of a char) but<br>
> produces exactly the same result & now makes the optimizer (& reader) do a<br>
> bit more work?<br>
<br>
</span>The general goal is to extract high 24 bits of r_info field. I think<br>
using the 0xffffff00 mask is a good method to state this goal.<br>
Shifting right by 8 bits is just an attempt to simplify the following<br>
usage of the _tag field.<br></blockquote><div><br>Sure - but the usual code one would expect is to keep it shifted down and to populate it by shifting down. The extra masking seems surprising/inexplicable, since it doesn't do anything (removing it & the code has exactly the same result) - it'd make a reader do a double take wondering whether this code is somehow meaningful/significant/observable when it isn't.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">By the way, what do you suggest to silence the VC++ warning?<br></blockquote><div><br>Disabling the warning, this is a false positive because some instantiations of the template produce non-zero results out of this shift and the fact that some other instantiations always produce 0 is fine. Same goes for template-conditionally dead code, etc.<br><br>- David<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Simon Atanasyan<br>
</font></span></blockquote></div><br></div></div>