mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-24 03:25:00 +00:00
Softfloat support for FDIV. Patch by
Richard Pennington. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f8ac645c59
commit
c3e26727c1
@ -61,6 +61,7 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
|
||||
break;
|
||||
case ISD::FADD: R = SoftenFloatRes_FADD(N); break;
|
||||
case ISD::FCOPYSIGN: R = SoftenFloatRes_FCOPYSIGN(N); break;
|
||||
case ISD::FDIV: R = SoftenFloatRes_FDIV(N); break;
|
||||
case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break;
|
||||
case ISD::FP_EXTEND: R = SoftenFloatRes_FP_EXTEND(N); break;
|
||||
case ISD::FP_ROUND: R = SoftenFloatRes_FP_ROUND(N); break;
|
||||
@ -146,6 +147,18 @@ SDOperand DAGTypeLegalizer::SoftenFloatRes_FCOPYSIGN(SDNode *N) {
|
||||
return DAG.getNode(ISD::OR, LVT, LHS, SignBit);
|
||||
}
|
||||
|
||||
SDOperand DAGTypeLegalizer::SoftenFloatRes_FDIV(SDNode *N) {
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)),
|
||||
GetSoftenedFloat(N->getOperand(1)) };
|
||||
return MakeLibCall(GetFPLibCall(N->getValueType(0),
|
||||
RTLIB::DIV_F32,
|
||||
RTLIB::DIV_F64,
|
||||
RTLIB::DIV_F80,
|
||||
RTLIB::DIV_PPCF128),
|
||||
NVT, Ops, 2, false);
|
||||
}
|
||||
|
||||
SDOperand DAGTypeLegalizer::SoftenFloatRes_FMUL(SDNode *N) {
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)),
|
||||
|
@ -336,6 +336,7 @@ private:
|
||||
SDOperand SoftenFloatRes_ConstantFP(ConstantFPSDNode *N);
|
||||
SDOperand SoftenFloatRes_FADD(SDNode *N);
|
||||
SDOperand SoftenFloatRes_FCOPYSIGN(SDNode *N);
|
||||
SDOperand SoftenFloatRes_FDIV(SDNode *N);
|
||||
SDOperand SoftenFloatRes_FMUL(SDNode *N);
|
||||
SDOperand SoftenFloatRes_FP_EXTEND(SDNode *N);
|
||||
SDOperand SoftenFloatRes_FP_ROUND(SDNode *N);
|
||||
|
6
test/CodeGen/ARM/2008-07-17-Fdiv.ll
Normal file
6
test/CodeGen/ARM/2008-07-17-Fdiv.ll
Normal file
@ -0,0 +1,6 @@
|
||||
; RUN: llvm-as < %s | llc -march=arm
|
||||
|
||||
define float @f(float %a, float %b) nounwind {
|
||||
%tmp = fdiv float %a, %b
|
||||
ret float %tmp
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user