Expand description
Encoder for the SME (Scalable Matrix Extension) group — the inverse of
crate::decode::sme.
Gated behind #[cfg(feature = "sme")]. Without the feature the
crate::encode::sme::encode stub returns
crate::encode::EncodeError::Unsupported and is_sme reports false, so
the default build still compiles. With it, every Sme*
crate::mnemonic::Code the decoder produces is inverted: dispatch on
crate::instruction::Instruction::code to a family encoder,
read the operands the decoder pushed (the binja z-prefixed tile-slice
spellings included), and pack the exact bitfields in reverse. It reconstructs
the word purely from the instruction’s semantics — it never reads
crate::instruction::Instruction::word. Total and panic-free.
SMSTART/SMSTOP are not handled here: they are MSR (immediate) PSTATE
encodings owned by crate::encode::branch_sys (mirroring the decoder).
§Field layout recap (inverted from the decoder)
All SME reserved-region words have word<31> == 1, op0 == 0b0000, and are
split by word<31:29>:
word<31:29> | base | family |
|---|---|---|
100 | 0x8000_0000 | outer-product FP/BF16 |
101 | 0xA000_0000 | outer-product integer |
110 | 0xC000_0000 | MOVA / ADDHA / ADDVA |
111 | 0xE000_0000 | ZA load/store |