[llvm-dev] Should rint and nearbyint be always constrained?

Stephen Canon via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 5 08:29:11 PST 2020

> On Mar 3, 2020, at 12:59 PM, Serge Pavlov via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> One concern with replacing llvm.rint and llvm.nearbyint with llvm.roundeven makes it difficult to turn back into a libcall if the backend doesn't have an instruction for it. You can't just call the roundeven library function since that wouldn't exist in older libm implementations. So ideally you would know which function was originally used in the user code and call that.

You can turn it into a libcall to nearbyint (or lower to an instruction that does the operation), since you’re in a context where you’re allowed to assume the rounding mode is default.

– Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200305/349ffe5a/attachment.html>

More information about the llvm-dev mailing list