The Vector/SIMD Multimedia Extension model adds a set of fundamental data types, called vector types.
The vector types use the prefix vector in front of one of standard C data types—for example vector signed int and vector unsigned short. A vector type represents a vector of as many of the specified C data type as will fit in a 128-bit register. Hence, the vector signed int is a 128-bit operand containing four 32-bit signed ints. The vector unsigned short is a 128-bit operand containing eight unsigned values.
Vector Data Type | Meaning | Values |
---|---|---|
vector unsigned char | Sixteen 8-bit unsigned values | 0 ... 255 |
vector signed char | Sixteen 8-bit signed values | -128 ... 127 |
vector bool char | Sixteen 8-bit unsigned boolean | 0 (false), 255 (true) |
vector unsigned short | Eight 16-bit unsigned values | 0 ... 65535 |
vector unsigned short int | Eight 16-bit unsigned values | 0 ... 65535 |
vector signed short | Eight 16-bit signed values | -32768 ... 32767 |
vector signed short int | Eight 16-bit signed values | -32768 ... 32767 |
vector bool short | Eight 16-bit unsigned boolean | 0 (false), 65535 (true) |
vector bool short int | Eight 16-bit unsigned boolean | 0 (false), 65535 (true) |
vector unsigned int | Four 32-bit unsigned values | 0 ... 2³² - 1 |
vector signed int | Four 32-bit signed values | -2³¹ ... 2³¹ - 1 |
vector bool int | Four 32-bit unsigned values | 0 (false), 2³¹ - 1 (true) |
vector float | Four 32-bit single precision | IEEE-754 values |
vector pixel | Eight 16-bit unsigned values | 1/5/5/5 pixel |
Introducing fundamental vector data types permits the compiler to provide stronger type-checking and supports overloaded operations on vector types.