mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
Revert r150328, "Remove more vector_shuffle patterns."
It caused 3 failures on pre-penryn and non-x86(generic) hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ce3900849a
commit
7f42e9886e
@ -348,6 +348,18 @@ def SHUFFLE_get_shuf_imm : SDNodeXForm<vector_shuffle, [{
|
|||||||
return getI8Imm(X86::getShuffleSHUFImmediate(cast<ShuffleVectorSDNode>(N)));
|
return getI8Imm(X86::getShuffleSHUFImmediate(cast<ShuffleVectorSDNode>(N)));
|
||||||
}]>;
|
}]>;
|
||||||
|
|
||||||
|
// SHUFFLE_get_pshufhw_imm xform function: convert vector_shuffle mask to
|
||||||
|
// PSHUFHW imm.
|
||||||
|
def SHUFFLE_get_pshufhw_imm : SDNodeXForm<vector_shuffle, [{
|
||||||
|
return getI8Imm(X86::getShufflePSHUFHWImmediate(N));
|
||||||
|
}]>;
|
||||||
|
|
||||||
|
// SHUFFLE_get_pshuflw_imm xform function: convert vector_shuffle mask to
|
||||||
|
// PSHUFLW imm.
|
||||||
|
def SHUFFLE_get_pshuflw_imm : SDNodeXForm<vector_shuffle, [{
|
||||||
|
return getI8Imm(X86::getShufflePSHUFLWImmediate(N));
|
||||||
|
}]>;
|
||||||
|
|
||||||
// EXTRACT_get_vextractf128_imm xform function: convert extract_subvector index
|
// EXTRACT_get_vextractf128_imm xform function: convert extract_subvector index
|
||||||
// to VEXTRACTF128 imm.
|
// to VEXTRACTF128 imm.
|
||||||
def EXTRACT_get_vextractf128_imm : SDNodeXForm<extract_subvector, [{
|
def EXTRACT_get_vextractf128_imm : SDNodeXForm<extract_subvector, [{
|
||||||
@ -395,6 +407,21 @@ def unpckh : PatFrag<(ops node:$lhs, node:$rhs),
|
|||||||
return X86::isUNPCKHMask(cast<ShuffleVectorSDNode>(N), Subtarget->hasAVX2());
|
return X86::isUNPCKHMask(cast<ShuffleVectorSDNode>(N), Subtarget->hasAVX2());
|
||||||
}]>;
|
}]>;
|
||||||
|
|
||||||
|
def pshufd : PatFrag<(ops node:$lhs, node:$rhs),
|
||||||
|
(vector_shuffle node:$lhs, node:$rhs), [{
|
||||||
|
return X86::isPSHUFDMask(cast<ShuffleVectorSDNode>(N));
|
||||||
|
}], SHUFFLE_get_shuf_imm>;
|
||||||
|
|
||||||
|
def pshufhw : PatFrag<(ops node:$lhs, node:$rhs),
|
||||||
|
(vector_shuffle node:$lhs, node:$rhs), [{
|
||||||
|
return X86::isPSHUFHWMask(cast<ShuffleVectorSDNode>(N));
|
||||||
|
}], SHUFFLE_get_pshufhw_imm>;
|
||||||
|
|
||||||
|
def pshuflw : PatFrag<(ops node:$lhs, node:$rhs),
|
||||||
|
(vector_shuffle node:$lhs, node:$rhs), [{
|
||||||
|
return X86::isPSHUFLWMask(cast<ShuffleVectorSDNode>(N));
|
||||||
|
}], SHUFFLE_get_pshuflw_imm>;
|
||||||
|
|
||||||
def vextractf128_extract : PatFrag<(ops node:$bigvec, node:$index),
|
def vextractf128_extract : PatFrag<(ops node:$bigvec, node:$index),
|
||||||
(extract_subvector node:$bigvec,
|
(extract_subvector node:$bigvec,
|
||||||
node:$index), [{
|
node:$index), [{
|
||||||
|
@ -2270,6 +2270,17 @@ let Predicates = [HasAVX] in {
|
|||||||
def : Pat<(v4f32 (movlp:$src3 VR128:$src1, (v4f32 VR128:$src2))),
|
def : Pat<(v4f32 (movlp:$src3 VR128:$src1, (v4f32 VR128:$src2))),
|
||||||
(VSHUFPSrri VR128:$src2, VR128:$src1,
|
(VSHUFPSrri VR128:$src2, VR128:$src1,
|
||||||
(SHUFFLE_get_shuf_imm VR128:$src3))>;
|
(SHUFFLE_get_shuf_imm VR128:$src3))>;
|
||||||
|
// Special unary SHUFPSrri case.
|
||||||
|
def : Pat<(v4f32 (pshufd:$src3 VR128:$src1, (undef))),
|
||||||
|
(VSHUFPSrri VR128:$src1, VR128:$src1,
|
||||||
|
(SHUFFLE_get_shuf_imm VR128:$src3))>;
|
||||||
|
// Special unary SHUFPDrri cases.
|
||||||
|
def : Pat<(v2i64 (pshufd:$src3 VR128:$src1, (undef))),
|
||||||
|
(VSHUFPDrri VR128:$src1, VR128:$src1,
|
||||||
|
(SHUFFLE_get_shuf_imm VR128:$src3))>;
|
||||||
|
def : Pat<(v2f64 (pshufd:$src3 VR128:$src1, (undef))),
|
||||||
|
(VSHUFPDrri VR128:$src1, VR128:$src1,
|
||||||
|
(SHUFFLE_get_shuf_imm VR128:$src3))>;
|
||||||
|
|
||||||
def : Pat<(v2i64 (X86Shufp VR128:$src1,
|
def : Pat<(v2i64 (X86Shufp VR128:$src1,
|
||||||
(memopv2i64 addr:$src2), (i8 imm:$imm))),
|
(memopv2i64 addr:$src2), (i8 imm:$imm))),
|
||||||
@ -3837,19 +3848,21 @@ defm PACKUSWB : PDI_binop_rm_int<0x67, "packuswb", int_x86_sse2_packuswb_128,
|
|||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
let ExeDomain = SSEPackedInt in {
|
let ExeDomain = SSEPackedInt in {
|
||||||
multiclass sse2_pshuffle<string OpcodeStr, ValueType vt, SDNode OpNode> {
|
multiclass sse2_pshuffle<string OpcodeStr, ValueType vt, PatFrag pshuf_frag,
|
||||||
|
PatFrag bc_frag> {
|
||||||
def ri : Ii8<0x70, MRMSrcReg,
|
def ri : Ii8<0x70, MRMSrcReg,
|
||||||
(outs VR128:$dst), (ins VR128:$src1, i8imm:$src2),
|
(outs VR128:$dst), (ins VR128:$src1, i8imm:$src2),
|
||||||
!strconcat(OpcodeStr,
|
!strconcat(OpcodeStr,
|
||||||
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
||||||
[(set VR128:$dst, (vt (OpNode VR128:$src1, (i8 imm:$src2))))]>;
|
[(set VR128:$dst, (vt (pshuf_frag:$src2 VR128:$src1,
|
||||||
|
(undef))))]>;
|
||||||
def mi : Ii8<0x70, MRMSrcMem,
|
def mi : Ii8<0x70, MRMSrcMem,
|
||||||
(outs VR128:$dst), (ins i128mem:$src1, i8imm:$src2),
|
(outs VR128:$dst), (ins i128mem:$src1, i8imm:$src2),
|
||||||
!strconcat(OpcodeStr,
|
!strconcat(OpcodeStr,
|
||||||
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
|
||||||
[(set VR128:$dst,
|
[(set VR128:$dst, (vt (pshuf_frag:$src2
|
||||||
(vt (OpNode (bitconvert (memopv2i64 addr:$src1)),
|
(bc_frag (memopv2i64 addr:$src1)),
|
||||||
(i8 imm:$src2))))]>;
|
(undef))))]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
multiclass sse2_pshuffle_y<string OpcodeStr, ValueType vt, SDNode OpNode> {
|
multiclass sse2_pshuffle_y<string OpcodeStr, ValueType vt, SDNode OpNode> {
|
||||||
@ -3870,18 +3883,43 @@ def Ymi : Ii8<0x70, MRMSrcMem,
|
|||||||
|
|
||||||
let Predicates = [HasAVX] in {
|
let Predicates = [HasAVX] in {
|
||||||
let AddedComplexity = 5 in
|
let AddedComplexity = 5 in
|
||||||
defm VPSHUFD : sse2_pshuffle<"vpshufd", v4i32, X86PShufd>, TB, OpSize, VEX;
|
defm VPSHUFD : sse2_pshuffle<"vpshufd", v4i32, pshufd, bc_v4i32>, TB, OpSize,
|
||||||
|
VEX;
|
||||||
|
|
||||||
// SSE2 with ImmT == Imm8 and XS prefix.
|
// SSE2 with ImmT == Imm8 and XS prefix.
|
||||||
defm VPSHUFHW : sse2_pshuffle<"vpshufhw", v8i16, X86PShufhw>, XS, VEX;
|
defm VPSHUFHW : sse2_pshuffle<"vpshufhw", v8i16, pshufhw, bc_v8i16>, XS,
|
||||||
|
VEX;
|
||||||
|
|
||||||
// SSE2 with ImmT == Imm8 and XD prefix.
|
// SSE2 with ImmT == Imm8 and XD prefix.
|
||||||
defm VPSHUFLW : sse2_pshuffle<"vpshuflw", v8i16, X86PShuflw>, XD, VEX;
|
defm VPSHUFLW : sse2_pshuffle<"vpshuflw", v8i16, pshuflw, bc_v8i16>, XD,
|
||||||
|
VEX;
|
||||||
|
|
||||||
|
let AddedComplexity = 5 in
|
||||||
|
def : Pat<(v4f32 (pshufd:$src2 VR128:$src1, (undef))),
|
||||||
|
(VPSHUFDri VR128:$src1, (SHUFFLE_get_shuf_imm VR128:$src2))>;
|
||||||
|
// Unary v4f32 shuffle with VPSHUF* in order to fold a load.
|
||||||
|
def : Pat<(pshufd:$src2 (bc_v4i32 (memopv4f32 addr:$src1)), (undef)),
|
||||||
|
(VPSHUFDmi addr:$src1, (SHUFFLE_get_shuf_imm VR128:$src2))>;
|
||||||
|
|
||||||
|
def : Pat<(v4i32 (X86PShufd (bc_v4i32 (memopv2i64 addr:$src1)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(VPSHUFDmi addr:$src1, imm:$imm)>;
|
||||||
def : Pat<(v4f32 (X86PShufd (memopv4f32 addr:$src1), (i8 imm:$imm))),
|
def : Pat<(v4f32 (X86PShufd (memopv4f32 addr:$src1), (i8 imm:$imm))),
|
||||||
(VPSHUFDmi addr:$src1, imm:$imm)>;
|
(VPSHUFDmi addr:$src1, imm:$imm)>;
|
||||||
def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
||||||
(VPSHUFDri VR128:$src1, imm:$imm)>;
|
(VPSHUFDri VR128:$src1, imm:$imm)>;
|
||||||
|
def : Pat<(v4i32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
||||||
|
(VPSHUFDri VR128:$src1, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShufhw VR128:$src, (i8 imm:$imm))),
|
||||||
|
(VPSHUFHWri VR128:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShufhw (bc_v8i16 (memopv2i64 addr:$src)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(VPSHUFHWmi addr:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShuflw VR128:$src, (i8 imm:$imm))),
|
||||||
|
(VPSHUFLWri VR128:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShuflw (bc_v8i16 (memopv2i64 addr:$src)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(VPSHUFLWmi addr:$src, imm:$imm)>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let Predicates = [HasAVX2] in {
|
let Predicates = [HasAVX2] in {
|
||||||
@ -3892,18 +3930,40 @@ let Predicates = [HasAVX2] in {
|
|||||||
|
|
||||||
let Predicates = [HasSSE2] in {
|
let Predicates = [HasSSE2] in {
|
||||||
let AddedComplexity = 5 in
|
let AddedComplexity = 5 in
|
||||||
defm PSHUFD : sse2_pshuffle<"pshufd", v4i32, X86PShufd>, TB, OpSize;
|
defm PSHUFD : sse2_pshuffle<"pshufd", v4i32, pshufd, bc_v4i32>, TB, OpSize;
|
||||||
|
|
||||||
// SSE2 with ImmT == Imm8 and XS prefix.
|
// SSE2 with ImmT == Imm8 and XS prefix.
|
||||||
defm PSHUFHW : sse2_pshuffle<"pshufhw", v8i16, X86PShufhw>, XS;
|
defm PSHUFHW : sse2_pshuffle<"pshufhw", v8i16, pshufhw, bc_v8i16>, XS;
|
||||||
|
|
||||||
// SSE2 with ImmT == Imm8 and XD prefix.
|
// SSE2 with ImmT == Imm8 and XD prefix.
|
||||||
defm PSHUFLW : sse2_pshuffle<"pshuflw", v8i16, X86PShuflw>, XD;
|
defm PSHUFLW : sse2_pshuffle<"pshuflw", v8i16, pshuflw, bc_v8i16>, XD;
|
||||||
|
|
||||||
|
let AddedComplexity = 5 in
|
||||||
|
def : Pat<(v4f32 (pshufd:$src2 VR128:$src1, (undef))),
|
||||||
|
(PSHUFDri VR128:$src1, (SHUFFLE_get_shuf_imm VR128:$src2))>;
|
||||||
|
// Unary v4f32 shuffle with PSHUF* in order to fold a load.
|
||||||
|
def : Pat<(pshufd:$src2 (bc_v4i32 (memopv4f32 addr:$src1)), (undef)),
|
||||||
|
(PSHUFDmi addr:$src1, (SHUFFLE_get_shuf_imm VR128:$src2))>;
|
||||||
|
|
||||||
|
def : Pat<(v4i32 (X86PShufd (bc_v4i32 (memopv2i64 addr:$src1)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(PSHUFDmi addr:$src1, imm:$imm)>;
|
||||||
def : Pat<(v4f32 (X86PShufd (memopv4f32 addr:$src1), (i8 imm:$imm))),
|
def : Pat<(v4f32 (X86PShufd (memopv4f32 addr:$src1), (i8 imm:$imm))),
|
||||||
(PSHUFDmi addr:$src1, imm:$imm)>;
|
(PSHUFDmi addr:$src1, imm:$imm)>;
|
||||||
def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
||||||
(PSHUFDri VR128:$src1, imm:$imm)>;
|
(PSHUFDri VR128:$src1, imm:$imm)>;
|
||||||
|
def : Pat<(v4i32 (X86PShufd VR128:$src1, (i8 imm:$imm))),
|
||||||
|
(PSHUFDri VR128:$src1, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShufhw VR128:$src, (i8 imm:$imm))),
|
||||||
|
(PSHUFHWri VR128:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShufhw (bc_v8i16 (memopv2i64 addr:$src)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(PSHUFHWmi addr:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShuflw VR128:$src, (i8 imm:$imm))),
|
||||||
|
(PSHUFLWri VR128:$src, imm:$imm)>;
|
||||||
|
def : Pat<(v8i16 (X86PShuflw (bc_v8i16 (memopv2i64 addr:$src)),
|
||||||
|
(i8 imm:$imm))),
|
||||||
|
(PSHUFLWmi addr:$src, imm:$imm)>;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user