[LLVMdev] uitofp and sitofp rounding mode

Owen Anderson resistor at mac.com
Wed Jul 24 12:05:21 PDT 2013


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



More information about the llvm-dev mailing list