================ @@ -849,17 +849,46 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_UnaryWithTwoFPResults( SetSoftenedFloat(SDValue(N, ResNum), CreateStackLoad(SlackSlot)); } - return SDValue(); + return true; } SDValue DAGTypeLegalizer::SoftenFloatRes_FSINCOS(SDNode *N) { - return SoftenFloatRes_UnaryWithTwoFPResults( - N, RTLIB::getSINCOS(N->getValueType(0))); + EVT VT = N->getValueType(0); + if (SoftenFloatRes_UnaryWithTwoFPResults(N, RTLIB::getSINCOS(VT))) + return SDValue(); + + // Fall back on softening the separate sin and cos calls if available. + RTLIB::Libcall SinLC = RTLIB::getSIN(VT); + RTLIB::Libcall CosLC = RTLIB::getCOS(VT); + + SDValue SoftSin, SoftCos; + if (!TLI.getLibcallName(SinLC) || !TLI.getLibcallName(CosLC)) { + DAG.getContext()->emitError("do not know how to soften fsincos"); + + EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT); + SoftSin = SoftCos = DAG.getPOISON(NVT); + } else { + SoftSin = SoftenFloatRes_Unary(N, SinLC); + SoftCos = SoftenFloatRes_Unary(N, CosLC); ---------------- arsenm wrote:
The input operand structure is the same and the output doesn't matter, we're managing the 2 results here. https://github.com/llvm/llvm-project/pull/147468 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits