When the uitofp and sitofp instructions convert e.g. from i64 to float, what rounding mode do they use? Answers in the form a patch to LangRef.html would be great! Thanks, Jay.
On Wed, Jul 24, 2013 at 4:03 AM, Jay Foad <jay.foad at gmail.com> wrote:> When the uitofp and sitofp instructions convert e.g. from i64 to > float, what rounding mode do they use? Answers in the form a patch to > LangRef.html would be great!The default rounding mode, just like every other floating-point operation. -Eli
On Jul 24, 2013, at 12:00 PM, Eli Friedman <eli.friedman at gmail.com> wrote:> On Wed, Jul 24, 2013 at 4:03 AM, Jay Foad <jay.foad at gmail.com> wrote: >> When the uitofp and sitofp instructions convert e.g. from i64 to >> float, what rounding mode do they use? Answers in the form a patch to >> LangRef.html would be great! > > The default rounding mode, just like every other floating-point operation.Except, of course, that the default rounding mode for an FP->integer conversion is different than the default rounding mode on, say, an FADD. FP->integer conversions are round-to-zero, while FP arithmetic operations are round-nearest-ties-to-even. --Owen
Possibly Parallel Threads
- [LLVMdev] uitofp and sitofp rounding mode
- [LLVMdev] convert integer to double "uitofp" or "sitofp" ?
- [LLVMdev] PTX backend do not support sitofp instruction?
- [LLVMdev] PTX backend do not support sitofp instruction?
- [LLVMdev] Reference Manual Clarifications 2