<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 2, 2014 at 2:24 PM, Ahmed Bougacha <span dir="ltr"><<a href="mailto:ahmed.bougacha@gmail.com" target="_blank">ahmed.bougacha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":80g" class="a3s" style="overflow:hidden">Hi Chandler, all,<br>
<br>
Why aren't the vector [zs]extloads introduced by SSE4.1/AVX2 declared<br>
legal? Is it a simple oversight, or did I miss a deeper reason?<br></div></blockquote><div><br></div><div>While hacking on this, I tried to make them legal, and failed. I don't recall everything that went wrong though, and perhaps you'll have better luck than I did.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":80g" class="a3s" style="overflow:hidden">
<br>
<br>
While cleaning up PMOV*X patterns, I stumbled upon this braindead testcase:<br>
<br>
        %0 = load <8 x i8>* %src, align 1<br>
        %1 = zext <8 x i8> %0 to <8 x i16><br>
<br>
turning into:<br>
<br>
        pmovzxbw       (%rsi), %xmm0<br>
        pand   <0xff,0xff,...>, %xmm0, %xmm0<br>
<br>
v8i8 isn't legal, so the load became an anyext load from v8i8 to<br>
v8i16, with the pand masking out the unwanted/zero bits.<br></div></blockquote><div><br></div><div>I've seen this too. It's horrible.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":80g" class="a3s" style="overflow:hidden">
<br>
In that example, if you declare zextloads from v8i8 legal, and add the<br>
simple corresponding pattern, the pand isn't generated anymore, as<br>
expected.</div></blockquote></div><br>Won't type legalization insist on legalizing the <8 x i8> type even though we can do the extload? My memory of this is very dim. If this "just works" as expected, then by all means, lets do it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Speaking of which, I should actually go nuke the old shuffle lowering. Some of my problems may have only been problems with it.</div></div>