Built-in functions for POWER and PowerPC architectures

A built-in function is a coding extension to C and C++ that allows a programmer to use the syntax of C function calls and C variables to access the instruction set of the processor of the compiling machine. IBM POWER and PowerPC architectures have special instructions that enable the development of highly optimized applications. Access to some POWER or PowerPC instructions cannot be generated using the standard constructs of the C and C++ languages. Other instructions can be generated through standard constructs, but using built-in functions allows exact control of the generated code. Inline assembly language programming, which uses these instructions directly, is not fully supported by XL C/C++ and other compilers. Furthermore, the technique can be time-consuming to implement.

As an alternative to managing hardware registers through assembly language, XL C/C++ built-in functions provide access to the optimized POWER or PowerPC instruction set and allow the compiler to optimize the instruction scheduling. To call any of the XL C/C++ built-in functions in C++, you must include the header file builtins.h in your source code.

The following tables describe the available built-in functions for the AIX platform.

Additional built-in functions are described at Built-in functions for parallel processing.