ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

AMX EXTR_X

T3 apple-silicon matrix insn
Apple AMX: extr_x
SourceApple AMX Matrix Coprocessor Specification (corsix/amx) (apple_corsix_amx)
Reliability TierT3 — Hardware-Verified
ISA / Silicon ScopeApple Silicon M1–M4 (AMX)
Apple M1 / M2 / M3 / M4 (A13+)
License & VersionMIT
main
Upstreamhttps://github.com/corsix/amx
Privilegeuser
Note: Undocumented Apple matrix coprocessor specification verified on M1–M4 hardware.

Summary

Copies an entire register from Y to X.

Syntax / Encoding

AMX extr_x Xn (0x00201100 | Rn)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32A64.AMX000000000010000000010001000xxxxx0xffffffe0 / 0x00201100

Bitfields (8)

BitsFieldDescription
63:28IgnoredIgnored
27Must be 1Must be 1 — Otherwise decodes as extrh
26Must be 0Must be 0 — Otherwise decodes as extrh
25:23IgnoredIgnored
22:20Y register indexY register index
19IgnoredIgnored
18:16X register indexX register index
15:0IgnoredIgnored

Operands

NameDescription
Xn64-bit packed operand descriptor (8 bitfields)

Reference Notes

## Quick summary

|Instruction|General theme|Writemask|Optional special features|
|---|---|---|---|
|`extrx`|`x[i] = y[i]`|None|

## Instruction encoding

|Bit|Width|Meaning|Notes|
|---:|---:|---|---|
|10|22|[A64 reserved instruction](aarch64.md)|Must be `0x201000 >> 10`|
|5|5|Instruction|Must be `8`|
|0|5|5-bit GPR index|See below for the meaning of the 64 bits in the GPR|

## Operand bitfields

|Bit|Width|Meaning|Notes|
|---:|---:|---|---|
|28|36|Ignored|
|27|1|Must be `1`|Otherwise decodes as [`extrh`](extr_h.md)|
|26|1|Must be `0`|Otherwise decodes as [`extrh`](extr_h.md)|
|23|3|Ignored|
|20|3|Y register index|
|19|1|Ignored|
|16|3|X register index|
|0|16|Ignored|

## Description

Copies an entire register from Y to X.

## Emulation code

See [extr.c](extr.c).

A representative sample is:
```c
void emulate_AMX_EXTRX(amx_state* state, uint64_t operand) {
    if (operand & EXTR_HV) {
        ...
    } else if (operand & EXTR_BETWEEN_XY) {
        memcpy(state->x + ((operand >> 16) & 7),
               state->y + ((operand >> 20) & 7), 64);
    } else {
        ...
    }
}
```