Floating-point built-ins

Prototype Description
double _Complex __cmplx (double, double) ; Converts two doubles into a complex double value
float _Complex __cmplxf (float, float); Converts two floats into a complex float value
long double _Complex __cmplxl (long double, long double) ; Converts two long doubles into a complex long double value
__complex__ double conj(__complex__ double);
__complex__ float conjf(__complex__ float);
__complex__ long double conjl(__complex__ long double);
double __copysign (double, double); Returns the first argument with its sign changed to the sign of the second argument
double __cos(double);
float cosf(float);
long double cosl(long double);
double __creal(__complex__ double);
float __crealf(__complex__ float);
long double __creall(__complex__ long double);
double __exp(double); Returns the exponential value
double __fabs(double); Returns the absolute value
float __fabss(float); Returns the short floating point absolute value
double __fadd (double, double); Adds two double values and generate an XIL OP_AFL.
float __fadds (float, float); Adds two float values and generate an XIL OP_AFL.
double __fcfid (double); Floating Convert From Integer Doubleword.

The 64bit signed fixedpoint operand is converted to a double-precision floating-point.

double __fctid (double); Floating Convert to Integer Doubleword.

The floating-point operand is converted into 64-bit signed fixed-point integer, using the rounding mode specified by FPSCRRN (Floating-Point Rounding Control field in the Floating-Point Status and Control Register).

double __fctidz (double); Floating Convert to Integer Doubleword with Rounding towards Zero.

The floating-point operand is converted into 64-bit signed fixed-point integer, using the rounding mode Round toward Zero.

double __fctiw (double); Floating Convert To Integer Word.

The floating-point operand is converted to a 32-bit signed fixed-point integer, using the rounding mode specified by FPSCRRN (Floating-Point Rounding Control field in the Floating-Point Status and Control Register).

double __fctiwz (double); Floating Convert To Integer Word with Rounding towards Zero.

The floating-point operand is converted to a 32-bit signed fixed-point integer, using the rounding mode Round toward Zero.

double __fmadd(double, double, double); Floating point multiply-add
float __fmadds(float, float, float); Floating point multiply-add short
double __fmsub(double, double, double); Floating point multiply-subtract
float __fmsubs(float, float, float); Floating point multiply-subtract
double __fmul (double, double); Floating point multiply. The function generates an XIL OP_FMSS
float __fmuls (float, float); Floating point multiply. The function generates an XIL OP_FMSS
double __fnabs(double); Floating point negative absolute
float __fnabss(float); Floating point negative absolute
double __fnmadd(double, double, double); Floating point negative multiply-add
float __fnmadds (float, float, float); Floating point negative multiply-add
double __fnmsub(double, double, double); Floating point negative multiply-subtract
float __fnmsubs (float, float, float); __fnmsubs (a, x, y) = [- (a * x - y)]
double __fre (double); Floating point reciprocal
__fre (x) = [(estimate of) 1.0/x].
(POWER5 processors only)
float __fres (float); Floating point reciprocal
__fres (x) = [(estimate of) 1.0/x]
float __frims (float); Takes a float argument and returns a float value. The returned value is an integer in a float format that equals the input value rounded to integer using the round-down rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
double __frim (double); Takes a double argument and returns a double value. The returned value is an integer in a double format that equals the input value rounded to integer using the round-down rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
float __frins (float); Takes a float argument and returns a float value. The returned value is an integer in a float format that equals the input value rounded to integer using the round-to-nearest rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
double __frin (double); Takes a double argument and returns a double value. The returned value is an integer in a double format that equals the input value rounded to integer using the round-to-nearest rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
float __frips (float); Takes a float argument and returns a float value. The returned value is an integer in a float format that equals the input value rounded to integer using the round-up rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
double __frip (double); Takes a double argument and returns a double value. The returned value is an integer in a double format that equals the input value rounded to integer using the round-up rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
float __frizs (float); Takes a float argument and returns a float value. The returned value is an integer in a float format that equals the input value rounded to integer using the round-toward-zero rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
double __friz (double); Takes a double argument and returns a double value. The returned value is an integer in a double format that equals the input value rounded to integer using the round-toward-zero rounding mode. This built-in function expands to the single PPC instruction of the same name available on Power5+ hardware.
Note:
This function is only supported when -qarch=pwr5+ is specified. Othrwise; the compiler issues a warning message.
double __frsqrte (double); Floating point reciprocal square root
__frsqrte (x) = [(estimate of) 1.0/sqrt(x)]
float __frsqrtes (float); Floating point reciprocal square root
__frsqrtes (x) = [(estimate of) 1.0/sqrt(x)].
(POWER5 processors only)
double __fsel (double, double, double); Floating point select
if (a >= 0.0) then __fsel (a, x, y) = x;
else __fsel (a, x, y) = y
float __fsels (float, float, float); Floating point select
if (a >= 0.0) then __fsels (a, x, y) = x;
else __fsels (a, x, y) = y
double __fsqrt (double); Floating point square root
__fsqrt (x) = square root of x
float __fsqrts (float); Floating point square root
__fsqrts (x) = square root of x
void __imul_dbl (void); Computes Double Long Product
signed long __labs (signed long); Calculates the absolute value long integer
double __log (double); Calculates the natural logarithm of the value passed as an argument
void __mtfsb0(unsigned int bt); Moves to FPSCR Bit 0.

