arm.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  1. #ifndef CAPSTONE_ARM_H
  2. #define CAPSTONE_ARM_H
  3. /* Capstone Disassembly Engine */
  4. /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #include "platform.h"
  9. #ifdef _MSC_VER
  10. #pragma warning(disable:4201)
  11. #endif
  12. /// ARM shift type
  13. typedef enum arm_shifter {
  14. ARM_SFT_INVALID = 0,
  15. ARM_SFT_ASR, ///< shift with immediate const
  16. ARM_SFT_LSL, ///< shift with immediate const
  17. ARM_SFT_LSR, ///< shift with immediate const
  18. ARM_SFT_ROR, ///< shift with immediate const
  19. ARM_SFT_RRX, ///< shift with immediate const
  20. ARM_SFT_ASR_REG, ///< shift with register
  21. ARM_SFT_LSL_REG, ///< shift with register
  22. ARM_SFT_LSR_REG, ///< shift with register
  23. ARM_SFT_ROR_REG, ///< shift with register
  24. ARM_SFT_RRX_REG, ///< shift with register
  25. } arm_shifter;
  26. /// ARM condition code
  27. typedef enum arm_cc {
  28. ARM_CC_INVALID = 0,
  29. ARM_CC_EQ, ///< Equal Equal
  30. ARM_CC_NE, ///< Not equal Not equal, or unordered
  31. ARM_CC_HS, ///< Carry set >, ==, or unordered
  32. ARM_CC_LO, ///< Carry clear Less than
  33. ARM_CC_MI, ///< Minus, negative Less than
  34. ARM_CC_PL, ///< Plus, positive or zero >, ==, or unordered
  35. ARM_CC_VS, ///< Overflow Unordered
  36. ARM_CC_VC, ///< No overflow Not unordered
  37. ARM_CC_HI, ///< Unsigned higher Greater than, or unordered
  38. ARM_CC_LS, ///< Unsigned lower or same Less than or equal
  39. ARM_CC_GE, ///< Greater than or equal Greater than or equal
  40. ARM_CC_LT, ///< Less than Less than, or unordered
  41. ARM_CC_GT, ///< Greater than Greater than
  42. ARM_CC_LE, ///< Less than or equal <, ==, or unordered
  43. ARM_CC_AL ///< Always (unconditional) Always (unconditional)
  44. } arm_cc;
  45. typedef enum arm_sysreg {
  46. /// Special registers for MSR
  47. ARM_SYSREG_INVALID = 0,
  48. // SPSR* registers can be OR combined
  49. ARM_SYSREG_SPSR_C = 1,
  50. ARM_SYSREG_SPSR_X = 2,
  51. ARM_SYSREG_SPSR_S = 4,
  52. ARM_SYSREG_SPSR_F = 8,
  53. // CPSR* registers can be OR combined
  54. ARM_SYSREG_CPSR_C = 16,
  55. ARM_SYSREG_CPSR_X = 32,
  56. ARM_SYSREG_CPSR_S = 64,
  57. ARM_SYSREG_CPSR_F = 128,
  58. // independent registers
  59. ARM_SYSREG_APSR = 256,
  60. ARM_SYSREG_APSR_G,
  61. ARM_SYSREG_APSR_NZCVQ,
  62. ARM_SYSREG_APSR_NZCVQG,
  63. ARM_SYSREG_IAPSR,
  64. ARM_SYSREG_IAPSR_G,
  65. ARM_SYSREG_IAPSR_NZCVQG,
  66. ARM_SYSREG_IAPSR_NZCVQ,
  67. ARM_SYSREG_EAPSR,
  68. ARM_SYSREG_EAPSR_G,
  69. ARM_SYSREG_EAPSR_NZCVQG,
  70. ARM_SYSREG_EAPSR_NZCVQ,
  71. ARM_SYSREG_XPSR,
  72. ARM_SYSREG_XPSR_G,
  73. ARM_SYSREG_XPSR_NZCVQG,
  74. ARM_SYSREG_XPSR_NZCVQ,
  75. ARM_SYSREG_IPSR,
  76. ARM_SYSREG_EPSR,
  77. ARM_SYSREG_IEPSR,
  78. ARM_SYSREG_MSP,
  79. ARM_SYSREG_PSP,
  80. ARM_SYSREG_PRIMASK,
  81. ARM_SYSREG_BASEPRI,
  82. ARM_SYSREG_BASEPRI_MAX,
  83. ARM_SYSREG_FAULTMASK,
  84. ARM_SYSREG_CONTROL,
  85. // Banked Registers
  86. ARM_SYSREG_R8_USR,
  87. ARM_SYSREG_R9_USR,
  88. ARM_SYSREG_R10_USR,
  89. ARM_SYSREG_R11_USR,
  90. ARM_SYSREG_R12_USR,
  91. ARM_SYSREG_SP_USR,
  92. ARM_SYSREG_LR_USR,
  93. ARM_SYSREG_R8_FIQ,
  94. ARM_SYSREG_R9_FIQ,
  95. ARM_SYSREG_R10_FIQ,
  96. ARM_SYSREG_R11_FIQ,
  97. ARM_SYSREG_R12_FIQ,
  98. ARM_SYSREG_SP_FIQ,
  99. ARM_SYSREG_LR_FIQ,
  100. ARM_SYSREG_LR_IRQ,
  101. ARM_SYSREG_SP_IRQ,
  102. ARM_SYSREG_LR_SVC,
  103. ARM_SYSREG_SP_SVC,
  104. ARM_SYSREG_LR_ABT,
  105. ARM_SYSREG_SP_ABT,
  106. ARM_SYSREG_LR_UND,
  107. ARM_SYSREG_SP_UND,
  108. ARM_SYSREG_LR_MON,
  109. ARM_SYSREG_SP_MON,
  110. ARM_SYSREG_ELR_HYP,
  111. ARM_SYSREG_SP_HYP,
  112. ARM_SYSREG_SPSR_FIQ,
  113. ARM_SYSREG_SPSR_IRQ,
  114. ARM_SYSREG_SPSR_SVC,
  115. ARM_SYSREG_SPSR_ABT,
  116. ARM_SYSREG_SPSR_UND,
  117. ARM_SYSREG_SPSR_MON,
  118. ARM_SYSREG_SPSR_HYP,
  119. } arm_sysreg;
  120. /// The memory barrier constants map directly to the 4-bit encoding of
  121. /// the option field for Memory Barrier operations.
  122. typedef enum arm_mem_barrier {
  123. ARM_MB_INVALID = 0,
  124. ARM_MB_RESERVED_0,
  125. ARM_MB_OSHLD,
  126. ARM_MB_OSHST,
  127. ARM_MB_OSH,
  128. ARM_MB_RESERVED_4,
  129. ARM_MB_NSHLD,
  130. ARM_MB_NSHST,
  131. ARM_MB_NSH,
  132. ARM_MB_RESERVED_8,
  133. ARM_MB_ISHLD,
  134. ARM_MB_ISHST,
  135. ARM_MB_ISH,
  136. ARM_MB_RESERVED_12,
  137. ARM_MB_LD,
  138. ARM_MB_ST,
  139. ARM_MB_SY,
  140. } arm_mem_barrier;
  141. /// Operand type for instruction's operands
  142. typedef enum arm_op_type {
  143. ARM_OP_INVALID = 0, ///< = CS_OP_INVALID (Uninitialized).
  144. ARM_OP_REG, ///< = CS_OP_REG (Register operand).
  145. ARM_OP_IMM, ///< = CS_OP_IMM (Immediate operand).
  146. ARM_OP_MEM, ///< = CS_OP_MEM (Memory operand).
  147. ARM_OP_FP, ///< = CS_OP_FP (Floating-Point operand).
  148. ARM_OP_CIMM = 64, ///< C-Immediate (coprocessor registers)
  149. ARM_OP_PIMM, ///< P-Immediate (coprocessor registers)
  150. ARM_OP_SETEND, ///< operand for SETEND instruction
  151. ARM_OP_SYSREG, ///< MSR/MRS special register operand
  152. } arm_op_type;
  153. /// Operand type for SETEND instruction
  154. typedef enum arm_setend_type {
  155. ARM_SETEND_INVALID = 0, ///< Uninitialized.
  156. ARM_SETEND_BE, ///< BE operand.
  157. ARM_SETEND_LE, ///< LE operand
  158. } arm_setend_type;
  159. typedef enum arm_cpsmode_type {
  160. ARM_CPSMODE_INVALID = 0,
  161. ARM_CPSMODE_IE = 2,
  162. ARM_CPSMODE_ID = 3
  163. } arm_cpsmode_type;
  164. /// Operand type for SETEND instruction
  165. typedef enum arm_cpsflag_type {
  166. ARM_CPSFLAG_INVALID = 0,
  167. ARM_CPSFLAG_F = 1,
  168. ARM_CPSFLAG_I = 2,
  169. ARM_CPSFLAG_A = 4,
  170. ARM_CPSFLAG_NONE = 16, ///< no flag
  171. } arm_cpsflag_type;
  172. /// Data type for elements of vector instructions.
  173. typedef enum arm_vectordata_type {
  174. ARM_VECTORDATA_INVALID = 0,
  175. // Integer type
  176. ARM_VECTORDATA_I8,
  177. ARM_VECTORDATA_I16,
  178. ARM_VECTORDATA_I32,
  179. ARM_VECTORDATA_I64,
  180. // Signed integer type
  181. ARM_VECTORDATA_S8,
  182. ARM_VECTORDATA_S16,
  183. ARM_VECTORDATA_S32,
  184. ARM_VECTORDATA_S64,
  185. // Unsigned integer type
  186. ARM_VECTORDATA_U8,
  187. ARM_VECTORDATA_U16,
  188. ARM_VECTORDATA_U32,
  189. ARM_VECTORDATA_U64,
  190. // Data type for VMUL/VMULL
  191. ARM_VECTORDATA_P8,
  192. // Floating type
  193. ARM_VECTORDATA_F32,
  194. ARM_VECTORDATA_F64,
  195. // Convert float <-> float
  196. ARM_VECTORDATA_F16F64, // f16.f64
  197. ARM_VECTORDATA_F64F16, // f64.f16
  198. ARM_VECTORDATA_F32F16, // f32.f16
  199. ARM_VECTORDATA_F16F32, // f32.f16
  200. ARM_VECTORDATA_F64F32, // f64.f32
  201. ARM_VECTORDATA_F32F64, // f32.f64
  202. // Convert integer <-> float
  203. ARM_VECTORDATA_S32F32, // s32.f32
  204. ARM_VECTORDATA_U32F32, // u32.f32
  205. ARM_VECTORDATA_F32S32, // f32.s32
  206. ARM_VECTORDATA_F32U32, // f32.u32
  207. ARM_VECTORDATA_F64S16, // f64.s16
  208. ARM_VECTORDATA_F32S16, // f32.s16
  209. ARM_VECTORDATA_F64S32, // f64.s32
  210. ARM_VECTORDATA_S16F64, // s16.f64
  211. ARM_VECTORDATA_S16F32, // s16.f64
  212. ARM_VECTORDATA_S32F64, // s32.f64
  213. ARM_VECTORDATA_U16F64, // u16.f64
  214. ARM_VECTORDATA_U16F32, // u16.f32
  215. ARM_VECTORDATA_U32F64, // u32.f64
  216. ARM_VECTORDATA_F64U16, // f64.u16
  217. ARM_VECTORDATA_F32U16, // f32.u16
  218. ARM_VECTORDATA_F64U32, // f64.u32
  219. } arm_vectordata_type;
  220. /// ARM registers
  221. typedef enum arm_reg {
  222. ARM_REG_INVALID = 0,
  223. ARM_REG_APSR,
  224. ARM_REG_APSR_NZCV,
  225. ARM_REG_CPSR,
  226. ARM_REG_FPEXC,
  227. ARM_REG_FPINST,
  228. ARM_REG_FPSCR,
  229. ARM_REG_FPSCR_NZCV,
  230. ARM_REG_FPSID,
  231. ARM_REG_ITSTATE,
  232. ARM_REG_LR,
  233. ARM_REG_PC,
  234. ARM_REG_SP,
  235. ARM_REG_SPSR,
  236. ARM_REG_D0,
  237. ARM_REG_D1,
  238. ARM_REG_D2,
  239. ARM_REG_D3,
  240. ARM_REG_D4,
  241. ARM_REG_D5,
  242. ARM_REG_D6,
  243. ARM_REG_D7,
  244. ARM_REG_D8,
  245. ARM_REG_D9,
  246. ARM_REG_D10,
  247. ARM_REG_D11,
  248. ARM_REG_D12,
  249. ARM_REG_D13,
  250. ARM_REG_D14,
  251. ARM_REG_D15,
  252. ARM_REG_D16,
  253. ARM_REG_D17,
  254. ARM_REG_D18,
  255. ARM_REG_D19,
  256. ARM_REG_D20,
  257. ARM_REG_D21,
  258. ARM_REG_D22,
  259. ARM_REG_D23,
  260. ARM_REG_D24,
  261. ARM_REG_D25,
  262. ARM_REG_D26,
  263. ARM_REG_D27,
  264. ARM_REG_D28,
  265. ARM_REG_D29,
  266. ARM_REG_D30,
  267. ARM_REG_D31,
  268. ARM_REG_FPINST2,
  269. ARM_REG_MVFR0,
  270. ARM_REG_MVFR1,
  271. ARM_REG_MVFR2,
  272. ARM_REG_Q0,
  273. ARM_REG_Q1,
  274. ARM_REG_Q2,
  275. ARM_REG_Q3,
  276. ARM_REG_Q4,
  277. ARM_REG_Q5,
  278. ARM_REG_Q6,
  279. ARM_REG_Q7,
  280. ARM_REG_Q8,
  281. ARM_REG_Q9,
  282. ARM_REG_Q10,
  283. ARM_REG_Q11,
  284. ARM_REG_Q12,
  285. ARM_REG_Q13,
  286. ARM_REG_Q14,
  287. ARM_REG_Q15,
  288. ARM_REG_R0,
  289. ARM_REG_R1,
  290. ARM_REG_R2,
  291. ARM_REG_R3,
  292. ARM_REG_R4,
  293. ARM_REG_R5,
  294. ARM_REG_R6,
  295. ARM_REG_R7,
  296. ARM_REG_R8,
  297. ARM_REG_R9,
  298. ARM_REG_R10,
  299. ARM_REG_R11,
  300. ARM_REG_R12,
  301. ARM_REG_S0,
  302. ARM_REG_S1,
  303. ARM_REG_S2,
  304. ARM_REG_S3,
  305. ARM_REG_S4,
  306. ARM_REG_S5,
  307. ARM_REG_S6,
  308. ARM_REG_S7,
  309. ARM_REG_S8,
  310. ARM_REG_S9,
  311. ARM_REG_S10,
  312. ARM_REG_S11,
  313. ARM_REG_S12,
  314. ARM_REG_S13,
  315. ARM_REG_S14,
  316. ARM_REG_S15,
  317. ARM_REG_S16,
  318. ARM_REG_S17,
  319. ARM_REG_S18,
  320. ARM_REG_S19,
  321. ARM_REG_S20,
  322. ARM_REG_S21,
  323. ARM_REG_S22,
  324. ARM_REG_S23,
  325. ARM_REG_S24,
  326. ARM_REG_S25,
  327. ARM_REG_S26,
  328. ARM_REG_S27,
  329. ARM_REG_S28,
  330. ARM_REG_S29,
  331. ARM_REG_S30,
  332. ARM_REG_S31,
  333. ARM_REG_ENDING, // <-- mark the end of the list or registers
  334. // alias registers
  335. ARM_REG_R13 = ARM_REG_SP,
  336. ARM_REG_R14 = ARM_REG_LR,
  337. ARM_REG_R15 = ARM_REG_PC,
  338. ARM_REG_SB = ARM_REG_R9,
  339. ARM_REG_SL = ARM_REG_R10,
  340. ARM_REG_FP = ARM_REG_R11,
  341. ARM_REG_IP = ARM_REG_R12,
  342. } arm_reg;
  343. /// Instruction's operand referring to memory
  344. /// This is associated with ARM_OP_MEM operand type above
  345. typedef struct arm_op_mem {
  346. arm_reg base; ///< base register
  347. arm_reg index; ///< index register
  348. int scale; ///< scale for index register (can be 1, or -1)
  349. int disp; ///< displacement/offset value
  350. /// left-shift on index register, or 0 if irrelevant
  351. /// NOTE: this value can also be fetched via operand.shift.value
  352. int lshift;
  353. } arm_op_mem;
  354. /// Instruction operand
  355. typedef struct cs_arm_op {
  356. int vector_index; ///< Vector Index for some vector operands (or -1 if irrelevant)
  357. struct {
  358. arm_shifter type;
  359. unsigned int value;
  360. } shift;
  361. arm_op_type type; ///< operand type
  362. union {
  363. int reg; ///< register value for REG/SYSREG operand
  364. int32_t imm; ///< immediate value for C-IMM, P-IMM or IMM operand
  365. double fp; ///< floating point value for FP operand
  366. arm_op_mem mem; ///< base/index/scale/disp value for MEM operand
  367. arm_setend_type setend; ///< SETEND instruction's operand type
  368. };
  369. /// in some instructions, an operand can be subtracted or added to
  370. /// the base register,
  371. /// if TRUE, this operand is subtracted. otherwise, it is added.
  372. bool subtracted;
  373. /// How is this operand accessed? (READ, WRITE or READ|WRITE)
  374. /// This field is combined of cs_ac_type.
  375. /// NOTE: this field is irrelevant if engine is compiled in DIET mode.
  376. uint8_t access;
  377. /// Neon lane index for NEON instructions (or -1 if irrelevant)
  378. int8_t neon_lane;
  379. } cs_arm_op;
  380. /// Instruction structure
  381. typedef struct cs_arm {
  382. bool usermode; ///< User-mode registers to be loaded (for LDM/STM instructions)
  383. int vector_size; ///< Scalar size for vector instructions
  384. arm_vectordata_type vector_data; ///< Data type for elements of vector instructions
  385. arm_cpsmode_type cps_mode; ///< CPS mode for CPS instruction
  386. arm_cpsflag_type cps_flag; ///< CPS mode for CPS instruction
  387. arm_cc cc; ///< conditional code for this insn
  388. bool update_flags; ///< does this insn update flags?
  389. bool writeback; ///< does this insn write-back?
  390. arm_mem_barrier mem_barrier; ///< Option for some memory barrier instructions
  391. /// Number of operands of this instruction,
  392. /// or 0 when instruction has no operand.
  393. uint8_t op_count;
  394. cs_arm_op operands[36]; ///< operands for this instruction.
  395. } cs_arm;
  396. /// ARM instruction
  397. typedef enum arm_insn {
  398. ARM_INS_INVALID = 0,
  399. ARM_INS_ADC,
  400. ARM_INS_ADD,
  401. ARM_INS_ADR,
  402. ARM_INS_AESD,
  403. ARM_INS_AESE,
  404. ARM_INS_AESIMC,
  405. ARM_INS_AESMC,
  406. ARM_INS_AND,
  407. ARM_INS_BFC,
  408. ARM_INS_BFI,
  409. ARM_INS_BIC,
  410. ARM_INS_BKPT,
  411. ARM_INS_BL,
  412. ARM_INS_BLX,
  413. ARM_INS_BX,
  414. ARM_INS_BXJ,
  415. ARM_INS_B,
  416. ARM_INS_CDP,
  417. ARM_INS_CDP2,
  418. ARM_INS_CLREX,
  419. ARM_INS_CLZ,
  420. ARM_INS_CMN,
  421. ARM_INS_CMP,
  422. ARM_INS_CPS,
  423. ARM_INS_CRC32B,
  424. ARM_INS_CRC32CB,
  425. ARM_INS_CRC32CH,
  426. ARM_INS_CRC32CW,
  427. ARM_INS_CRC32H,
  428. ARM_INS_CRC32W,
  429. ARM_INS_DBG,
  430. ARM_INS_DMB,
  431. ARM_INS_DSB,
  432. ARM_INS_EOR,
  433. ARM_INS_ERET,
  434. ARM_INS_VMOV,
  435. ARM_INS_FLDMDBX,
  436. ARM_INS_FLDMIAX,
  437. ARM_INS_VMRS,
  438. ARM_INS_FSTMDBX,
  439. ARM_INS_FSTMIAX,
  440. ARM_INS_HINT,
  441. ARM_INS_HLT,
  442. ARM_INS_HVC,
  443. ARM_INS_ISB,
  444. ARM_INS_LDA,
  445. ARM_INS_LDAB,
  446. ARM_INS_LDAEX,
  447. ARM_INS_LDAEXB,
  448. ARM_INS_LDAEXD,
  449. ARM_INS_LDAEXH,
  450. ARM_INS_LDAH,
  451. ARM_INS_LDC2L,
  452. ARM_INS_LDC2,
  453. ARM_INS_LDCL,
  454. ARM_INS_LDC,
  455. ARM_INS_LDMDA,
  456. ARM_INS_LDMDB,
  457. ARM_INS_LDM,
  458. ARM_INS_LDMIB,
  459. ARM_INS_LDRBT,
  460. ARM_INS_LDRB,
  461. ARM_INS_LDRD,
  462. ARM_INS_LDREX,
  463. ARM_INS_LDREXB,
  464. ARM_INS_LDREXD,
  465. ARM_INS_LDREXH,
  466. ARM_INS_LDRH,
  467. ARM_INS_LDRHT,
  468. ARM_INS_LDRSB,
  469. ARM_INS_LDRSBT,
  470. ARM_INS_LDRSH,
  471. ARM_INS_LDRSHT,
  472. ARM_INS_LDRT,
  473. ARM_INS_LDR,
  474. ARM_INS_MCR,
  475. ARM_INS_MCR2,
  476. ARM_INS_MCRR,
  477. ARM_INS_MCRR2,
  478. ARM_INS_MLA,
  479. ARM_INS_MLS,
  480. ARM_INS_MOV,
  481. ARM_INS_MOVT,
  482. ARM_INS_MOVW,
  483. ARM_INS_MRC,
  484. ARM_INS_MRC2,
  485. ARM_INS_MRRC,
  486. ARM_INS_MRRC2,
  487. ARM_INS_MRS,
  488. ARM_INS_MSR,
  489. ARM_INS_MUL,
  490. ARM_INS_MVN,
  491. ARM_INS_ORR,
  492. ARM_INS_PKHBT,
  493. ARM_INS_PKHTB,
  494. ARM_INS_PLDW,
  495. ARM_INS_PLD,
  496. ARM_INS_PLI,
  497. ARM_INS_QADD,
  498. ARM_INS_QADD16,
  499. ARM_INS_QADD8,
  500. ARM_INS_QASX,
  501. ARM_INS_QDADD,
  502. ARM_INS_QDSUB,
  503. ARM_INS_QSAX,
  504. ARM_INS_QSUB,
  505. ARM_INS_QSUB16,
  506. ARM_INS_QSUB8,
  507. ARM_INS_RBIT,
  508. ARM_INS_REV,
  509. ARM_INS_REV16,
  510. ARM_INS_REVSH,
  511. ARM_INS_RFEDA,
  512. ARM_INS_RFEDB,
  513. ARM_INS_RFEIA,
  514. ARM_INS_RFEIB,
  515. ARM_INS_RSB,
  516. ARM_INS_RSC,
  517. ARM_INS_SADD16,
  518. ARM_INS_SADD8,
  519. ARM_INS_SASX,
  520. ARM_INS_SBC,
  521. ARM_INS_SBFX,
  522. ARM_INS_SDIV,
  523. ARM_INS_SEL,
  524. ARM_INS_SETEND,
  525. ARM_INS_SHA1C,
  526. ARM_INS_SHA1H,
  527. ARM_INS_SHA1M,
  528. ARM_INS_SHA1P,
  529. ARM_INS_SHA1SU0,
  530. ARM_INS_SHA1SU1,
  531. ARM_INS_SHA256H,
  532. ARM_INS_SHA256H2,
  533. ARM_INS_SHA256SU0,
  534. ARM_INS_SHA256SU1,
  535. ARM_INS_SHADD16,
  536. ARM_INS_SHADD8,
  537. ARM_INS_SHASX,
  538. ARM_INS_SHSAX,
  539. ARM_INS_SHSUB16,
  540. ARM_INS_SHSUB8,
  541. ARM_INS_SMC,
  542. ARM_INS_SMLABB,
  543. ARM_INS_SMLABT,
  544. ARM_INS_SMLAD,
  545. ARM_INS_SMLADX,
  546. ARM_INS_SMLAL,
  547. ARM_INS_SMLALBB,
  548. ARM_INS_SMLALBT,
  549. ARM_INS_SMLALD,
  550. ARM_INS_SMLALDX,
  551. ARM_INS_SMLALTB,
  552. ARM_INS_SMLALTT,
  553. ARM_INS_SMLATB,
  554. ARM_INS_SMLATT,
  555. ARM_INS_SMLAWB,
  556. ARM_INS_SMLAWT,
  557. ARM_INS_SMLSD,
  558. ARM_INS_SMLSDX,
  559. ARM_INS_SMLSLD,
  560. ARM_INS_SMLSLDX,
  561. ARM_INS_SMMLA,
  562. ARM_INS_SMMLAR,
  563. ARM_INS_SMMLS,
  564. ARM_INS_SMMLSR,
  565. ARM_INS_SMMUL,
  566. ARM_INS_SMMULR,
  567. ARM_INS_SMUAD,
  568. ARM_INS_SMUADX,
  569. ARM_INS_SMULBB,
  570. ARM_INS_SMULBT,
  571. ARM_INS_SMULL,
  572. ARM_INS_SMULTB,
  573. ARM_INS_SMULTT,
  574. ARM_INS_SMULWB,
  575. ARM_INS_SMULWT,
  576. ARM_INS_SMUSD,
  577. ARM_INS_SMUSDX,
  578. ARM_INS_SRSDA,
  579. ARM_INS_SRSDB,
  580. ARM_INS_SRSIA,
  581. ARM_INS_SRSIB,
  582. ARM_INS_SSAT,
  583. ARM_INS_SSAT16,
  584. ARM_INS_SSAX,
  585. ARM_INS_SSUB16,
  586. ARM_INS_SSUB8,
  587. ARM_INS_STC2L,
  588. ARM_INS_STC2,
  589. ARM_INS_STCL,
  590. ARM_INS_STC,
  591. ARM_INS_STL,
  592. ARM_INS_STLB,
  593. ARM_INS_STLEX,
  594. ARM_INS_STLEXB,
  595. ARM_INS_STLEXD,
  596. ARM_INS_STLEXH,
  597. ARM_INS_STLH,
  598. ARM_INS_STMDA,
  599. ARM_INS_STMDB,
  600. ARM_INS_STM,
  601. ARM_INS_STMIB,
  602. ARM_INS_STRBT,
  603. ARM_INS_STRB,
  604. ARM_INS_STRD,
  605. ARM_INS_STREX,
  606. ARM_INS_STREXB,
  607. ARM_INS_STREXD,
  608. ARM_INS_STREXH,
  609. ARM_INS_STRH,
  610. ARM_INS_STRHT,
  611. ARM_INS_STRT,
  612. ARM_INS_STR,
  613. ARM_INS_SUB,
  614. ARM_INS_SVC,
  615. ARM_INS_SWP,
  616. ARM_INS_SWPB,
  617. ARM_INS_SXTAB,
  618. ARM_INS_SXTAB16,
  619. ARM_INS_SXTAH,
  620. ARM_INS_SXTB,
  621. ARM_INS_SXTB16,
  622. ARM_INS_SXTH,
  623. ARM_INS_TEQ,
  624. ARM_INS_TRAP,
  625. ARM_INS_TST,
  626. ARM_INS_UADD16,
  627. ARM_INS_UADD8,
  628. ARM_INS_UASX,
  629. ARM_INS_UBFX,
  630. ARM_INS_UDF,
  631. ARM_INS_UDIV,
  632. ARM_INS_UHADD16,
  633. ARM_INS_UHADD8,
  634. ARM_INS_UHASX,
  635. ARM_INS_UHSAX,
  636. ARM_INS_UHSUB16,
  637. ARM_INS_UHSUB8,
  638. ARM_INS_UMAAL,
  639. ARM_INS_UMLAL,
  640. ARM_INS_UMULL,
  641. ARM_INS_UQADD16,
  642. ARM_INS_UQADD8,
  643. ARM_INS_UQASX,
  644. ARM_INS_UQSAX,
  645. ARM_INS_UQSUB16,
  646. ARM_INS_UQSUB8,
  647. ARM_INS_USAD8,
  648. ARM_INS_USADA8,
  649. ARM_INS_USAT,
  650. ARM_INS_USAT16,
  651. ARM_INS_USAX,
  652. ARM_INS_USUB16,
  653. ARM_INS_USUB8,
  654. ARM_INS_UXTAB,
  655. ARM_INS_UXTAB16,
  656. ARM_INS_UXTAH,
  657. ARM_INS_UXTB,
  658. ARM_INS_UXTB16,
  659. ARM_INS_UXTH,
  660. ARM_INS_VABAL,
  661. ARM_INS_VABA,
  662. ARM_INS_VABDL,
  663. ARM_INS_VABD,
  664. ARM_INS_VABS,
  665. ARM_INS_VACGE,
  666. ARM_INS_VACGT,
  667. ARM_INS_VADD,
  668. ARM_INS_VADDHN,
  669. ARM_INS_VADDL,
  670. ARM_INS_VADDW,
  671. ARM_INS_VAND,
  672. ARM_INS_VBIC,
  673. ARM_INS_VBIF,
  674. ARM_INS_VBIT,
  675. ARM_INS_VBSL,
  676. ARM_INS_VCEQ,
  677. ARM_INS_VCGE,
  678. ARM_INS_VCGT,
  679. ARM_INS_VCLE,
  680. ARM_INS_VCLS,
  681. ARM_INS_VCLT,
  682. ARM_INS_VCLZ,
  683. ARM_INS_VCMP,
  684. ARM_INS_VCMPE,
  685. ARM_INS_VCNT,
  686. ARM_INS_VCVTA,
  687. ARM_INS_VCVTB,
  688. ARM_INS_VCVT,
  689. ARM_INS_VCVTM,
  690. ARM_INS_VCVTN,
  691. ARM_INS_VCVTP,
  692. ARM_INS_VCVTT,
  693. ARM_INS_VDIV,
  694. ARM_INS_VDUP,
  695. ARM_INS_VEOR,
  696. ARM_INS_VEXT,
  697. ARM_INS_VFMA,
  698. ARM_INS_VFMS,
  699. ARM_INS_VFNMA,
  700. ARM_INS_VFNMS,
  701. ARM_INS_VHADD,
  702. ARM_INS_VHSUB,
  703. ARM_INS_VLD1,
  704. ARM_INS_VLD2,
  705. ARM_INS_VLD3,
  706. ARM_INS_VLD4,
  707. ARM_INS_VLDMDB,
  708. ARM_INS_VLDMIA,
  709. ARM_INS_VLDR,
  710. ARM_INS_VMAXNM,
  711. ARM_INS_VMAX,
  712. ARM_INS_VMINNM,
  713. ARM_INS_VMIN,
  714. ARM_INS_VMLA,
  715. ARM_INS_VMLAL,
  716. ARM_INS_VMLS,
  717. ARM_INS_VMLSL,
  718. ARM_INS_VMOVL,
  719. ARM_INS_VMOVN,
  720. ARM_INS_VMSR,
  721. ARM_INS_VMUL,
  722. ARM_INS_VMULL,
  723. ARM_INS_VMVN,
  724. ARM_INS_VNEG,
  725. ARM_INS_VNMLA,
  726. ARM_INS_VNMLS,
  727. ARM_INS_VNMUL,
  728. ARM_INS_VORN,
  729. ARM_INS_VORR,
  730. ARM_INS_VPADAL,
  731. ARM_INS_VPADDL,
  732. ARM_INS_VPADD,
  733. ARM_INS_VPMAX,
  734. ARM_INS_VPMIN,
  735. ARM_INS_VQABS,
  736. ARM_INS_VQADD,
  737. ARM_INS_VQDMLAL,
  738. ARM_INS_VQDMLSL,
  739. ARM_INS_VQDMULH,
  740. ARM_INS_VQDMULL,
  741. ARM_INS_VQMOVUN,
  742. ARM_INS_VQMOVN,
  743. ARM_INS_VQNEG,
  744. ARM_INS_VQRDMULH,
  745. ARM_INS_VQRSHL,
  746. ARM_INS_VQRSHRN,
  747. ARM_INS_VQRSHRUN,
  748. ARM_INS_VQSHL,
  749. ARM_INS_VQSHLU,
  750. ARM_INS_VQSHRN,
  751. ARM_INS_VQSHRUN,
  752. ARM_INS_VQSUB,
  753. ARM_INS_VRADDHN,
  754. ARM_INS_VRECPE,
  755. ARM_INS_VRECPS,
  756. ARM_INS_VREV16,
  757. ARM_INS_VREV32,
  758. ARM_INS_VREV64,
  759. ARM_INS_VRHADD,
  760. ARM_INS_VRINTA,
  761. ARM_INS_VRINTM,
  762. ARM_INS_VRINTN,
  763. ARM_INS_VRINTP,
  764. ARM_INS_VRINTR,
  765. ARM_INS_VRINTX,
  766. ARM_INS_VRINTZ,
  767. ARM_INS_VRSHL,
  768. ARM_INS_VRSHRN,
  769. ARM_INS_VRSHR,
  770. ARM_INS_VRSQRTE,
  771. ARM_INS_VRSQRTS,
  772. ARM_INS_VRSRA,
  773. ARM_INS_VRSUBHN,
  774. ARM_INS_VSELEQ,
  775. ARM_INS_VSELGE,
  776. ARM_INS_VSELGT,
  777. ARM_INS_VSELVS,
  778. ARM_INS_VSHLL,
  779. ARM_INS_VSHL,
  780. ARM_INS_VSHRN,
  781. ARM_INS_VSHR,
  782. ARM_INS_VSLI,
  783. ARM_INS_VSQRT,
  784. ARM_INS_VSRA,
  785. ARM_INS_VSRI,
  786. ARM_INS_VST1,
  787. ARM_INS_VST2,
  788. ARM_INS_VST3,
  789. ARM_INS_VST4,
  790. ARM_INS_VSTMDB,
  791. ARM_INS_VSTMIA,
  792. ARM_INS_VSTR,
  793. ARM_INS_VSUB,
  794. ARM_INS_VSUBHN,
  795. ARM_INS_VSUBL,
  796. ARM_INS_VSUBW,
  797. ARM_INS_VSWP,
  798. ARM_INS_VTBL,
  799. ARM_INS_VTBX,
  800. ARM_INS_VCVTR,
  801. ARM_INS_VTRN,
  802. ARM_INS_VTST,
  803. ARM_INS_VUZP,
  804. ARM_INS_VZIP,
  805. ARM_INS_ADDW,
  806. ARM_INS_ASR,
  807. ARM_INS_DCPS1,
  808. ARM_INS_DCPS2,
  809. ARM_INS_DCPS3,
  810. ARM_INS_IT,
  811. ARM_INS_LSL,
  812. ARM_INS_LSR,
  813. ARM_INS_ORN,
  814. ARM_INS_ROR,
  815. ARM_INS_RRX,
  816. ARM_INS_SUBW,
  817. ARM_INS_TBB,
  818. ARM_INS_TBH,
  819. ARM_INS_CBNZ,
  820. ARM_INS_CBZ,
  821. ARM_INS_POP,
  822. ARM_INS_PUSH,
  823. // special instructions
  824. ARM_INS_NOP,
  825. ARM_INS_YIELD,
  826. ARM_INS_WFE,
  827. ARM_INS_WFI,
  828. ARM_INS_SEV,
  829. ARM_INS_SEVL,
  830. ARM_INS_VPUSH,
  831. ARM_INS_VPOP,
  832. ARM_INS_ENDING, // <-- mark the end of the list of instructions
  833. } arm_insn;
  834. /// Group of ARM instructions
  835. typedef enum arm_insn_group {
  836. ARM_GRP_INVALID = 0, ///< = CS_GRP_INVALID
  837. // Generic groups
  838. // all jump instructions (conditional+direct+indirect jumps)
  839. ARM_GRP_JUMP, ///< = CS_GRP_JUMP
  840. ARM_GRP_CALL, ///< = CS_GRP_CALL
  841. ARM_GRP_INT = 4, ///< = CS_GRP_INT
  842. ARM_GRP_PRIVILEGE = 6, ///< = CS_GRP_PRIVILEGE
  843. ARM_GRP_BRANCH_RELATIVE, ///< = CS_GRP_BRANCH_RELATIVE
  844. // Architecture-specific groups
  845. ARM_GRP_CRYPTO = 128,
  846. ARM_GRP_DATABARRIER,
  847. ARM_GRP_DIVIDE,
  848. ARM_GRP_FPARMV8,
  849. ARM_GRP_MULTPRO,
  850. ARM_GRP_NEON,
  851. ARM_GRP_T2EXTRACTPACK,
  852. ARM_GRP_THUMB2DSP,
  853. ARM_GRP_TRUSTZONE,
  854. ARM_GRP_V4T,
  855. ARM_GRP_V5T,
  856. ARM_GRP_V5TE,
  857. ARM_GRP_V6,
  858. ARM_GRP_V6T2,
  859. ARM_GRP_V7,
  860. ARM_GRP_V8,
  861. ARM_GRP_VFP2,
  862. ARM_GRP_VFP3,
  863. ARM_GRP_VFP4,
  864. ARM_GRP_ARM,
  865. ARM_GRP_MCLASS,
  866. ARM_GRP_NOTMCLASS,
  867. ARM_GRP_THUMB,
  868. ARM_GRP_THUMB1ONLY,
  869. ARM_GRP_THUMB2,
  870. ARM_GRP_PREV8,
  871. ARM_GRP_FPVMLX,
  872. ARM_GRP_MULOPS,
  873. ARM_GRP_CRC,
  874. ARM_GRP_DPVFP,
  875. ARM_GRP_V6M,
  876. ARM_GRP_VIRTUALIZATION,
  877. ARM_GRP_ENDING,
  878. } arm_insn_group;
  879. #ifdef __cplusplus
  880. }
  881. #endif
  882. #endif