GNU Compiler Collection (GCC) Internals: Soft float library routines |
---|
Next: Decimal float library routines, Previous: Integer library routines, Up: Libgcc [Contents][Index]
The software floating point library is used on machines which do not have hardware support for floating point. It is also used whenever -msoft-float is used to disable generation of floating point instructions. (Not all targets support this switch.)
For compatibility with other compilers, the floating point emulation
routines can be renamed with the DECLARE_LIBRARY_RENAMES
macro
(see Library Calls). In this section, the default names are used.
Presently the library does not support XFmode
, which is used
for long double
on some architectures.
These functions return the sum of a and b.
These functions return the difference between b and a; that is, a - b .
These functions return the product of a and b.
These functions return the quotient of a and b; that is, a / b .
These functions return the negation of a. They simply flip the sign bit, so they can produce negative zero and negative NaN.
These functions extend a to the wider mode of their return type.
These functions truncate a to the narrower mode of their return type, rounding toward zero.
These functions convert a to a signed integer, rounding toward zero.
These functions convert a to a signed long, rounding toward zero.
These functions convert a to a signed long long, rounding toward zero.
These functions convert a to an unsigned integer, rounding toward zero. Negative values all become zero.
These functions convert a to an unsigned long, rounding toward zero. Negative values all become zero.
These functions convert a to an unsigned long long, rounding toward zero. Negative values all become zero.
These functions convert i, a signed integer, to floating point.
These functions convert i, a signed long, to floating point.
These functions convert i, a signed long long, to floating point.
These functions convert i, an unsigned integer, to floating point.
These functions convert i, an unsigned long, to floating point.
These functions convert i, an unsigned long long, to floating point.
There are two sets of basic comparison functions.
These functions calculate a <=> b. That is, if a is less than b, they return -1; if a is greater than b, they return 1; and if a and b are equal they return 0. If either argument is NaN they return 1, but you should not rely on this; if NaN is a possibility, use one of the higher-level comparison functions.
These functions return a nonzero value if either argument is NaN, otherwise 0.
There is also a complete group of higher level functions which correspond directly to comparison operators. They implement the ISO C semantics for floating-point comparisons, taking NaN into account. Pay careful attention to the return values defined for each set. Under the hood, all of these routines are implemented as
if (__unordXf2 (a, b)) return E; return __cmpXf2 (a, b);
where E is a constant chosen to give the proper behavior for NaN. Thus, the meaning of the return value is different for each set. Do not rely on this implementation; only the semantics documented below are guaranteed.
These functions return zero if neither argument is NaN, and a and b are equal.
These functions return a nonzero value if either argument is NaN, or if a and b are unequal.
These functions return a value greater than or equal to zero if neither argument is NaN, and a is greater than or equal to b.
These functions return a value less than zero if neither argument is NaN, and a is strictly less than b.
These functions return a value less than or equal to zero if neither argument is NaN, and a is less than or equal to b.
These functions return a value greater than zero if neither argument is NaN, and a is strictly greater than b.
These functions convert raise a to the power b.
These functions return the product of a + ib and c + id , following the rules of C99 Annex G.
These functions return the quotient of a + ib and c + id (i.e., (a + ib) / (c + id)), following the rules of C99 Annex G.
Next: Decimal float library routines, Previous: Integer library routines, Up: Libgcc [Contents][Index]