1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[SelectionDAG] Add MVT::bf16 to getConstantFP()

Summary:
This was probably overlooked in recent bfloat patches.
Needed to handle bf16 constants in SelectionDAG.

  ConstantFP:bf16<APFloat(0)>

Reviewers: stuij

Reviewed By: stuij

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81779
This commit is contained in:
Aaron Smith 2020-06-16 15:10:05 -07:00
parent 3ac41a5d21
commit f22e6d55bc

View File

@ -1394,7 +1394,7 @@ SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT,
else if (EltVT == MVT::f64) else if (EltVT == MVT::f64)
return getConstantFP(APFloat(Val), DL, VT, isTarget); return getConstantFP(APFloat(Val), DL, VT, isTarget);
else if (EltVT == MVT::f80 || EltVT == MVT::f128 || EltVT == MVT::ppcf128 || else if (EltVT == MVT::f80 || EltVT == MVT::f128 || EltVT == MVT::ppcf128 ||
EltVT == MVT::f16) { EltVT == MVT::f16 || EltVT == MVT::bf16) {
bool Ignored; bool Ignored;
APFloat APF = APFloat(Val); APFloat APF = APFloat(Val);
APF.convert(EVTToAPFloatSemantics(EltVT), APFloat::rmNearestTiesToEven, APF.convert(EVTToAPFloatSemantics(EltVT), APFloat::rmNearestTiesToEven,