<div dir="ltr">FYI, this is all fixed. =] Sorry for the trouble, was a silly goof that should have been caught sooner.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 5, 2014 at 11:09 AM, Robert Lougher <span dir="ltr"><<a href="mailto:rob.lougher@gmail.com" target="_blank">rob.lougher@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chandler,<br>
<div><div class="h5"><br>
On 5 September 2014 17:38, Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br>
><br>
> On Fri, Sep 5, 2014 at 9:32 AM, Robert Lougher <<a href="mailto:rob.lougher@gmail.com">rob.lougher@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Unfortunately, another team, while doing internal testing has seen the<br>
>> new path generating illegal insertps masks. A sample here:<br>
>><br>
>> vinsertps $256, %xmm0, %xmm13, %xmm4 # xmm4 = xmm0[0],xmm13[1,2,3]<br>
>> vinsertps $256, %xmm1, %xmm0, %xmm6 # xmm6 = xmm1[0],xmm0[1,2,3]<br>
>> vinsertps $256, %xmm13, %xmm1, %xmm7 # xmm7 = xmm13[0],xmm1[1,2,3]<br>
>> vinsertps $416, %xmm1, %xmm4, %xmm14 # xmm14 =<br>
>> xmm4[0,1],xmm1[2],xmm4[3]<br>
>> vinsertps $416, %xmm13, %xmm6, %xmm13 # xmm13 =<br>
>> xmm6[0,1],xmm13[2],xmm6[3]<br>
>> vinsertps $416, %xmm0, %xmm7, %xmm0 # xmm0 =<br>
>> xmm7[0,1],xmm0[2],xmm7[3]<br>
>><br>
>> We'll continue to look into this and do additional testing.<br>
><br>
><br>
> Interesting. Let me know if you get a test case. The insertps code path was<br>
> added recently though and has been much less well tested. I'll start fuzz<br>
> testing it and should hopefully uncover the bug.<br>
<br>
</div></div>Here's two small test cases. Hope they are of use.<br>
<br>
Thanks,<br>
Rob.<br>
<br>
------<br>
define <4 x float> @test(<4 x float> %xyzw, <4 x float> %abcd) {<br>
%1 = extractelement <4 x float> %xyzw, i32 0<br>
%2 = insertelement <4 x float> undef, float %1, i32 0<br>
%3 = insertelement <4 x float> %2, float 0.000000e+00, i32 1<br>
%4 = shufflevector <4 x float> %3, <4 x float> %xyzw, <4 x i32> <i32<br>
0, i32 1, i32 6, i32 undef><br>
%5 = shufflevector <4 x float> %4, <4 x float> %abcd, <4 x i32> <i32<br>
0, i32 1, i32 2, i32 4><br>
ret <4 x float> %5<br>
}<br>
<br>
define <4 x float> @test2(<4 x float> %xyzw, <4 x float> %abcd) {<br>
%1 = shufflevector <4 x float> %xyzw, <4 x float> %abcd, <4 x i32><br>
<i32 0, i32 undef, i32 2, i32 4><br>
%2 = shufflevector <4 x float> <float undef, float 0.000000e+00,<br>
float undef, float undef>, <4 x float> %1, <4 x i32> <i32 4, i32 1,<br>
i32 6, i32 7><br>
ret <4 x float> %2<br>
}<br>
<br>
<br>
llc -march=x86-64 -mattr=+avx test.ll -o -<br>
<br>
test: # @test<br>
vxorps %xmm2, %xmm2, %xmm2<br>
vmovss %xmm0, %xmm2, %xmm2<br>
vblendps $4, %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0,1],xmm0[2],xmm2[3]<br>
vinsertps $48, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm1[0]<br>
retl<br>
<br>
test2: # @test2<br>
vinsertps $48, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm1[0]<br>
vxorps %xmm1, %xmm1, %xmm1<br>
vblendps $13, %xmm0, %xmm1, %xmm0 # xmm0 = xmm0[0],xmm1[1],xmm0[2,3]<br>
retl<br>
<br>
llc -march=x86-64 -mattr=+avx<br>
-x86-experimental-vector-shuffle-lowering test.ll -o -<br>
<br>
test: # @test<br>
vinsertps $270, %xmm0, %xmm0, %xmm2 # xmm2 = xmm0[0],zero,zero,zero<br>
vinsertps $416, %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0,1],xmm0[2],xmm2[3]<br>
vinsertps $304, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm1[0]<br>
retl<br>
<br>
test2: # @test2<br>
vinsertps $304, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm1[0]<br>
vxorps %xmm1, %xmm1, %xmm1<br>
vinsertps $336, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[1],xmm0[2,3]<br>
retl<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>