Next: , Previous: Basic PowerPC Built-in Functions, Up: Target Builtins


6.60.22 PowerPC AltiVec/VSX Built-in Functions

GCC provides an interface for the PowerPC family of processors to access the AltiVec operations described in Motorola's AltiVec Programming Interface Manual. The interface is made available by including <altivec.h> and using -maltivec and -mabi=altivec. The interface supports the following vector types.

     vector unsigned char
     vector signed char
     vector bool char
     
     vector unsigned short
     vector signed short
     vector bool short
     vector pixel
     
     vector unsigned int
     vector signed int
     vector bool int
     vector float

GCC's implementation of the high-level language interface available from C and C++ code differs from Motorola's documentation in several ways.

Note: Only the <altivec.h> interface is supported. Internally, GCC uses built-in functions to achieve the functionality in the aforementioned header file, but they are not supported and are subject to change without notice.

GCC complies with the OpenPOWER 64-Bit ELF V2 ABI Specification, which may be found at http://openpowerfoundation.org/wp-content/uploads/resources/leabi-prd/content/index.html. Appendix A of this document lists the vector API interfaces that must be provided by compliant compilers. Programmers should preferentially use the interfaces described therein. However, historically GCC has provided additional interfaces for access to vector instructions. These are briefly described below.