[PATCH] D31533: Do not translate rint into nearbyint, but truncate it like nearbyint

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 11:34:45 PDT 2017


scanon added a comment.

In https://reviews.llvm.org/D31533#715623, @efriedma wrote:

> If rint() is faster than nearbyint(), should we canonicalize nearbyint()->rint()?


nearbyint( ) is not allowed to raise inexact. rint( ) is. Replacing nearbyint( ) with rint( ) requires that we support the FENV_ACCESS pragma (and only do the transformation when FENV_ACCESS is off).

Also, this is relatively low-value, because on newer platforms there's no difference; e.g. SSE4.1 and armv8 have single instruction implementations for both.


Repository:
  rL LLVM

https://reviews.llvm.org/D31533





More information about the llvm-commits mailing list