Originally posted by: TracyR
For vector processing, IBM XL C/C++ for Linux V13.1 supports a new POWER8 built-in function vec_bperm. The vec_bperm can gather up to 16-bit values from a quadword in the specified order and it operates on vectors as 128-bit unsigned integers. The vec_bperm function is valid only when the -qarch option is set to target POWER8™ processors.
The function has the following syntax, where d represents the function returned value; a and b represent the arguments.
The following table describes the types of the returned value and the function arguments.
vector unsigned char
The following table describes the function result. For each i (0 <= i < 16), let index denote the byte value of the ith element of the argument b.
Value of index
index >= 128
bit 48+i of the result is set to 0.
index < 128
bit 48+i of the result is set to the value of the indexth bit of the input a.