Remove AVX2 vpermq and vpermpd intrinsics. These can now be handled with normal shuffle vectors.

llvm-svn: 154778
This commit is contained in:
Craig Topper 2012-04-15 22:43:31 +00:00
parent 8e57855ea0
commit bfc9a5f7d3
3 changed files with 8 additions and 39 deletions

View File

@ -1659,15 +1659,9 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
def int_x86_avx2_permd : GCCBuiltin<"__builtin_ia32_permvarsi256">,
Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
[IntrNoMem]>;
def int_x86_avx2_permq : GCCBuiltin<"__builtin_ia32_permdi256">,
Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_i8_ty],
[IntrNoMem]>;
def int_x86_avx2_permps : GCCBuiltin<"__builtin_ia32_permvarsf256">,
Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
[IntrNoMem]>;
def int_x86_avx2_permpd : GCCBuiltin<"__builtin_ia32_permdf256">,
Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i8_ty],
[IntrNoMem]>;
def int_x86_avx2_vperm2i128 : GCCBuiltin<"__builtin_ia32_permti256">,
Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;

View File

@ -7755,24 +7755,26 @@ let ExeDomain = SSEPackedSingle in
defm VPERMPS : avx2_perm<0x16, "vpermps", memopv8f32, int_x86_avx2_permps>;
multiclass avx2_perm_imm<bits<8> opc, string OpcodeStr, PatFrag mem_frag,
Intrinsic Int> {
SDNode OpNode, ValueType OpVT> {
def Yri : AVX2AIi8<opc, MRMSrcReg, (outs VR256:$dst),
(ins VR256:$src1, i8imm:$src2),
!strconcat(OpcodeStr,
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[(set VR256:$dst, (Int VR256:$src1, imm:$src2))]>, VEX;
[(set VR256:$dst,
(OpVT (OpNode VR256:$src1, (i8 imm:$src2))))]>, VEX;
def Ymi : AVX2AIi8<opc, MRMSrcMem, (outs VR256:$dst),
(ins i256mem:$src1, i8imm:$src2),
!strconcat(OpcodeStr,
"\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
[(set VR256:$dst, (Int (mem_frag addr:$src1), imm:$src2))]>,
[(set VR256:$dst,
(OpVT (OpNode (mem_frag addr:$src1), (i8 imm:$src2))))]>,
VEX;
}
defm VPERMQ : avx2_perm_imm<0x00, "vpermq", memopv4i64, int_x86_avx2_permq>,
defm VPERMQ : avx2_perm_imm<0x00, "vpermq", memopv4i64, X86VPermq, v4i64>,
VEX_W;
let ExeDomain = SSEPackedDouble in
defm VPERMPD : avx2_perm_imm<0x01, "vpermpd", memopv4f64, int_x86_avx2_permpd>,
defm VPERMPD : avx2_perm_imm<0x01, "vpermpd", memopv4f64, X86VPermpd, v4f64>,
VEX_W;
let Predicates = [HasAVX2] in {
@ -7780,22 +7782,11 @@ def : Pat<(v8i32 (X86VPermd VR256:$src1, VR256:$src2)),
(VPERMDYrr VR256:$src1, VR256:$src2)>;
def : Pat<(v8f32 (X86VPermps VR256:$src1, VR256:$src2)),
(VPERMPSYrr VR256:$src1, VR256:$src2)>;
def : Pat<(v4i64 (X86VPermq VR256:$src1, (i8 imm:$imm))),
(VPERMQYri VR256:$src1, imm:$imm)>;
def : Pat<(v4f64 (X86VPermpd VR256:$src1, (i8 imm:$imm))),
(VPERMPDYri VR256:$src1, imm:$imm)>;
def : Pat<(v8i32 (X86VPermps VR256:$src1, (bc_v8i32 (memopv4i64 addr:$src2)))),
def : Pat<(v8i32 (X86VPermd VR256:$src1, (bc_v8i32 (memopv4i64 addr:$src2)))),
(VPERMDYrm VR256:$src1, addr:$src2)>;
def : Pat<(v8f32 (X86VPermps VR256:$src1, (memopv8f32 addr:$src2))),
(VPERMPSYrm VR256:$src1, addr:$src2)>;
def : Pat<(v4i64 (X86VPermq (memopv4i64 addr:$src1), (i8 imm:$imm))),
(VPERMQYmi addr:$src1, imm:$imm)>;
def : Pat<(v4f64 (X86VPermpd (memopv4f64 addr:$src1), (i8 imm:$imm))),
(VPERMPDYmi addr:$src1, imm:$imm)>;
}
//===----------------------------------------------------------------------===//

View File

@ -800,22 +800,6 @@ define <8 x float> @test_x86_avx2_permps(<8 x float> %a0, <8 x float> %a1) {
declare <8 x float> @llvm.x86.avx2.permps(<8 x float>, <8 x float>) nounwind readonly
define <4 x i64> @test_x86_avx2_permq(<4 x i64> %a0) {
; CHECK: vpermq
%res = call <4 x i64> @llvm.x86.avx2.permq(<4 x i64> %a0, i8 7) ; <<4 x i64>> [#uses=1]
ret <4 x i64> %res
}
declare <4 x i64> @llvm.x86.avx2.permq(<4 x i64>, i8) nounwind readonly
define <4 x double> @test_x86_avx2_permpd(<4 x double> %a0) {
; CHECK: vpermpd
%res = call <4 x double> @llvm.x86.avx2.permpd(<4 x double> %a0, i8 7) ; <<4 x double>> [#uses=1]
ret <4 x double> %res
}
declare <4 x double> @llvm.x86.avx2.permpd(<4 x double>, i8) nounwind readonly
define <4 x i64> @test_x86_avx2_vperm2i128(<4 x i64> %a0, <4 x i64> %a1) {
; CHECK: vperm2i128
%res = call <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64> %a0, <4 x i64> %a1, i8 1) ; <<4 x i64>> [#uses=1]