aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-04-15 22:43:31 +0000
committerCraig Topper <craig.topper@gmail.com>2012-04-15 22:43:31 +0000
commit2cb1e9dc7da53bae7f1530216b297edd25909933 (patch)
treed9c2d235401bd24edd2eb469e7d3b4d40772afb1
parentfb22ede033f792196643bad0ceafe473366ddf41 (diff)
downloadexternal_llvm-2cb1e9dc7da53bae7f1530216b297edd25909933.zip
external_llvm-2cb1e9dc7da53bae7f1530216b297edd25909933.tar.gz
external_llvm-2cb1e9dc7da53bae7f1530216b297edd25909933.tar.bz2
Remove AVX2 vpermq and vpermpd intrinsics. These can now be handled with normal shuffle vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154778 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/IntrinsicsX86.td6
-rw-r--r--lib/Target/X86/X86InstrSSE.td25
-rw-r--r--test/CodeGen/X86/avx2-intrinsics-x86.ll16
3 files changed, 8 insertions, 39 deletions
diff --git a/include/llvm/IntrinsicsX86.td b/include/llvm/IntrinsicsX86.td
index a6fda4a..a733373 100644
--- a/include/llvm/IntrinsicsX86.td
+++ b/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/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td
index b0aeb3f..8ce974d 100644
--- a/lib/Target/X86/X86InstrSSE.td
+++ b/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<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)>;
-
}
//===----------------------------------------------------------------------===//
diff --git a/test/CodeGen/X86/avx2-intrinsics-x86.ll b/test/CodeGen/X86/avx2-intrinsics-x86.ll
index 1fb41c0..3f27a02 100644
--- a/test/CodeGen/X86/avx2-intrinsics-x86.ll
+++ b/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]