vec_permi
Purpose
Returns a vector by permuting and combining two eight-byte-long vector elements in a and b based on the value of c.
This built-in function is valid only when you include the altivec.h file.
Syntax
d=vec_permi(a, b, c)
Result and argument types
The following table describes the types of the returned value and the function arguments.
| d | a | b | c |
|---|---|---|---|
| vector bool long long | vector bool long long | vector bool long long | 0–3 |
| vector signed long long | vector signed long long | vector signed long long | |
| vector unsigned long long | vector unsigned long long | vector unsigned long long | |
| vector double | vector double | vector double |
Result value
If we use a[0] and a[1] to
represent the first and second eight-byte-long elements in a,
and use b[0] and b[1] for elements
in b, then this function determines the elements
in the result vector based on the binary value of c.
This is illustrated as follows:
- 00 - a[0],b[0]
- 01 - a[0], b[1]
- 10 - a[1], b[0]
- 11 - a[1], b[1]


