rounding mode

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

rounding mode

Chuck Rose III

Hello LLVMers,

 

A question.  In our system we often go from

 

our-system -> LLVM generated functions -> callback functions in our system

 

Is it the case that we can rely on the rounding mode being the same on both sides of the LLVM generated functions or can generated functions change the rounding mode and not restore it prior to calling another function which may or may not be one generated via LLVM?  In our system, all our APFloats use the default rounding mode.

 

Thanks,

Chuck.


_______________________________________________
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: rounding mode

Chris Lattner
On Jun 24, 2008, at 11:58 AM, Chuck Rose III wrote:
Hello LLVMers,
 
A question.  In our system we often go from
 
our-system -> LLVM generated functions -> callback functions in our system
 
Is it the case that we can rely on the rounding mode being the same on both sides of the LLVM generated functions or can generated functions change the rounding mode and not restore it prior to calling another function which may or may not be one generated via LLVM?  In our system, all our APFloats use the default rounding mode.

Hey Chuck,

The rounding mode is part of the platform ABI and LLVM conforms to it.  The ABI specifies that the rounding mode is always set to default on entry/exit of functions.  You can be sure that if llvm changes the rounding mode (e.g. in certain int <-> fp conversions) that it changes it back before calling a function or returning.

-Chris

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev