@@ -12663,8 +12663,7 @@ SDValue RISCVTargetLowering::lowerGET_ROUNDING(SDValue Op,
12663
12663
const MVT XLenVT = Subtarget.getXLenVT();
12664
12664
SDLoc DL(Op);
12665
12665
SDValue Chain = Op->getOperand(0);
12666
- SDValue SysRegNo = DAG.getTargetConstant(
12667
- RISCVSysReg::lookupSysRegByName("FRM")->Encoding, DL, XLenVT);
12666
+ SDValue SysRegNo = DAG.getTargetConstant(RISCVSysReg::frm, DL, XLenVT);
12668
12667
SDVTList VTs = DAG.getVTList(XLenVT, MVT::Other);
12669
12668
SDValue RM = DAG.getNode(RISCVISD::READ_CSR, DL, VTs, Chain, SysRegNo);
12670
12669
@@ -12695,8 +12694,7 @@ SDValue RISCVTargetLowering::lowerSET_ROUNDING(SDValue Op,
12695
12694
SDLoc DL(Op);
12696
12695
SDValue Chain = Op->getOperand(0);
12697
12696
SDValue RMValue = Op->getOperand(1);
12698
- SDValue SysRegNo = DAG.getTargetConstant(
12699
- RISCVSysReg::lookupSysRegByName("FRM")->Encoding, DL, XLenVT);
12697
+ SDValue SysRegNo = DAG.getTargetConstant(RISCVSysReg::frm, DL, XLenVT);
12700
12698
12701
12699
// Encoding used for rounding mode in RISC-V differs from that used in
12702
12700
// FLT_ROUNDS. To convert it the C rounding mode is used as an index in
@@ -12899,15 +12897,11 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N,
12899
12897
SDValue LoCounter, HiCounter;
12900
12898
MVT XLenVT = Subtarget.getXLenVT();
12901
12899
if (N->getOpcode() == ISD::READCYCLECOUNTER) {
12902
- LoCounter = DAG.getTargetConstant(
12903
- RISCVSysReg::lookupSysRegByName("CYCLE")->Encoding, DL, XLenVT);
12904
- HiCounter = DAG.getTargetConstant(
12905
- RISCVSysReg::lookupSysRegByName("CYCLEH")->Encoding, DL, XLenVT);
12900
+ LoCounter = DAG.getTargetConstant(RISCVSysReg::cycle, DL, XLenVT);
12901
+ HiCounter = DAG.getTargetConstant(RISCVSysReg::cycleh, DL, XLenVT);
12906
12902
} else {
12907
- LoCounter = DAG.getTargetConstant(
12908
- RISCVSysReg::lookupSysRegByName("TIME")->Encoding, DL, XLenVT);
12909
- HiCounter = DAG.getTargetConstant(
12910
- RISCVSysReg::lookupSysRegByName("TIMEH")->Encoding, DL, XLenVT);
12903
+ LoCounter = DAG.getTargetConstant(RISCVSysReg::time, DL, XLenVT);
12904
+ HiCounter = DAG.getTargetConstant(RISCVSysReg::timeh, DL, XLenVT);
12911
12905
}
12912
12906
SDVTList VTs = DAG.getVTList(MVT::i32, MVT::i32, MVT::Other);
12913
12907
SDValue RCW = DAG.getNode(RISCVISD::READ_COUNTER_WIDE, DL, VTs,
0 commit comments