mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Add hooks for other intrinsics to get low-precision expansions.
llvm-svn: 55845
This commit is contained in:
parent
0be4bca4b6
commit
116163ab21
@ -2753,6 +2753,58 @@ SelectionDAGLowering::implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// visitExp - lower an exp intrinsic. Handles the special sequences
|
||||||
|
/// for limited-precision mode.
|
||||||
|
|
||||||
|
void
|
||||||
|
SelectionDAGLowering::visitExp(CallInst &I) {
|
||||||
|
SDValue result;
|
||||||
|
// No special expansion.
|
||||||
|
result = DAG.getNode(ISD::FEXP,
|
||||||
|
getValue(I.getOperand(1)).getValueType(),
|
||||||
|
getValue(I.getOperand(1)));
|
||||||
|
setValue(&I, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// visitLog - lower a log intrinsic. Handles the special sequences
|
||||||
|
/// for limited-precision mode.
|
||||||
|
|
||||||
|
void
|
||||||
|
SelectionDAGLowering::visitLog(CallInst &I) {
|
||||||
|
SDValue result;
|
||||||
|
// No special expansion.
|
||||||
|
result = DAG.getNode(ISD::FLOG,
|
||||||
|
getValue(I.getOperand(1)).getValueType(),
|
||||||
|
getValue(I.getOperand(1)));
|
||||||
|
setValue(&I, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// visitLog2 - lower a log2 intrinsic. Handles the special sequences
|
||||||
|
/// for limited-precision mode.
|
||||||
|
|
||||||
|
void
|
||||||
|
SelectionDAGLowering::visitLog2(CallInst &I) {
|
||||||
|
SDValue result;
|
||||||
|
// No special expansion.
|
||||||
|
result = DAG.getNode(ISD::FLOG2,
|
||||||
|
getValue(I.getOperand(1)).getValueType(),
|
||||||
|
getValue(I.getOperand(1)));
|
||||||
|
setValue(&I, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// visitLog10 - lower a log10 intrinsic. Handles the special sequences
|
||||||
|
/// for limited-precision mode.
|
||||||
|
|
||||||
|
void
|
||||||
|
SelectionDAGLowering::visitLog10(CallInst &I) {
|
||||||
|
SDValue result;
|
||||||
|
// No special expansion.
|
||||||
|
result = DAG.getNode(ISD::FLOG10,
|
||||||
|
getValue(I.getOperand(1)).getValueType(),
|
||||||
|
getValue(I.getOperand(1)));
|
||||||
|
setValue(&I, result);
|
||||||
|
}
|
||||||
|
|
||||||
/// visitExp2 - lower an exp2 intrinsic. Handles the special sequences
|
/// visitExp2 - lower an exp2 intrinsic. Handles the special sequences
|
||||||
/// for limited-precision mode.
|
/// for limited-precision mode.
|
||||||
|
|
||||||
@ -3071,24 +3123,16 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
getValue(I.getOperand(1))));
|
getValue(I.getOperand(1))));
|
||||||
return 0;
|
return 0;
|
||||||
case Intrinsic::log:
|
case Intrinsic::log:
|
||||||
setValue(&I, DAG.getNode(ISD::FLOG,
|
visitLog(I);
|
||||||
getValue(I.getOperand(1)).getValueType(),
|
|
||||||
getValue(I.getOperand(1))));
|
|
||||||
return 0;
|
return 0;
|
||||||
case Intrinsic::log2:
|
case Intrinsic::log2:
|
||||||
setValue(&I, DAG.getNode(ISD::FLOG2,
|
visitLog2(I);
|
||||||
getValue(I.getOperand(1)).getValueType(),
|
|
||||||
getValue(I.getOperand(1))));
|
|
||||||
return 0;
|
return 0;
|
||||||
case Intrinsic::log10:
|
case Intrinsic::log10:
|
||||||
setValue(&I, DAG.getNode(ISD::FLOG10,
|
visitLog10(I);
|
||||||
getValue(I.getOperand(1)).getValueType(),
|
|
||||||
getValue(I.getOperand(1))));
|
|
||||||
return 0;
|
return 0;
|
||||||
case Intrinsic::exp:
|
case Intrinsic::exp:
|
||||||
setValue(&I, DAG.getNode(ISD::FEXP,
|
visitExp(I);
|
||||||
getValue(I.getOperand(1)).getValueType(),
|
|
||||||
getValue(I.getOperand(1))));
|
|
||||||
return 0;
|
return 0;
|
||||||
case Intrinsic::exp2:
|
case Intrinsic::exp2:
|
||||||
visitExp2(I);
|
visitExp2(I);
|
||||||
|
@ -506,6 +506,10 @@ private:
|
|||||||
void visitTargetIntrinsic(CallInst &I, unsigned Intrinsic);
|
void visitTargetIntrinsic(CallInst &I, unsigned Intrinsic);
|
||||||
|
|
||||||
void visitExp2(CallInst &I);
|
void visitExp2(CallInst &I);
|
||||||
|
void visitExp(CallInst &I);
|
||||||
|
void visitLog(CallInst &I);
|
||||||
|
void visitLog2(CallInst &I);
|
||||||
|
void visitLog10(CallInst &I);
|
||||||
|
|
||||||
void visitVAStart(CallInst &I);
|
void visitVAStart(CallInst &I);
|
||||||
void visitVAArg(VAArgInst &I);
|
void visitVAArg(VAArgInst &I);
|
||||||
|
Loading…
Reference in New Issue
Block a user