Skip to content

Commit ef9c255

Browse files
author
Aidan
committed
draft commit for targetlowering port
1 parent 4a467b9 commit ef9c255

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8404,6 +8404,17 @@ bool TargetLowering::expandUINT_TO_FP(SDNode *Node, SDValue &Result,
84048404
EVT SrcVT = Src.getValueType();
84058405
EVT DstVT = Node->getValueType(0);
84068406

8407+
if (DstVT == MVT::bf16) {
8408+
SDLoc Loc(Node);
8409+
SDValue Operand = Node->getOperand(0);
8410+
8411+
Result = DAG.getNode(
8412+
ISD::FP_ROUND, Loc, MVT::bf16,
8413+
DAG.getNode(ISD::UINT_TO_FP, Loc, MVT::f32, Operand),
8414+
DAG.getIntPtrConstant(0, Loc));
8415+
return true;
8416+
}
8417+
84078418
// If the input is known to be non-negative and SINT_TO_FP is legal then use
84088419
// it.
84098420
if (Node->getFlags().hasNonNeg() &&

0 commit comments

Comments
 (0)