@@ -2639,7 +2639,11 @@ SDValue DAGTypeLegalizer::PromoteFloatOp_FCOPYSIGN(SDNode *N, unsigned OpNo) {
2639
2639
// Convert the promoted float value to the desired integer type
2640
2640
SDValue DAGTypeLegalizer::PromoteFloatOp_UnaryOp (SDNode *N, unsigned OpNo) {
2641
2641
SDValue Op = GetPromotedFloat (N->getOperand (0 ));
2642
- return DAG.getNode (N->getOpcode (), SDLoc (N), N->getValueType (0 ), Op);
2642
+ if (N->getOpcode () == ISD::AssertNoFPClass)
2643
+ return DAG.getNode (N->getOpcode (), SDLoc (N), N->getValueType (0 ), Op,
2644
+ N->getOperand (1 ));
2645
+ else
2646
+ return DAG.getNode (N->getOpcode (), SDLoc (N), N->getValueType (0 ), Op);
2643
2647
}
2644
2648
2645
2649
SDValue DAGTypeLegalizer::PromoteFloatOp_FP_TO_XINT_SAT (SDNode *N,
@@ -2999,8 +3003,10 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_UnaryOp(SDNode *N) {
2999
3003
EVT VT = N->getValueType (0 );
3000
3004
EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), VT);
3001
3005
SDValue Op = GetPromotedFloat (N->getOperand (0 ));
3002
-
3003
- return DAG.getNode (N->getOpcode (), SDLoc (N), NVT, Op);
3006
+ if (N->getOpcode () == ISD::AssertNoFPClass)
3007
+ return DAG.getNode (N->getOpcode (), SDLoc (N), NVT, Op, N->getOperand (1 ));
3008
+ else
3009
+ return DAG.getNode (N->getOpcode (), SDLoc (N), NVT, Op);
3004
3010
}
3005
3011
3006
3012
// Binary operations where the result and both operands have PromoteFloat type
@@ -3245,6 +3251,8 @@ void DAGTypeLegalizer::SoftPromoteHalfResult(SDNode *N, unsigned ResNo) {
3245
3251
report_fatal_error (" Do not know how to soft promote this operator's "
3246
3252
" result!" );
3247
3253
3254
+ // case ISD::AssertNoFPClass:
3255
+ // break;
3248
3256
case ISD::ARITH_FENCE:
3249
3257
R = SoftPromoteHalfRes_ARITH_FENCE (N); break ;
3250
3258
case ISD::BITCAST: R = SoftPromoteHalfRes_BITCAST (N); break ;
@@ -3283,6 +3291,7 @@ void DAGTypeLegalizer::SoftPromoteHalfResult(SDNode *N, unsigned ResNo) {
3283
3291
case ISD::FTRUNC:
3284
3292
case ISD::FTAN:
3285
3293
case ISD::FTANH:
3294
+ case ISD::AssertNoFPClass:
3286
3295
case ISD::FCANONICALIZE: R = SoftPromoteHalfRes_UnaryOp (N); break ;
3287
3296
3288
3297
// Binary FP Operations
@@ -3604,7 +3613,11 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfRes_UnaryOp(SDNode *N) {
3604
3613
// Promote to the larger FP type.
3605
3614
Op = DAG.getNode (GetPromotionOpcode (OVT, NVT), dl, NVT, Op);
3606
3615
3607
- SDValue Res = DAG.getNode (N->getOpcode (), dl, NVT, Op);
3616
+ SDValue Res;
3617
+ if (N->getOpcode () == ISD::AssertNoFPClass)
3618
+ Res = DAG.getNode (N->getOpcode (), dl, NVT, Op, N->getOperand (1 ));
3619
+ else
3620
+ Res = DAG.getNode (N->getOpcode (), dl, NVT, Op);
3608
3621
3609
3622
// Convert back to FP16 as an integer.
3610
3623
return DAG.getNode (GetPromotionOpcode (NVT, OVT), dl, MVT::i16 , Res);
0 commit comments