diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-09-27 13:04:21 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-09-27 13:04:21 +0000 |
| commit | 7f3d946fb7a84a6dc2f6fc674b04ebf4ca1319cf (patch) | |
| tree | cbdbee38b643e323fc63573365c6588624703233 /llvm/lib | |
| parent | 51287b9355ffd5f863dc67db3df886934a2ccbb2 (diff) | |
| download | bcm5719-llvm-7f3d946fb7a84a6dc2f6fc674b04ebf4ca1319cf.tar.gz bcm5719-llvm-7f3d946fb7a84a6dc2f6fc674b04ebf4ca1319cf.zip | |
[mips][msa] Implemented copy_[us].d intrinsic.
This intrinsic is lowered into equivalent copy_s.w instructions during
legalization.
llvm-svn: 191518
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Mips/MSA.txt | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MSA.txt b/llvm/lib/Target/Mips/MSA.txt index a4f320ac007..a6a7dda88e7 100644 --- a/llvm/lib/Target/Mips/MSA.txt +++ b/llvm/lib/Target/Mips/MSA.txt @@ -32,3 +32,8 @@ ilvr.d, ilvod.d, pckod.d: splati.w: It is not possible to emit splati.w since shf.w covers the same cases. shf.w will be emitted instead. + +copy_s.w + On MIPS32, the copy_u.d intrinsic will emit this instruction instead of + copy_u.w. This is semantically equivalent since the general-purpose + register file is 32-bits wide. diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp index 42afe596d52..9af5a280053 100644 --- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -1242,10 +1242,26 @@ SDValue MipsSETargetLowering::lowerINTRINSIC_WO_CHAIN(SDValue Op, case Intrinsic::mips_copy_s_h: case Intrinsic::mips_copy_s_w: return lowerMSACopyIntr(Op, DAG, MipsISD::VEXTRACT_SEXT_ELT); + case Intrinsic::mips_copy_s_d: + // Don't lower directly into VEXTRACT_SEXT_ELT since i64 might be illegal. + // Instead lower to the generic EXTRACT_VECTOR_ELT node and let the type + // legalizer and EXTRACT_VECTOR_ELT lowering sort it out. + return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SDLoc(Op), Op->getValueType(0), + Op->getOperand(1), Op->getOperand(2)); case Intrinsic::mips_copy_u_b: case Intrinsic::mips_copy_u_h: case Intrinsic::mips_copy_u_w: return lowerMSACopyIntr(Op, DAG, MipsISD::VEXTRACT_ZEXT_ELT); + case Intrinsic::mips_copy_u_d: + // Don't lower directly into VEXTRACT_ZEXT_ELT since i64 might be illegal. + // Instead lower to the generic EXTRACT_VECTOR_ELT node and let the type + // legalizer and EXTRACT_VECTOR_ELT lowering sort it out. + // + // Note: When i64 is illegal, this results in copy_s.w instructions instead + // of copy_u.w instructions. This makes no difference to the behaviour + // since i64 is only illegal when the register file is 32-bit. + return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SDLoc(Op), Op->getValueType(0), + Op->getOperand(1), Op->getOperand(2)); case Intrinsic::mips_div_s_b: case Intrinsic::mips_div_s_h: case Intrinsic::mips_div_s_w: |

