LegalizeTypes support for powi soft float.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53285 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2008-07-09 11:11:47 +00:00
parent ddc7aa3417
commit 851b1ee83f
2 changed files with 16 additions and 3 deletions

View File

@ -71,9 +71,10 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
case ISD::SINT_TO_FP:
case ISD::UINT_TO_FP: R = SoftenFloatRes_XINT_TO_FP(N); break;
case ISD::FADD: R = SoftenFloatRes_FADD(N); break;
case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break;
case ISD::FSUB: R = SoftenFloatRes_FSUB(N); break;
case ISD::FADD: R = SoftenFloatRes_FADD(N); break;
case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break;
case ISD::FPOWI: R = SoftenFloatRes_FPOWI(N); break;
case ISD::FSUB: R = SoftenFloatRes_FSUB(N); break;
}
// If R is null, the sub-method took care of registering the result.
@ -201,6 +202,17 @@ SDOperand DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) {
return MakeLibCall(LC, NVT, &Op, 1, false);
}
SDOperand DAGTypeLegalizer::SoftenFloatRes_FPOWI(SDNode *N) {
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)), N->getOperand(1) };
return MakeLibCall(GetFPLibCall(N->getValueType(0),
RTLIB::POWI_F32,
RTLIB::POWI_F64,
RTLIB::POWI_F80,
RTLIB::POWI_PPCF128),
NVT, Ops, 2, false);
}
SDOperand DAGTypeLegalizer::SoftenFloatRes_FSUB(SDNode *N) {
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)),

View File

@ -336,6 +336,7 @@ private:
SDOperand SoftenFloatRes_FMUL(SDNode *N);
SDOperand SoftenFloatRes_FP_EXTEND(SDNode *N);
SDOperand SoftenFloatRes_FP_ROUND(SDNode *N);
SDOperand SoftenFloatRes_FPOWI(SDNode *N);
SDOperand SoftenFloatRes_FSUB(SDNode *N);
SDOperand SoftenFloatRes_LOAD(SDNode *N);
SDOperand SoftenFloatRes_SELECT(SDNode *N);