SME course

simd-anim

A course in ARM SME. Chapter 1 builds a GEMM: the hardware, the inner pipeline, the microkernel, the roofline, and memory in flight. Chapter 2 goes past that outer product — pack, softmax, and one head of attention.

New to matrix multiply? Take the optional self-check

Giving a talk with this lab? Open the guided talk mode

The course

Chapter 1 is the five-step GEMM intro. Chapter 2 is what attention needs beyond an outer product.

Instructions

The opcode reference, numbered to match each page. The kernel tour walks WHILELT, LD1W, FMOPA, and ST1W; the rest sit beside that path.

  1. 01 SME · Live

    FMOPA

    Outer product of z0.s and z1.s, accumulated into a 4×4 ZA tile.

    Play this instruction

    fmopa za0.s, p0/m, p1/m, z0.s, z1.s

  2. 02 SVE · Live

    Vector load / pack

    Bring memory into a Z register, lane by lane, then pack those lanes.

    Play this instruction

    ld1w { z0.s }, p0/z, [x0]

  3. 03 SVE · Live

    FMLA

    A fused multiply-add along a predicated vector.

    Play this instruction

    fmla z0.s, p0/m, z1.s, z2.s

  4. 04 SME · Live

    Store

    Write one horizontal slice of a ZA tile back to memory.

    Play this instruction

    st1w { za0h.s[w12, 0] }, p0, [x0]

  5. 05 SVE · Live

    WHILELT

    Turn scalar bounds into a predicate: lane i is active while x0 + i < x1.

    Play this instruction

    whilelt p0.s, x0, x1

  6. 06 SVE · Live

    ADDV

    Collapse the active lanes of a vector into one scalar sum.

    Play this instruction

    uaddv d0, p0, z0.s

  7. 07 SVE · Live

    UZP1

    Deinterleave: the even elements of two vectors gather into one.

    Play this instruction

    uzp1 z0.s, z1.s, z2.s

  8. 08 SVE · Live

    Gather load

    Each lane reads the word its own vector index selects — duplicates included.

    Play this instruction

    ld1w { z0.s }, p0/z, [x0, z1.s, sxtw #2]

  9. 09 SME2 · Live

    FMLAL

    Half-precision operands, single-precision tile: a widening multiply-add with an indexed vector.

    Play this instruction

    fmlal za.s[w11, 4:5], z0.h, z1.h[2]

  10. 10 SME · Live

    ADDHA

    One vector lands in every active row of the ZA tile.

    Play this instruction

    addha za0.s, p0/m, p1/m, z0.s

  11. 11 SVE · Live

    TBL

    Each lane picks any element of an eight-entry table — out of range gives zero.

    Play this instruction

    tbl z0.s, { z1.s, z2.s }, z3.s

  12. 12 SME · Live

    ADDVA

    One vector lands in every active column of the ZA tile.

    Play this instruction

    addva za0.s, p0/m, p1/m, z0.s

  13. 13 SVE · Live

    ZIP1

    Interleave: the low halves of two vectors alternate into one.

    Play this instruction

    zip1 z0.s, z1.s, z2.s

Words this lab uses

The four abbreviations, spelled out once so no page has to repeat them.

SVE
Scalable Vector Extension — the vector half of the ISA, where the z registers and p predicates come from.
SME
Scalable Matrix Extension — adds the ZA matrix accumulator and the outer-product instructions (fmopa, addha, st1w).
SVL
Streaming vector length — how many bits one vector holds, fixed by the hardware; 128 in every drawing here.
ZA
The SME matrix accumulator — the square tile that fmopa accumulates into and st1w writes back to memory.