vec_permi: Vector Permute Immediate

d = vec_permi(a, b, c)

Returns a vector by permuting and combining the two eight-byte-long vector elements in a and b based on the value of c.

If you use a[0] and a[1] to represent the first and second eight-byte-long elements in a, and likewise use b[0] and b[1] for elements in b, this function determines the elements in the result vector based on the binary value of c.

The value of c can be:
  • 0 (b'00') - a[0], b[0]
  • 1 (b'01') - a[0], b[1]
  • 2 (b'10') - a[1], b[0]
  • 3 (b'11') - a[1], b[1]
Table 1. Vector Permute Immediate
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