[llvm] r299247 - Do not translate rint into nearbyint, but truncate it like nearbyint.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 1 09:25:23 PDT 2017


On Fri, Mar 31, 2017 at 08:10:33PM -0700, Davide Italiano wrote:
> On Fri, Mar 31, 2017 at 12:58 PM, Joerg Sonnenberger via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: joerg
> > Date: Fri Mar 31 14:58:07 2017
> > New Revision: 299247
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=299247&view=rev
> > Log:
> > Do not translate rint into nearbyint, but truncate it like nearbyint.
> >
> 
> I think Eli pointed out this already in the past, but aren't
> llvm.rint()/llvm.nearbyint() equal and should we remove rint until we
> have a better story for FP exception modeling?

Please see the discussion in phab: they are not equal as one is allowed
to raise exceptions and the other not. In practise this means that at
least software implementations of nearbyint tend to wrap rint with
exception glue. That's the original motivation for the change -- it
breaks BSD libm builds and pessimizes code in general.

Joerg


More information about the llvm-commits mailing list