vec_promote
Purpose
Returns
a vector with a in
element position b.
Note: This built-in function is valid only when you specify the -qaltivec option
and include the
altivec.h file.Syntax
d=vec_promote(a, b)Result and argument types
The following table describes the types of the returned value and the function arguments.
| d | a | b |
|---|---|---|
| vector signed char | signed char | signed int |
| vector unsigned char | unsigned char | |
| vector signed short | signed short | |
| vector unsigned short | unsigned short | |
| vector signed int | signed int | |
| vector unsigned int | unsigned int | |
| vector signed long long | signed long long | |
| vector unsigned long long | unsigned long | |
| vector float | float | |
| vector double | double |
Result value
The result is a
vector with a in
element position b. This function uses modulo arithmetic
on b to
determine the element number. For example, if b is out of range, the compiler uses b modulo
the number of elements in the vector to determine the element position.
The other elements of the vector are undefined.