SUB
Integer subtraction
Subtract scalar integers or corresponding vector elements, keeping the result within the selected width.
Similar operations on other architectures:PSUBB_mm_sub_epi8SUB
| Form | Bits | Requires | Encoding |
|---|---|---|---|
| Vector integer | |||
SUB Vd.16B,Vn.16B,Vm.16B | 128 | AdvSIMD | — |
SUB Vd.8H,Vn.8H,Vm.8H | 128 | AdvSIMD | — |
SUB Vd.4S,Vn.4S,Vm.4S | 128 | AdvSIMD | — |
| Scalar integer | |||
SUB Wd, Wn, Wm{, shift #amount} | 32 | Armv8-A | 01001011xx0xxxxxxxxxxxxxxxxxxxxx |
SUB Wd|WSP, Wn|WSP, #imm{, LSL #12} | 32 | Armv8-A | 010100010xxxxxxxxxxxxxxxxxxxxxxx |
SUB Xd, Xn, Xm{, shift #amount} | 64 | Armv8-A | 11001011xx0xxxxxxxxxxxxxxxxxxxxx |
SUB Xd|SP, Xn|SP, #imm{, LSL #12} | 64 | Armv8-A | 110100010xxxxxxxxxxxxxxxxxxxxxxx |
Explore the operation
The interactive explorer is loading. The operation and reference details are available below.
Operation#
dst[i] = (a[i] - b[i]) mod 256What to watch for
- This selected form performs independent byte subtractions.
- Vector SUB does not update NZCV.
Corresponding intrinsics#
Architectural details#
- Flags
- NZCV unchanged.
- Destination
- Writes all 128 bits of the selected V destination register.
- Encoding
- Encoding details have not been imported for this form.
- Operands
a -> Vn.16B b -> Vm.16BVdwrite · 128 bits (16 × 8) · unsignedaread · 128 bits (16 × 8) · unsignedbread · 128 bits (16 × 8) · unsigned
- Coverage
- Selected 128-bit AdvSIMD byte, halfword and word arrangements. Scalar forms, if present, have a separate variant. Other vector arrangements and SVE/SME are outside this variant.
Exception information & execution requirements
Complete exception conditions have not been imported.
Availability depends on execution-level controls for AdvSIMD. This ACLE import does not contain an exhaustive architectural exception list.
Feature availability alone does not guarantee execution: OS state and execution-level controls also apply. Use the linked architecture documentation for the full exception conditions.
Sources & provenance#
Technical fields are imported from pinned upstream files. Explanations and explorer behavior are maintained separately.
Arm · advsimd.md
- Revision
3a8fb2b1145b27ba0a9110ed32f3a6cfdad6c002- SHA-256
722dcf758d7a6dbbab54210d55bbce73a6db7691bb4092112375bf096563fd73- Terms
- CC-BY-SA-4.0 AND Apache-Patent-License
Arm · aarchmrs
- Revision
2026-03_rel- SHA-256
bf355d263eed08ef6b3e4e680e6bba3642fa7c3dd0be77ffb4783420041a0860- Terms
- BSD-3-Clause