XL C/C++ V2R1M1 web deliverable for z/OS® 2.1 includes vector programming support, which provides an efficient and expressive mechanism for programmers to make use of the Vector Facility for z/Architecture® from the C and C++ programming languages. This section describes the supported vector data types.
In this syntax, type qualifiers and storage class specifiers can precede the keyword vector (or its alternative spelling, __vector) in a declaration. Most of the legal forms of the syntax are captured in the following diagram. Some variations have been omitted from the diagram for the sake of clarity: type qualifiers such as const and storage class specifiers such as static can appear in any order within the declaration, as long as neither immediately follows the keyword vector (or __vector).
Vector declaration syntax .-----------------------------. V | >>---+-------------------------+-+------------------------------> +-type_qualifier----------+ '-storage_class_specifier-' >--+-vector---+-+-+-bool-----+--+-char-----------+-+----------->< '-__vector-' | +-signed---+ +-short--+-----+-+ | | '-unsigned-' | '-int-' | | | +-int------------+ | | '-long long------' | '-double---------------------------'
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 (FALSE), 255 (TRUE) |
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 (FALSE), 65535 (TRUE) |
vector bool short int | ||
vector unsigned int | 4 unsigned int | 0..232-1 |
vector signed int | 4 signed int | -231..231-1 |
vector bool int | 4 unsigned int | 0 (FALSE), 232-1 (TRUE) |
vector unsigned long long | 2 unsigned long long | 0..264-1 |
vector signed long long | 2 signed long long | -263..263-1 |
vector bool long long | 2 unsigned long long | 0 (FALSE), 264-1 (TRUE) |
vector double | 2 double | IEEE-754 double (64 bit) precision floating-point values |
All vector types are aligned on an 8-byte boundary. An aggregate that contains one or more vector types is aligned on an 8-byte boundary, and padded, if necessary, so that each member of vector type is also 8-byte aligned.