[PATCH] D83587: [X86] Consistently use 128 as the PSHUFB/VPPERM index for zero
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 13:52:09 PDT 2020
craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added subscribers: arphaman, hiraditya.
Herald added a project: LLVM.
Bit 7 of the index controls zeroing, the other bits are ignored when bit 7 is set. Shuffle lowering was using 128 and shuffle combining was using 255. Seems like we should be consistent.
This patch changes shuffle combining to use 128 to match lowering.
https://reviews.llvm.org/D83587
Files:
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-trunc.ll
Index: llvm/test/CodeGen/X86/vector-trunc.ll
===================================================================
--- llvm/test/CodeGen/X86/vector-trunc.ll
+++ llvm/test/CodeGen/X86/vector-trunc.ll
@@ -456,7 +456,7 @@
;
; SSSE3-LABEL: trunc8i32_8i16_lshr:
; SSSE3: # %bb.0: # %entry
-; SSSE3-NEXT: movdqa {{.*#+}} xmm2 = [2,3,6,7,10,11,14,15,10,11,14,15,14,15,255,255]
+; SSSE3-NEXT: movdqa {{.*#+}} xmm2 = [2,3,6,7,10,11,14,15,10,11,14,15,14,15,128,128]
; SSSE3-NEXT: pshufb %xmm2, %xmm1
; SSSE3-NEXT: pshufb %xmm2, %xmm0
; SSSE3-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- llvm/lib/Target/X86/X86ISelLowering.cpp
+++ llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -35040,7 +35040,7 @@
continue;
}
if (M == SM_SentinelZero) {
- PSHUFBMask.push_back(DAG.getConstant(255, DL, MVT::i8));
+ PSHUFBMask.push_back(DAG.getConstant(0x80, DL, MVT::i8));
continue;
}
M = Ratio * M + i % Ratio;
@@ -35071,7 +35071,7 @@
continue;
}
if (M == SM_SentinelZero) {
- VPPERMMask.push_back(DAG.getConstant(128, DL, MVT::i8));
+ VPPERMMask.push_back(DAG.getConstant(0x80, DL, MVT::i8));
continue;
}
M = Ratio * M + i % Ratio;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83587.277139.patch
Type: text/x-patch
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200710/024a8dc5/attachment.bin>
More information about the llvm-commits
mailing list