| Cray C/C++ Reference Manual | ||
|---|---|---|
| Prev Section | Next Section | |
The Cray C/C++ intrinsic functions either allow for direct access to some Cray Research hardware instructions or result in generation of inline code to perform some specialized functions. These intrinsic functions are processed completely by the compiler. In many cases, the generated code is one or two instructions. These are called functions because they are invoked with the syntax of function calls.
To get access to the intrinsic functions, the Cray C++ compiler requires that either the intrinsics.h file be included or that the intrinsic functions that you want to call be explicitly declared. If you explicitly declare an intrinsic function, the declaration must agree with the documentation or the compiler treats the call as a call to a normal function, not the intrinsic function. When using the Cray Standard C compiler, it is not necessary to declare intrinsic functions. In either case, the -h nointrinsics command-line option causes the compiler to treat these calls as regular function calls and not as intrinsic function calls.
The types of the arguments to intrinsic functions are checked by the compiler, and if any of the arguments do not have the correct type, a warning message is issued and the call is treated as a normal call to an external function. If your intention was to call an external function with the same name as an intrinsic function, you should change the external function name. The names used for the Cray Standard C intrinsic functions are in the name space reserved for the implementation.
For detailed descriptions of appropriate Cray Research hardware instructions, see the Symbolic Machine Instructions Reference Manual.
Note: Several of these intrinsic functions have both a vector and a scalar version on UNICOS systems. If a vector version of an intrinsic function exists and the intrinsic is called within a vectorized loop, the compiler uses the vector version of the intrinsic. See the appropriate intrinsic function man page for details on whether it has a vector version.
The following table provides a summary of all C/C++ intrinsic functions and indicates their availability on Cray Research computer systems. See the appropriate man page for more information.
Table D-1. Summary of C/C++ intrinsic functions
Function | UNICOS systems | UNICOS/mk systems |
|---|---|---|
_argcount (See Footnote 1) | X | X |
_cmr | X | |
_dshiftl | X | X |
_dshiftr | X | X |
_EX | X | |
_gbit | X | X |
_gbits | X | X |
_getvm | X | |
_int_mult_upper (See Footnote 2) | X | X |
_leadz | X | X |
_mask | X | X |
_maskl | X | X |
_maskr | X | X |
_mclr (See Footnote 3) | X | X |
_mld (See Footnote 3) | X | X |
_memory_barrier | X | |
_mldmx (See Footnote 3) | X | X |
_mmx (See Footnote 3) | X | X |
_mul (See Footnote 3) | X | X |
_my_pe | X | |
_numargs | X | X |
_num_pes | X | |
_pbit | X | X |
_pbits | X | X |
_popcnt | X | X |
_poppar | X | X |
_ranf | X | X |
_readSB | X | |
_readSR | X | |
_readST | X | |
_remote_write_barrier | X | |
_rtc | X | X |
_semclr | X | |
_semget | X | |
_semput | X | |
_semset | X | |
_semts | X | |
_setvm | X | |
_write_memory_barrier | X | |
_writeSB | X | |
_writeST | X | |
Footnote 1: Available only on CRAY T90 systems. Footnote 2: Available only on Cray Research systems with IEEE floating-point hardware. Footnote 3: This function is not available on some CRAY Y-MP systems. | ||
| Prev Section | Table of Contents | Title Page | Next Section |
| Common System Messages | Up one level | Index |