[PATCH] D14067: [FPEnv Core 02/14] Add FPEnv access flags to fast-math flags

Sergey Dmitrouk via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 09:04:46 PDT 2015


sdmitrouk added a comment.

In http://reviews.llvm.org/D14067#275220, @majnemer wrote:

> I'd like to propose a mildly different design; I'd phrase the two flags using a positive perspective:
>
> - `nexc`: Assume that floating-point exceptions are not relevant.
> - `nrnd`: Assume that the rounding-mode is round-to-nearest (ties even).
>
>   This has the nice property that `fast` is the union of all flags and, in general, keeps things consistent with all the other fast math flags.  The general pattern is that adding flags permits further optimization; places where this is violated have been a wellspring of bugs (namely `volatile`).
>
>   Older bitcode would have to be auto-upgraded to add those flags onto older instructions.


There is a compatibility issue. `kexc` and `kround` can be added when they are needed leaving regular behaviour for cases where these flags are not specified, they also have property of having all fast-math flags unset by default. Combination of `nexc` and `nrnd` flags corresponds to current behaviour and all new code that wants folding will need to include these flags explicitly. Or is this what you mean by saying `Older bitcode would have to be auto-upgraded to add those flags onto older instructions.`?


Repository:
  rL LLVM

http://reviews.llvm.org/D14067





More information about the llvm-commits mailing list