vec_genpcvm

Purpose

Generates a permute control vector for expanding or compressing a source vector according to a specified mask.

Note: This built-in function is valid only when the -mcpu option is set to target Power10 processors.

Syntax

d = vec_genpcvm(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

Table 1. Result and argument types
d a b
vector unsigned char vector unsigned char const int
vector unsigned short vector unsigned short const int
vector unsigned int vector unsigned int const int
vector unsigned long long vector unsigned long long const int
Note: b must have a value of 0, 1, 2, or 3.

Result value

a contains a bit mask where the high-order bit in each element is set if the permute mask specifies expansion or compression of that element:
  • If b = 0, d is assigned the value of the permute control vector required to enable a left-indexed permute to implement an expansion of the leftmost elements of a source vector into the elements of a result vector specified by the element mask in a.
  • If b = 1, d is assigned the value of the permute control vector required to enable a left-indexed permute to implement a compression of the sparse elements in a source vector specified by the element mask in a into the leftmost elements of a result vector.
  • If b = 2, d is assigned the value of the permute control vector required to enable a right-indexed permute to implement an expansion of the rightmost elements of a source vector into the elements of a result vector specified by the element mask in a.
  • If b = 3, d is assigned the value of the permute control vector required to enable a right-indexed permute to implement a compression of the sparse elements in a source vector specified by the element mask in a into the rightmost elements of a result vector.