Move some XOP patterns into instruction definition. Replae VPCMOV intrinsic patterns with custom lowering to a target specific nodes.

llvm-svn: 149216
This commit is contained in:
Craig Topper 2012-01-30 01:10:15 +00:00
parent 372dd1ea18
commit ca29bcfc10
4 changed files with 252 additions and 452 deletions

View File

@ -9213,7 +9213,7 @@ X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const
unsigned Opc = 0;
ISD::CondCode CC = ISD::SETCC_INVALID;
switch (IntNo) {
default: break;
default: llvm_unreachable("Impossible intrinsic"); // Can't reach here.
case Intrinsic::x86_sse_comieq_ss:
case Intrinsic::x86_sse2_comieq_sd:
Opc = X86ISD::COMI;
@ -9285,6 +9285,196 @@ X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const
DAG.getConstant(X86CC, MVT::i8), Cond);
return DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, SetCC);
}
// XOP comparison intrinsics
case Intrinsic::x86_xop_vpcomltb:
case Intrinsic::x86_xop_vpcomltw:
case Intrinsic::x86_xop_vpcomltd:
case Intrinsic::x86_xop_vpcomltq:
case Intrinsic::x86_xop_vpcomltub:
case Intrinsic::x86_xop_vpcomltuw:
case Intrinsic::x86_xop_vpcomltud:
case Intrinsic::x86_xop_vpcomltuq:
case Intrinsic::x86_xop_vpcomleb:
case Intrinsic::x86_xop_vpcomlew:
case Intrinsic::x86_xop_vpcomled:
case Intrinsic::x86_xop_vpcomleq:
case Intrinsic::x86_xop_vpcomleub:
case Intrinsic::x86_xop_vpcomleuw:
case Intrinsic::x86_xop_vpcomleud:
case Intrinsic::x86_xop_vpcomleuq:
case Intrinsic::x86_xop_vpcomgtb:
case Intrinsic::x86_xop_vpcomgtw:
case Intrinsic::x86_xop_vpcomgtd:
case Intrinsic::x86_xop_vpcomgtq:
case Intrinsic::x86_xop_vpcomgtub:
case Intrinsic::x86_xop_vpcomgtuw:
case Intrinsic::x86_xop_vpcomgtud:
case Intrinsic::x86_xop_vpcomgtuq:
case Intrinsic::x86_xop_vpcomgeb:
case Intrinsic::x86_xop_vpcomgew:
case Intrinsic::x86_xop_vpcomged:
case Intrinsic::x86_xop_vpcomgeq:
case Intrinsic::x86_xop_vpcomgeub:
case Intrinsic::x86_xop_vpcomgeuw:
case Intrinsic::x86_xop_vpcomgeud:
case Intrinsic::x86_xop_vpcomgeuq:
case Intrinsic::x86_xop_vpcomeqb:
case Intrinsic::x86_xop_vpcomeqw:
case Intrinsic::x86_xop_vpcomeqd:
case Intrinsic::x86_xop_vpcomeqq:
case Intrinsic::x86_xop_vpcomequb:
case Intrinsic::x86_xop_vpcomequw:
case Intrinsic::x86_xop_vpcomequd:
case Intrinsic::x86_xop_vpcomequq:
case Intrinsic::x86_xop_vpcomneb:
case Intrinsic::x86_xop_vpcomnew:
case Intrinsic::x86_xop_vpcomned:
case Intrinsic::x86_xop_vpcomneq:
case Intrinsic::x86_xop_vpcomneub:
case Intrinsic::x86_xop_vpcomneuw:
case Intrinsic::x86_xop_vpcomneud:
case Intrinsic::x86_xop_vpcomneuq:
case Intrinsic::x86_xop_vpcomfalseb:
case Intrinsic::x86_xop_vpcomfalsew:
case Intrinsic::x86_xop_vpcomfalsed:
case Intrinsic::x86_xop_vpcomfalseq:
case Intrinsic::x86_xop_vpcomfalseub:
case Intrinsic::x86_xop_vpcomfalseuw:
case Intrinsic::x86_xop_vpcomfalseud:
case Intrinsic::x86_xop_vpcomfalseuq:
case Intrinsic::x86_xop_vpcomtrueb:
case Intrinsic::x86_xop_vpcomtruew:
case Intrinsic::x86_xop_vpcomtrued:
case Intrinsic::x86_xop_vpcomtrueq:
case Intrinsic::x86_xop_vpcomtrueub:
case Intrinsic::x86_xop_vpcomtrueuw:
case Intrinsic::x86_xop_vpcomtrueud:
case Intrinsic::x86_xop_vpcomtrueuq: {
unsigned CC = 0;
unsigned Opc = 0;
switch (IntNo) {
default: llvm_unreachable("Impossible intrinsic"); // Can't reach here.
case Intrinsic::x86_xop_vpcomltb:
case Intrinsic::x86_xop_vpcomltw:
case Intrinsic::x86_xop_vpcomltd:
case Intrinsic::x86_xop_vpcomltq:
CC = 0;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomltub:
case Intrinsic::x86_xop_vpcomltuw:
case Intrinsic::x86_xop_vpcomltud:
case Intrinsic::x86_xop_vpcomltuq:
CC = 0;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomleb:
case Intrinsic::x86_xop_vpcomlew:
case Intrinsic::x86_xop_vpcomled:
case Intrinsic::x86_xop_vpcomleq:
CC = 1;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomleub:
case Intrinsic::x86_xop_vpcomleuw:
case Intrinsic::x86_xop_vpcomleud:
case Intrinsic::x86_xop_vpcomleuq:
CC = 1;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomgtb:
case Intrinsic::x86_xop_vpcomgtw:
case Intrinsic::x86_xop_vpcomgtd:
case Intrinsic::x86_xop_vpcomgtq:
CC = 2;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomgtub:
case Intrinsic::x86_xop_vpcomgtuw:
case Intrinsic::x86_xop_vpcomgtud:
case Intrinsic::x86_xop_vpcomgtuq:
CC = 2;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomgeb:
case Intrinsic::x86_xop_vpcomgew:
case Intrinsic::x86_xop_vpcomged:
case Intrinsic::x86_xop_vpcomgeq:
CC = 3;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomgeub:
case Intrinsic::x86_xop_vpcomgeuw:
case Intrinsic::x86_xop_vpcomgeud:
case Intrinsic::x86_xop_vpcomgeuq:
CC = 3;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomeqb:
case Intrinsic::x86_xop_vpcomeqw:
case Intrinsic::x86_xop_vpcomeqd:
case Intrinsic::x86_xop_vpcomeqq:
CC = 4;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomequb:
case Intrinsic::x86_xop_vpcomequw:
case Intrinsic::x86_xop_vpcomequd:
case Intrinsic::x86_xop_vpcomequq:
CC = 4;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomneb:
case Intrinsic::x86_xop_vpcomnew:
case Intrinsic::x86_xop_vpcomned:
case Intrinsic::x86_xop_vpcomneq:
CC = 5;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomneub:
case Intrinsic::x86_xop_vpcomneuw:
case Intrinsic::x86_xop_vpcomneud:
case Intrinsic::x86_xop_vpcomneuq:
CC = 5;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomfalseb:
case Intrinsic::x86_xop_vpcomfalsew:
case Intrinsic::x86_xop_vpcomfalsed:
case Intrinsic::x86_xop_vpcomfalseq:
CC = 6;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomfalseub:
case Intrinsic::x86_xop_vpcomfalseuw:
case Intrinsic::x86_xop_vpcomfalseud:
case Intrinsic::x86_xop_vpcomfalseuq:
CC = 6;
Opc = X86ISD::VPCOMU;
break;
case Intrinsic::x86_xop_vpcomtrueb:
case Intrinsic::x86_xop_vpcomtruew:
case Intrinsic::x86_xop_vpcomtrued:
case Intrinsic::x86_xop_vpcomtrueq:
CC = 7;
Opc = X86ISD::VPCOM;
break;
case Intrinsic::x86_xop_vpcomtrueub:
case Intrinsic::x86_xop_vpcomtrueuw:
case Intrinsic::x86_xop_vpcomtrueud:
case Intrinsic::x86_xop_vpcomtrueuq:
CC = 7;
Opc = X86ISD::VPCOMU;
break;
}
SDValue LHS = Op.getOperand(1);
SDValue RHS = Op.getOperand(2);
return DAG.getNode(Opc, dl, Op.getValueType(), LHS, RHS,
DAG.getConstant(CC, MVT::i8));
}
// Arithmetic intrinsics.
case Intrinsic::x86_sse3_hadd_ps:
case Intrinsic::x86_sse3_hadd_pd:

