Go to main content
Oracle® Developer Studio 12.5: C User's Guide

Exit Print View

Updated: June 2017
 
 

2.20 Compiler Support for SPARC64X and SPARC64X+ Platform Intrinsics

Oracle Developer Studio compilers provide intrinsic types and functions to support special features that SPARC64X and SPARC64X+ have, namely, SIMD data and Decimal Floating-Point numbers.

You must specify both -xarch=[sparcace|sparcaceplus] and -m64 options to compile source files which use these intrinsics.

2.20.1 SIMD Intrinsics

The SIMD data provided by SPARC64X and SPARC64X+ can hold a pair of double or unsigned long long values. The compiler has a few intrinsic types and functions to handle these data.

2.20.1.1 Types and Operations

Prototypes declared in the sparcace_types.h header file support the following two SIMD data types that SPARC64X and SPARC64X+ provide:

__m128d

a pair of double-precision floating-point numbers

__m128i

a pair of signed/unsigned 64-bit integers

SIMD data type

  • is handled as a basic type, not aggregate; it has no internal structures. You need to use a intrinsic function to get a part of the data.

  • can be modified with type modifiers: const and/or volatile.

  • can be specified with storage class specifiers: auto, static, register, extern and/or typedef.

  • can be elements of an aggregate: array, struct and/or union.

SIMD data type variables can be any of the following:

  • a formal parameter of a function

  • an actual argument of a function call

  • the return value of a function

  • lhs or rhs of assignment operator "="

  • the operand of address operator "&"

  • the operand of sizeof operator

  • the operand of typeof operator

Literal syntax is not supported for SIMD data types; you can build a SIMD data type constant with a proper intrinsic function.

2.20.1.2 Extensions to the Application Binary Interface

Passing/receiving a SIMD value to/from a function

Up to the first 8 SIMD arguments are passed via floating-point registers. The first halves of SIMD arguments occupy %d0, %d4, %d8, ..., %d28. The second halves of SIMD arguments occupy %d256, %d260, %d264, ..., %d284. If there are nine or more SIMD arguments, they are passed via the stack area.

Returning a SIMD value from a function

The first half of a SIMD return value appears in %d0. The second half appears in %d256.

Storing a SIMD value in memory

A SIMD type value should be stored at a 16 byte-aligned address in order to be loaded/stored with SIMD load(ldd,s)/store(std,s).

2.20.1.3 Intrinsic functions

The intrinsic functions declared in the sparcace_types.h header file are as follows:

__m128d __sparcace_set_m128d(double a, double b)

This function builds an __m128d type data from a pair of double-precision floating-point numbers and returns the object.

__m128d _mm_set_pd(double z, double y)

This is an alias to __sparcace_set_m128d().

__m128i __sparcace_set_m128i(unsigned long long a, unsigned long long b)

This function builds an __m128i type data from a pair of unsigned long long type numbers and returns the object.

__m128i _mm_set_epi64x(long long a, long long b)

This is an alias to __sparcace_set_m128i().

