EasyManua.ls Logo

IBM Power7 - Page 58

IBM Power7
224 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
42 POWER7 and POWER7+ Optimization and Tuning Guide
The hardware does not have instructions for supporting vector unsigned long long, vector
bool long long, or vector signed long long. In GCC, you can declare these types, but the only
hardware operation you can use these types for is vector floating point convert. In 64-bit
mode, vector long is the same as vector long long. In 32-bit mode, these types are
not permitted.
All vector types are aligned on a 16-byte boundary. An aggregate that contains one or more
vector types is aligned on a 16-byte boundary, and padded, if necessary, so that each
member of vector type is also 16-byte aligned. Vector data types can use some of the unary,
binary, and relational operators that are used with primitive data types. All operators require
compatible types as operands unless otherwise stated. For more information about the
operator’s usage, see the XLC online publications
51,
52,
53
.
Individual elements of vectors can be accessed by using the Vector Multimedia eXtension
(VMX) or the VSX built-in functions. For more information about the VMX and the VSX built-in
functions, refer to the built-in functions section of Vector Built-in Functions.
54
Vector initialization
A vector type is initialized by a vector literal or any expression that has the same vector type.
For example:
55
vector unsigned int v1;
vector unsigned int v2 = (vector unsigned int)(10);// XL only, not GCC
v1 = v2;
The number of values in a braced initializer list must be less than or equal to the number of
elements of the vector type. Any uninitialized element is initialized to zero.
Vector types: The vector double type requires architectures that support the VSX
instruction set extensions, such as POWER7. You must specify the XL -qarch=pwr7
-qaltivec compiler options when you use this type, or the GCC -mcpu=power7 or
-mvsx options.
51
Support for POWER7 processors, available at:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlc111.aix.doc/get
start/architecture.html
52
Vector Built-in Functions, available at:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlc111.aix.doc/com
piler_ref/vec_intrin_cpp.html
53
Vector Initialization, available at:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlc111.aix.doc/lan
guage_ref/vector_init.html
54
Vector Built-in Functions, available at:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlc111.aix.doc/c
ompiler_ref/vec_intrin_cpp.html
55
Vector types (IBM extension), available at:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlc111.aix.doc/l
anguage_ref/altivec_types.html

Table of Contents

Related product manuals