uitofp and sitofp rounding mode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

uitofp and sitofp rounding mode

Jay Foad-2
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.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: uitofp and sitofp rounding mode

Eli Friedman-2
On Wed, Jul 24, 2013 at 4:03 AM, Jay Foad <[hidden email]> 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
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: uitofp and sitofp rounding mode

Owen Anderson-2

On Jul 24, 2013, at 12:00 PM, Eli Friedman <[hidden email]> wrote:

> On Wed, Jul 24, 2013 at 4:03 AM, Jay Foad <[hidden email]> 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
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev