summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
diff options
context:
space:
mode:
authorJack Carter <jack.carter@imgtec.com>2013-08-13 20:54:07 +0000
committerJack Carter <jack.carter@imgtec.com>2013-08-13 20:54:07 +0000
commit3a2c2d42b85b657535dfb39e811045403ccdd195 (patch)
tree91733d18b2e193094e8d667b643f206c9fdec0aa /llvm/lib/Target/Mips/MipsSEISelLowering.cpp
parent9770097727c21d41fe966e7faef69140a72a49b7 (diff)
downloadbcm5719-llvm-3a2c2d42b85b657535dfb39e811045403ccdd195.tar.gz
bcm5719-llvm-3a2c2d42b85b657535dfb39e811045403ccdd195.zip
[Mips][msa] Added initial MSA support.
* msa SubtargetFeature * registers * ld.[bhwd], and st.[bhwd] instructions Does not correctly prohibit use of both 32-bit FPU registers and MSA together. Patch by Daniel Sanders llvm-svn: 188313
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSEISelLowering.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsSEISelLowering.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
index a0aacb57e47..979cfcb31da 100644
--- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -77,6 +77,23 @@ MipsSETargetLowering::MipsSETargetLowering(MipsTargetMachine &TM)
if (Subtarget->hasDSPR2())
setOperationAction(ISD::MUL, MVT::v2i16, Legal);
+ if (Subtarget->hasMSA()) {
+ MVT::SimpleValueType VecTys[4] = {MVT::v16i8, MVT::v8i16,
+ MVT::v4i32, MVT::v2i64};
+
+ for (unsigned i = 0; i < array_lengthof(VecTys); ++i) {
+ addRegisterClass(VecTys[i], &Mips::MSA128RegClass);
+
+ // Expand all builtin opcodes.
+ for (unsigned Opc = 0; Opc < ISD::BUILTIN_OP_END; ++Opc)
+ setOperationAction(Opc, VecTys[i], Expand);
+
+ setOperationAction(ISD::LOAD, VecTys[i], Legal);
+ setOperationAction(ISD::STORE, VecTys[i], Legal);
+ setOperationAction(ISD::BITCAST, VecTys[i], Legal);
+ }
+ }
+
if (!TM.Options.UseSoftFloat) {
addRegisterClass(MVT::f32, &Mips::FGR32RegClass);
OpenPOWER on IntegriCloud