Connect, learn, share, and engage with IBM Power.
Originally posted by: TracyR
IBM XL C/C++ for AIX, V13.1 supports a vector population count procedure vec_popcnt. This built-in function computes the population count (number of set bits) in each element of their input. This function is valid only when the -qarch option is set to target POWER8™ processors.
The syntax of this function is:
d=vec_popcnt(a) where d represents the types of the returned value and a in parentheses represents the type of the function argument. For details about d and a, see the following table.
d=vec_popcnt(a)
Each element of the result is set to the number of set bits in the corresponding element of the input.
Copy