[PATCH] D12969: Don't raise inexact when lowering ceil, floor, round, trunc

Steve Canon via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 10:45:05 PDT 2015

scanon added a comment.

In http://reviews.llvm.org/D12969#250004, @t.p.northover wrote:

> Sorry for only bringing this up now, but this doesn't look right. I think if an FRINTX does get created it probably should be treated specially. You'd mostly only do so (by calling "rint") if you actually cared about the otherwise unmodeled FPSR flags, wouldn't you?

On x86 rint( ) is often just the fastest portable way to get round-to-nearest integer (assuming default rounding is set), so it's mostly used for that purpose, not because the caller is necessarily interested in the flags.

We don't handle FPSR like this anywhere else, so it doesn't seem like we should give it special attention here either.  While I'd like to eventually model floating-point flags correctly, I don't think it's important that we go out of our way to add fake side-effects to one instruction in isolation.


More information about the llvm-commits mailing list