summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-05-05 19:24:45 -0600
committerEvan Lojewski <github@meklort.com>2019-05-05 19:24:45 -0600
commitef79ce38ee855a5c6c301f601cb5c2b534ce4d99 (patch)
tree0125759b32818a67256e5c68c3e01d5786316901
parentd0d8eb2e5415b8be29343e3c17a18e49e67b5551 (diff)
downloadbcm5719-llvm-ef79ce38ee855a5c6c301f601cb5c2b534ce4d99.zip
bcm5719-llvm-ef79ce38ee855a5c6c301f601cb5c2b534ce4d99.tar.gz
Add a quick hack so clang does not use mul type instructions on mips.
-rw-r--r--llvm/lib/Target/Mips/MipsISelLowering.cpp51
1 files changed, 36 insertions, 15 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 0677d37..3453e62 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -208,8 +208,8 @@ const char *MipsTargetLowering::getTargetNodeName(unsigned Opcode) const {
case MipsISD::MFHI: return "MipsISD::MFHI";
case MipsISD::MFLO: return "MipsISD::MFLO";
case MipsISD::MTLOHI: return "MipsISD::MTLOHI";
- case MipsISD::Mult: return "MipsISD::Mult";
- case MipsISD::Multu: return "MipsISD::Multu";
+// case MipsISD::Mult: return "MipsISD::Mult";
+// case MipsISD::Multu: return "MipsISD::Multu";
case MipsISD::MAdd: return "MipsISD::MAdd";
case MipsISD::MAddu: return "MipsISD::MAddu";
case MipsISD::MSub: return "MipsISD::MSub";
@@ -345,6 +345,26 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine &TM,
// which is used implicitly by brcond and select operations.
AddPromotedToType(ISD::SETCC, MVT::i1, MVT::i32);
+ setOperationAction(MipsISD::LWL, MVT::i8, Expand);
+ setOperationAction(MipsISD::LWL, MVT::i16, Expand);
+ setOperationAction(MipsISD::LWL, MVT::i32, Expand);
+
+ setOperationAction(ISD::MUL, MVT::i8, Expand);
+ setOperationAction(ISD::MUL, MVT::i16, Expand);
+ setOperationAction(ISD::MUL, MVT::i32, Expand);
+ setOperationAction(ISD::MUL, MVT::i64, Expand);
+
+
+ setOperationAction(ISD::SMUL_LOHI, MVT::i8, Expand);
+ setOperationAction(ISD::SMUL_LOHI, MVT::i16, Expand);
+ setOperationAction(ISD::SMUL_LOHI, MVT::i32, Expand);
+ setOperationAction(ISD::SMUL_LOHI, MVT::i64, Expand);
+ setOperationAction(ISD::UMUL_LOHI, MVT::i8, Expand);
+ setOperationAction(ISD::UMUL_LOHI, MVT::i16, Expand);
+ setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand);
+ setOperationAction(ISD::UMUL_LOHI, MVT::i64, Expand);
+
+
// Mips Custom Operations
setOperationAction(ISD::BR_JT, MVT::Other, Expand);
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
@@ -657,16 +677,16 @@ static SDValue createFPCmp(SelectionDAG &DAG, const SDValue &Op) {
DAG.getConstant(condCodeToFCC(CC), DL, MVT::i32));
}
-// Creates and returns a CMovFPT/F node.
-static SDValue createCMovFP(SelectionDAG &DAG, SDValue Cond, SDValue True,
- SDValue False, const SDLoc &DL) {
- ConstantSDNode *CC = cast<ConstantSDNode>(Cond.getOperand(2));
- bool invert = invertFPCondCodeUser((Mips::CondCode)CC->getSExtValue());
- SDValue FCC0 = DAG.getRegister(Mips::FCC0, MVT::i32);
+// // Creates and returns a CMovFPT/F node.
+// static SDValue createCMovFP(SelectionDAG &DAG, SDValue Cond, SDValue True,
+// SDValue False, const SDLoc &DL) {
+// ConstantSDNode *CC = cast<ConstantSDNode>(Cond.getOperand(2));
+// bool invert = invertFPCondCodeUser((Mips::CondCode)CC->getSExtValue());
+// SDValue FCC0 = DAG.getRegister(Mips::FCC0, MVT::i32);
- return DAG.getNode((invert ? MipsISD::CMovFP_F : MipsISD::CMovFP_T), DL,
- True.getValueType(), True, FCC0, False, Cond);
-}
+// return DAG.getNode((invert ? MipsISD::CMovFP_F : MipsISD::CMovFP_T), DL,
+// True.getValueType(), True, FCC0, False, Cond);
+// }
static SDValue performSELECTCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
@@ -1914,11 +1934,11 @@ lowerSELECT(SDValue Op, SelectionDAG &DAG) const
SDValue Cond = createFPCmp(DAG, Op.getOperand(0));
// Return if flag is not set by a floating point comparison.
- if (Cond.getOpcode() != MipsISD::FPCmp)
+ // if (Cond.getOpcode() != MipsISD::FPCmp)
return Op;
- return createCMovFP(DAG, Cond, Op.getOperand(1), Op.getOperand(2),
- SDLoc(Op));
+ // return createCMovFP(DAG, Cond, Op.getOperand(1), Op.getOperand(2),
+ // SDLoc(Op));
}
SDValue MipsTargetLowering::lowerSETCC(SDValue Op, SelectionDAG &DAG) const {
@@ -1932,7 +1952,8 @@ SDValue MipsTargetLowering::lowerSETCC(SDValue Op, SelectionDAG &DAG) const {
SDValue True = DAG.getConstant(1, DL, MVT::i32);
SDValue False = DAG.getConstant(0, DL, MVT::i32);
- return createCMovFP(DAG, Cond, True, False, DL);
+ // return createCMovFP(DAG, Cond, True, False, DL);
+ return Op;
}
SDValue MipsTargetLowering::lowerGlobalAddress(SDValue Op,
OpenPOWER on IntegriCloud