diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-08-07 22:49:12 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-08-07 22:49:12 +0000 |
commit | 171817ee8ae888d595734a1b911d77dfa235ec9e (patch) | |
tree | 75c05d10cf1b0a9cb2417b4b6119abd66b0383b4 /llvm/lib/CodeGen/BasicTargetTransformInfo.cpp | |
parent | c377275a4a0ac50671f6eb2e1927a5a9be262153 (diff) | |
download | bcm5719-llvm-171817ee8ae888d595734a1b911d77dfa235ec9e.tar.gz bcm5719-llvm-171817ee8ae888d595734a1b911d77dfa235ec9e.zip |
Add ISD::FROUND for libm round()
All libm floating-point rounding functions, except for round(), had their own
ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm
adding ISD::FROUND so that round() can be custom lowered as well.
For the most part, this is straightforward. I've added an intrinsic
and a matching ISD node just like those for nearbyint() and friends. The
SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed
fround).
This will be used by the PowerPC backend in a follow-up commit.
llvm-svn: 187926
Diffstat (limited to 'llvm/lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BasicTargetTransformInfo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp index b48b81767ee..ef532357c5c 100644 --- a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp +++ b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp @@ -449,6 +449,7 @@ unsigned BasicTTI::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, case Intrinsic::nearbyint: ISD = ISD::FNEARBYINT; break; case Intrinsic::rint: ISD = ISD::FRINT; break; + case Intrinsic::round: ISD = ISD::FROUND; break; case Intrinsic::pow: ISD = ISD::FPOW; break; case Intrinsic::fma: ISD = ISD::FMA; break; case Intrinsic::fmuladd: ISD = ISD::FMA; break; // FIXME: mul + add? |