@@ -357,10 +357,6 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine &TM,
357357 setOperationAction (ISD::FCOPYSIGN, MVT::f64 , Custom);
358358 setOperationAction (ISD::FP_TO_SINT, MVT::i32 , Custom);
359359
360- if (Subtarget.hasMips32r2 () ||
361- getTargetMachine ().getTargetTriple ().isOSLinux ())
362- setOperationAction (ISD::READCYCLECOUNTER, MVT::i64 , Custom);
363-
364360 // Lower fmin/fmax/fclass operations for MIPS R6.
365361 if (Subtarget.hasMips32r6 ()) {
366362 setOperationAction (ISD::FMINNUM_IEEE, MVT::f32 , Legal);
@@ -1319,8 +1315,6 @@ LowerOperation(SDValue Op, SelectionDAG &DAG) const
13191315 case ISD::STORE: return lowerSTORE (Op, DAG);
13201316 case ISD::EH_DWARF_CFA: return lowerEH_DWARF_CFA (Op, DAG);
13211317 case ISD::FP_TO_SINT: return lowerFP_TO_SINT (Op, DAG);
1322- case ISD::READCYCLECOUNTER:
1323- return lowerREADCYCLECOUNTER (Op, DAG);
13241318 }
13251319 return SDValue ();
13261320}
@@ -2102,44 +2096,6 @@ MachineBasicBlock *MipsTargetLowering::emitAtomicCmpSwapPartword(
21022096 return exitMBB;
21032097}
21042098
2105- SDValue MipsTargetLowering::lowerREADCYCLECOUNTER (SDValue Op,
2106- SelectionDAG &DAG) const {
2107- SmallVector<SDValue, 3 > Results;
2108- SDLoc DL (Op);
2109- MachineFunction &MF = DAG.getMachineFunction ();
2110- unsigned RdhwrOpc, DestReg;
2111- EVT PtrVT = getPointerTy (DAG.getDataLayout ());
2112-
2113- if (PtrVT == MVT::i64 ) {
2114- RdhwrOpc = Mips::RDHWR64;
2115- DestReg = MF.getRegInfo ().createVirtualRegister (getRegClassFor (MVT::i64 ));
2116- SDNode *Rdhwr = DAG.getMachineNode (RdhwrOpc, DL, MVT::i64 , MVT::Glue,
2117- DAG.getRegister (Mips::HWR2, MVT::i32 ),
2118- DAG.getTargetConstant (0 , DL, MVT::i32 ));
2119- SDValue Chain = DAG.getCopyToReg (DAG.getEntryNode (), DL, DestReg,
2120- SDValue (Rdhwr, 0 ), SDValue (Rdhwr, 1 ));
2121- SDValue ResNode =
2122- DAG.getCopyFromReg (Chain, DL, DestReg, MVT::i64 , Chain.getValue (1 ));
2123- Results.push_back (ResNode);
2124- Results.push_back (ResNode.getValue (1 ));
2125- } else {
2126- RdhwrOpc = Mips::RDHWR;
2127- DestReg = MF.getRegInfo ().createVirtualRegister (getRegClassFor (MVT::i32 ));
2128- SDNode *Rdhwr = DAG.getMachineNode (RdhwrOpc, DL, MVT::i32 , MVT::Glue,
2129- DAG.getRegister (Mips::HWR2, MVT::i32 ),
2130- DAG.getTargetConstant (0 , DL, MVT::i32 ));
2131- SDValue Chain = DAG.getCopyToReg (DAG.getEntryNode (), DL, DestReg,
2132- SDValue (Rdhwr, 0 ), SDValue (Rdhwr, 1 ));
2133- SDValue ResNode =
2134- DAG.getCopyFromReg (Chain, DL, DestReg, MVT::i32 , Chain.getValue (1 ));
2135- Results.push_back (DAG.getNode (ISD::BUILD_PAIR, DL, MVT::i64 , ResNode,
2136- DAG.getConstant (0 , DL, MVT::i32 )));
2137- Results.push_back (ResNode.getValue (1 ));
2138- }
2139-
2140- return DAG.getMergeValues (Results, DL);
2141- }
2142-
21432099SDValue MipsTargetLowering::lowerBRCOND (SDValue Op, SelectionDAG &DAG) const {
21442100 // The first operand is the chain, the second is the condition, the third is
21452101 // the block to branch to if the condition is true.
0 commit comments