SUB
llvm_aarch64_isa)Armv8-A / Armv9-A (SVE, SVE2, SME, FP8, MTE, Apple Silicon)
llvm/main
userA64, NEONSummary
AArch64 SUB instruction (A64, 32-bit) with 15 encoding variants extracted from LLVM TableGen. Extensions: NEON.
Syntax / Encoding
SUBXrx64: sub $Rd, $Rn, $Rm$ext SUBWrx: sub $Rd, $Rn, $Rm_and_extend SUBWrs: sub $Rd, $Rn, $Rm_and_shift SUBWri: sub $Rd, $Rn, $imm SUBv16i8: sub $Rd.16b, $Rn.16b, $Rm.16b SUBv1i64: sub $Rd, $Rn, $Rm SUBv2i32: sub $Rd.2s, $Rn.2s, $Rm.2s SUBv2i64: sub $Rd.2d, $Rn.2d, $Rm.2d
Cross-Chip Latency & Throughput (6 cores)
| Microarchitecture | Latency (cycles) | Recip. TP | uops | Ports | Source |
|---|---|---|---|---|---|
| Apple M1 Firestorm (P-core) | 1–2 | 0.167 | 1 | 1 - - u1-6 | apple_dougallj |
| Apple M1 Icestorm (E-core) | 1–2 | 0.333 | 1 | 1 - - u1-3 | apple_dougallj |
| Arm Neoverse V1 | 1–2 | 0.25 | 1 | V1UnitM | llvm_sched_models |
| Arm Neoverse V2 | 1–2 | 0.17 | 1 | V2UnitM | llvm_sched_models |
| NVIDIA Olympus (Vera) | 2 | 0.17 | 1 | OlympusUnitV | llvm_sched_models |
| Qualcomm Oryon | 2 | 0.25 | 1 | ORYONFP0123 | llvm_sched_models |
Binary Encodings (12)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | SUBXrx64 | 11001011001xxxxxx11xxxxxxxxxxxxx | 0xffe06000 / 0xcb206000 |
| 32 | SUBWrx | 01001011001xxxxxxxxxxxxxxxxxxxxx | 0xffe00000 / 0x4b200000 |
| 32 | SUBXrx | 11001011001xxxxxxxxxxxxxxxxxxxxx | 0xffe00000 / 0xcb200000 |
| 32 | SUBWrs | 01001011xx0xxxxxxxxxxxxxxxxxxxxx | 0xff200000 / 0x4b000000 |
| 32 | SUBXrs | 11001011xx0xxxxxxxxxxxxxxxxxxxxx | 0xff200000 / 0xcb000000 |
| 32 | SUBWri | 01010001xxxxxxxxxxxxxxxxxxxxxxxx | 0xff000000 / 0x51000000 |
| 32 | SUBXri | 11010001xxxxxxxxxxxxxxxxxxxxxxxx | 0xff000000 / 0xd1000000 |
| 32 | SUBv16i8 | 01101110001xxxxx100001xxxxxxxxxx | 0xffe0fc00 / 0x6e208400 |
| 32 | SUBv1i64 | 01111110111xxxxx100001xxxxxxxxxx | 0xffe0fc00 / 0x7ee08400 |
| 32 | SUBv2i32 | 00101110101xxxxx100001xxxxxxxxxx | 0xffe0fc00 / 0x2ea08400 |
| 32 | SUBv2i64 | 01101110111xxxxx100001xxxxxxxxxx | 0xffe0fc00 / 0x6ee08400 |
| 32 | SUBv4i16 | 00101110011xxxxx100001xxxxxxxxxx | 0xffe0fc00 / 0x2e608400 |
Operands
| Name | Description |
|---|---|
Rd | |
Rn | |
imm | |
Rd | |
Rn | |
Rm_and_shift | |
Rm_and_extend | |
Rd | |
Rn | |
imm | |
Rd | |
Rn | |
Rm | |
ext |