ARM / OFFLINE REFERENCE

On this page
← Home

FMOPS (widening)

Half-precision sum of outer products to single-precision, subtracting

This instruction works with a 32-bit element ZA tile.

This instruction widens the SVLS×2 sub-matrix of half-precision values held in the first source vector to single-precision values and multiplies it by the widened 2×SVLS sub-matrix of half-precision values in the second source vector to single-precision values.

Each source vector is independently predicated by a corresponding governing predicate. When a 16-bit source element is Inactive it is treated as having the value +0.0, but if both pairs of source vector elements that correspond to a 32-bit destination element contain Inactive elements, then the destination element remains unmodified.

The resulting SVLS×SVLS single-precision sum of outer products is then destructively subtracted from the single-precision destination tile. This is equivalent to performing a 2-way dot product and subtract from each of the destination tile elements.

Each 32-bit container of the first source vector holds 2 consecutive column elements of each row of a SVLS×2 sub-matrix. Similarly, each 32-bit container of the second source vector holds 2 consecutive row elements of each column of a 2×SVLS sub-matrix.

This instruction follows SME ZA-targeting floating-point behaviors.

SME class
(FEAT_SME)

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 0 0 0 0 1 1 0 1 Zm Pm Pn Zn 1 0 0 ZAda
S

Encoding

FMOPS <ZAda>.S, <Pn>/M, <Pm>/M, <Zn>.H, <Zm>.H

Decode

if !IsFeatureImplemented(FEAT_SME) then EndOfDecode(Decode_UNDEF); end;
let a : integer = UInt(Pn);
let b : integer = UInt(Pm);
let n : integer = UInt(Zn);
let m : integer = UInt(Zm);
let da : integer = UInt(ZAda);

Assembler Symbols

<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.

Operation

CheckStreamingSVEAndZAEnabled();
let VL : integer{} = CurrentVL();
let PL : integer{} = VL DIV 8;
let dim : integer{} = VL DIV 32;
let mask1 : bits(PL) = P{PL}(a);
let mask2 : bits(PL) = P{PL}(b);
let operand1 : bits(VL) = Z{VL}(n);
let operand2 : bits(VL) = Z{VL}(m);
let operand3 : bits(dim*dim*32) = ZAtile{dim*dim*32}(da, 32);
var result : bits(dim*dim*32);

for row = 0 to dim-1 do
    for col = 0 to dim-1 do
        // determine row/col predicates
        let prow_0 : boolean = ActivePredicateElement{PL}(mask1, 2*row + 0, 16);
        let prow_1 : boolean = ActivePredicateElement{PL}(mask1, 2*row + 1, 16);
        let pcol_0 : boolean = ActivePredicateElement{PL}(mask2, 2*col + 0, 16);
        let pcol_1 : boolean = ActivePredicateElement{PL}(mask2, 2*col + 1, 16);

        var sum : bits(32) = operand3[(row*dim+col)*:32];
        if (prow_0 && pcol_0) || (prow_1 && pcol_1) then
            var erow_0 : bits(16) = if prow_0 then operand1[(2*row + 0)*:16]
                                                else FPZero{16}('0');
            var erow_1 : bits(16) = if prow_1 then operand1[(2*row + 1)*:16]
                                                else FPZero{16}('0');
            let ecol_0 : bits(16) = if pcol_0 then operand2[(2*col + 0)*:16]
                                                else FPZero{16}('0');
            let ecol_1 : bits(16) = if pcol_1 then operand2[(2*col + 1)*:16]
                                                else FPZero{16}('0');
            if prow_0 then erow_0 = FPNeg{16}(erow_0, FPCR()); end;
            if prow_1 then erow_1 = FPNeg{16}(erow_1, FPCR()); end;
            sum = FPDotAdd_ZA(sum, erow_0, erow_1, ecol_0, ecol_1, FPCR());
        end;
        result[(row*dim+col)*:32] = sum;
    end;
end;

ZAtile{dim*dim*32}(da, 32) = result;

Version 2026.09 — Copyright © 2010-2026 Arm Limited or its affiliates.

This site is provided as a community resource and is NOT affiliated with nor endorsed by Arm Limited.