[llvm-commits] [llvm] r159644 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/X86/x86-32-coverage.s
Craig Topper
craig.topper at gmail.com
Mon Jul 2 22:49:45 PDT 2012
Author: ctopper
Date: Tue Jul 3 00:49:45 2012
New Revision: 159644
URL: http://llvm.org/viewvc/llvm-project?rev=159644&view=rev
Log:
Add aliases for pblendvb, blendvpd, and blendvps instructions with the implicit xmm0 operand specified. Fixes PR13252.
Modified:
llvm/trunk/lib/Target/X86/X86InstrSSE.td
llvm/trunk/test/MC/X86/x86-32-coverage.s
Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=159644&r1=159643&r2=159644&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 3 00:49:45 2012
@@ -6703,7 +6703,7 @@
/// SS41I_ternary_int - SSE 4.1 ternary operator
let Uses = [XMM0], Constraints = "$src1 = $dst" in {
multiclass SS41I_ternary_int<bits<8> opc, string OpcodeStr, PatFrag mem_frag,
- Intrinsic IntId> {
+ X86MemOperand x86memop, Intrinsic IntId> {
def rr0 : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, VR128:$src2),
!strconcat(OpcodeStr,
@@ -6712,7 +6712,7 @@
OpSize;
def rm0 : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
- (ins VR128:$src1, i128mem:$src2),
+ (ins VR128:$src1, x86memop:$src2),
!strconcat(OpcodeStr,
"\t{$src2, $dst|$dst, $src2}"),
[(set VR128:$dst,
@@ -6722,14 +6722,28 @@
}
let ExeDomain = SSEPackedDouble in
-defm BLENDVPD : SS41I_ternary_int<0x15, "blendvpd", memopv2f64,
+defm BLENDVPD : SS41I_ternary_int<0x15, "blendvpd", memopv2f64, f128mem,
int_x86_sse41_blendvpd>;
let ExeDomain = SSEPackedSingle in
-defm BLENDVPS : SS41I_ternary_int<0x14, "blendvps", memopv4f32,
+defm BLENDVPS : SS41I_ternary_int<0x14, "blendvps", memopv4f32, f128mem,
int_x86_sse41_blendvps>;
-defm PBLENDVB : SS41I_ternary_int<0x10, "pblendvb", memopv2i64,
+defm PBLENDVB : SS41I_ternary_int<0x10, "pblendvb", memopv2i64, i128mem,
int_x86_sse41_pblendvb>;
+// Aliases with the implicit xmm0 argument
+def : InstAlias <"blendvpd\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (BLENDVPDrr0 VR128:$dst, VR128:$src2)>;
+def : InstAlias <"blendvpd\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (BLENDVPDrm0 VR128:$dst, f128mem:$src2)>;
+def : InstAlias <"blendvps\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (BLENDVPSrr0 VR128:$dst, VR128:$src2)>;
+def : InstAlias <"blendvps\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (BLENDVPSrm0 VR128:$dst, f128mem:$src2)>;
+def : InstAlias <"pblendvb\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (PBLENDVBrr0 VR128:$dst, VR128:$src2)>;
+def : InstAlias <"pblendvb\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}",
+ (PBLENDVBrm0 VR128:$dst, i128mem:$src2)>;
+
let Predicates = [HasSSE41] in {
def : Pat<(v16i8 (vselect (v16i8 XMM0), (v16i8 VR128:$src1),
(v16i8 VR128:$src2))),
Modified: llvm/trunk/test/MC/X86/x86-32-coverage.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32-coverage.s?rev=159644&r1=159643&r2=159644&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-32-coverage.s (original)
+++ llvm/trunk/test/MC/X86/x86-32-coverage.s Tue Jul 3 00:49:45 2012
@@ -19626,3 +19626,29 @@
dppd $0x81, %xmm2, %xmm1
// CHECK: insertps $129, %xmm2, %xmm1
insertps $0x81, %xmm2, %xmm1
+
+// PR13253 handle implicit optional third argument that must always be xmm0
+// CHECK: pblendvb %xmm2, %xmm1
+pblendvb %xmm2, %xmm1
+// CHECK: pblendvb %xmm2, %xmm1
+pblendvb %xmm0, %xmm2, %xmm1
+// CHECK: pblendvb (%eax), %xmm1
+pblendvb (%eax), %xmm1
+// CHECK: pblendvb (%eax), %xmm1
+pblendvb %xmm0, (%eax), %xmm1
+// CHECK: blendvpd %xmm2, %xmm1
+blendvpd %xmm2, %xmm1
+// CHECK: blendvpd %xmm2, %xmm1
+blendvpd %xmm0, %xmm2, %xmm1
+// CHECK: blendvpd (%eax), %xmm1
+blendvpd (%eax), %xmm1
+// CHECK: blendvpd (%eax), %xmm1
+blendvpd %xmm0, (%eax), %xmm1
+// CHECK: blendvps %xmm2, %xmm1
+blendvps %xmm2, %xmm1
+// CHECK: blendvps %xmm2, %xmm1
+blendvps %xmm0, %xmm2, %xmm1
+// CHECK: blendvps (%eax), %xmm1
+blendvps (%eax), %xmm1
+// CHECK: blendvps (%eax), %xmm1
+blendvps %xmm0, (%eax), %xmm1
More information about the llvm-commits
mailing list