forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
All aarch64 Instructions by Category
klakelyn edited this page Aug 2, 2022
·
43 revisions
Legend:
- ➖ (
:heavy_minus_sign
): unimplemented - ✅ (
:white_check_mark:
): mark implemented instructions - 🔜 (
:soon:
) for partially implemented instructions - ❌ (
:x:
) to mark ones we can't implement - ❓ (
:question:
) to raise issues
Abbreviations:
- imm: immediate
- shift: shifted register
- reg: register
- ext: extended register
- vec: vector
Indented dot-points indicate aliases of the parent instruction. LLVM automatically de-aliases these, so we only need to worry about implementing the top-level dot points.
Instructions | Status |
---|---|
LDADD, LDADDA, LDADDAL, LDADDL
|
➖ |
LDADDB, LDADDAB, LDADDALB, LDADDLB
|
➖ |
LDADDH, LDADDAH, LDADDALH, LDADDLH
|
➖ |
LDAPR | ➖ |
LDAPRB | ➖ |
LDAPRH | ➖ |
LDAPUR | ➖ |
LDAPURB | ➖ |
LDAPURH | ➖ |
LDAPURSB | ➖ |
LDAPURSH | ➖ |
LDAPURSW | ➖ |
LDAR | ➖ |
LDARB | ➖ |
LDARH | ➖ |
LDAXP | ➖ |
LDAXR | ➖ |
LDAXRB | ➖ |
LDAXRH | ➖ |
LDCLR, LDCLRA, LDCLRAL, LDCLRL
|
➖ |
LDCLRB, LDCLRAB, LDCLRALB, LDCLRLB
|
➖ |
LDCLRH, LDCLRAH, LDCLRALH, LDCLRLH
|
➖ |
LDEOR, LDEORA, LDEORAL, LDEORL
|
➖ |
LDEORB, LDEORAB, LDEORALB, LDEORLB
|
➖ |
LDEORH, LDEORAH, LDEORALH, LDEORLH
|
➖ |
LDLAR | ➖ |
LDLARB | ➖ |
LDLARH | ➖ |
LDNP | ➖ |
LDP | 🔜 |
LDPSW | ➖ |
LDR (imm) | 🔜 |
LDR (literal) | ➖ |
LDR (reg) | ✅ |
LDRB (imm) | ✅ |
LDRB (reg) | ✅ |
LDRH (imm) | 🔜 |
LDRH (reg) | ✅ |
LDRSB (imm) | ➖ |
LDRSB (reg) | ➖ |
LDRSH (imm) | ➖ |
LDRSH (reg) | ➖ |
LDRSW (imm) | ➖ |
LDRSW (literal) | ➖ |
LDRSW (reg) | ✅ |
LDSET, LDSETA, LDSETAL, LDSETL
|
➖ |
LDSETB, LDSETAB, LDSETALB, LDSETLB
|
➖ |
LDSETH, LDSETAH, LDSETALH, LDSETLH
|
➖ |
LDSMAX, LDSMAXA, LDSMAXAL, LDSMAXL
|
➖ |
LDSMAXB, LDSMAXAB, LDSMAXALB, LDSMAXLB
|
➖ |
LDSMAXH, LDSMAXAH, LDSMAXALH, LDSMAXLH
|
➖ |
LDSMIN, LDSMINA, LDSMINAL, LDSMINL
|
➖ |
LDSMINB, LDSMINAB, LDSMINALB, LDSMINLB
|
➖ |
LDSMINH, LDSMINAH, LDSMINALH, LDSMINLH
|
➖ |
LDUMAX, LDUMAXA, LDUMAXAL, LDUMAXL
|
➖ |
LDUMAXB, LDUMAXAB, LDUMAXALB, LDUMAXLB
|
➖ |
LDUMAXH, LDUMAXAH, LDUMAXALH, LDUMAXLH
|
➖ |
LDUMIN, LDUMINA, LDUMINAL, LDUMINL
|
➖ |
LDUMINB, LDUMINAB, LDUMINALB, LDUMINLB
|
➖ |
LDUMINH, LDUMINAH, LDUMINALH, LDUMINLH
|
➖ |
LDUR | ✅ |
LDURB | ✅ |
LDURH | ✅ |
LDURSB | ✅ |
LDURSH | ✅ |
LDURSW | ✅ |
LDXP | ➖ |
LDXR | ➖ |
LDXRB | ➖ |
LDXRH | ➖ |
MOVK | ✅ |
MOVN
|
🔜 |
MOVZ
|
✅ |
MRS | ➖ |
MSR (imm) | ➖ |
MSR (reg) | ➖ |
STLLR | ➖ |
STLLRB | ➖ |
STLLRH | ➖ |
STLR | ➖ |
STLRB | ➖ |
STLRH | ➖ |
STLUR | ➖ |
STLURB | ➖ |
STLURH | ➖ |
STLXP | ➖ |
STLXR | ➖ |
STLXRB | ➖ |
STLXRH | ➖ |
STNP | ➖ |
STP | ✅ |
STR (imm) | ✅ |
STR (reg) | ✅ |
STRB (imm) | ✅ |
STRB (reg) | ➖ |
STRH (imm) | ➖ |
STRH (reg) | ➖ |
STUR | ✅ |
STURB | ✅ |
STURH | ✅ |
SWP, SWPA, SWPAL, SWPL | ➖ |
SWPB, SWPAB, SWPALB, SWPLB | ➖ |
SWPH, SWPAH, SWPALH, SWPLH | ➖ |
Instructions | Status |
---|---|
AND (imm) | ✅ |
AND (shift) | ✅ |
ANDS (imm)
|
✅ |
ANDS (shift)
|
✅ |
ASRV
|
✅ |
BFM
|
➖ |
BIC (shift) | ✅ |
BICS (shift) | ✅ |
CLS | ➖ |
CLZ | ✅ |
EON (shift) | ➖ |
EOR (imm) | c |
EOR (shift) | ✅ |
EXTR
|
➖ |
LSLV
|
✅ |
LSRV
|
✅ |
ORN (shift)
|
✅ |
ORR (imm)
|
✅ |
ORR (shift)
|
✅ |
RBIT | ✅ |
REV
|
✅ |
REV16 | ➖ |
REV32 | ➖ |
RORV
|
✅ |
SBFM
|
✅ |
UBFM
|
✅ |
Instructions | Status |
---|---|
ADC | ➖ |
ADCS | ➖ |
ADD (ext) | ✅ |
ADD (imm)
|
✅ |
ADD (shift) | ✅ |
ADDG | ➖ |
ADDS (ext)
|
✅ |
ADDS (imm)
|
✅ |
ADDS (shift)
|
✅ |
ADR | ✅ |
ADRP | ✅ |
MADD
|
✅ |
MSUB
|
✅ |
SBC
|
➖ |
SBCS
|
➖ |
SDIV | ✅ |
SMADDL
|
✅ |
SMSUBL
|
✅ |
SUB (ext) | ✅ |
SUB (imm) | ✅ |
SUB (shift)
|
✅ |
SUBP | ➖ |
SUBPS
|
➖ |
SUBS (ext)
|
➖ |
SUBS (imm)
|
✅ |
SUBS (shift)
|
✅ |
UDIV | ✅ |
UMADDL
|
✅ |
UMSUBL
|
✅ |
UMULH | ✅ |
Instructions | Status |
---|---|
B.cond | ✅ |
B | ✅ |
BL | ✅ |
BLR | ✅ |
BR | ✅ |
CBNZ | ✅ |
CBZ | ✅ |
RET | ✅ |
TBNZ | ✅ |
TBZ | ✅ |
Instructions | Status |
---|---|
CAS, CASA, CASAL, CASL | ✅ |
CASB, CASAB, CASALB, CASLB | ✅ |
CASH, CASAH, CASALH, CASLH | ✅ |
CASP, CASPA, CASPAL, CASPL | ➖ |
CSEL | ✅ |
CSINC
|
✅ |
CSINV
|
✅ |
CSNEG
|
✅ |
Let's finish the others before getting to these..
Instructions | Status |
---|---|
AESD | ➖ |
AESE | ➖ |
AESIMC | ➖ |
AESMC | ➖ |
CRC32B, CRC32H, CRC32W, CRC32X | ➖ |
CRC32CB, CRC32CH, CRC32CW, CRC32CX | ➖ |
SHA1C | ➖ |
SHA1H | ➖ |
SHA1M | ➖ |
SHA1P | ➖ |
SHA1SU0 | ➖ |
SHA1SU1 | ➖ |
SHA256H | ➖ |
SHA256H2 | ➖ |
SHA256SU0 | ➖ |
SHA256SU1 | ➖ |
SHA512H | ➖ |
SHA512H2 | ➖ |
SHA512SU0 | ➖ |
SHA512SU1 | ➖ |
SHADD | ➖ |
SM3PARTW1 | ➖ |
SM3PARTW2 | ➖ |
SMESS1 | ➖ |
SM3TT1A | ➖ |
SM3TT1B | ➖ |
SM3TT2A | ➖ |
SM3TT2B | ➖ |
SM4E | ➖ |
SM4EKEY | ➖ |
These are just instructions that specifically deal with processor state. Other ones in other categories modify flags.
Instructions | Status |
---|---|
CCMN (imm) | ✅ |
CCMN (reg) | ✅ |
CCMP (imm) | ✅ |
CCMP (reg) | ✅ |
CFINV | ✅ |
RMIF | ✅ |
SETF8, SETF16 | ✅ |
Some of these require us to model processor exceptions, privileges etc. Not sure if we're doing that.
Instructions | Status |
---|---|
AUTDA, AUTDZA | ➖ |
AUTDB, AUTDZB | ➖ |
AUTIA, AUTIA1716, AUTIASP, AUTIAZ, AUTIZA | ➖ |
AUTIB, AUTIB1716, AUTIBSP, AUTIBZ, AUTIZB | ➖ |
BLRAA, BLRAAZ, BLRAB, BLRABZ | ➖ |
BRAA, BRAAZ, BRAB, BRABZ | ➖ |
BTI | ➖ |
CLREX | ➖ |
ERET | ➖ |
ERETAA, ERETAB | ➖ |
GMI | ➖ |
HVC | ➖ |
IRG | ➖ |
LDG | ➖ |
LDGV | ➖ |
LDRAA, LDRAB | ➖ |
LDTR | ➖ |
LDTRB | ➖ |
LDTRH | ➖ |
LDTRSB | ➖ |
LDTRSH | ➖ |
LDTRSW | ➖ |
PACDA, PACZDA | ➖ |
PACDB, PACDZB | ➖ |
PACGA | ➖ |
PACIA, PACIA1716, PACIASP, PACIAZ, PACIZA | ➖ |
PACIB, PACIB1716, PACIBSP, PACIBZ, PACIZB | ➖ |
PFRM (imm) [this is cool] | ➖ |
PFRM (literal) | ➖ |
PFRM (reg) | ➖ |
PFRM (unscaled offset) | ➖ |
RETAA, RETAB | ➖ |
SMC | ➖ |
STTR | ➖ |
STTRB | ➖ |
STTRH | ➖ |
STXP | ➖ |
STXR | ➖ |
STXRB | ➖ |
STXRH | ➖ |
STZ2G | ➖ |
STZG | ➖ |
SVC | ➖ |
SYS
|
➖ |
SYSL | ➖ |
XAFlag | ➖ |
XPACD, XPACI, XPACLRI | ➖ |
Instructions | Status |
---|---|
CSDB | ➖ |
DMB | ✅ |
DSB | ✅ |
ESB | ➖ |
HINT | ✅ |
ISB | ✅ |
NOP | ➖ |
PSB CSYNC | ➖ |
PSSBB | ➖ |
SB | ➖ |
SEV | ➖ |
SEVL | ➖ |
SSBB | ➖ |
ST2G | ➖ |
STG | ➖ |
STGP | ➖ |
STGV | ➖ |
SUBG | ➖ |
TSB CSYNC | ➖ |
UDF | ✅ |
WFE | ➖ |
WFI | ➖ |
YIELD | ➖ |
Not sure how to implement these in Primus Lisp.
Instructions | Status |
---|---|
BRK | ➖ |
DCPS1 | ➖ |
DCPS2 | ➖ |
DCPS3 | ➖ |
DRPS | ➖ |
HLT | ➖ |
I think implementing these is outside the scope of the project, but let me know if I'm wrong.
Instructions | Status |
---|---|
ABS | ➖ |
ADD (vec) | ➖ |
ADDHN, ADDHN2 | ➖ |
ADDP (scalar) | ➖ |
ADDP (vec) | ➖ |
ADDV | ➖ |
AND (vec) | ➖ |
AXflag | ➖ |
BCAX | ➖ |
BIC (vec, imm) | ➖ |
BIC (vec, reg) | ➖ |
BIF | ➖ |
BIT | ➖ |
BSL | ➖ |
CLS (vec) | ➖ |
CLZ (vec) | ➖ |
CMEQ (reg) | ➖ |
CMEQ (zero) | ➖ |
CMGE (reg) | ➖ |
CMGE (zero) | ➖ |
CMGT (reg) | ➖ |
CMGT (zero) | ➖ |
CMHI (reg) | ➖ |
CMHS (reg) | ➖ |
CMLE (zero) | ➖ |
CMLT (zero) | ➖ |
CMTST | ➖ |
CNT | ➖ |
DUP (element) | ➖ |
DUP (general) | ➖ |
EOR3 | ➖ |
EOR (vec) | ➖ |
EXT | ➖ |
everything starting with F | ➖ |
INS (element)
|
✅ |
INS (general)
|
✅ |
LD1 (multiple structures) | ✅ |
LD1 (single structure) | ✅ |
LD1R | ✅ |
LD2 (multiple structures) | ✅ |
LD2 (single structure) | ✅ |
LD2R | ✅ |
LD3 (multiple structures) | ✅ |
LD3 (single structure) | ✅ |
LD3R | ✅ |
LD4 (multiple structures) | ✅ |
LD4 (single structure) | ✅ |
LD4R | ✅ |
LDNP (SIMD&FP) | ✅ |
LDP (SIMD&FP) | ✅ |
LDR (imm, SIMD&FP) | ✅ |
LDR (literal, SIMD&FP) | ✅ |
LDR (reg, SIMD&FP) | ✅ |
LDUR (SIMD&FP) | ✅ |
MLA (by element) | ➖ |
MLA (vec) | ➖ |
MLS (by element) | ➖ |
MLS (vec) | ➖ |
MOVI | ➖ |
MUL (by element) | ➖ |
MUL (vec) | ➖ |
MVNI | ➖ |
NEG (vec) | ➖ |
NOT
|
➖ |
ORN (vec) | ➖ |
ORR (vec, imm) | ➖ |
ORR (vec, reg) | ➖ |
PMUL | ➖ |
PMULL, PMULL2 | ➖ |
RADDHN, RADDHN2 | ➖ |
RAX1 | ➖ |
RBIT | ➖ |
REV16 (vec) | ➖ |
REV32 (vec) | ➖ |
REV64 | ➖ |
RSHRN, RSHRN2 | ➖ |
RSUBHN, RSUBHN2 | ➖ |
SABA | ➖ |
SABAL, SABAL2 | ➖ |
SABD | ➖ |
SABDL, SABDL2 | ➖ |
SADALP | ➖ |
SADDL, SADDL2 | ➖ |
SADDLP | ➖ |
SADDLV | ➖ |
SADDW, SADDW2 | ➖ |
SCVTF (vec, fixed-point) | ➖ |
SCVTF (vec, integer) | ➖ |
SCVTF (scalar, fixed-point) | ➖ |
SCVTF (scalar, integer) | ➖ |
SDOT (by element) | ➖ |
SDOT (vec) | ➖ |
SHL | ➖ |
SHLL, SHLL2 | ➖ |
SHRN, SHRN2 | ➖ |
SHSUB | ➖ |
SLI | ➖ |
SMAX | ➖ |
SMAXP | ➖ |
SMAXV | ➖ |
SMIN | ➖ |
SMINP | ➖ |
SMINV | ➖ |
SMLAL, SMLAL2 (by element) | ➖ |
SMLAL, SMLAL2 (vec) | ➖ |
SMLSL, SMLSL2 (by element) | ➖ |
SMLSL, SMLSL2 (vec) | ➖ |
SMOV | ➖ |
SMULL, SMULL2 (by element) | ➖ |
SMULL, SMULL2 (vec) | ➖ |
everything starting with SQ | ➖ |
SRHADD | ➖ |
SRI | ➖ |
SRSHL | ➖ |
SRSHR | ➖ |
SRSRA | ➖ |
SSHL | ➖ |
SSHLL, SSHLL2
|
➖ |
SSHR | ➖ |
SSRA | ➖ |
SSUBL, SSUBL2 | ➖ |
SSUBW, SSUBW2 | ➖ |
ST1 (multiple structures) | ➖ |
ST1 (single structure) | ➖ |
ST2 (multiple structures) | ➖ |
ST2 (single structure) | ➖ |
ST3 (multiple structures) | ➖ |
ST3 (single structure) | ➖ |
ST4 (multiple structures) | ➖ |
ST4 (single structure) | ➖ |
STNP (SIMD&FP) | ➖ |
STP (SIMD&FP) | ✅ |
STR (imm, SIMD&FP) | ✅ |
STR (REG, SIMD&FP) | ✅ |
STUR (SIMD&FP) | ✅ |
SUB (vec) | ➖ |
SUBHN, SUBHN2 | ➖ |
SUQADD | ➖ |
TBL | ➖ |
TRN1 | ➖ |
TRN2 | ➖ |
UABA | ➖ |
UABAL, UABAL2 | ➖ |
UABD | ➖ |
UABDL, UABDL2 | ➖ |
UADALP | ➖ |
UADDL, UADDL2 | ➖ |
UADDLP | ➖ |
UADDLV | ➖ |
UADDW, UADDW2 | ➖ |
UCVTF (vec, fixed-point) | ➖ |
UCVTF (vec, int) | ➖ |
UCVTF (scalar, fixed-point) | ➖ |
UCVTF (scalar, int) | ➖ |
UDOT (by element) | ➖ |
UDOT (vec) | ➖ |
UHADD | ➖ |
UHSUB | ➖ |
UMAX | ➖ |
UMAXP | ➖ |
UMAXV | ➖ |
UMIN | ➖ |
UMINP | ➖ |
UMINV | ➖ |
UMLAL, UMLAL2 (by element) | ➖ |
UMLAL, UMLAL2 (vec) | ➖ |
UMLSL, UMLSL2 (by element) | ➖ |
UMLSL, UMLSL2 (vec) | ➖ |
UMOV
|
➖ |
UMULL, UMULL2 (by element) | ➖ |
UMULL, UMULL2 (vec) | ➖ |
UQADD | ➖ |
UQRSHL | ➖ |
UQRSHRN, UQRSHRN2 | ➖ |
UQSHL (imm) | ➖ |
UQSHL (reg) | ➖ |
UQSHRN, UQSHRN2 | ➖ |
UQSUB | ➖ |
UQXTN | ➖ |
UQXTN2 | ➖ |
URECPE | ➖ |
Urhadd | ➖ |
URSHL | ➖ |
URSHR | ➖ |
URSQRTE | ➖ |
URSRA | ➖ |
USHL | ➖ |
USHLL, USHLL2
|
➖ |
USHR | ➖ |
USQADD | ➖ |
USRA | ➖ |
USUBL, USUBL2 | ➖ |
USUBW, USUBW2 | ➖ |
UZP1 | ➖ |
UZP2 | ➖ |
XAR | ➖ |
XTN, XTN2 | ➖ |
ZIP1 | ➖ |
ZIP2 | ➖ |
What are "tags"? They're used by GMI, IRG, LDG, LDGV, ST2G, STG, STGP, STGV, STZ2G, STZG, SUBG.