EasyManua.ls Logo

IBM Power7 - Page 57

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...
Chapter 2. The POWER7 processor 41
Compiler support for vectors
XLC supports vector processing technologies through language extensions on both AIX and
Linux. GCC supports using the VSX engine on Linux. XL and GCC C implement and extend
the AltiVec Programming Interface specification. In the extended syntax, type qualifiers and
storage class specifiers can precede the keyword vector (or its alternative spelling, __vector)
in a declaration.
Also, the XL compilers are able to automatically generate VSX instructions from scalar code
when they generate code that targets the POWER7 processor. This task is accomplished by
using the -qsimd=auto option with the -O3 optimization level or higher.
Table 2-9 lists the supported vector data types and the size and possible values for
each type.
Table 2-9 Vector data types
Type Interpretation of content Range of values
vector unsigned char 16 unsigned char 0..255
vector signed char 16 signed char 128..127
vector bool char 16 unsigned char 0, 255
vector unsigned short 8 unsigned short 0..65535
vector unsigned short int
vector signed short 8 signed short 32768..32767
vector signed short int
vector bool short 8 unsigned short 0, 65535
vector bool short int
vector unsigned int 4 unsigned int 0..232-1
vector unsigned long
vector unsigned long int
vector signed int 4 signed int 231..231-1
vector signed long
vector signed long int
vector bool int 4 unsigned int 0, 232-1
vector bool long
vector bool long int
vector float 4 float IEEE-754 single (32 bit)
precision floating point values
vector double 2 double IEEE-754 double (64 bit)
precision floating point values
vector pixel 8 unsigned short 1/5/5/5 pixel

Table of Contents

Related product manuals