PPC: Map frin to round() not nearbyint() and rint()
authorHal Finkel <hfinkel@anl.gov>
Thu, 8 Aug 2013 04:31:34 +0000 (04:31 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 8 Aug 2013 04:31:34 +0000 (04:31 +0000)
commit05a4d2642b415e3332651733015b656bc3c7b9bc
treedc98d38fad5211ccd39659ff641addbed87c2e36
parent9706d43b56e16eb3029314e02c499305284e99f1
PPC: Map frin to round() not nearbyint() and rint()

Making use of the recently-added ISD::FROUND, which allows for custom lowering
of round(), the PPC backend will now map frin to round(). Previously, we had
been using frin to lower nearbyint() (and rint() via some custom lowering to
handle the extra fenv flags requirements), but only in fast-math mode because
frin does not tie-to-even. Several users had complained about this behavior,
and this new mapping of frin to round is certainly more appropriate (and does
not require fast-math mode).

In effect, this reverts r178362 (and part of r178337, replacing the nearbyint
mapping with the round mapping).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187960 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrInfo.td
test/CodeGen/PowerPC/rounding-ops.ll