gccint: Soft float library routines
1
1 4.2 Routines for floating point emulation
1 =========================================
1
1 The software floating point library is used on machines which do not
1 have hardware support for floating point. It is also used whenever
1 '-msoft-float' is used to disable generation of floating point
1 instructions. (Not all targets support this switch.)
1
1 For compatibility with other compilers, the floating point emulation
11 routines can be renamed with the 'DECLARE_LIBRARY_RENAMES' macro (⇒
Library Calls). In this section, the default names are used.
1
1 Presently the library does not support 'XFmode', which is used for
1 'long double' on some architectures.
1
1 4.2.1 Arithmetic functions
1 --------------------------
1
1 -- Runtime Function: float __addsf3 (float A, float B)
1 -- Runtime Function: double __adddf3 (double A, double B)
1 -- Runtime Function: long double __addtf3 (long double A, long double
1 B)
1 -- Runtime Function: long double __addxf3 (long double A, long double
1 B)
1 These functions return the sum of A and B.
1
1 -- Runtime Function: float __subsf3 (float A, float B)
1 -- Runtime Function: double __subdf3 (double A, double B)
1 -- Runtime Function: long double __subtf3 (long double A, long double
1 B)
1 -- Runtime Function: long double __subxf3 (long double A, long double
1 B)
1 These functions return the difference between B and A; that is,
1 A - B.
1
1 -- Runtime Function: float __mulsf3 (float A, float B)
1 -- Runtime Function: double __muldf3 (double A, double B)
1 -- Runtime Function: long double __multf3 (long double A, long double
1 B)
1 -- Runtime Function: long double __mulxf3 (long double A, long double
1 B)
1 These functions return the product of A and B.
1
1 -- Runtime Function: float __divsf3 (float A, float B)
1 -- Runtime Function: double __divdf3 (double A, double B)
1 -- Runtime Function: long double __divtf3 (long double A, long double
1 B)
1 -- Runtime Function: long double __divxf3 (long double A, long double
1 B)
1 These functions return the quotient of A and B; that is, A / B.
1
1 -- Runtime Function: float __negsf2 (float A)
1 -- Runtime Function: double __negdf2 (double A)
1 -- Runtime Function: long double __negtf2 (long double A)
1 -- Runtime Function: long double __negxf2 (long double A)
1 These functions return the negation of A. They simply flip the
1 sign bit, so they can produce negative zero and negative NaN.
1
1 4.2.2 Conversion functions
1 --------------------------
1
1 -- Runtime Function: double __extendsfdf2 (float A)
1 -- Runtime Function: long double __extendsftf2 (float A)
1 -- Runtime Function: long double __extendsfxf2 (float A)
1 -- Runtime Function: long double __extenddftf2 (double A)
1 -- Runtime Function: long double __extenddfxf2 (double A)
1 These functions extend A to the wider mode of their return type.
1
1 -- Runtime Function: double __truncxfdf2 (long double A)
1 -- Runtime Function: double __trunctfdf2 (long double A)
1 -- Runtime Function: float __truncxfsf2 (long double A)
1 -- Runtime Function: float __trunctfsf2 (long double A)
1 -- Runtime Function: float __truncdfsf2 (double A)
1 These functions truncate A to the narrower mode of their return
1 type, rounding toward zero.
1
1 -- Runtime Function: int __fixsfsi (float A)
1 -- Runtime Function: int __fixdfsi (double A)
1 -- Runtime Function: int __fixtfsi (long double A)
1 -- Runtime Function: int __fixxfsi (long double A)
1 These functions convert A to a signed integer, rounding toward
1 zero.
1
1 -- Runtime Function: long __fixsfdi (float A)
1 -- Runtime Function: long __fixdfdi (double A)
1 -- Runtime Function: long __fixtfdi (long double A)
1 -- Runtime Function: long __fixxfdi (long double A)
1 These functions convert A to a signed long, rounding toward zero.
1
1 -- Runtime Function: long long __fixsfti (float A)
1 -- Runtime Function: long long __fixdfti (double A)
1 -- Runtime Function: long long __fixtfti (long double A)
1 -- Runtime Function: long long __fixxfti (long double A)
1 These functions convert A to a signed long long, rounding toward
1 zero.
1
1 -- Runtime Function: unsigned int __fixunssfsi (float A)
1 -- Runtime Function: unsigned int __fixunsdfsi (double A)
1 -- Runtime Function: unsigned int __fixunstfsi (long double A)
1 -- Runtime Function: unsigned int __fixunsxfsi (long double A)
1 These functions convert A to an unsigned integer, rounding toward
1 zero. Negative values all become zero.
1
1 -- Runtime Function: unsigned long __fixunssfdi (float A)
1 -- Runtime Function: unsigned long __fixunsdfdi (double A)
1 -- Runtime Function: unsigned long __fixunstfdi (long double A)
1 -- Runtime Function: unsigned long __fixunsxfdi (long double A)
1 These functions convert A to an unsigned long, rounding toward
1 zero. Negative values all become zero.
1
1 -- Runtime Function: unsigned long long __fixunssfti (float A)
1 -- Runtime Function: unsigned long long __fixunsdfti (double A)
1 -- Runtime Function: unsigned long long __fixunstfti (long double A)
1 -- Runtime Function: unsigned long long __fixunsxfti (long double A)
1 These functions convert A to an unsigned long long, rounding toward
1 zero. Negative values all become zero.
1
1 -- Runtime Function: float __floatsisf (int I)
1 -- Runtime Function: double __floatsidf (int I)
1 -- Runtime Function: long double __floatsitf (int I)
1 -- Runtime Function: long double __floatsixf (int I)
1 These functions convert I, a signed integer, to floating point.
1
1 -- Runtime Function: float __floatdisf (long I)
1 -- Runtime Function: double __floatdidf (long I)
1 -- Runtime Function: long double __floatditf (long I)
1 -- Runtime Function: long double __floatdixf (long I)
1 These functions convert I, a signed long, to floating point.
1
1 -- Runtime Function: float __floattisf (long long I)
1 -- Runtime Function: double __floattidf (long long I)
1 -- Runtime Function: long double __floattitf (long long I)
1 -- Runtime Function: long double __floattixf (long long I)
1 These functions convert I, a signed long long, to floating point.
1
1 -- Runtime Function: float __floatunsisf (unsigned int I)
1 -- Runtime Function: double __floatunsidf (unsigned int I)
1 -- Runtime Function: long double __floatunsitf (unsigned int I)
1 -- Runtime Function: long double __floatunsixf (unsigned int I)
1 These functions convert I, an unsigned integer, to floating point.
1
1 -- Runtime Function: float __floatundisf (unsigned long I)
1 -- Runtime Function: double __floatundidf (unsigned long I)
1 -- Runtime Function: long double __floatunditf (unsigned long I)
1 -- Runtime Function: long double __floatundixf (unsigned long I)
1 These functions convert I, an unsigned long, to floating point.
1
1 -- Runtime Function: float __floatuntisf (unsigned long long I)
1 -- Runtime Function: double __floatuntidf (unsigned long long I)
1 -- Runtime Function: long double __floatuntitf (unsigned long long I)
1 -- Runtime Function: long double __floatuntixf (unsigned long long I)
1 These functions convert I, an unsigned long long, to floating
1 point.
1
1 4.2.3 Comparison functions
1 --------------------------
1
1 There are two sets of basic comparison functions.
1
1 -- Runtime Function: int __cmpsf2 (float A, float B)
1 -- Runtime Function: int __cmpdf2 (double A, double B)
1 -- Runtime Function: int __cmptf2 (long double A, long double B)
1 These functions calculate a <=> b. That is, if A is less than B,
1 they return -1; if A is greater than B, they return 1; and if A and
1 B are equal they return 0. If either argument is NaN they return
1 1, but you should not rely on this; if NaN is a possibility, use
1 one of the higher-level comparison functions.
1
1 -- Runtime Function: int __unordsf2 (float A, float B)
1 -- Runtime Function: int __unorddf2 (double A, double B)
1 -- Runtime Function: int __unordtf2 (long double A, long double B)
1 These functions return a nonzero value if either argument is NaN,
1 otherwise 0.
1
1 There is also a complete group of higher level functions which
1 correspond directly to comparison operators. They implement the ISO C
1 semantics for floating-point comparisons, taking NaN into account. Pay
1 careful attention to the return values defined for each set. Under the
1 hood, all of these routines are implemented as
1
1 if (__unordXf2 (a, b))
1 return E;
1 return __cmpXf2 (a, b);
1
1 where E is a constant chosen to give the proper behavior for NaN. Thus,
1 the meaning of the return value is different for each set. Do not rely
1 on this implementation; only the semantics documented below are
1 guaranteed.
1
1 -- Runtime Function: int __eqsf2 (float A, float B)
1 -- Runtime Function: int __eqdf2 (double A, double B)
1 -- Runtime Function: int __eqtf2 (long double A, long double B)
1 These functions return zero if neither argument is NaN, and A and B
1 are equal.
1
1 -- Runtime Function: int __nesf2 (float A, float B)
1 -- Runtime Function: int __nedf2 (double A, double B)
1 -- Runtime Function: int __netf2 (long double A, long double B)
1 These functions return a nonzero value if either argument is NaN,
1 or if A and B are unequal.
1
1 -- Runtime Function: int __gesf2 (float A, float B)
1 -- Runtime Function: int __gedf2 (double A, double B)
1 -- Runtime Function: int __getf2 (long double A, long double B)
1 These functions return a value greater than or equal to zero if
1 neither argument is NaN, and A is greater than or equal to B.
1
1 -- Runtime Function: int __ltsf2 (float A, float B)
1 -- Runtime Function: int __ltdf2 (double A, double B)
1 -- Runtime Function: int __lttf2 (long double A, long double B)
1 These functions return a value less than zero if neither argument
1 is NaN, and A is strictly less than B.
1
1 -- Runtime Function: int __lesf2 (float A, float B)
1 -- Runtime Function: int __ledf2 (double A, double B)
1 -- Runtime Function: int __letf2 (long double A, long double B)
1 These functions return a value less than or equal to zero if
1 neither argument is NaN, and A is less than or equal to B.
1
1 -- Runtime Function: int __gtsf2 (float A, float B)
1 -- Runtime Function: int __gtdf2 (double A, double B)
1 -- Runtime Function: int __gttf2 (long double A, long double B)
1 These functions return a value greater than zero if neither
1 argument is NaN, and A is strictly greater than B.
1
1 4.2.4 Other floating-point functions
1 ------------------------------------
1
1 -- Runtime Function: float __powisf2 (float A, int B)
1 -- Runtime Function: double __powidf2 (double A, int B)
1 -- Runtime Function: long double __powitf2 (long double A, int B)
1 -- Runtime Function: long double __powixf2 (long double A, int B)
1 These functions convert raise A to the power B.
1
1 -- Runtime Function: complex float __mulsc3 (float A, float B, float C,
1 float D)
1 -- Runtime Function: complex double __muldc3 (double A, double B,
1 double C, double D)
1 -- Runtime Function: complex long double __multc3 (long double A, long
1 double B, long double C, long double D)
1 -- Runtime Function: complex long double __mulxc3 (long double A, long
1 double B, long double C, long double D)
1 These functions return the product of A + iB and C + iD, following
1 the rules of C99 Annex G.
1
1 -- Runtime Function: complex float __divsc3 (float A, float B, float C,
1 float D)
1 -- Runtime Function: complex double __divdc3 (double A, double B,
1 double C, double D)
1 -- Runtime Function: complex long double __divtc3 (long double A, long
1 double B, long double C, long double D)
1 -- Runtime Function: complex long double __divxc3 (long double A, long
1 double B, long double C, long double D)
1 These functions return the quotient of A + iB and C + iD (i.e., (A
1 + iB) / (C + iD)), following the rules of C99 Annex G.
1