mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[x86] Prevent instruction selection of AVX512 cmp.ps/pd/ss/sd intrinsics with illegal immediates. Forgot to do this when I did SSE/SSE2/AVX/AVX2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3e9bf4c0d0
commit
d840bf4ba9
@ -1198,16 +1198,18 @@ def : Pat<(v8i32 (vselect (v8i1 VK8WM:$mask), (v8i32 VR256X:$src1),
|
||||
|
||||
// avx512_cmp_scalar - AVX512 CMPSS and CMPSD
|
||||
multiclass avx512_cmp_scalar<RegisterClass RC, X86MemOperand x86memop,
|
||||
Operand CC, SDNode OpNode, ValueType VT,
|
||||
ValueType VT,
|
||||
PatFrag ld_frag, string asm, string asm_alt> {
|
||||
def rr : AVX512Ii8<0xC2, MRMSrcReg,
|
||||
(outs VK1:$dst), (ins RC:$src1, RC:$src2, CC:$cc), asm,
|
||||
[(set VK1:$dst, (OpNode (VT RC:$src1), RC:$src2, imm:$cc))],
|
||||
(outs VK1:$dst), (ins RC:$src1, RC:$src2, AVXCC:$cc), asm,
|
||||
[(set VK1:$dst, (X86cmpms (VT RC:$src1),
|
||||
RC:$src2, i8immZExt5:$cc))],
|
||||
IIC_SSE_ALU_F32S_RR>, EVEX_4V;
|
||||
def rm : AVX512Ii8<0xC2, MRMSrcMem,
|
||||
(outs VK1:$dst), (ins RC:$src1, x86memop:$src2, CC:$cc), asm,
|
||||
[(set VK1:$dst, (OpNode (VT RC:$src1),
|
||||
(ld_frag addr:$src2), imm:$cc))], IIC_SSE_ALU_F32P_RM>, EVEX_4V;
|
||||
(outs VK1:$dst), (ins RC:$src1, x86memop:$src2, AVXCC:$cc), asm,
|
||||
[(set VK1:$dst, (X86cmpms (VT RC:$src1),
|
||||
(ld_frag addr:$src2), i8immZExt5:$cc))], IIC_SSE_ALU_F32P_RM>,
|
||||
EVEX_4V;
|
||||
let isAsmParserOnly = 1, hasSideEffects = 0 in {
|
||||
def rri_alt : AVX512Ii8<0xC2, MRMSrcReg,
|
||||
(outs VK1:$dst), (ins RC:$src1, RC:$src2, i8imm:$cc),
|
||||
@ -1219,11 +1221,11 @@ multiclass avx512_cmp_scalar<RegisterClass RC, X86MemOperand x86memop,
|
||||
}
|
||||
|
||||
let Predicates = [HasAVX512] in {
|
||||
defm VCMPSSZ : avx512_cmp_scalar<FR32X, f32mem, AVXCC, X86cmpms, f32, loadf32,
|
||||
defm VCMPSSZ : avx512_cmp_scalar<FR32X, f32mem, f32, loadf32,
|
||||
"vcmp${cc}ss\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
||||
"vcmpss\t{$cc, $src2, $src1, $dst|$dst, $src1, $src2, $cc}">,
|
||||
XS;
|
||||
defm VCMPSDZ : avx512_cmp_scalar<FR64X, f64mem, AVXCC, X86cmpms, f64, loadf64,
|
||||
defm VCMPSDZ : avx512_cmp_scalar<FR64X, f64mem, f64, loadf64,
|
||||
"vcmp${cc}sd\t{$src2, $src1, $dst|$dst, $src1, $src2}",
|
||||
"vcmpsd\t{$cc, $src2, $src1, $dst|$dst, $src1, $src2, $cc}">,
|
||||
XD, VEX_W;
|
||||
@ -1374,7 +1376,7 @@ multiclass avx512_icmp_cc<bits<8> opc, string Suffix, SDNode OpNode,
|
||||
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
||||
[(set _.KRC:$dst, (OpNode (_.VT _.RC:$src1),
|
||||
(_.VT (bitconvert (_.LdFrag addr:$src2))),
|
||||
imm:$cc))],
|
||||
i8immZExt5:$cc))],
|
||||
IIC_SSE_ALU_F32P_RM>, EVEX_4V;
|
||||
def rrik : AVX512AIi8<opc, MRMSrcReg,
|
||||
(outs _.KRC:$dst), (ins _.KRCWM:$mask, _.RC:$src1, _.RC:$src2,
|
||||
@ -1384,7 +1386,7 @@ multiclass avx512_icmp_cc<bits<8> opc, string Suffix, SDNode OpNode,
|
||||
"$dst {${mask}}, $src1, $src2}"),
|
||||
[(set _.KRC:$dst, (and _.KRCWM:$mask,
|
||||
(OpNode (_.VT _.RC:$src1), (_.VT _.RC:$src2),
|
||||
imm:$cc)))],
|
||||
i8immZExt5:$cc)))],
|
||||
IIC_SSE_ALU_F32P_RR>, EVEX_4V, EVEX_K;
|
||||
let mayLoad = 1 in
|
||||
def rmik : AVX512AIi8<opc, MRMSrcMem,
|
||||
@ -1396,7 +1398,7 @@ multiclass avx512_icmp_cc<bits<8> opc, string Suffix, SDNode OpNode,
|
||||
[(set _.KRC:$dst, (and _.KRCWM:$mask,
|
||||
(OpNode (_.VT _.RC:$src1),
|
||||
(_.VT (bitconvert (_.LdFrag addr:$src2))),
|
||||
imm:$cc)))],
|
||||
i8immZExt5:$cc)))],
|
||||
IIC_SSE_ALU_F32P_RM>, EVEX_4V, EVEX_K;
|
||||
|
||||
// Accept explicit immediate argument form instead of comparison code.
|
||||
@ -1440,7 +1442,7 @@ multiclass avx512_icmp_cc_rmb<bits<8> opc, string Suffix, SDNode OpNode,
|
||||
"$dst, $src1, ${src2}", _.BroadcastStr, "}"),
|
||||
[(set _.KRC:$dst, (OpNode (_.VT _.RC:$src1),
|
||||
(X86VBroadcast (_.ScalarLdFrag addr:$src2)),
|
||||
imm:$cc))],
|
||||
i8immZExt5:$cc))],
|
||||
IIC_SSE_ALU_F32P_RM>, EVEX_4V, EVEX_B;
|
||||
def rmibk : AVX512AIi8<opc, MRMSrcMem,
|
||||
(outs _.KRC:$dst), (ins _.KRCWM:$mask, _.RC:$src1,
|
||||
@ -1451,7 +1453,7 @@ multiclass avx512_icmp_cc_rmb<bits<8> opc, string Suffix, SDNode OpNode,
|
||||
[(set _.KRC:$dst, (and _.KRCWM:$mask,
|
||||
(OpNode (_.VT _.RC:$src1),
|
||||
(X86VBroadcast (_.ScalarLdFrag addr:$src2)),
|
||||
imm:$cc)))],
|
||||
i8immZExt5:$cc)))],
|
||||
IIC_SSE_ALU_F32P_RM>, EVEX_4V, EVEX_K, EVEX_B;
|
||||
}
|
||||
|
||||
@ -1527,7 +1529,8 @@ multiclass avx512_cmp_packed<RegisterClass KRC, RegisterClass RC,
|
||||
(outs KRC:$dst), (ins RC:$src1, RC:$src2, AVXCC:$cc),
|
||||
!strconcat("vcmp${cc}", suffix,
|
||||
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
||||
[(set KRC:$dst, (X86cmpm (vt RC:$src1), (vt RC:$src2), imm:$cc))], d>;
|
||||
[(set KRC:$dst, (X86cmpm (vt RC:$src1), (vt RC:$src2),
|
||||
i8immZExt5:$cc))], d>;
|
||||
def rrib: AVX512PIi8<0xC2, MRMSrcReg,
|
||||
(outs KRC:$dst), (ins RC:$src1, RC:$src2, AVXCC:$cc),
|
||||
!strconcat("vcmp${cc}", suffix,
|
||||
@ -1538,7 +1541,7 @@ multiclass avx512_cmp_packed<RegisterClass KRC, RegisterClass RC,
|
||||
!strconcat("vcmp${cc}", suffix,
|
||||
"\t{$src2, $src1, $dst|$dst, $src1, $src2, $cc}"),
|
||||
[(set KRC:$dst,
|
||||
(X86cmpm (vt RC:$src1), (memop addr:$src2), imm:$cc))], d>;
|
||||
(X86cmpm (vt RC:$src1), (memop addr:$src2), i8immZExt5:$cc))], d>;
|
||||
|
||||
// Accept explicit immediate argument form instead of comparison code.
|
||||
let isAsmParserOnly = 1, hasSideEffects = 0 in {
|
||||
|
Loading…
Reference in New Issue
Block a user