vec_genbm

Purpose

Creates an element mask for byte elements from a bit mask.

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

Syntax

d = vec_genbm (a)

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
vector unsigned char unsigned long long
Note: When a is a constant, compilers might generate the mtvsrbmi instruction as an optimization.

Result value

The bits in a are numbered from left to right.

For each integer i from 0 to 15, the leftmost element of d is counted as the 0th element, and the rightmost element is counted as the 15th element.

All bits of the ith element of d are set to 0 if the ith bit of the 16-bit value in a is equal to 0.

All bits of the ith element of d are set to 1 if the ith bit of the 16-bit value in a is equal to 1.

For example:
Argument Example
a 1010 1010 1010 1010
d 0x ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00