View File

@ -234,6 +234,9 @@ namespace llvm {
// PCMP* - Vector integer comparisons.
PCMPEQ, PCMPGT,
// VPCOM, VPCOMU - XOP Vector integer comparisons.
VPCOM, VPCOMU,
// ADD, SUB, SMUL, etc. - Arithmetic operations with FLAGS results.
ADD, SUB, ADC, SBB, SMUL,
INC, DEC, OR, XOR, AND,

View File

@ -99,6 +99,13 @@ def SDTX86CmpPTest : SDTypeProfile<1, 2, [SDTCisVT<0, i32>,
def X86ptest : SDNode<"X86ISD::PTEST", SDTX86CmpPTest>;
def X86testp : SDNode<"X86ISD::TESTP", SDTX86CmpPTest>;
def X86vpcom : SDNode<"X86ISD::VPCOM",
SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>,
SDTCisSameAs<0,2>, SDTCisVT<3, i8>]>>;
def X86vpcomu : SDNode<"X86ISD::VPCOMU",
SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>,
SDTCisSameAs<0,2>, SDTCisVT<3, i8>]>>;
// Specific shuffle nodes - At some point ISD::VECTOR_SHUFFLE will always get
// translated into one of the target nodes below during lowering.
// Note: this is a work in progress...

