|Non-Confidential||PDF version||ARM DUI0475M|
|Home > Floating-point Support > The software floating-point library, fplib > Calling fplib routines|
Floating-point routines have names like
__aeabi_dadd (add two
__aeabi_fdiv (divide two
floats). User programs can call these routines directly.
Even in environments with a coprocessor, the routines are provided. They are typically only a few instructions long because all they do is execute the appropriate coprocessor instruction.
All the fplib routines are called using a software floating-point variant of the calling standard. This means that floating-point arguments are passed and returned in integer registers. By contrast, if the program is compiled for a coprocessor, floating-point data is passed in its floating-point registers.
So, for example,
__aeabi_dadd takes a
r1, and another
double in registers
and returns the sum in
r1, the register that holds the high 32 bits of the
doubledepends on whether your program is little-endian or big-endian.
Software floating-point library routines are declared in one of two header files:
To call a function from assembler, the software floating-point
function is named
example, to call the
nextafter() function, implement
the following code:
IMPORT nextafter BL nextafter