@@ -715,31 +715,32 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FPOW(SDNode *N) {
715
715
SDValue DAGTypeLegalizer::SoftenFloatRes_ExpOp (SDNode *N) {
716
716
bool IsStrict = N->isStrictFPOpcode ();
717
717
unsigned Offset = IsStrict ? 1 : 0 ;
718
- assert ((N->getOperand (1 + Offset).getValueType () == MVT::i16 ||
719
- N->getOperand (1 + Offset).getValueType () == MVT::i32 ) &&
720
- " Unsupported power type!" );
721
718
bool IsPowI =
722
719
N->getOpcode () == ISD::FPOWI || N->getOpcode () == ISD::STRICT_FPOWI;
720
+ EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), N->getValueType (0 ));
723
721
724
722
RTLIB::Libcall LC = IsPowI ? RTLIB::getPOWI (N->getValueType (0 ))
725
723
: RTLIB::getLDEXP (N->getValueType (0 ));
726
724
assert (LC != RTLIB::UNKNOWN_LIBCALL && " Unexpected fpowi." );
727
725
if (!TLI.getLibcallName (LC)) {
728
726
// Some targets don't have a powi libcall; use pow instead.
729
727
// FIXME: Implement this if some target needs it.
730
- DAG.getContext ()->emitError (" Don't know how to soften fpowi to fpow" );
731
- return DAG.getUNDEF (N->getValueType (0 ));
728
+ DAG.getContext ()->emitError (" do not know how to soften fpowi to fpow" );
729
+ if (IsStrict)
730
+ ReplaceValueWith (SDValue (N, 1 ), N->getOperand (0 ));
731
+ return DAG.getPOISON (NVT);
732
732
}
733
733
734
734
if (DAG.getLibInfo ().getIntSize () !=
735
735
N->getOperand (1 + Offset).getValueType ().getSizeInBits ()) {
736
736
// If the exponent does not match with sizeof(int) a libcall to RTLIB::POWI
737
737
// would use the wrong type for the argument.
738
- DAG.getContext ()->emitError (" POWI exponent does not match sizeof(int)" );
739
- return DAG.getUNDEF (N->getValueType (0 ));
738
+ DAG.getContext ()->emitError (" powi exponent does not match sizeof(int)" );
739
+ if (IsStrict)
740
+ ReplaceValueWith (SDValue (N, 1 ), N->getOperand (0 ));
741
+ return DAG.getPOISON (NVT);
740
742
}
741
743
742
- EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), N->getValueType (0 ));
743
744
SDValue Ops[2 ] = { GetSoftenedFloat (N->getOperand (0 + Offset)),
744
745
N->getOperand (1 + Offset) };
745
746
SDValue Chain = IsStrict ? N->getOperand (0 ) : SDValue ();
0 commit comments