vec_gather_element: Vector Gather Element

e = vec_gather_element(a, b, c, d)

Returns a copy of the vector a with the value of its element d replaced by *(c+b[d]).

Table 1. Vector Gather Element
e a b c d
vector signed int vector signed int vector unsigned int const signed int * 0-3
vector bool int vector bool int const unsigned int *
vector unsigned int vector unsigned int
vector signed long long vector signed long long vector unsigned long long const signed long long * 0-1
vector bool long long vector bool long long const unsigned long long *
vector unsigned long long vector unsigned long long
vector double vector double vector unsigned long long const double * 0-1
Example:
unsigned int a1[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
unsigned int a2[10] = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29};
vector unsigned int v1= {1, 2, 3, 4}, v2 = {1, 2, 3, 4};
vector unsigned int v3 = {5 * sizeof(int), 8 * sizeof(int), 
                          9 * sizeof(int), 6 * sizeof(int)};

v1 = vec_gather_element (v1, v3, a1, 0); // v1 = {15, 2, 3, 4}
v2 = vec_gather_element (v2, v3, a2, 0); // v2 = {25, 2, 3, 4}