GCC provides extensions for the SPU processor as described in the Sony/Toshiba/IBM SPU Language Extensions Specification, which can be found at http://cell.scei.co.jp/ or http://www.ibm.com/developerworks/power/cell/. GCC's implementation differs in several ways.
signed
or unsigned
is omitted, the signedness of the vector type is the default signedness of the base type. The default varies depending on the operating system, so a portable program should always specify the signedness. __vector
is added. The macro vector
is defined in <spu_intrinsics.h>
and can be undefined. typedef
name as the type specifier for a vector type. spu_add ((vector signed int){1, 2, 3, 4}, foo);
Since spu_add
is a macro, the vector constant in the example is treated as four separate arguments. Wrap the entire argument in parentheses for this to work.
__builtin_expect
is not supported. Note: Only the interface described in the aforementioned specification is supported. Internally, GCC uses built-in functions to implement the required functionality, but these are not supported and are subject to change without notice.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/SPU-Built_002din-Functions.html