<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 5:28 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.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 4, 2015 at 5:07 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> On Wed, Mar 4, 2015 at 4:56 PM, Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>> wrote:<br>
</span><span class="">>> @@ -357,16 +394,22 @@ linear_to_xtiled_faster(uint32_t x0, uint32_t x1,<br>
>> uint32_t x2, uint32_t x3,<br>
>> if (mem_copy == memcpy)<br>
>> return linear_to_xtiled(0, 0, xtile_width, xtile_width, 0,<br>
>> xtile_height,<br>
>> dst, src, src_pitch, swizzle_bit,<br>
>> memcpy);<br>
>> - else if (mem_copy == rgba8_copy)<br>
>> + else if (mem_copy == rgba8_copy_aligned_dst)<br>
>> return linear_to_xtiled(0, 0, xtile_width, xtile_width, 0,<br>
>> xtile_height,<br>
>> - dst, src, src_pitch, swizzle_bit,<br>
>> rgba8_copy);<br>
>> + dst, src, src_pitch, swizzle_bit,<br>
>> + rgba8_copy_aligned_dst);<br>
>> + else<br>
>> + unreachable("not reached");<br>
><br>
><br>
> I'm not sure what I think about the unreachable here. The original versions<br>
> of the *_faster functions would work regardless of what memcpy you passed<br>
> in.<br>
<br>
</span>Well, yeah, but there were only two. :)<br>
<span class=""><br>
> The *_faster was only to force the compiler to inline the universe in<br>
> the case where we knew some parameters. Adding unreachable changes that.<br>
<br>
</span>Oh, I didn't know what you meant, until I realized that the if-elseif<br>
is supposed to fall through to another function call in the case that<br>
mem_copy wasn't matched.<br>
<br>
At the very least I should split that out into a separate patch. Using<br>
unreachable(), if it's safe, cuts more than 1k of text:<br>
<br>
text data bss dec hex filename<br>
9663 0 0 9663 25bf .libs/intel_tiled_memcpy.o<br>
8215 0 0 8215 2017 .libs/intel_tiled_memcpy.o<br>
<br>
I'll drop the unreachable()s from this patch.<br></blockquote><div><br></div><div>Fine with me. In any case, my R-B still applies.<br></div><div>--Jason<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
> That said, we never call them with anything other than memcpy or<br>
> rgba8_copy_aligned_* so it's probably ok. I think I'm ok with it with or<br>
> without the unreachable()'s.<br>
</div></div></blockquote></div><br></div></div>