forked from OSchip/llvm-project
parent
86c3c794fa
commit
d98c99fd01
|
@ -183,8 +183,8 @@ def MTHI64 : MoveToLOHI<"mthi", GPR64Opnd, [HI0_64]>, MTLO_FM<0x11>;
|
|||
def MTLO64 : MoveToLOHI<"mtlo", GPR64Opnd, [LO0_64]>, MTLO_FM<0x13>;
|
||||
def MFHI64 : MoveFromLOHI<"mfhi", GPR64Opnd, AC0_64>, MFLO_FM<0x10>;
|
||||
def MFLO64 : MoveFromLOHI<"mflo", GPR64Opnd, AC0_64>, MFLO_FM<0x12>;
|
||||
def PseudoMFHI64 : PseudoMFLOHI<GPR64, ACC128, MipsExtractHI>;
|
||||
def PseudoMFLO64 : PseudoMFLOHI<GPR64, ACC128, MipsExtractLO>;
|
||||
def PseudoMFHI64 : PseudoMFLOHI<GPR64, ACC128, MipsMFHI>;
|
||||
def PseudoMFLO64 : PseudoMFLOHI<GPR64, ACC128, MipsMFLO>;
|
||||
|
||||
/// Sign Ext In Register Instructions.
|
||||
def SEB64 : SignExtInReg<"seb", i8, GPR64Opnd>, SEB_FM<0x10, 0x20>;
|
||||
|
|
|
@ -739,10 +739,8 @@ class MAQ_SA_W_PHR_DESC : DPA_W_PH_DESC_BASE<"maq_sa.w.phr", MipsMAQ_SA_W_PHR>,
|
|||
Defs<[DSPOutFlag16_19]>;
|
||||
|
||||
// Move from/to hi/lo.
|
||||
class MFHI_DESC : MFHI_DESC_BASE<"mfhi", ACC64DSPOpnd, MipsExtractHI,
|
||||
NoItinerary>;
|
||||
class MFLO_DESC : MFHI_DESC_BASE<"mflo", ACC64DSPOpnd, MipsExtractLO,
|
||||
NoItinerary>;
|
||||
class MFHI_DESC : MFHI_DESC_BASE<"mfhi", ACC64DSPOpnd, MipsMFHI, NoItinerary>;
|
||||
class MFLO_DESC : MFHI_DESC_BASE<"mflo", ACC64DSPOpnd, MipsMFLO, NoItinerary>;
|
||||
class MTHI_DESC : MTHI_DESC_BASE<"mthi", HI32DSPOpnd, NoItinerary>;
|
||||
class MTLO_DESC : MTHI_DESC_BASE<"mtlo", LO32DSPOpnd, NoItinerary>;
|
||||
|
||||
|
|
|
@ -126,9 +126,9 @@ const char *MipsTargetLowering::getTargetNodeName(unsigned Opcode) const {
|
|||
case MipsISD::CMovFP_T: return "MipsISD::CMovFP_T";
|
||||
case MipsISD::CMovFP_F: return "MipsISD::CMovFP_F";
|
||||
case MipsISD::TruncIntFP: return "MipsISD::TruncIntFP";
|
||||
case MipsISD::ExtractHI: return "MipsISD::ExtractHI";
|
||||
case MipsISD::ExtractLO: return "MipsISD::ExtractLO";
|
||||
case MipsISD::InsertLOHI: return "MipsISD::InsertLOHI";
|
||||
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::MAdd: return "MipsISD::MAdd";
|
||||
|
|
|
@ -70,11 +70,11 @@ namespace llvm {
|
|||
EH_RETURN,
|
||||
|
||||
// Node used to extract integer from accumulator.
|
||||
ExtractHI,
|
||||
ExtractLO,
|
||||
MFHI,
|
||||
MFLO,
|
||||
|
||||
// Node used to insert integers to accumulator.
|
||||
InsertLOHI,
|
||||
MTLOHI,
|
||||
|
||||
// Mult nodes.
|
||||
Mult,
|
||||
|
|
|
@ -23,10 +23,10 @@ def SDT_MipsCMov : SDTypeProfile<1, 4, [SDTCisSameAs<0, 1>,
|
|||
SDTCisInt<4>]>;
|
||||
def SDT_MipsCallSeqStart : SDCallSeqStart<[SDTCisVT<0, i32>]>;
|
||||
def SDT_MipsCallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i32>, SDTCisVT<1, i32>]>;
|
||||
def SDT_ExtractLOHI : SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVT<1, untyped>]>;
|
||||
def SDT_InsertLOHI : SDTypeProfile<1, 2, [SDTCisVT<0, untyped>,
|
||||
SDTCisVT<1, i32>,
|
||||
SDTCisSameAs<1, 2>]>;
|
||||
def SDT_MFLOHI : SDTypeProfile<1, 1, [SDTCisInt<0>, SDTCisVT<1, untyped>]>;
|
||||
def SDT_MTLOHI : SDTypeProfile<1, 2, [SDTCisVT<0, untyped>,
|
||||
SDTCisVT<1, i32>,
|
||||
SDTCisSameAs<1, 2>]>;
|
||||
def SDT_MipsMultDiv : SDTypeProfile<1, 2, [SDTCisVT<0, untyped>, SDTCisInt<1>,
|
||||
SDTCisSameAs<1, 2>]>;
|
||||
def SDT_MipsMAddMSub : SDTypeProfile<1, 3,
|
||||
|
@ -86,11 +86,11 @@ def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_MipsCallSeqEnd,
|
|||
SDNPOptInGlue, SDNPOutGlue]>;
|
||||
|
||||
// Nodes used to extract LO/HI registers.
|
||||
def MipsExtractHI : SDNode<"MipsISD::ExtractHI", SDT_ExtractLOHI>;
|
||||
def MipsExtractLO : SDNode<"MipsISD::ExtractLO", SDT_ExtractLOHI>;
|
||||
def MipsMFHI : SDNode<"MipsISD::MFHI", SDT_MFLOHI>;
|
||||
def MipsMFLO : SDNode<"MipsISD::MFLO", SDT_MFLOHI>;
|
||||
|
||||
// Node used to insert 32-bit integers to LOHI register pair.
|
||||
def InsertLOHI : SDNode<"MipsISD::InsertLOHI", SDT_InsertLOHI>;
|
||||
def MipsMTLOHI : SDNode<"MipsISD::MTLOHI", SDT_MTLOHI>;
|
||||
|
||||
// Mult nodes.
|
||||
def MipsMult : SDNode<"MipsISD::Mult", SDT_MipsMultDiv>;
|
||||
|
@ -1043,8 +1043,8 @@ def MTHI : MMRel, MoveToLOHI<"mthi", GPR32Opnd, [HI0]>, MTLO_FM<0x11>;
|
|||
def MTLO : MMRel, MoveToLOHI<"mtlo", GPR32Opnd, [LO0]>, MTLO_FM<0x13>;
|
||||
def MFHI : MMRel, MoveFromLOHI<"mfhi", GPR32Opnd, AC0>, MFLO_FM<0x10>;
|
||||
def MFLO : MMRel, MoveFromLOHI<"mflo", GPR32Opnd, AC0>, MFLO_FM<0x12>;
|
||||
def PseudoMFHI : PseudoMFLOHI<GPR32, ACC64, MipsExtractHI>;
|
||||
def PseudoMFLO : PseudoMFLOHI<GPR32, ACC64, MipsExtractLO>;
|
||||
def PseudoMFHI : PseudoMFLOHI<GPR32, ACC64, MipsMFHI>;
|
||||
def PseudoMFLO : PseudoMFLOHI<GPR32, ACC64, MipsMFLO>;
|
||||
|
||||
/// Sign Ext In Register Instructions.
|
||||
def SEB : MMRel, SignExtInReg<"seb", i8, GPR32Opnd>, SEB_FM<0x10, 0x20>;
|
||||
|
|
|
@ -684,7 +684,7 @@ std::pair<bool, SDNode*> MipsSEDAGToDAGISel::selectNode(SDNode *Node) {
|
|||
return std::make_pair(true, ResNode.getNode());
|
||||
}
|
||||
|
||||
case MipsISD::InsertLOHI: {
|
||||
case MipsISD::MTLOHI: {
|
||||
unsigned RCID = Subtarget.hasDSP() ? Mips::ACC64DSPRegClassID :
|
||||
Mips::ACC64RegClassID;
|
||||
SDValue RegClass = CurDAG->getTargetConstant(RCID, MVT::i32);
|
||||
|
|
|
@ -323,7 +323,7 @@ static bool selectMADD(SDNode *ADDENode, SelectionDAG *CurDAG) {
|
|||
SDLoc DL(ADDENode);
|
||||
|
||||
// Initialize accumulator.
|
||||
SDValue ACCIn = CurDAG->getNode(MipsISD::InsertLOHI, DL, MVT::Untyped,
|
||||
SDValue ACCIn = CurDAG->getNode(MipsISD::MTLOHI, DL, MVT::Untyped,
|
||||
ADDCNode->getOperand(1),
|
||||
ADDENode->getOperand(1));
|
||||
|
||||
|
@ -337,11 +337,11 @@ static bool selectMADD(SDNode *ADDENode, SelectionDAG *CurDAG) {
|
|||
|
||||
// replace uses of adde and addc here
|
||||
if (!SDValue(ADDCNode, 0).use_empty()) {
|
||||
SDValue LoOut = CurDAG->getNode(MipsISD::ExtractLO, DL, MVT::i32, MAdd);
|
||||
SDValue LoOut = CurDAG->getNode(MipsISD::MFLO, DL, MVT::i32, MAdd);
|
||||
CurDAG->ReplaceAllUsesOfValueWith(SDValue(ADDCNode, 0), LoOut);
|
||||
}
|
||||
if (!SDValue(ADDENode, 0).use_empty()) {
|
||||
SDValue HiOut = CurDAG->getNode(MipsISD::ExtractHI, DL, MVT::i32, MAdd);
|
||||
SDValue HiOut = CurDAG->getNode(MipsISD::MFHI, DL, MVT::i32, MAdd);
|
||||
CurDAG->ReplaceAllUsesOfValueWith(SDValue(ADDENode, 0), HiOut);
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ static bool selectMSUB(SDNode *SUBENode, SelectionDAG *CurDAG) {
|
|||
SDLoc DL(SUBENode);
|
||||
|
||||
// Initialize accumulator.
|
||||
SDValue ACCIn = CurDAG->getNode(MipsISD::InsertLOHI, DL, MVT::Untyped,
|
||||
SDValue ACCIn = CurDAG->getNode(MipsISD::MTLOHI, DL, MVT::Untyped,
|
||||
SUBCNode->getOperand(0),
|
||||
SUBENode->getOperand(0));
|
||||
|
||||
|
@ -409,11 +409,11 @@ static bool selectMSUB(SDNode *SUBENode, SelectionDAG *CurDAG) {
|
|||
|
||||
// replace uses of sube and subc here
|
||||
if (!SDValue(SUBCNode, 0).use_empty()) {
|
||||
SDValue LoOut = CurDAG->getNode(MipsISD::ExtractLO, DL, MVT::i32, MSub);
|
||||
SDValue LoOut = CurDAG->getNode(MipsISD::MFLO, DL, MVT::i32, MSub);
|
||||
CurDAG->ReplaceAllUsesOfValueWith(SDValue(SUBCNode, 0), LoOut);
|
||||
}
|
||||
if (!SDValue(SUBENode, 0).use_empty()) {
|
||||
SDValue HiOut = CurDAG->getNode(MipsISD::ExtractHI, DL, MVT::i32, MSub);
|
||||
SDValue HiOut = CurDAG->getNode(MipsISD::MFHI, DL, MVT::i32, MSub);
|
||||
CurDAG->ReplaceAllUsesOfValueWith(SDValue(SUBENode, 0), HiOut);
|
||||
}
|
||||
|
||||
|
@ -943,9 +943,9 @@ SDValue MipsSETargetLowering::lowerMulDiv(SDValue Op, unsigned NewOpc,
|
|||
SDValue Lo, Hi;
|
||||
|
||||
if (HasLo)
|
||||
Lo = DAG.getNode(MipsISD::ExtractLO, DL, Ty, Mult);
|
||||
Lo = DAG.getNode(MipsISD::MFLO, DL, Ty, Mult);
|
||||
if (HasHi)
|
||||
Hi = DAG.getNode(MipsISD::ExtractHI, DL, Ty, Mult);
|
||||
Hi = DAG.getNode(MipsISD::MFHI, DL, Ty, Mult);
|
||||
|
||||
if (!HasLo || !HasHi)
|
||||
return HasLo ? Lo : Hi;
|
||||
|
@ -960,12 +960,12 @@ static SDValue initAccumulator(SDValue In, SDLoc DL, SelectionDAG &DAG) {
|
|||
DAG.getConstant(0, MVT::i32));
|
||||
SDValue InHi = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, In,
|
||||
DAG.getConstant(1, MVT::i32));
|
||||
return DAG.getNode(MipsISD::InsertLOHI, DL, MVT::Untyped, InLo, InHi);
|
||||
return DAG.getNode(MipsISD::MTLOHI, DL, MVT::Untyped, InLo, InHi);
|
||||
}
|
||||
|
||||
static SDValue extractLOHI(SDValue Op, SDLoc DL, SelectionDAG &DAG) {
|
||||
SDValue Lo = DAG.getNode(MipsISD::ExtractLO, DL, MVT::i32, Op);
|
||||
SDValue Hi = DAG.getNode(MipsISD::ExtractHI, DL, MVT::i32, Op);
|
||||
SDValue Lo = DAG.getNode(MipsISD::MFLO, DL, MVT::i32, Op);
|
||||
SDValue Hi = DAG.getNode(MipsISD::MFHI, DL, MVT::i32, Op);
|
||||
return DAG.getNode(ISD::BUILD_PAIR, DL, MVT::i64, Lo, Hi);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue