Skip to content

Commit 0b0ed8f

Browse files
committed
[RISCV] Add missing hunk to llvm#67889 to fix test failures
Without this, various CodeGen tests fail because a RISCV::FCVT_D_W[_IN32X] machine node is created without the rounding mode operand. The relevant PR was committed as bf94ba3
1 parent bf94ba3 commit 0b0ed8f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,13 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
911911
break;
912912
}
913913

914-
SDNode *Res = CurDAG->getMachineNode(Opc, DL, VT, Imm);
914+
SDNode *Res;
915+
if (Opc == RISCV::FCVT_D_W_IN32X || Opc == RISCV::FCVT_D_W)
916+
Res = CurDAG->getMachineNode(
917+
Opc, DL, VT, Imm,
918+
CurDAG->getTargetConstant(RISCVFPRndMode::RNE, DL, XLenVT));
919+
else
920+
Res = CurDAG->getMachineNode(Opc, DL, VT, Imm);
915921

916922
// For f64 -0.0, we need to insert a fneg.d idiom.
917923
if (NegZeroF64)

0 commit comments

Comments
 (0)