OSDN Git Service

[X86][XOP] Fixed VPPERM permute op decoding (PR27472).
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 24 Apr 2016 15:05:04 +0000 (15:05 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 24 Apr 2016 15:05:04 +0000 (15:05 +0000)
Fixed issue with VPPERM target shuffle mask decoding that was incorrectly masking off the 3-bit permute op with a 2-bit mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267346 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Utils/X86ShuffleDecode.cpp
test/CodeGen/X86/vector-shuffle-combining-xop.ll

index d8f8f9e..472474d 100644 (file)
@@ -367,7 +367,7 @@ void DecodeVPPERMMask(ArrayRef<uint64_t> RawMask,
       continue;
     }
 
-    uint64_t PermuteOp = (M >> 5) & 0x3;
+    uint64_t PermuteOp = (M >> 5) & 0x7;
     if (PermuteOp == 4) {
       ShuffleMask.push_back(SM_SentinelZero);
       continue;
index 0fba831..dda93ac 100644 (file)
@@ -23,7 +23,7 @@ define <16 x i8> @combine_vpperm_identity(<16 x i8> %a0, <16 x i8> %a1) {
 define <16 x i8> @combine_vpperm_zero(<16 x i8> %a0, <16 x i8> %a1) {
 ; CHECK-LABEL: combine_vpperm_zero:
 ; CHECK:       # BB#0:
-; CHECK-NEXT:    vpshufb {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
+; CHECK-NEXT:    vxorps %xmm0, %xmm0, %xmm0
 ; CHECK-NEXT:    retq
   %res0 = call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> <i8 128, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>)
   %res1 = call <16 x i8> @llvm.x86.xop.vpperm(<16 x i8> %res0, <16 x i8> undef, <16 x i8> <i8 0, i8 128, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>)