@@ -168,6 +168,7 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
168168 case ISD::POISON:
169169 case ISD::UNDEF: R = SoftenFloatRes_UNDEF (N); break ;
170170 case ISD::VAARG: R = SoftenFloatRes_VAARG (N); break ;
171+ case ISD::AssertNoFPClass: R = GetSoftenedFloat (N->getOperand (0 )); break ;
171172 case ISD::VECREDUCE_FADD:
172173 case ISD::VECREDUCE_FMUL:
173174 case ISD::VECREDUCE_FMIN:
@@ -2582,6 +2583,7 @@ bool DAGTypeLegalizer::PromoteFloatOperand(SDNode *N, unsigned OpNo) {
25822583 case ISD::LLROUND:
25832584 case ISD::LRINT:
25842585 case ISD::LLRINT: R = PromoteFloatOp_UnaryOp (N, OpNo); break ;
2586+ case ISD::AssertNoFPClass: R = PromoteFloatOp_AssertNoFPClass (N, OpNo); break ;
25852587 case ISD::FP_TO_SINT_SAT:
25862588 case ISD::FP_TO_UINT_SAT:
25872589 R = PromoteFloatOp_FP_TO_XINT_SAT (N, OpNo); break ;
@@ -2640,6 +2642,12 @@ SDValue DAGTypeLegalizer::PromoteFloatOp_UnaryOp(SDNode *N, unsigned OpNo) {
26402642 return DAG.getNode (N->getOpcode (), SDLoc (N), N->getValueType (0 ), Op);
26412643}
26422644
2645+ // Convert the promoted float value to the desired integer type
2646+ SDValue DAGTypeLegalizer::PromoteFloatOp_AssertNoFPClass (SDNode *N,
2647+ unsigned OpNo) {
2648+ return GetPromotedFloat (N->getOperand (0 ));
2649+ }
2650+
26432651SDValue DAGTypeLegalizer::PromoteFloatOp_FP_TO_XINT_SAT (SDNode *N,
26442652 unsigned OpNo) {
26452653 SDValue Op = GetPromotedFloat (N->getOperand (0 ));
@@ -2804,6 +2812,9 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) {
28042812 case ISD::FTAN:
28052813 case ISD::FTANH:
28062814 case ISD::FCANONICALIZE: R = PromoteFloatRes_UnaryOp (N); break ;
2815+ case ISD::AssertNoFPClass:
2816+ R = PromoteFloatRes_AssertNoFPClass (N);
2817+ break ;
28072818
28082819 // Binary FP Operations
28092820 case ISD::FADD:
@@ -2996,10 +3007,16 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_UnaryOp(SDNode *N) {
29963007 EVT VT = N->getValueType (0 );
29973008 EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), VT);
29983009 SDValue Op = GetPromotedFloat (N->getOperand (0 ));
2999-
30003010 return DAG.getNode (N->getOpcode (), SDLoc (N), NVT, Op);
30013011}
30023012
3013+ // Unary operation with a more non-float operand where the result and the
3014+ // operand have PromoteFloat type action. Construct a new SDNode with the
3015+ // promoted float value of the old operand.
3016+ SDValue DAGTypeLegalizer::PromoteFloatRes_AssertNoFPClass (SDNode *N) {
3017+ return GetPromotedFloat (N->getOperand (0 ));
3018+ }
3019+
30033020// Binary operations where the result and both operands have PromoteFloat type
30043021// action. Construct a new SDNode with the promoted float values of the old
30053022// operands.
@@ -3281,6 +3298,9 @@ void DAGTypeLegalizer::SoftPromoteHalfResult(SDNode *N, unsigned ResNo) {
32813298 case ISD::FTAN:
32823299 case ISD::FTANH:
32833300 case ISD::FCANONICALIZE: R = SoftPromoteHalfRes_UnaryOp (N); break ;
3301+ case ISD::AssertNoFPClass:
3302+ R = SoftPromoteHalfRes_AssertNoFPClass (N);
3303+ break ;
32843304
32853305 // Binary FP Operations
32863306 case ISD::FADD:
@@ -3607,6 +3627,10 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfRes_UnaryOp(SDNode *N) {
36073627 return DAG.getNode (GetPromotionOpcode (NVT, OVT), dl, MVT::i16 , Res);
36083628}
36093629
3630+ SDValue DAGTypeLegalizer::SoftPromoteHalfRes_AssertNoFPClass (SDNode *N) {
3631+ return GetSoftPromotedHalf (N->getOperand (0 ));
3632+ }
3633+
36103634SDValue DAGTypeLegalizer::SoftPromoteHalfRes_BinOp (SDNode *N) {
36113635 EVT OVT = N->getValueType (0 );
36123636 EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), OVT);
0 commit comments