arc-ext-tbl.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* ARC instruction defintions.
  2. Copyright (C) 2016-2022 Free Software Foundation, Inc.
  3. Contributed by Claudiu Zissulescu (claziss@synopsys.com)
  4. This file is part of libopcodes.
  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; if not, write to the Free Software Foundation,
  15. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  16. /* Common combinations of FLAGS. */
  17. #define FLAGS_NONE { 0 }
  18. #define FLAGS_F { C_F }
  19. #define FLAGS_CC { C_CC }
  20. #define FLAGS_CCF { C_CC, C_F }
  21. /* Common combination of arguments. */
  22. #define ARG_NONE { 0 }
  23. #define ARG_32BIT_RARBRC { RA, RB, RC }
  24. #define ARG_32BIT_ZARBRC { ZA, RB, RC }
  25. #define ARG_32BIT_RBRBRC { RB, RBdup, RC }
  26. #define ARG_32BIT_RARBU6 { RA, RB, UIMM6_20 }
  27. #define ARG_32BIT_ZARBU6 { ZA, RB, UIMM6_20 }
  28. #define ARG_32BIT_RBRBU6 { RB, RBdup, UIMM6_20 }
  29. #define ARG_32BIT_RBRBS12 { RB, RBdup, SIMM12_20 }
  30. #define ARG_32BIT_RALIMMRC { RA, LIMM, RC }
  31. #define ARG_32BIT_RARBLIMM { RA, RB, LIMM }
  32. #define ARG_32BIT_ZALIMMRC { ZA, LIMM, RC }
  33. #define ARG_32BIT_ZARBLIMM { ZA, RB, LIMM }
  34. #define ARG_32BIT_RBRBLIMM { RB, RBdup, LIMM }
  35. #define ARG_32BIT_RALIMMU6 { RA, LIMM, UIMM6_20 }
  36. #define ARG_32BIT_ZALIMMU6 { ZA, LIMM, UIMM6_20 }
  37. #define ARG_32BIT_ZALIMMS12 { ZA, LIMM, SIMM12_20 }
  38. #define ARG_32BIT_RALIMMLIMM { RA, LIMM, LIMMdup }
  39. #define ARG_32BIT_ZALIMMLIMM { ZA, LIMM, LIMMdup }
  40. #define ARG_32BIT_RBRC { RB, RC }
  41. #define ARG_32BIT_ZARC { ZA, RC }
  42. #define ARG_32BIT_RBU6 { RB, UIMM6_20 }
  43. #define ARG_32BIT_ZAU6 { ZA, UIMM6_20 }
  44. #define ARG_32BIT_RBLIMM { RB, LIMM }
  45. #define ARG_32BIT_ZALIMM { ZA, LIMM }
  46. /* Macro to generate 2 operand extension instruction. */
  47. #define EXTINSN2OPF(NAME, CPU, CLASS, SCLASS, MOP, SOP, FL) \
  48. { NAME, INSN2OP_BC (MOP,SOP), MINSN2OP_BC, CPU, CLASS, SCLASS, \
  49. ARG_32BIT_RBRC, FL }, \
  50. { NAME, INSN2OP_0C (MOP,SOP), MINSN2OP_0C, CPU, CLASS, SCLASS, \
  51. ARG_32BIT_ZARC, FL }, \
  52. { NAME, INSN2OP_BU (MOP,SOP), MINSN2OP_BU, CPU, CLASS, SCLASS, \
  53. ARG_32BIT_RBU6, FL }, \
  54. { NAME, INSN2OP_0U (MOP,SOP), MINSN2OP_0U, CPU, CLASS, SCLASS, \
  55. ARG_32BIT_ZAU6, FL }, \
  56. { NAME, INSN2OP_BL (MOP,SOP), MINSN2OP_BL, CPU, CLASS, SCLASS, \
  57. ARG_32BIT_RBLIMM, FL }, \
  58. { NAME, INSN2OP_0L (MOP,SOP), MINSN2OP_0L, CPU, CLASS, SCLASS, \
  59. ARG_32BIT_ZALIMM, FL },
  60. #define EXTINSN2OP(NAME, CPU, CLASS, SCLASS, MOP, SOP) \
  61. EXTINSN2OPF(NAME, CPU, CLASS, SCLASS, MOP, SOP, FLAGS_F)
  62. /* Macro to generate 3 operand extesion instruction. */
  63. #define EXTINSN3OP(NAME, CPU, CLASS, SCLASS, MOP, SOP) \
  64. { NAME, INSN3OP_ABC (MOP,SOP), MINSN3OP_ABC, CPU, CLASS, SCLASS, \
  65. ARG_32BIT_RARBRC, FLAGS_F }, \
  66. { NAME, INSN3OP_0BC (MOP,SOP), MINSN3OP_0BC, CPU, CLASS, SCLASS, \
  67. ARG_32BIT_ZARBRC, FLAGS_F }, \
  68. { NAME, INSN3OP_CBBC (MOP,SOP), MINSN3OP_CBBC, CPU, CLASS, SCLASS, \
  69. ARG_32BIT_RBRBRC, FLAGS_CCF }, \
  70. { NAME, INSN3OP_ABU (MOP,SOP), MINSN3OP_ABU, CPU, CLASS, SCLASS, \
  71. ARG_32BIT_RARBU6, FLAGS_F }, \
  72. { NAME, INSN3OP_0BU (MOP,SOP), MINSN3OP_0BU, CPU, CLASS, SCLASS, \
  73. ARG_32BIT_ZARBU6, FLAGS_F }, \
  74. { NAME, INSN3OP_CBBU (MOP,SOP), MINSN3OP_CBBU, CPU, CLASS, SCLASS, \
  75. ARG_32BIT_RBRBU6, FLAGS_CCF }, \
  76. { NAME, INSN3OP_BBS (MOP,SOP), MINSN3OP_BBS, CPU, CLASS, SCLASS, \
  77. ARG_32BIT_RBRBS12, FLAGS_F }, \
  78. { NAME, INSN3OP_ALC (MOP,SOP), MINSN3OP_ALC, CPU, CLASS, SCLASS, \
  79. ARG_32BIT_RALIMMRC, FLAGS_F }, \
  80. { NAME, INSN3OP_ABL (MOP,SOP), MINSN3OP_ABL, CPU, CLASS, SCLASS, \
  81. ARG_32BIT_RARBLIMM, FLAGS_F }, \
  82. { NAME, INSN3OP_0LC (MOP,SOP), MINSN3OP_0LC, CPU, CLASS, SCLASS, \
  83. ARG_32BIT_ZALIMMRC, FLAGS_F }, \
  84. { NAME, INSN3OP_0BL (MOP,SOP), MINSN3OP_0BL, CPU, CLASS, SCLASS, \
  85. ARG_32BIT_ZARBLIMM, FLAGS_F }, \
  86. { NAME, INSN3OP_C0LC (MOP,SOP), MINSN3OP_C0LC, CPU, CLASS, SCLASS, \
  87. ARG_32BIT_ZALIMMRC, FLAGS_CCF }, \
  88. { NAME, INSN3OP_CBBL (MOP,SOP), MINSN3OP_CBBL, CPU, CLASS, SCLASS, \
  89. ARG_32BIT_RBRBLIMM, FLAGS_CCF }, \
  90. { NAME, INSN3OP_ALU (MOP,SOP), MINSN3OP_ALU, CPU, CLASS, SCLASS, \
  91. ARG_32BIT_RALIMMU6, FLAGS_F }, \
  92. { NAME, INSN3OP_0LU (MOP,SOP), MINSN3OP_0LU, CPU, CLASS, SCLASS, \
  93. ARG_32BIT_ZALIMMU6, FLAGS_F }, \
  94. { NAME, INSN3OP_C0LU (MOP,SOP), MINSN3OP_C0LU, CPU, CLASS, SCLASS, \
  95. ARG_32BIT_ZALIMMU6, FLAGS_CCF }, \
  96. { NAME, INSN3OP_0LS (MOP,SOP), MINSN3OP_0LS, CPU, CLASS, SCLASS, \
  97. ARG_32BIT_ZALIMMS12, FLAGS_F }, \
  98. { NAME, INSN3OP_ALL (MOP,SOP), MINSN3OP_ALL, CPU, CLASS, SCLASS, \
  99. ARG_32BIT_RALIMMLIMM, FLAGS_F }, \
  100. { NAME, INSN3OP_0LL (MOP,SOP), MINSN3OP_0LL, CPU, CLASS, SCLASS, \
  101. ARG_32BIT_ZALIMMLIMM, FLAGS_F }, \
  102. { NAME, INSN3OP_C0LL (MOP,SOP), MINSN3OP_C0LL, CPU, CLASS, SCLASS, \
  103. ARG_32BIT_ZALIMMLIMM, FLAGS_CCF },
  104. /* Extension instruction declarations. */
  105. EXTINSN2OP ("dsp_fp_flt2i", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 43)
  106. EXTINSN2OP ("dsp_fp_i2flt", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 44)
  107. EXTINSN2OP ("dsp_fp_sqrt", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE2, 7, 45)
  108. EXTINSN3OP ("dsp_fp_div", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE2, 7, 42)
  109. EXTINSN3OP ("dsp_fp_cmp", ARC_OPCODE_ARCv2EM, FLOAT, QUARKSE1, 7, 43)