rounding mode

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.