[PATCH] D54749: Saturating float to int casts: Basics [1/n]

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 12:29:47 PDT 2020


nikic added a comment.

In D54749#2218724 <https://reviews.llvm.org/D54749#2218724>, @efriedma wrote:

>> Finally, something worth mentioning is that the legalization implemented here is not compatible with trapping fptoi (at least one of the expansions isn't). I don't believe trapping fptoi's are actually legal per langref, but I've also seen people adjust x86 fptoi lowering to work with trapping fptoi at some point, so I'm a bit confused on what the state here is.
>
> The fptosi instruction doesn't have side-effects.  llvm.experimental.constrained.fptosi can raise floating-point exceptions.  I'm not sure anyone has looked at actually trapping.

Thanks for the clarification. The changes I vaguely remembered here were apparently D53794 <https://reviews.llvm.org/D53794> and D67105 <https://reviews.llvm.org/D67105>, which were indeed related to FPEs. I presume it is not a problem if saturating fptoi causes FPEs as part of normal operation?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54749/new/

https://reviews.llvm.org/D54749



More information about the llvm-commits mailing list