Bit bt of the FPSCR is set to 0. bt must be a constant and 0<=bt<=31.

void __mtfsb1(unsigned int bt); Moves to FPSCR Bit 1.

Bit bt of the FPSCR is set to 1. bt must be a constant and 0<=bt<=31.

void __mtfsf(unsigned int flm, unsigned int frb); Moves to FPSCR Fields.

The contents of frb are placed into the FPSCR under control of the field mask specified by flm. The field mask flm identifies the 4bit fields of the FPSCR affected. flm must be a constant 8-bit mask.

void __mtfsfi(unsigned int bf, unsigned int u); Moves to FPSCR Field Immediate.

The value of the u is placed into FPSCR field specified by bf. bf and u must be constants, with 0<=bf<=7 and 0<=u<=15.

double __pow(double, double);
double __readflm(); Read floating point status/control register
double __setflm(double); Sets Floating Point Status/Control Register
double __setrnd(int); Sets Rounding Mode.

The allowable values for integers are:

  • 0 -- round to zero
  • 1 -- round to nearest
  • 2 -- round to +infinity
  • 3 -- round to -infinity
void __stfiw( const int* addr, double value); Store Floating-Point as Integer Word.

The contents of the loworder 32 bits of value are stored, without conversion, into the word in storage addressed by addr.

double __swdiv_nochk(double, double); Floating-point division of double types; no range checking. This function can provide better performance than the normal divide operator or the __swdiv built-in function in situations where division is performed repeatedly in a loop and when arguments are within the permitted ranges.

Argument restrictions: numerators equal to infinity are not allowed; denominators equal to infinity, zero, or denormalized are not allowed; the quotient of numerator and denominator may not be equal to positive or negative infinity.

With -qstrict in effect, the result is identical bitwise to IEEE division. For correct operation in this scenario, the arguments must satisfy the following additional restrictions. Numerators must have an absolute value greater than 2 ^ (-970) and less than infinity. Denominators must have an absolute value greater than 2 ^ (-1022) and less than 2 ^ 1021. The quotient of numerator and denominator must have an absolute value greater than 2 ^ (-1021) and less than 2 ^ 1023.

double __swdiv(double, double); Floating-point division of double types. No argument restrictions.
float __swdivs_nochk(float, float); Floating-point division of float types; no range checking. Argument restrictions: numerators equal to infinity are not allowed; denominators equal to infinity, zero, or denormalized are not allowed; the quotient of numerator and denominator may not be equal to positive or negative infinity.
float __swdivs(float, float); Floating-point division of double types. No argument restrictions.