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.
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.
Prototypes declared in the sparcace_types.h header file support the following two SIMD data types that SPARC64X and SPARC64X+ provide:
a pair of double-precision floating-point numbers
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.
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.
The first half of a SIMD return value appears in %d0. The second half appears in %d256.
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).
The intrinsic functions declared in the sparcace_types.h header file are as follows:
This function builds an __m128d type data from a pair of double-precision floating-point numbers and returns the object.
This is an alias to __sparcace_set_m128d().
This function builds an __m128i type data from a pair of unsigned long long type numbers and returns the object.
This is an alias to __sparcace_set_m128i().
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.
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.
This is an alias to __sparcace_extract_m128i().
This function returns a __m128i type value which has exactly the same bit pattern of the parameter.
This is an alias to __sparcace_cast_m128d_m128i().
This function returns a __m128d type value which has exactly the same bit pattern of the parameter.
This is an alias to__sparcace_cast_m128i_m128d().
This function executes two double-precision divisions serially and produce a __m128d result of the first parameter divided by the second.
This is an alias to __sparcace_fdivd_m128d().
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.
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.
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.
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.
This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128d result.
This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128d result.
This is an alias to __sparcace_fandnot1_m128d().
This function performs bitwise AND operation between the first parameter inverted and the second parameter to produce a __m128i result.
This is an alias to __sparcace_fandnot1_m128i().
This is an alias to __sparcace_fandnot1_m128i().
This function performs bitwise AND operation between the first parameter and the second parameter to produce a__m128d result.
This is an alias to __sparcace_fand_m128d().
This function performs bitwise AND operation between the first parameter and the second parameter to produce a __m128i result.
This is an alias to __sparcace_fand_m128i().
This function performs bitwise NAND operation between the first parameter and the second parameter to produce a __m128d result.
This function performs bitwise NAND operation between the first parameter and the second parameter to produce a__m128i result.
This function performs bitwise NOR operation between the first parameter and the second parameter to produce a __m128d result.
This function performs bitwise NOR operation between the first parameter and the second parameter to produce a__m128i result.
This function performs bitwise inversion operation of the first parameter to produce a __m128d result.
This function performs bitwise inversion operation of the first parameter to produce a __m128i result.
This function produces a __m128d result whose bits are all 1.
This function produces a __m128i result whose bits are all 1.
This function performs bitwise OR operation between the first parameter inverted and the second parameter to produce a __m128d result.
This function performs bitwise OR operation between the first parameter inverted and the second parameter to produce a __m128i result.
This function performs bitwise OR operation between the first parameter and the second parameter to produce a __m128d result.
This is an alias to __sparcace_for_m128d().
This function performs bitwise OR operation between the first parameter and the second parameter to produce a__m128i result.
This is an alias to __sparcace_for_m128i().
This function performs bitwise XNOR operation between the first parameter and the second parameter to produce a__m128d result.
This function performs bitwise XNOR operation between the first parameter and the second parameter to produce a __m128i result.
This function performs bitwise XOR operation between the first parameter and the second parameter to produce a __m128d result.
This is an alias to __sparcace_fxor_m128d().
This function performs bitwise XOR operation between the first parameter and the second parameter to produce a __m128i result.
This is an alias to __sparcace_fxor_m128i().
This function produces a __m128d result whose bits are all 0.
This is an alias to __sparcace_fzero_m128d().
This function produces a __m128i result whose bits are all 0.
This is an alias to __sparcace_fzero_m128i().
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This function produces a __m128d result which has the absolute value of the parameter.
This function executes addition to produce a __m128d result.
This is an alias to __sparcace_faddd_m128d().
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.
This is an alias to __sparcace_fmaddd_m128d().
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.
This is an alias to __sparcace_fmsubd_m128d().
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.
This is an alias to __sparcace_fnmsubd_m128d(). CAUTION: this is not an alias to __sparcace_fnmaddd_m128d().
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.
This is an alias to __sparcace_fnmaddd_m128d(). CAUTION: this is not an alias to __sparcace_fnmsubd_m128().
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.
This is an alias to __sparcace_fmaxd_m128d().
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.
This is an alias to __sparcace_fmind_m128d().
This function executes multiplication to produce a __m128d result.
This is an alias to __sparcace_fmuld_m128d().
This function negates the value of the parameter.
This function executes subtraction to produce a __m128d result.
This is an alias to __sparcace_fsubd_m128d().
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This is an alias to __sparcace_fpsll64x_m128i().
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.
This is an alias to __sparcace_fpsrl64x_m128i().
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.
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.
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.
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.
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.
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.
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.
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.
This is an alias to __sparcace_fpadd64_m128i().
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.
This is an alias to __sparcace_fpsub64_m128i().
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.
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.
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.
Intrinsic functions listed below are declared in dpd_conf.h. They are useful to operate _Decimal64 type variables.
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.
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.
This function adds src1 and src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.
This function subtracts src2 from src1, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.
This function multiplies src1 and src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.
This function divides src1 by src2, and returns the result. A floating-point exception is thrown in accordance with the IEEE 754-2008 standard.
This function computes the absolute value of src and returns the result. No floating-point exception is thrown even if src is signaling NaN.
This function reverses the sign of src and returns the result. No floating-point exception is thrown even if src is signaling NaN.
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.
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.
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.
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.
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.
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.
This function converts a 64-bit signed integer value in src to a Decimal Floating-Point value and returns the result.
This function converts a 64-bit unsigned integer value in src to a Decimal Floating-Point value and returns the result.
This function converts a Binary Floating-Point value in src to a Decimal Floating-Point value and returns the result.
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".
This function converts a Decimal Floating-Point value in src to a 64-bit signed integer value and returns the result.
This function converts a Decimal Floating-Point value in src to a 64-bit unsigned integer value and returns the result.
This function converts a Decimal Floating-Point value in src to a Binary Floating-Point value and returns the result.
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.
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.
This function retrieves the current rounding mode for _Decimal64. The value is defined in dpd_conf.h, as follows:
round to nearest, ties to even
round toward zero
round toward positive infinity
round toward negative infinity
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.
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.