Chris Lattner
2010-Jul-13 19:43 UTC
[LLVMdev] Proposal for adding rounding variant of fpto?i instructions
On Jul 12, 2010, at 9:28 AM, Anton Lokhmotov wrote:> Hi Peter, > >> I would appreciate comments/feedback on this proposal to extend the >> fpto?i instructions to support rounding. > I think this might be useful. Actually, LLVM specifies that fpto?i convert > their operand into the nearest (rounding towards zero) signed integer value. > Do you have other rounding modes in mind? Currently I use custom metadata to > represent conversions with other rounding modes.My high level thought on this is that it would be great to have, but is a major new feature. In addition to adding rounding mode selection to fpto?i, we should add it to all the rest of the fp operators. We also want to eventually add support for the optimizer to know that the user is messing around with rounding modes (which needs to disable inexact constant folding and other optimizations) as well. Modeling this properly will require some fairly substantial changes throughout the compiler similar to when NUW/NSW were added on the integer side. -Chris
Possibly Parallel Threads
- [LLVMdev] Proposal for adding rounding variant of fpto?i instructions
- [LLVMdev] Proposal for adding rounding variant of fpto?i instructions
- [cfe-dev] Why is #pragma STDC FENV_ACCESS not supported?
- [LLVMdev] [cfe-dev] Proposal: floating point accuracy metadata (OpenCL related)
- Should rint and nearbyint be always constrained?