double __sparcace_extract_m128d(__m128d a, int imm

This function extracts a double-precision floating-point number from the __m128d type data passed as the first parameter. The value extracted is controlled by the second parameter. The second parameter must be an integer and must be a constant of 0 or 1.

unsigned long long __sparcace_extract_m128i(__m128i a, int imm)

This function extracts an unsigned long long type number from the __m128i type data passed as the first parameter. The value extracted is controlled by the second parameter. The second parameter must be an integer and must be a constant of 0 or 1.

long long _mm_extract_epi64(__m128i a, const int imm)

This is an alias to __sparcace_extract_m128i().

__m128i __sparcace_cast_m128d_m128i(__m128d a)

This function returns a __m128i type value which has exactly the same bit pattern of the parameter.

__m128i _mm_castpd_si128(__m128d in)

This is an alias to __sparcace_cast_m128d_m128i().

__m128d __sparcace_cast_m128i_m128d(__m128i a)

This function returns a __m128d type value which has exactly the same bit pattern of the parameter.

__m128d _mm_castsi128_pd(__m128i in)

This is an alias to__sparcace_cast_m128i_m128d().

__m128d __sparcace_fdivd_m128d(__m128d a, __m128d b)

This function executes two double-precision divisions serially and produce a __m128d result of the first parameter divided by the second.

__m128d _mm_div_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fdivd_m128d().

__m128d __sparcace_fshiftorx_m128d(__m128d a, __m128d b, __m128d c)

This function executes logical right or left shift on the first and second parameter, masked the fragments out of them and bitwise-or them together to produce a __m128d result. The shift width mask width and mask offset are given as the third parameter.

__m128i __sparcace_fshiftorx_m128i(__m128i a, __m128i b, __m128i c)

This function executes logical right or left shift on the first and second parameter, masked the fragments out of them and bitwise-or them together to produce a __m128i result. The shift width mask width and mask offset are given as the third parameter.

void __sparcace_stdfr_m128d(__m128d a, __m128d b, __m128d *p)

This function stores each double-precision floating-point number of the first parameter to the 16 byte-aligned address pointed to by the third parameter if the MSB of the corresponding floating-point number of the second parameter is one. Otherwise does nothing.

void __sparcace_stdfr_m128i(__m128i a, __m128i b, __m128i *p)

This function stores each unsigned long long type number of the first parameter to the 16 byte-aligned address pointed to by the third parameter if the MSB of the corresponding unsigned long long type number of the second parameter is one. Otherwise does nothing.

__m128d __sparcace_fandnot1_m128d(__m128d a, __m128d b)

This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128d result.

__m128d __sparcace_fandnot1_m128d(__m128d a, __m128d b)

This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128d result.

__m128d _mm_andnot_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fandnot1_m128d().

__m128i __sparcace_fandnot1_m128i(__m128i a, __m128i b)

This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128i result.

__m128i _mm_andnot_si128(__m128i a, __m128i b)

This is an alias to __sparcace_fandnot1_m128i().

__m128i _mm_andnot_si128(__m128i a, __m128i b)

This is an alias to __sparcace_fandnot1_m128i().

__m128d __sparcace_fand_m128d(__m128d a, __m128d b)

This function performs bitwise AND operation between the first parameter and the second parameter to produce a__m128d result.

__m128d _mm_and_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fand_m128d().

__m128i __sparcace_fand_m128i(__m128i a, __m128i b)

This function performs bitwise AND operation between the first parameter and the second parameter to produce a __m128i result.

__m128i _mm_and_si128(__m128i a, __m128i b)

This is an alias to __sparcace_fand_m128i().

__m128d __sparcace_fnand_m128d(__m128d a, __m128d b)

This function performs bitwise NAND operation between the first parameter and the second parameter to produce a __m128d result.

__m128i __sparcace_fnand_m128i(__m128i a, __m128i b)

This function performs bitwise NAND operation between the first parameter and the second parameter to produce a__m128i result.

__m128d __sparcace_fnor_m128d(__m128d a, __m128d b)

This function performs bitwise NOR operation between the first parameter and the second parameter to produce a __m128d result.

__m128i __sparcace_fnor_m128i(__m128i a, __m128i b)

This function performs bitwise NOR operation between the first parameter and the second parameter to produce a__m128i result.

__m128d __sparcace_fnot1_m128d(__m128d a)

This function performs bitwise inversion operation of the first parameter to produce a __m128d result.

__m128i __sparcace_fnot1_m128i(__m128i a)

This function performs bitwise inversion operation of the first parameter to produce a __m128i result.

__m128d __sparcace_fone_m128d()

This function produces a __m128d result whose bits are all 1.

__m128i __sparcace_fone_m128i()

This function produces a __m128i result whose bits are all 1.

__m128d __sparcace_fornot1_m128d(__m128d a, __m128d b)

This function performs bitwise OR operation between the first parameter inverted and the second parameter to produce a __m128d result.

__m128i __sparcace_fornot1_m128i(__m128i a, __m128i b)

This function performs bitwise OR operation between the first parameter inverted and the second parameter to produce a __m128i result.

__m128d __sparcace_for_m128d(__m128d a, __m128d b)

This function performs bitwise OR operation between the first parameter and the second parameter to produce a __m128d result.

__m128d _mm_or_pd(__m128d a, __m128d b)

This is an alias to __sparcace_for_m128d().

__m128i __sparcace_for_m128i(__m128i a, __m128i b)

This function performs bitwise OR operation between the first parameter and the second parameter to produce a__m128i result.

__m128i _mm_or_si128(__m128i a, __m128i b)

This is an alias to __sparcace_for_m128i().

__m128d __sparcace_fxnor_m128d(__m128d a, __m128d b)

This function performs bitwise XNOR operation between the first parameter and the second parameter to produce a__m128d result.

__m128i __sparcace_fxnor_m128i(__m128i a, __m128i b)

This function performs bitwise XNOR operation between the first parameter and the second parameter to produce a __m128i result.

__m128d __sparcace_fxor_m128d(__m128d a, __m128d b)

This function performs bitwise XOR operation between the first parameter and the second parameter to produce a __m128d result.

__m128d _mm_xor_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fxor_m128d().

__m128i __sparcace_fxor_m128i(__m128i a, __m128i b)

This function performs bitwise XOR operation between the first parameter and the second parameter to produce a __m128i result.

__m128i _mm_xor_si128(__m128i a, __m128i b)

This is an alias to __sparcace_fxor_m128i().

__m128d __sparcace_fzero_m128d()

This function produces a __m128d result whose bits are all 0.

__m128d _mm_setzero_pd()

This is an alias to __sparcace_fzero_m128d().

__m128i __sparcace_fzero_m128i()

This function produces a __m128i result whose bits are all 0.

__m128i _mm_setzero_si128()

This is an alias to __sparcace_fzero_m128i().

__m128d __sparcace_fcmpeqd_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the__m128d result are set to 1 if the first one is equal to the second one.

__m128d __sparcace_fcmpeqed_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is equal to the second one. An Exception will be raised if unordered.

__m128d __sparcace_fcmpleed_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is less than or equal to the second one. An Exception will be raised if unordered.

__m128d __sparcace_fcmplted_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is less than the second one. An Exception will be raised if unordered.

__m128d __sparcace_fcmpned_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is not equal to the second one.

__m128d __sparcace_fcmpneed_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is not equal to the second one. An Exception will be raised if unordered.

__m128d __sparcace_fcmpgted_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is greater than the second one. An Exception will be raised if unordered.

__m128d __sparcace_fcmpgeed_m128d(__m128d a, __m128d b)

This function compares each double-precision floating-point number of the first parameter to the corresponding double-precision floating-point number of the second parameter. All the bits of the corresponding double-precision floating-point number of the __m128d result are set to 1 if the first one is greater than or equal to the second one. An Exception will be raised if unordered.

__m128d __sparcace_fselmovd_m128d(__m128d a, __m128d b, __m128d c)

This function produces a __m128d result by copying each double-precision floating-point number of the first parameter or the ones of the second parameter, regarding the MSB's of the third parameter.

__m128i __sparcace_fselmovd_m128i(__m128i a, __m128i b, __m128i c)

This function produces a __m128d result by copying each unsigned long long type number of the first parameter or the ones of the second parameter, regarding the MSB's of the third parameter.

__m128d __sparcace_fabsd_m128d(__m128d a)

This function produces a __m128d result which has the absolute value of the parameter.

__m128d __sparcace_faddd_m128d(__m128d a, __m128d b)

This function executes addition to produce a __m128d result.

__m128d _mm_add_pd(__m128d a, __m128d b)

This is an alias to __sparcace_faddd_m128d().

__m128d __sparcace_fmaddd_m128d(__m128d a, __m128d b, __m128d c)

This function executes (a * b + c) operation with the pairs of double-precision floating-point numbers in the first, second and third parameters to produce a __m128d result.

__m128d _mm_fmadd_pd(__m128d a, __m128d b, __m128d c)

This is an alias to __sparcace_fmaddd_m128d().

__m128d __sparcace_fmsubd_m128d(__m128d a, __m128d b, __m128d c)

This function executes (a * b - c) with the pairs of double-precision floating-point numbers in the first, second and third parameters to produce a __m128d result.

__m128d _mm_fmsub_pd(__m128d a, __m128d b, __m128d c)

This is an alias to __sparcace_fmsubd_m128d().

__m128d __sparcace_fnmsubd_m128d(__m128d a, __m128d b, __m128d c)

This function executes -(a * b - c) with the pairs of double-precision floating-point numbers inthe first, second and third parameters to produce a __m128d result.

__m128d _mm_fnmadd_pd(__m128d a, __m128d b, __m128d c)

This is an alias to __sparcace_fnmsubd_m128d(). CAUTION: this is not an alias to __sparcace_fnmaddd_m128d().

__m128d __sparcace_fnmaddd_m128d(__m128d a, __m128d b, __m128d c)

This function executes -(a * b + c) with the pairs of double-precision floating-point numbers in the first, second and third parameters to produce a __m128d result.

__m128d _mm_fnmsub_pd(__m128d a, __m128d b, __m128d c)

This is an alias to __sparcace_fnmaddd_m128d(). CAUTION: this is not an alias to __sparcace_fnmsubd_m128().

__m128d __sparcace_fmaxd_m128d(__m128d a, __m128d b)

This function produces a __m128d result by copying the maximum values of each double-precision floating-point number of the first parameter or the ones of the second parameter.

__m128d _mm_max_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fmaxd_m128d().

__m128d __sparcace_fmind_m128d(__m128d a, __m128d b)

This function produces a __m128d result by copying the minimum values of each double-precision floating-point number of the first parameter or the ones of the second parameter.

__m128d _mm_min_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fmind_m128d().

__m128d __sparcace_fmuld_m128d(__m128d a, __m128d b)

This function executes multiplication to produce a __m128d result.

__m128d _mm_mul_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fmuld_m128d().

__m128d __sparcace_fnegd_m128d(__m128d a)

This function negates the value of the parameter.

__m128d __sparcace_fsubd_m128d(__m128d a, __m128d b)

This function executes subtraction to produce a __m128d result.

__m128d _mm_sub_pd(__m128d a, __m128d b)

This is an alias to __sparcace_fsubd_m128d().

__m128d __sparcace_fxtod_m128i_m128d(__m128i a)

This function converts a pair of unsigned long long type values in the __m128i type parameter into a pair of double-precision floating-point numbers in a __m128d type result.

__m128i __sparcace_fdtox_m128d_m128i(__m128d a)

This function converts a pair of double-precision floating-point numbers in a __m128d type values into a pair of unsigned long long in the __m128i type parameter type result.

__m128i __sparcace_fpmaddx_m128i(__m128i a, __m128i b, __m128i c)

This function executes (a * b + c) operation with the pairs of unsigned long long numbers in first, second and third parameters, takes the lower 8 bytes of the result pair to produce a __m128d result.

__m128i __sparcace_fpmaddxhi_m128i(__m128i a, __m128i b, __m128i c)

This function executes (a * b + c) operation with the pairs of unsigned long long numbers in first, second and third parameters, takes the upper 8 bytes of the result pair to produce a __m128d result.

__m128d __sparcace_fnaddd_m128d(__m128d a, __m128d b)

This function executes -(a - b) operation with the pairs of double-precision floating-point numbers in the first and second parameters to produce a __m128d result.

__m128d __sparcace_fnmuld_m128d(__m128d a, __m128d b)

This function executes -(a * b) operation with the pairs of double-precision floating-point numbers in the first and second parameters to produce a __m128d result.

__m128i __sparcace_fpmax64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by copying the maximum values of each signed long long type number of the first parameter or the ones of the second parameter.

__m128i __sparcace_fpmin64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by copying the minimum values of each signed long long type number of the first parameter or the ones of the second parameter.

__m128i __sparcace_fpmin64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by copying the minimum values of each signed long long type number of the first parameter or the ones of the second parameter.

__m128i __sparcace_fpminu64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by copying the minimum values of each unsigned long long type number of the first parameter or the ones of the second parameter.

__m128i __sparcace_fpsll64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by logical-shifting left of each unsigned long long type number of the first parameter by the shift amount indicated by the unsigned long long type number of the second parameter.

__m128i _mm_sll_epi64(__m128i a, __m128i b)

This is an alias to __sparcace_fpsll64x_m128i().

__m128i __sparcace_fpsrl64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by logical-shifting right of each unsigned long long type number of the first parameter by the shift amount indicated by the unsigned long long type number of the second parameter.

__m128i _mm_srl_epi64(__m128i a, __m128i b)

This is an alias to __sparcace_fpsrl64x_m128i().

__m128i __sparcace_fpsra64x_m128i(__m128i a, __m128i b)

This function produces a __m128i result by arithmetic-shifting right of each signed long long type number of the first parameter by the shift amount indicated by the unsigned long long type number of the second parameter.

__m128i __sparcace_fpcmple64x_m128i(__m128i a, __m128i b)

This function compares each signed long long type number of the first parameter to the corresponding signed long long type number of the second parameter. The MSB of the corresponding signed long long type number of the __m128i result is set to 1 if the first one is less than or equal to the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpcmpgt64x_m128i(__m128i a, __m128i b)

This function compares each signed long long type number of the first parameter to the corresponding signed long long type number of the second parameter. The MSB of the corresponding signed long long type number of the __m128i result is set to 1 if the first one is greater than the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpcmpule64x_m128i(__m128i a, __m128i b)

This function compares each unsigned long long type number of the first parameter to the corresponding unsigned long long type number of the second parameter. The MSB of the corresponding unsigned long long type number of the __m128i result is set to 1 if the first one is less than or equal to the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpcmpune64x_m128i(__m128i a, __m128i b)

This function compares each unsigned long long type number of the first parameter to the corresponding unsigned long long type number of the second parameter. The MSB of the corresponding unsigned long long type number of the __m128i result is set to 1 if the first one is not equal to the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpcmpugt64x_m128i(__m128i a, __m128i b)

This function compares each unsigned long long type number of the first parameter to the corresponding unsigned long long type number of the second parameter. The MSB of the corresponding unsigned long long type number of the __m128i result is set to 1 if the first one is greater than the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpcmpueq64x_m128i(__m128i a, __m128i b)

This function compares each unsigned long long type number of the first parameter to the corresponding unsigned long long type number of the second parameter. The MSB of the corresponding unsigned long long type number of the __m128i result is set to 1 if the first one is equal to the second one. Bit 0 to bit 62 are set to 0.

__m128i __sparcace_fpadd64_m128i(__m128i a, __m128i b)

This function produces a __m128i result by adding each unsigned long long type number of the first parameter and the unsigned long long type number of the second parameter.

__m128i _mm_add_epi64(__m128i a, __m128i b)

This is an alias to __sparcace_fpadd64_m128i().

__m128i __sparcace_fpsub64_m128i(__m128i a, __m128i b)

This function produces a __m128i result by subtracting each unsigned long long type number of the second parameter from the unsigned long long type number of the first parameter.

__m128i _mm_sub_epi64(__m128i a, __m128i b)

This is an alias to __sparcace_fpsub64_m128i().

2.20.2 Decimal Floating-Point Intrinsics

SPARC64X and SPARC64X+ support the Decimal Floating-Point data type and operations. The data format conforms to 64bit DPD defined in IEEE 754-2008. The compiler provides the type and various functions to handle the data.

2.20.2.1 Types and Operations

To represent Decimal Floating-Point numbers, _Decimal64 intrinsic type is declared in dpd_conf.h. You must include the header file prior to use of the type as in the following example:

#include <dpd_conf.h>
int main(void) {
  _Decimal64 dd;
  ...
  return 0;
}

_Decimal64 type

  • can be modified with type modifiers: const and/or volatile.

  • can be specified with storage class specifiers: auto, static, register, extern and/or typedef.

  • can be an element of an aggregate: array, struct and/or union.

_Decimal64 type variables

  • can be a formal parameter of a function.

  • can be an actual argument of a function call.

  • can be the return value of a function.

  • can be lhs or rhs of assignment operator "=".

  • can be the operand of address operator "&".

  • can be the operand of sizeof operator.

  • can be the operand of typeof operator.

Intrinsic functions are provided for other operations such as arithmetic, comparison, or type conversion.

Literal syntax for _Decimal64 is not supported. Intrinsics for type conversion can be used instead.

Memory alignment of an _Decimal64 type data is the same as a 64-bit Binary Floating-Point number.

2.20.2.2 Macros and Pragmas

The __DEC_FP_INTR macro is defined as 1 when -xarch=[sparcace|sparcaceplus] and -m64 are specified. This macro is useful to determine whether the compiler supports the Decimal Floating-Point intrinsics feature.

The DEC_EVAL_METHOD macro required by IEEE 754-2008 is defined as 1 when dpd_conf.h is included.

The __STDC_DEC_FP__ macro is not defined, as the compiler does not fully support the functionality described in ISO/IEC TR 24732.

The #pragma FLOAT_CONST_DECIMAL_64 required by IEEE 754-2008 is not supported.

2.20.2.3 Intrinsic functions

Intrinsic functions listed below are declared in dpd_conf.h. They are useful to operate _Decimal64 type variables.

void __dpd64_store(const _Decimal64 src, _Decimal64 * const addr)

This function stores src into memory addressed by addr. addr must be aligned on an 8-byte boundary, or the behavior is undefined regardless of the -xmemalign setting.

_Decimal64 __dpd64_load(const _Decimal64 * const addr)

This function loads _Decimal64 type value from memory addressed by addr, and returns it. addr must be aligned on an 8-byte boundary, or the behavior is undefined regardless of the -xmemalign setting.

_Decimal64 __dpd64_add(_Decimal64 src1, _Decimal64 src2)

This function adds src1 and src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.

_Decimal64 __dpd64_sub(_Decimal64 src1, _Decimal64 src2)

This function subtracts src2 from src1, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.

_Decimal64 __dpd64_mul(_Decimal64 src1, _Decimal64 src2)

This function multiplies src1 and src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.

_Decimal64 __dpd64_div(_Decimal64 src1, _Decimal64 src2)

This function divides src1 by src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.

_Decimal64 __dpd64_abs(_Decimal64 src)

This function computes the absolute value of src and returns the result. No floating-point exception is thrown even if src is signaling NaN.

_Decimal64 __dpd64_neg(_Decimal64 src)

This function reverses the sign of src and returns the result. No floating-point exception is thrown even if src is signaling NaN.

int __dpd64_cmpeq(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is equal to src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

int __dpd64_cmpne(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is not equal to src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

int __dpd64_cmpgt(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is grater than src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

int __dpd64_cmpge(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is grater than or equal to src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

int __dpd64_cmplt(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is less than src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

int __dpd64_cmple(_Decimal64 src1, _Decimal64 src2)

This function returns non-0 when src1 is less than or equal to src2, otherwise it returns 0. The treatments of NaN, Inf and negative-Zero conforms to IEEE 754-2008.

_Decimal64 __dpd64_convert_from_int64(int64_t src)

This function converts a 64-bit signed integer value in src to a Decimal Floating-Point value and returns the result.

_Decimal64 __dpd64_convert_from_uint64(uint64_t src)

This function converts a 64-bit unsigned integer value in src to a Decimal Floating-Point value and returns the result.

_Decimal64 __dpd64_convert_from_double(double src)

This function converts a Binary Floating-Point value in src to a Decimal Floating-Point value and returns the result.

_Decimal64 __dpd64_convert_from_str(const char * restrict nptr, char ** restrict endptr);

This function behaves just as the function strtod64() defined in "ISO/IEC TR 24732", except the rounding direction is fixed to "to nearest, ties even".

int64_t __dpd64_convert_to_int64(_Decimal64 src)

This function converts a Decimal Floating-Point value in src to a 64-bit signed integer value and returns the result.

uint64_t __dpd64_convert_to_uint64(_Decimal64 src)

This function converts a Decimal Floating-Point value in src to a 64-bit unsigned integer value and returns the result.

double __dpd64_convert_to_double(_Decimal64 src)

This function converts a Decimal Floating-Point value in src to a Binary Floating-Point value and returns the result.

char *__dpd64_convert_to_stre(_Decimal64 dec, char *buf, size_t n);

This function prints dec in %He format to the memory addressed by buf. The precision is as long as the coefficient of dec. The output string is terminated with a null character at the (n-1)th character when the string is equal to or longer than n, or at the end of the string. This function returns buf when dec is successfully translated to string and a null pointer otherwise.

char *__dpd64_convert_to_strf(_Decimal64 dec, char *buf, size_t n);

This function prints dec in %Hf format to the memory addressed by buf. The precision is as long as the coefficient of dec. The output string is terminated with a null character at the (n-1)th character when the string is equal to or longer than n, or at the end of the string. This function returns buf when dec is successfully translated to string and a null pointer otherwise.

int __dpd_getround(void)

This function retrieves the current rounding mode for _Decimal64. The value is defined in dpd_conf.h, as follows:

__DPD_ROUND_NEAREST

round to nearest, ties to even

__DPD_ROUND_TOZERO

round toward zero

__DPD_ROUND_POSITIVE

round toward positive infinity

__DPD_ROUND_NEGATIVE

round toward negative infinity

__DPD_ROUND_NEARESTFROMZERO

round to nearest, ties away from zero

The initial value of the rounding mode for _Decimal64 is __DPD_ROUND_NEAREST. Note that the -fround option does not alter the rounding mode for _Decimal64.

int __dpd_setround(int r)

This function set the rounding mode for _Decimal64 to r. r should be one those listed above. It returns 0 on success or non-0 on failure.