vec_cnttzm

Purpose

Returns the number of trailing consecutive 0-bits in the result returned when the first argument correspond to 1-bits in the second argument.

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

Syntax

d=vec_cnttzm(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 long long vector unsigned long long vector unsigned long long

Result value

Each element of d is set to the number of consecutive 0-bits, starting on the right, in the corresponding element of a that corresponds to 1-bits in the corresponding element of b.

Here is an example for doubleword inputs:
Argument Element 0 Element 1
a 0x fedc ba98 7654 3210 0x fedc ba98 7654 3210
b 0x aaaa aaaa aaaa aaaa 0x cccc cccc cccc cccc
d 4 8
Consider element 0 in the above table. The last sixteen bits of a are 0011 0010 0001 0000. The last sixteen bits of b are 1010 1010 1010 1010. Applying the mask of b to a means that the compiler only considers the even-numbered bits of a, which are 0 1 0 1 0 0 0 0. The number of trailing zeros in this result is 4.