-SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) {
- assert(N->getOperand(0).getValueType() == MVT::ppcf128 &&
- "Unsupported FP_TO_UINT!");
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- switch (N->getValueType(0).getSimpleVT()) {
- default:
- assert(false && "Unsupported FP_TO_UINT!");
- case MVT::i32:
- LC = RTLIB::FPTOUINT_PPCF128_I32;
- break;
- case MVT::i64:
- LC = RTLIB::FPTOUINT_PPCF128_I64;
- break;
- case MVT::i128:
- LC = RTLIB::FPTOUINT_PPCF128_I128;
- break;
- }
-
- return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false);
-}
-
-SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(SDNode *N) {
- assert(N->getOperand(0).getValueType() == MVT::ppcf128 &&
- "Unsupported FP_TO_SINT!");
-
- RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- switch (N->getValueType(0).getSimpleVT()) {
- default:
- assert(false && "Unsupported FP_TO_SINT!");
- case MVT::i32:
- LC = RTLIB::FPTOSINT_PPCF128_I32;
- case MVT::i64:
- LC = RTLIB::FPTOSINT_PPCF128_I64;
- break;
- case MVT::i128:
- LC = RTLIB::FPTOSINT_PPCF128_I64;
- break;
- }
-
- return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false);
-}
-
-SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_ROUND(SDNode *N) {
- assert(N->getOperand(0).getValueType() == MVT::ppcf128 &&
- "Logic only correct for ppcf128!");
- SDOperand Lo, Hi;
- GetExpandedFloat(N->getOperand(0), Lo, Hi);
- // Round it the rest of the way (e.g. to f32) if needed.
- return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Hi, N->getOperand(1));
-}
-
-SDOperand DAGTypeLegalizer::ExpandFloatOp_STORE(SDNode *N, unsigned OpNo) {