aarch64-dis.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* aarch64-dis.h -- Header file for aarch64-dis.c and aarch64-dis-2.c.
  2. Copyright (C) 2012-2022 Free Software Foundation, Inc.
  3. Contributed by ARM Ltd.
  4. This file is part of the GNU opcodes library.
  5. This library is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; see the file COPYING3. If not,
  15. see <http://www.gnu.org/licenses/>. */
  16. #ifndef OPCODES_AARCH64_DIS_H
  17. #define OPCODES_AARCH64_DIS_H
  18. #include <stdint.h>
  19. #include "aarch64-opc.h"
  20. /* Lookup opcode WORD in the opcode table.
  21. In the case of multiple aarch64_opcode candidates, one of them will be
  22. returned; for other candidate(s), call aarch64_find_next_opcode to
  23. obtain. Note that aarch64_find_next_opcode finds the next
  24. aarch64_opcode candidate in a way as if all related aarch64_opcode
  25. entries were in a single-link list.
  26. N.B. all alias opcodes are ignored here. */
  27. const aarch64_opcode* aarch64_opcode_lookup (uint32_t);
  28. const aarch64_opcode* aarch64_find_next_opcode (const aarch64_opcode *);
  29. /* Given OPCODE, return its alias, e.g. given UBFM, return LSL.
  30. In the case of multiple alias candidates, the one of the highest priority
  31. (or one of several aliases of the same highest priority) will be
  32. returned; for the other candidate(s), call aarch64_find_next_alias_opcode
  33. to obtain. Note that aarch64_find_next_alias_opcode finds the next
  34. alias candidate in a way as if all related aliases were in a single-link
  35. list with priority from the highest to the least. */
  36. const aarch64_opcode* aarch64_find_alias_opcode (const aarch64_opcode *);
  37. const aarch64_opcode* aarch64_find_next_alias_opcode (const aarch64_opcode *);
  38. /* Switch-table-based high-level operand extractor. */
  39. bool
  40. aarch64_extract_operand (const aarch64_operand *, aarch64_opnd_info *,
  41. const aarch64_insn, const aarch64_inst *,
  42. aarch64_operand_error *);
  43. /* Operand extractors. */
  44. #define AARCH64_DECL_OPD_EXTRACTOR(x) \
  45. bool aarch64_##x (const aarch64_operand *, aarch64_opnd_info *, \
  46. const aarch64_insn, const aarch64_inst *, \
  47. aarch64_operand_error *)
  48. AARCH64_DECL_OPD_EXTRACTOR (ext_none);
  49. AARCH64_DECL_OPD_EXTRACTOR (ext_regno);
  50. AARCH64_DECL_OPD_EXTRACTOR (ext_regno_pair);
  51. AARCH64_DECL_OPD_EXTRACTOR (ext_regrt_sysins);
  52. AARCH64_DECL_OPD_EXTRACTOR (ext_reglane);
  53. AARCH64_DECL_OPD_EXTRACTOR (ext_reglist);
  54. AARCH64_DECL_OPD_EXTRACTOR (ext_ldst_reglist);
  55. AARCH64_DECL_OPD_EXTRACTOR (ext_ldst_reglist_r);
  56. AARCH64_DECL_OPD_EXTRACTOR (ext_ldst_elemlist);
  57. AARCH64_DECL_OPD_EXTRACTOR (ext_advsimd_imm_shift);
  58. AARCH64_DECL_OPD_EXTRACTOR (ext_shll_imm);
  59. AARCH64_DECL_OPD_EXTRACTOR (ext_imm);
  60. AARCH64_DECL_OPD_EXTRACTOR (ext_imm_half);
  61. AARCH64_DECL_OPD_EXTRACTOR (ext_advsimd_imm_modified);
  62. AARCH64_DECL_OPD_EXTRACTOR (ext_fpimm);
  63. AARCH64_DECL_OPD_EXTRACTOR (ext_fbits);
  64. AARCH64_DECL_OPD_EXTRACTOR (ext_aimm);
  65. AARCH64_DECL_OPD_EXTRACTOR (ext_limm);
  66. AARCH64_DECL_OPD_EXTRACTOR (ext_inv_limm);
  67. AARCH64_DECL_OPD_EXTRACTOR (ext_ft);
  68. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_simple);
  69. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_offset);
  70. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_regoff);
  71. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_simm);
  72. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_simm10);
  73. AARCH64_DECL_OPD_EXTRACTOR (ext_addr_uimm12);
  74. AARCH64_DECL_OPD_EXTRACTOR (ext_simd_addr_post);
  75. AARCH64_DECL_OPD_EXTRACTOR (ext_cond);
  76. AARCH64_DECL_OPD_EXTRACTOR (ext_sysreg);
  77. AARCH64_DECL_OPD_EXTRACTOR (ext_pstatefield);
  78. AARCH64_DECL_OPD_EXTRACTOR (ext_sysins_op);
  79. AARCH64_DECL_OPD_EXTRACTOR (ext_barrier);
  80. AARCH64_DECL_OPD_EXTRACTOR (ext_barrier_dsb_nxs);
  81. AARCH64_DECL_OPD_EXTRACTOR (ext_hint);
  82. AARCH64_DECL_OPD_EXTRACTOR (ext_prfop);
  83. AARCH64_DECL_OPD_EXTRACTOR (ext_reg_extended);
  84. AARCH64_DECL_OPD_EXTRACTOR (ext_reg_shifted);
  85. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_ri_s4);
  86. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_ri_s4xvl);
  87. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_ri_s6xvl);
  88. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_ri_s9xvl);
  89. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_ri_u6);
  90. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_rr_lsl);
  91. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_rz_xtw);
  92. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_zi_u5);
  93. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_zz_lsl);
  94. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_zz_sxtw);
  95. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_addr_zz_uxtw);
  96. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_aimm);
  97. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_asimm);
  98. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_float_half_one);
  99. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_float_half_two);
  100. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_float_zero_one);
  101. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_index);
  102. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_limm_mov);
  103. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_quad_index);
  104. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_reglist);
  105. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_scale);
  106. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_shlimm);
  107. AARCH64_DECL_OPD_EXTRACTOR (ext_sve_shrimm);
  108. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_za_hv_tiles);
  109. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_za_list);
  110. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_za_array);
  111. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_addr_ri_u4xvl);
  112. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_sm_za);
  113. AARCH64_DECL_OPD_EXTRACTOR (ext_sme_pred_reg_with_index);
  114. AARCH64_DECL_OPD_EXTRACTOR (ext_imm_rotate1);
  115. AARCH64_DECL_OPD_EXTRACTOR (ext_imm_rotate2);
  116. AARCH64_DECL_OPD_EXTRACTOR (ext_x0_to_x30);
  117. #undef AARCH64_DECL_OPD_EXTRACTOR
  118. #endif /* OPCODES_AARCH64_DIS_H */