diff options
author | Jiangning Liu <jiangning.liu@arm.com> | 2013-11-19 01:46:48 +0000 |
---|---|---|
committer | Jiangning Liu <jiangning.liu@arm.com> | 2013-11-19 01:46:48 +0000 |
commit | f11b55c5cc85193170194c9d289ab15b2ad58b6d (patch) | |
tree | cdea3f2230cb28e7fcb695e7dd6bbe80dae5dd22 /lib/Target | |
parent | 282a979dddff8d06a744c1b686fb3b7a7619d0f4 (diff) | |
download | external_llvm-f11b55c5cc85193170194c9d289ab15b2ad58b6d.zip external_llvm-f11b55c5cc85193170194c9d289ab15b2ad58b6d.tar.gz external_llvm-f11b55c5cc85193170194c9d289ab15b2ad58b6d.tar.bz2 |
Implement AArch64 SISD intrinsics for vget_high and vget_low.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/AArch64/AArch64InstrNEON.td | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/lib/Target/AArch64/AArch64InstrNEON.td b/lib/Target/AArch64/AArch64InstrNEON.td index 6332745..b6fa6fa 100644 --- a/lib/Target/AArch64/AArch64InstrNEON.td +++ b/lib/Target/AArch64/AArch64InstrNEON.td @@ -1590,16 +1590,31 @@ def Neon_High8H : PatFrag<(ops node:$in), (extract_subvector (v8i16 node:$in), (iPTR 4))>; def Neon_High4S : PatFrag<(ops node:$in), (extract_subvector (v4i32 node:$in), (iPTR 2))>; - +def Neon_High2D : PatFrag<(ops node:$in), + (extract_subvector (v2i64 node:$in), (iPTR 1))>; +def Neon_High4f : PatFrag<(ops node:$in), + (extract_subvector (v4f32 node:$in), (iPTR 2))>; +def Neon_High2d : PatFrag<(ops node:$in), + (extract_subvector (v2f64 node:$in), (iPTR 1))>; + +def Neon_low16B : PatFrag<(ops node:$in), + (v8i8 (extract_subvector (v16i8 node:$in), + (iPTR 0)))>; def Neon_low8H : PatFrag<(ops node:$in), (v4i16 (extract_subvector (v8i16 node:$in), (iPTR 0)))>; def Neon_low4S : PatFrag<(ops node:$in), (v2i32 (extract_subvector (v4i32 node:$in), (iPTR 0)))>; +def Neon_low2D : PatFrag<(ops node:$in), + (v1i64 (extract_subvector (v2i64 node:$in), + (iPTR 0)))>; def Neon_low4f : PatFrag<(ops node:$in), (v2f32 (extract_subvector (v4f32 node:$in), (iPTR 0)))>; +def Neon_low2d : PatFrag<(ops node:$in), + (v1f64 (extract_subvector (v2f64 node:$in), + (iPTR 0)))>; def neon_uimm3_shift : Operand<i32>, ImmLeaf<i32, [{return Imm < 8;}]> { @@ -5136,9 +5151,8 @@ def DUPdv_D : NeonI_Scalar_DUP<"dup", "d", FPR64, VPR128, neon_uimm1_bare> { multiclass NeonI_Scalar_DUP_Elt_pattern<Instruction DUPI, ValueType ResTy, ValueType OpTy, Operand OpImm, ValueType OpNTy, ValueType ExTy, Operand OpNImm> { - - def : Pat<(ResTy (vector_extract (OpTy VPR128:$Rn), OpImm:$Imm)), - (ResTy (DUPI (OpTy VPR128:$Rn), OpImm:$Imm))>; + def : Pat<(ResTy (vector_extract (OpTy VPR128:$Rn), OpImm:$Imm)), + (ResTy (DUPI (OpTy VPR128:$Rn), OpImm:$Imm))>; def : Pat<(ResTy (vector_extract (OpNTy VPR64:$Rn), OpNImm:$Imm)), (ResTy (DUPI @@ -5146,6 +5160,21 @@ multiclass NeonI_Scalar_DUP_Elt_pattern<Instruction DUPI, ValueType ResTy, OpNImm:$Imm))>; } +multiclass NeonI_SDUP<PatFrag GetLow, PatFrag GetHigh, + ValueType ResTy, ValueType OpTy> { + def : Pat<(ResTy (GetLow VPR128:$Rn)), + (ResTy (DUPdv_D (OpTy VPR128:$Rn), 0))>; + def : Pat<(ResTy (GetHigh VPR128:$Rn)), + (ResTy (DUPdv_D (OpTy VPR128:$Rn), 1))>; +} + +defm : NeonI_SDUP<Neon_low16B, Neon_High16B, v8i8, v16i8>; +defm : NeonI_SDUP<Neon_low8H, Neon_High8H, v4i16, v8i16>; +defm : NeonI_SDUP<Neon_low4S, Neon_High4S, v2i32, v4i32>; +defm : NeonI_SDUP<Neon_low2D, Neon_High2D, v1i64, v2i64>; +defm : NeonI_SDUP<Neon_low4f, Neon_High4f, v2f32, v4f32>; +defm : NeonI_SDUP<Neon_low2d, Neon_High2d, v1f64, v2f64>; + // Patterns for vector extract of FP data using scalar DUP instructions defm : NeonI_Scalar_DUP_Elt_pattern<DUPsv_S, f32, v4f32, neon_uimm2_bare, v2f32, v4f32, neon_uimm1_bare>; |