You copied the Doc URL to your clipboard.

INCP (vector)

Increment vector by active predicate element count.

Counts the number of active elements in the source predicate and then uses the result to increment all destination vector elements.



INCP <Zdn>.<T>, <Pg>

if !HaveSVE() then UNDEFINED;
if size == '00' then UNDEFINED;
integer esize = 8 << UInt(size);
integer g = UInt(Pg);
integer dn = UInt(Zdn);

Assembler Symbols


Is the name of the source and destination scalable vector register, encoded in the "Zdn" field.

<T> Is the size specifier, encoded in size:
size <T>
01 H
10 S
11 D

Is the name of the governing scalable predicate register, encoded in the "Pg" field.


integer elements = VL DIV esize;
bits(PL) mask = P[g];
bits(VL) operand = Z[dn];
bits(VL) result;
integer count = 0;

for e = 0 to elements-1
    if ElemP[mask, e, esize] == '1' then
        count = count + 1;

for e = 0 to elements-1
    Elem[result, e, esize] = Elem[operand, e, esize] + count;

Z[dn] = result;