ADDHA

Add horizontally vector elements to ZA tile

This instruction adds each element of the source vector to the corresponding active element of each horizontal slice of a ZA tile. The tile elements are predicated by a pair of governing predicates. An element of a horizontal slice is considered active if its corresponding element in the second governing predicate is TRUE and the element corresponding to its horizontal slice number in the first governing predicate is TRUE. Inactive elements in the destination tile remain unmodified.

ID_AA64SMFR0_EL1.I16I64 indicates whether the 64-bit integer variant is implemented.

Encoding: 32-bit

Variants: FEAT_SME (PROFILE_A)

313029282726252423222120191817161514131211109876543210
1100000010010000000
opVPmPnZnZAda

ADDHA <ZAda>.S, <Pn>/M, <Pm>/M, <Zn>.S

Decoding algorithm

if !IsFeatureImplemented(FEAT_SME) then EndOfDecode(Decode_UNDEF);
constant integer esize = 32;
constant integer a = UInt(Pn);
constant integer b = UInt(Pm);
constant integer n = UInt(Zn);
constant integer da = UInt(ZAda);

Encoding: 64-bit

Variants: FEAT_SME_I16I64 (ARMv9.2)

313029282726252423222120191817161514131211109876543210
110000001101000000
opVPmPnZnZAda

ADDHA <ZAda>.D, <Pn>/M, <Pm>/M, <Zn>.D

Decoding algorithm

if !IsFeatureImplemented(FEAT_SME_I16I64) then EndOfDecode(Decode_UNDEF);
constant integer esize = 64;
constant integer a = UInt(Pn);
constant integer b = UInt(Pm);
constant integer n = UInt(Zn);
constant integer da = UInt(ZAda);

Operation

CheckStreamingSVEAndZAEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
constant integer dim = VL DIV esize;
constant bits(PL) mask1 = P[a, PL];
constant bits(PL) mask2 = P[b, PL];
constant bits(VL) operand_src = Z[n, VL];
constant bits(dim*dim*esize) operand_acc = ZAtile[da, esize, dim*dim*esize];
bits(dim*dim*esize) result;

for col = 0 to dim-1
    constant bits(esize) element = Elem[operand_src, col, esize];
    for row = 0 to dim-1
        bits(esize) res = Elem[operand_acc, row*dim+col, esize];
        if (ActivePredicateElement(mask1, row, esize) &&
              ActivePredicateElement(mask2, col, esize)) then
            res = res + element;
        Elem[result, row*dim+col, esize] = res;

ZAtile[da, esize, dim*dim*esize] = result;

Explanations

<ZAda>: For the "32-bit" variant: is the name of the ZA tile ZA0-ZA3, encoded in the "ZAda" field.
<ZAda>: For the "64-bit" variant: is the name of the ZA tile ZA0-ZA7, encoded in the "ZAda" field.
<Pn>: Is the name of the first governing scalable predicate register P0-P7, encoded in the "Pn" field.
<Pm>: Is the name of the second governing scalable predicate register P0-P7, encoded in the "Pm" field.
<Zn>: Is the name of the source scalable vector register, encoded in the "Zn" field.

Operational Notes

If PSTATE.DIT is 1: