Originally posted by: AshleyZhou
The built-in functions in XL compilers on Power compilers provide access to the Power instruction set, including some special Power instructions for developing highly optimized applications that cannot otherwise be generated using the standard C, C++, or Fortran constructs.
How does it work?
A built-in function is a coding extension to C, C++ or Fortran that allows a programmer to use the syntax of C/C++/Fortran function calls and variables to access the instruction set of the processor. IBM® Power® architectures have special instructions that enable the development of highly optimized applications. Access to some Power instructions cannot be generated using the standard constructs of the C/C++/Fortran 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 also supported. However, the technique can be time-consuming to implement. As an alternative to managing hardware registers through assembly language, XL built-in functions provide access to the optimized Power instruction set and allow the compiler to optimize the instruction scheduling.
Did you know that IBM provides an “encyclopedia” about compiler built-in functions? To help you make the best of the built-in functions, in the user manual we’ve included comprehensive explanations and usage information for each built-in function. This reference assists you in using the built-in functions to achieve your goals. Specifically, this encyclopedia can help you in the following two ways:
1. Explore built-in functions through the categorization
The categorization we provide helps you explore new built-in functions. Are you still struggling to write assembly code to manage hardware registers, or not sure how built-in functions can help you with certain operations? Let the built-in function reference shed light on your problems! You are able to learn about new built-in functions starting from the different purposes of our built-in functions, or you can just look for the functions in the category that serves your purpose.
2. Look up comprehensive information about specific built-in functions
The compiler built-in function reference is an individual section in the manual where you can look up any built-in function available in the compiler by name. All built-in functions are categorized by their functions, and within each category they are in alphabetical order.
We include multiple sections for each built-in, as appropriate:
The multiple aspects of description ensures that you can easily get started with each of the built-in function and helps you make the best of it.
Start using the compiler built-in function reference now!
The Compiler Built-in Function Reference is available as both online documentation in the IBM Knowledge Center and as a PDF version. The documentation links of the latest XL compilers on POWER are listed below:
*The intrinsic procedure reference for XL Fortran is available as the following sections in the Language Reference:
- “TRANSACTIONAL_MEMORY intrinsic module (IBM extension)”
- “Vector intrinsic procedures (IBM extension)”
We value your feedback
If you are finding that what you need is beyond the current built-in functions we are providing, you can raise a new feature request in the XL compilers on POWER community forum (https://ibm.biz/xl-power-compilers-forum) and the XL compiler team will carefully evaluate your request.
If it is hard for you to quickly navigate to the built-in function you are looking for, or you are not sure if the built-in function is already supported by the compiler, you can also post your question in the forum and the IBM compiler experts will get back to you as soon as possible.
#C/C++andFortran#IBM-XL-C,-C++,-and-Fortran-Compilers-for-POWER-servers-blog