View File

@ -117,14 +117,17 @@ let isAsmParserOnly = 1 in {
}
multiclass xop3opimm<bits<8> opc, string OpcodeStr> {
def ri : IXOPi8<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, i8imm:$src2),
!strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[]>, VEX;
def mi : IXOPi8<opc, MRMSrcMem, (outs VR128:$dst),
(ins f128mem:$src1, i8imm:$src2),
!strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[]>, VEX;
let neverHasSideEffects = 1 in {
def ri : IXOPi8<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, i8imm:$src2),
!strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[]>, VEX;
let mayLoad = 1 in
def mi : IXOPi8<opc, MRMSrcMem, (outs VR128:$dst),
(ins f128mem:$src1, i8imm:$src2),
!strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[]>, VEX;
}
}
let isAsmParserOnly = 1 in {
@ -167,74 +170,92 @@ let isAsmParserOnly = 1 in {
}
// Instruction where second source can be memory, third must be imm8
multiclass xop4opimm<bits<8> opc, string OpcodeStr> {
multiclass xop4opimm<bits<8> opc, string OpcodeStr, SDNode OpNode,
ValueType VT> {
def ri : IXOPi8<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, VR128:$src2, i8imm:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V;
[(set VR128:$dst,
(VT (OpNode VR128:$src1, VR128:$src2, imm:$src3)))]>, VEX_4V;
def mi : IXOPi8<opc, MRMSrcMem, (outs VR128:$dst),
(ins VR128:$src1, f128mem:$src2, i8imm:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V;
[(set VR128:$dst,
(VT (OpNode VR128:$src1, (bitconvert (memopv2i64 addr:$src2)),
imm:$src3)))]>, VEX_4V;
}
let isAsmParserOnly = 1 in {
defm VPCOMW : xop4opimm<0xCD, "vpcomw">;
defm VPCOMUW : xop4opimm<0xED, "vpcomuw">;
defm VPCOMUQ : xop4opimm<0xEF, "vpcomuq">;
defm VPCOMUD : xop4opimm<0xEE, "vpcomud">;
defm VPCOMUB : xop4opimm<0xEC, "vpcomub">;
defm VPCOMQ : xop4opimm<0xCF, "vpcomq">;
defm VPCOMD : xop4opimm<0xCE, "vpcomd">;
defm VPCOMB : xop4opimm<0xCC, "vpcomb">;
defm VPCOMB : xop4opimm<0xCC, "vpcomb", X86vpcom, v16i8>;
defm VPCOMW : xop4opimm<0xCD, "vpcomw", X86vpcom, v8i16>;
defm VPCOMD : xop4opimm<0xCE, "vpcomd", X86vpcom, v4i32>;
defm VPCOMQ : xop4opimm<0xCF, "vpcomq", X86vpcom, v2i64>;
defm VPCOMUB : xop4opimm<0xEC, "vpcomub", X86vpcomu, v16i8>;
defm VPCOMUW : xop4opimm<0xED, "vpcomuw", X86vpcomu, v8i16>;
defm VPCOMUD : xop4opimm<0xEE, "vpcomud", X86vpcomu, v4i32>;
defm VPCOMUQ : xop4opimm<0xEF, "vpcomuq", X86vpcomu, v2i64>;
}
// Instruction where either second or third source can be memory
multiclass xop4op<bits<8> opc, string OpcodeStr> {
multiclass xop4op<bits<8> opc, string OpcodeStr, Intrinsic Int> {
def rr : IXOPi8<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, VR128:$src2, VR128:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM;
[(set VR128:$dst, (Int VR128:$src1, VR128:$src2, VR128:$src3))]>,
VEX_4V, VEX_I8IMM;
def rm : IXOPi8<opc, MRMSrcMem, (outs VR128:$dst),
(ins VR128:$src1, VR128:$src2, f128mem:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM, VEX_W, MemOp4;
[(set VR128:$dst,
(Int VR128:$src1, VR128:$src2,
(bitconvert (memopv2i64 addr:$src3))))]>,
VEX_4V, VEX_I8IMM, VEX_W, MemOp4;
def mr : IXOPi8<opc, MRMSrcMem, (outs VR128:$dst),
(ins VR128:$src1, f128mem:$src2, VR128:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM;
[(set VR128:$dst,
(Int VR128:$src1, (bitconvert (memopv2i64 addr:$src2)),
VR128:$src3))]>,
VEX_4V, VEX_I8IMM;
}
let isAsmParserOnly = 1 in {
defm VPPERM : xop4op<0xA3, "vpperm">;
defm VPCMOV : xop4op<0xA2, "vpcmov">;
defm VPPERM : xop4op<0xA3, "vpperm", int_x86_xop_vpperm>;
defm VPCMOV : xop4op<0xA2, "vpcmov", int_x86_xop_vpcmov>;
}
multiclass xop4op256<bits<8> opc, string OpcodeStr> {
multiclass xop4op256<bits<8> opc, string OpcodeStr, Intrinsic Int> {
def rrY : IXOPi8<opc, MRMSrcReg, (outs VR256:$dst),
(ins VR256:$src1, VR256:$src2, VR256:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM;
[(set VR256:$dst, (Int VR256:$src1, VR256:$src2, VR256:$src3))]>,
VEX_4V, VEX_I8IMM;
def rmY : IXOPi8<opc, MRMSrcMem, (outs VR256:$dst),
(ins VR256:$src1, VR256:$src2, f256mem:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM, VEX_W, MemOp4;
[(set VR256:$dst,
(Int VR256:$src1, VR256:$src2,
(bitconvert (memopv4i64 addr:$src3))))]>,
VEX_4V, VEX_I8IMM, VEX_W, MemOp4;
def mrY : IXOPi8<opc, MRMSrcMem, (outs VR256:$dst),
(ins VR256:$src1, f256mem:$src2, VR256:$src3),
!strconcat(OpcodeStr,
"\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"),
[]>, VEX_4V, VEX_I8IMM;
[(set VR256:$dst,
(Int VR256:$src1, (bitconvert (memopv4i64 addr:$src2)),
VR256:$src3))]>,
VEX_4V, VEX_I8IMM;
}
let isAsmParserOnly = 1 in {
defm VPCMOV : xop4op256<0xA2, "vpcmov">;
defm VPCMOV : xop4op256<0xA2, "vpcmov", int_x86_xop_vpcmov_256>;
}
multiclass xop5op<bits<8> opc, string OpcodeStr, Intrinsic Int128,
@ -287,427 +308,6 @@ defm VPERMIL2PS : xop5op<0x48, "vpermil2ps", int_x86_xop_vpermil2ps,
// XOP Intrinsics patterns
let Predicates = [HasXOP] in {
// VPCOM EQ
def : Pat<(int_x86_xop_vpcomeqw VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequd VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequd VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequb VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomequb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqd VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqd VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 4))>;
def : Pat<(int_x86_xop_vpcomeqb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 4))>;
// VPCOM FALSE
def : Pat<(int_x86_xop_vpcomfalsew VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalsew VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalsed VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalsed VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomfalseb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 6))>;
// VPCOM GE
def : Pat<(int_x86_xop_vpcomgew VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgew VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomged VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomged VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 3))>;
def : Pat<(int_x86_xop_vpcomgeb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 3))>;
// VPCOM GT
def : Pat<(int_x86_xop_vpcomgtw VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtd VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtd VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 2))>;
def : Pat<(int_x86_xop_vpcomgtb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 2))>;
// VPCOM LE
def : Pat<(int_x86_xop_vpcomlew VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomlew VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomled VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomled VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 1))>;
def : Pat<(int_x86_xop_vpcomleb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 1))>;
// VPCOM LT
def : Pat<(int_x86_xop_vpcomltw VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltd VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltd VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 0))>;
def : Pat<(int_x86_xop_vpcomltb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 0))>;
// VPCOM NE
def : Pat<(int_x86_xop_vpcomnew VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomnew VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomned VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomned VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 5))>;
def : Pat<(int_x86_xop_vpcomneb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 5))>;
// VPCOM TRUE
def : Pat<(int_x86_xop_vpcomtruew VR128:$src1, VR128:$src2),
(VPCOMWri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtruew VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMWmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueuw VR128:$src1, VR128:$src2),
(VPCOMUWri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueuw VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUWmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueuq VR128:$src1, VR128:$src2),
(VPCOMUQri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueuq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUQmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueud VR128:$src1, VR128:$src2),
(VPCOMUDri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueud VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUDmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueub VR128:$src1, VR128:$src2),
(VPCOMUBri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueub VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMUBmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueq VR128:$src1, VR128:$src2),
(VPCOMQri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueq VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMQmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrued VR128:$src1, VR128:$src2),
(VPCOMDri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrued VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMDmi VR128:$src1, addr:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueb VR128:$src1, VR128:$src2),
(VPCOMBri VR128:$src1, VR128:$src2, (i8 6))>;
def : Pat<(int_x86_xop_vpcomtrueb VR128:$src1,
(bitconvert (memopv2i64 addr:$src2))),
(VPCOMBmi VR128:$src1, addr:$src2, (i8 6))>;
// VPPERM
def : Pat<(int_x86_xop_vpperm VR128:$src1, VR128:$src2, VR128:$src3),
(VPPERMrr VR128:$src1, VR128:$src2, VR128:$src3)>;
def : Pat<(int_x86_xop_vpperm VR128:$src1, VR128:$src2,
(bitconvert (memopv2i64 addr:$src3))),
(VPPERMrm VR128:$src1, VR128:$src2, addr:$src3)>;
def : Pat<(int_x86_xop_vpperm VR128:$src1, (bitconvert (memopv2i64 addr:$src2)),
VR128:$src3),
(VPPERMmr VR128:$src1, addr:$src2, VR128:$src3)>;
// VPCMOV
def : Pat<(int_x86_xop_vpcmov VR128:$src1, VR128:$src2, VR128:$src3),
(VPCMOVrr VR128:$src1, VR128:$src2, VR128:$src3)>;
def : Pat<(int_x86_xop_vpcmov VR128:$src1, VR128:$src2,
(bitconvert (memopv2i64 addr:$src3))),
(VPCMOVrm VR128:$src1, VR128:$src2, addr:$src3)>;
def : Pat<(int_x86_xop_vpcmov VR128:$src1, (bitconvert (memopv2i64 addr:$src2)),
VR128:$src3),
(VPCMOVmr VR128:$src1, addr:$src2, VR128:$src3)>;
def : Pat<(int_x86_xop_vpcmov_256 VR256:$src1, VR256:$src2, VR256:$src3),
(VPCMOVrrY VR256:$src1, VR256:$src2, VR256:$src3)>;
def : Pat<(int_x86_xop_vpcmov_256 VR256:$src1, VR256:$src2,
(bitconvert (memopv4i64 addr:$src3))),
(VPCMOVrmY VR256:$src1, VR256:$src2, addr:$src3)>;
def : Pat<(int_x86_xop_vpcmov_256 VR256:$src1,
(bitconvert (memopv4i64 addr:$src2)),
VR256:$src3),
(VPCMOVmrY VR256:$src1, addr:$src2, VR256:$src3)>;
// VPCMOV di
def : Pat<(int_x86_xop_vpcmov_v2di VR128:$src1, VR128:$src2, VR128:$src3),
(VPCMOVrr VR128:$src1, VR128:$src2, VR128:$src3)>;