From bfc9a5f7d3fda13dc9545a22c23e4e16834ac9e2 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 15 Apr 2012 22:43:31 +0000 Subject: [PATCH] Remove AVX2 vpermq and vpermpd intrinsics. These can now be handled with normal shuffle vectors. llvm-svn: 154778 --- llvm/include/llvm/IntrinsicsX86.td | 6 ----- llvm/lib/Target/X86/X86InstrSSE.td | 25 +++++++------------- llvm/test/CodeGen/X86/avx2-intrinsics-x86.ll | 16 ------------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/llvm/include/llvm/IntrinsicsX86.td b/llvm/include/llvm/IntrinsicsX86.td index a6fda4a3afc7..a73337330c35 100644 --- a/llvm/include/llvm/IntrinsicsX86.td +++ b/llvm/include/llvm/IntrinsicsX86.td @@ -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]>; diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index b0aeb3f5249f..8ce974d6fa7b 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -7755,24 +7755,26 @@ let ExeDomain = SSEPackedSingle in defm VPERMPS : avx2_perm<0x16, "vpermps", memopv8f32, int_x86_avx2_permps>; multiclass avx2_perm_imm opc, string OpcodeStr, PatFrag mem_frag, - Intrinsic Int> { + SDNode OpNode, ValueType OpVT> { def Yri : AVX2AIi8, VEX; + [(set VR256:$dst, + (OpVT (OpNode VR256:$src1, (i8 imm:$src2))))]>, VEX; def Ymi : AVX2AIi8, + [(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)>; - } //===----------------------------------------------------------------------===// diff --git a/llvm/test/CodeGen/X86/avx2-intrinsics-x86.ll b/llvm/test/CodeGen/X86/avx2-intrinsics-x86.ll index 1fb41c02b9e9..3f27a0291b4f 100644 --- a/llvm/test/CodeGen/X86/avx2-intrinsics-x86.ll +++ b/llvm/test/CodeGen/X86/avx2-intrinsics-x86.ll @@ -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]