BMOPS
Bitwise exclusive NOR population count outer product and subtract
This instruction works with 32-bit element ZA tile. This instruction generates an outer product of the first source SVLS×1 vector and the second source 1×SVLS vector. Each outer product element is obtained as population count of the bitwise XNOR result of the corresponding 32-bit elements of the first source vector and the second source vector. Each source vector is independently predicated by a corresponding governing predicate. When either source vector element is inactive the corresponding destination tile element remains unmodified. The resulting SVLS×SVLS product is then destructively subtracted from the destination tile.
Green
True
True
SM_1_only
True
1
0
0
0
0
0
0
0
1
0
0
1
1
0
BMOPS <ZAda>.S, <Pn>/M, <Pm>/M, <Zn>.S, <Zm>.S
if !IsFeatureImplemented(FEAT_SME2) then UNDEFINED;
constant integer esize = 32;
constant integer a = UInt(Pn);
constant integer b = UInt(Pm);
constant integer n = UInt(Zn);
constant integer m = UInt(Zm);
constant integer da = UInt(ZAda);
<ZAda>
Is the name of the ZA tile ZA0-ZA3, 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 first source scalable vector register, encoded in the "Zn" field.
<Zm>
Is the name of the second source scalable vector register, encoded in the "Zm" field.
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) operand1 = Z[n, VL];
constant bits(VL) operand2 = Z[m, VL];
constant bits(dim*dim*esize) operand3 = ZAtile[da, esize, dim*dim*esize];
bits(dim*dim*esize) result;
for row = 0 to dim-1
constant bits(esize) element1 = Elem[operand1, row, esize];
for col = 0 to dim-1
constant bits(esize) element2 = Elem[operand2, col, esize];
constant bits(esize) element3 = Elem[operand3, row*dim + col, esize];
if (ActivePredicateElement(mask1, row, esize) &&
ActivePredicateElement(mask2, col, esize)) then
constant integer res = BitCount(NOT(element1 EOR element2));
Elem[result, row*dim + col, esize] = element3 - res;
else
Elem[result, row*dim + col, esize] = element3;
ZAtile[da, esize, dim*dim*esize] = result;