fr30-desc.c 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758
  1. /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
  2. /* CPU data for fr30.
  3. THIS FILE IS MACHINE GENERATED WITH CGEN.
  4. Copyright (C) 1996-2022 Free Software Foundation, Inc.
  5. This file is part of the GNU Binutils and/or GDB, the GNU debugger.
  6. This file is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3, or (at your option)
  9. any later version.
  10. It is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  13. License for more details.
  14. You should have received a copy of the GNU General Public License along
  15. with this program; if not, write to the Free Software Foundation, Inc.,
  16. 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #include "sysdep.h"
  19. #include <stdio.h>
  20. #include <stdarg.h>
  21. #include <stdlib.h>
  22. #include "ansidecl.h"
  23. #include "bfd.h"
  24. #include "symcat.h"
  25. #include "fr30-desc.h"
  26. #include "fr30-opc.h"
  27. #include "opintl.h"
  28. #include "libiberty.h"
  29. #include "xregex.h"
  30. /* Attributes. */
  31. static const CGEN_ATTR_ENTRY bool_attr[] =
  32. {
  33. { "#f", 0 },
  34. { "#t", 1 },
  35. { 0, 0 }
  36. };
  37. static const CGEN_ATTR_ENTRY MACH_attr[] ATTRIBUTE_UNUSED =
  38. {
  39. { "base", MACH_BASE },
  40. { "fr30", MACH_FR30 },
  41. { "max", MACH_MAX },
  42. { 0, 0 }
  43. };
  44. static const CGEN_ATTR_ENTRY ISA_attr[] ATTRIBUTE_UNUSED =
  45. {
  46. { "fr30", ISA_FR30 },
  47. { "max", ISA_MAX },
  48. { 0, 0 }
  49. };
  50. const CGEN_ATTR_TABLE fr30_cgen_ifield_attr_table[] =
  51. {
  52. { "MACH", & MACH_attr[0], & MACH_attr[0] },
  53. { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
  54. { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] },
  55. { "ABS-ADDR", &bool_attr[0], &bool_attr[0] },
  56. { "RESERVED", &bool_attr[0], &bool_attr[0] },
  57. { "SIGN-OPT", &bool_attr[0], &bool_attr[0] },
  58. { "SIGNED", &bool_attr[0], &bool_attr[0] },
  59. { 0, 0, 0 }
  60. };
  61. const CGEN_ATTR_TABLE fr30_cgen_hardware_attr_table[] =
  62. {
  63. { "MACH", & MACH_attr[0], & MACH_attr[0] },
  64. { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
  65. { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] },
  66. { "PC", &bool_attr[0], &bool_attr[0] },
  67. { "PROFILE", &bool_attr[0], &bool_attr[0] },
  68. { 0, 0, 0 }
  69. };
  70. const CGEN_ATTR_TABLE fr30_cgen_operand_attr_table[] =
  71. {
  72. { "MACH", & MACH_attr[0], & MACH_attr[0] },
  73. { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
  74. { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] },
  75. { "ABS-ADDR", &bool_attr[0], &bool_attr[0] },
  76. { "SIGN-OPT", &bool_attr[0], &bool_attr[0] },
  77. { "SIGNED", &bool_attr[0], &bool_attr[0] },
  78. { "NEGATIVE", &bool_attr[0], &bool_attr[0] },
  79. { "RELAX", &bool_attr[0], &bool_attr[0] },
  80. { "SEM-ONLY", &bool_attr[0], &bool_attr[0] },
  81. { "HASH-PREFIX", &bool_attr[0], &bool_attr[0] },
  82. { 0, 0, 0 }
  83. };
  84. const CGEN_ATTR_TABLE fr30_cgen_insn_attr_table[] =
  85. {
  86. { "MACH", & MACH_attr[0], & MACH_attr[0] },
  87. { "ALIAS", &bool_attr[0], &bool_attr[0] },
  88. { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
  89. { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] },
  90. { "COND-CTI", &bool_attr[0], &bool_attr[0] },
  91. { "SKIP-CTI", &bool_attr[0], &bool_attr[0] },
  92. { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] },
  93. { "RELAXABLE", &bool_attr[0], &bool_attr[0] },
  94. { "RELAXED", &bool_attr[0], &bool_attr[0] },
  95. { "NO-DIS", &bool_attr[0], &bool_attr[0] },
  96. { "PBB", &bool_attr[0], &bool_attr[0] },
  97. { "NOT-IN-DELAY-SLOT", &bool_attr[0], &bool_attr[0] },
  98. { 0, 0, 0 }
  99. };
  100. /* Instruction set variants. */
  101. static const CGEN_ISA fr30_cgen_isa_table[] = {
  102. { "fr30", 16, 16, 16, 48 },
  103. { 0, 0, 0, 0, 0 }
  104. };
  105. /* Machine variants. */
  106. static const CGEN_MACH fr30_cgen_mach_table[] = {
  107. { "fr30", "fr30", MACH_FR30, 0 },
  108. { 0, 0, 0, 0 }
  109. };
  110. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_gr_names_entries[] =
  111. {
  112. { "r0", 0, {0, {{{0, 0}}}}, 0, 0 },
  113. { "r1", 1, {0, {{{0, 0}}}}, 0, 0 },
  114. { "r2", 2, {0, {{{0, 0}}}}, 0, 0 },
  115. { "r3", 3, {0, {{{0, 0}}}}, 0, 0 },
  116. { "r4", 4, {0, {{{0, 0}}}}, 0, 0 },
  117. { "r5", 5, {0, {{{0, 0}}}}, 0, 0 },
  118. { "r6", 6, {0, {{{0, 0}}}}, 0, 0 },
  119. { "r7", 7, {0, {{{0, 0}}}}, 0, 0 },
  120. { "r8", 8, {0, {{{0, 0}}}}, 0, 0 },
  121. { "r9", 9, {0, {{{0, 0}}}}, 0, 0 },
  122. { "r10", 10, {0, {{{0, 0}}}}, 0, 0 },
  123. { "r11", 11, {0, {{{0, 0}}}}, 0, 0 },
  124. { "r12", 12, {0, {{{0, 0}}}}, 0, 0 },
  125. { "r13", 13, {0, {{{0, 0}}}}, 0, 0 },
  126. { "r14", 14, {0, {{{0, 0}}}}, 0, 0 },
  127. { "r15", 15, {0, {{{0, 0}}}}, 0, 0 },
  128. { "ac", 13, {0, {{{0, 0}}}}, 0, 0 },
  129. { "fp", 14, {0, {{{0, 0}}}}, 0, 0 },
  130. { "sp", 15, {0, {{{0, 0}}}}, 0, 0 }
  131. };
  132. CGEN_KEYWORD fr30_cgen_opval_gr_names =
  133. {
  134. & fr30_cgen_opval_gr_names_entries[0],
  135. 19,
  136. 0, 0, 0, 0, ""
  137. };
  138. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_cr_names_entries[] =
  139. {
  140. { "cr0", 0, {0, {{{0, 0}}}}, 0, 0 },
  141. { "cr1", 1, {0, {{{0, 0}}}}, 0, 0 },
  142. { "cr2", 2, {0, {{{0, 0}}}}, 0, 0 },
  143. { "cr3", 3, {0, {{{0, 0}}}}, 0, 0 },
  144. { "cr4", 4, {0, {{{0, 0}}}}, 0, 0 },
  145. { "cr5", 5, {0, {{{0, 0}}}}, 0, 0 },
  146. { "cr6", 6, {0, {{{0, 0}}}}, 0, 0 },
  147. { "cr7", 7, {0, {{{0, 0}}}}, 0, 0 },
  148. { "cr8", 8, {0, {{{0, 0}}}}, 0, 0 },
  149. { "cr9", 9, {0, {{{0, 0}}}}, 0, 0 },
  150. { "cr10", 10, {0, {{{0, 0}}}}, 0, 0 },
  151. { "cr11", 11, {0, {{{0, 0}}}}, 0, 0 },
  152. { "cr12", 12, {0, {{{0, 0}}}}, 0, 0 },
  153. { "cr13", 13, {0, {{{0, 0}}}}, 0, 0 },
  154. { "cr14", 14, {0, {{{0, 0}}}}, 0, 0 },
  155. { "cr15", 15, {0, {{{0, 0}}}}, 0, 0 }
  156. };
  157. CGEN_KEYWORD fr30_cgen_opval_cr_names =
  158. {
  159. & fr30_cgen_opval_cr_names_entries[0],
  160. 16,
  161. 0, 0, 0, 0, ""
  162. };
  163. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_dr_names_entries[] =
  164. {
  165. { "tbr", 0, {0, {{{0, 0}}}}, 0, 0 },
  166. { "rp", 1, {0, {{{0, 0}}}}, 0, 0 },
  167. { "ssp", 2, {0, {{{0, 0}}}}, 0, 0 },
  168. { "usp", 3, {0, {{{0, 0}}}}, 0, 0 },
  169. { "mdh", 4, {0, {{{0, 0}}}}, 0, 0 },
  170. { "mdl", 5, {0, {{{0, 0}}}}, 0, 0 }
  171. };
  172. CGEN_KEYWORD fr30_cgen_opval_dr_names =
  173. {
  174. & fr30_cgen_opval_dr_names_entries[0],
  175. 6,
  176. 0, 0, 0, 0, ""
  177. };
  178. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_ps_entries[] =
  179. {
  180. { "ps", 0, {0, {{{0, 0}}}}, 0, 0 }
  181. };
  182. CGEN_KEYWORD fr30_cgen_opval_h_ps =
  183. {
  184. & fr30_cgen_opval_h_ps_entries[0],
  185. 1,
  186. 0, 0, 0, 0, ""
  187. };
  188. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r13_entries[] =
  189. {
  190. { "r13", 0, {0, {{{0, 0}}}}, 0, 0 }
  191. };
  192. CGEN_KEYWORD fr30_cgen_opval_h_r13 =
  193. {
  194. & fr30_cgen_opval_h_r13_entries[0],
  195. 1,
  196. 0, 0, 0, 0, ""
  197. };
  198. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r14_entries[] =
  199. {
  200. { "r14", 0, {0, {{{0, 0}}}}, 0, 0 }
  201. };
  202. CGEN_KEYWORD fr30_cgen_opval_h_r14 =
  203. {
  204. & fr30_cgen_opval_h_r14_entries[0],
  205. 1,
  206. 0, 0, 0, 0, ""
  207. };
  208. static CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r15_entries[] =
  209. {
  210. { "r15", 0, {0, {{{0, 0}}}}, 0, 0 }
  211. };
  212. CGEN_KEYWORD fr30_cgen_opval_h_r15 =
  213. {
  214. & fr30_cgen_opval_h_r15_entries[0],
  215. 1,
  216. 0, 0, 0, 0, ""
  217. };
  218. /* The hardware table. */
  219. #define A(a) (1 << CGEN_HW_##a)
  220. const CGEN_HW_ENTRY fr30_cgen_hw_table[] =
  221. {
  222. { "h-memory", HW_H_MEMORY, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  223. { "h-sint", HW_H_SINT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  224. { "h-uint", HW_H_UINT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  225. { "h-addr", HW_H_ADDR, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  226. { "h-iaddr", HW_H_IADDR, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  227. { "h-pc", HW_H_PC, CGEN_ASM_NONE, 0, { 0|A(PROFILE)|A(PC), { { { (1<<MACH_BASE), 0 } } } } },
  228. { "h-gr", HW_H_GR, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_gr_names, { 0|A(CACHE_ADDR)|A(PROFILE), { { { (1<<MACH_BASE), 0 } } } } },
  229. { "h-cr", HW_H_CR, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_cr_names, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  230. { "h-dr", HW_H_DR, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_dr_names, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  231. { "h-ps", HW_H_PS, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_ps, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  232. { "h-r13", HW_H_R13, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r13, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  233. { "h-r14", HW_H_R14, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r14, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  234. { "h-r15", HW_H_R15, CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r15, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  235. { "h-nbit", HW_H_NBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  236. { "h-zbit", HW_H_ZBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  237. { "h-vbit", HW_H_VBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  238. { "h-cbit", HW_H_CBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  239. { "h-ibit", HW_H_IBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  240. { "h-sbit", HW_H_SBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  241. { "h-tbit", HW_H_TBIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  242. { "h-d0bit", HW_H_D0BIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  243. { "h-d1bit", HW_H_D1BIT, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  244. { "h-ccr", HW_H_CCR, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  245. { "h-scr", HW_H_SCR, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  246. { "h-ilm", HW_H_ILM, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  247. { 0, 0, CGEN_ASM_NONE, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } }
  248. };
  249. #undef A
  250. /* The instruction field table. */
  251. #define A(a) (1 << CGEN_IFLD_##a)
  252. const CGEN_IFLD fr30_cgen_ifld_table[] =
  253. {
  254. { FR30_F_NIL, "f-nil", 0, 0, 0, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  255. { FR30_F_ANYOF, "f-anyof", 0, 0, 0, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  256. { FR30_F_OP1, "f-op1", 0, 16, 0, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  257. { FR30_F_OP2, "f-op2", 0, 16, 4, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  258. { FR30_F_OP3, "f-op3", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  259. { FR30_F_OP4, "f-op4", 0, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  260. { FR30_F_OP5, "f-op5", 0, 16, 4, 1, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  261. { FR30_F_CC, "f-cc", 0, 16, 4, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  262. { FR30_F_CCC, "f-ccc", 16, 16, 0, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  263. { FR30_F_RJ, "f-Rj", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  264. { FR30_F_RI, "f-Ri", 0, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  265. { FR30_F_RS1, "f-Rs1", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  266. { FR30_F_RS2, "f-Rs2", 0, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  267. { FR30_F_RJC, "f-Rjc", 16, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  268. { FR30_F_RIC, "f-Ric", 16, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  269. { FR30_F_CRJ, "f-CRj", 16, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  270. { FR30_F_CRI, "f-CRi", 16, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  271. { FR30_F_U4, "f-u4", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  272. { FR30_F_U4C, "f-u4c", 0, 16, 12, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  273. { FR30_F_I4, "f-i4", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  274. { FR30_F_M4, "f-m4", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  275. { FR30_F_U8, "f-u8", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  276. { FR30_F_I8, "f-i8", 0, 16, 4, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  277. { FR30_F_I20_4, "f-i20-4", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  278. { FR30_F_I20_16, "f-i20-16", 16, 16, 0, 16, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  279. { FR30_F_I20, "f-i20", 0, 0, 0, 0,{ 0|A(VIRTUAL), { { { (1<<MACH_BASE), 0 } } } } },
  280. { FR30_F_I32, "f-i32", 16, 32, 0, 32, { 0|A(SIGN_OPT), { { { (1<<MACH_BASE), 0 } } } } },
  281. { FR30_F_UDISP6, "f-udisp6", 0, 16, 8, 4, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  282. { FR30_F_DISP8, "f-disp8", 0, 16, 4, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  283. { FR30_F_DISP9, "f-disp9", 0, 16, 4, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  284. { FR30_F_DISP10, "f-disp10", 0, 16, 4, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  285. { FR30_F_S10, "f-s10", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  286. { FR30_F_U10, "f-u10", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  287. { FR30_F_REL9, "f-rel9", 0, 16, 8, 8, { 0|A(PCREL_ADDR), { { { (1<<MACH_BASE), 0 } } } } },
  288. { FR30_F_DIR8, "f-dir8", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  289. { FR30_F_DIR9, "f-dir9", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  290. { FR30_F_DIR10, "f-dir10", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  291. { FR30_F_REL12, "f-rel12", 0, 16, 5, 11, { 0|A(PCREL_ADDR), { { { (1<<MACH_BASE), 0 } } } } },
  292. { FR30_F_REGLIST_HI_ST, "f-reglist_hi_st", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  293. { FR30_F_REGLIST_LOW_ST, "f-reglist_low_st", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  294. { FR30_F_REGLIST_HI_LD, "f-reglist_hi_ld", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  295. { FR30_F_REGLIST_LOW_LD, "f-reglist_low_ld", 0, 16, 8, 8, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  296. { 0, 0, 0, 0, 0, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } }
  297. };
  298. #undef A
  299. /* multi ifield declarations */
  300. const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD [];
  301. /* multi ifield definitions */
  302. const CGEN_MAYBE_MULTI_IFLD FR30_F_I20_MULTI_IFIELD [] =
  303. {
  304. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_4] } },
  305. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I20_16] } },
  306. { 0, { (const PTR) 0 } }
  307. };
  308. /* The operand table. */
  309. #define A(a) (1 << CGEN_OPERAND_##a)
  310. #define OPERAND(op) FR30_OPERAND_##op
  311. const CGEN_OPERAND fr30_cgen_operand_table[] =
  312. {
  313. /* pc: program counter */
  314. { "pc", FR30_OPERAND_PC, HW_H_PC, 0, 0,
  315. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_NIL] } },
  316. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  317. /* Ri: destination register */
  318. { "Ri", FR30_OPERAND_RI, HW_H_GR, 12, 4,
  319. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RI] } },
  320. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  321. /* Rj: source register */
  322. { "Rj", FR30_OPERAND_RJ, HW_H_GR, 8, 4,
  323. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJ] } },
  324. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  325. /* Ric: target register coproc insn */
  326. { "Ric", FR30_OPERAND_RIC, HW_H_GR, 12, 4,
  327. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RIC] } },
  328. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  329. /* Rjc: source register coproc insn */
  330. { "Rjc", FR30_OPERAND_RJC, HW_H_GR, 8, 4,
  331. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RJC] } },
  332. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  333. /* CRi: coprocessor register */
  334. { "CRi", FR30_OPERAND_CRI, HW_H_CR, 12, 4,
  335. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRI] } },
  336. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  337. /* CRj: coprocessor register */
  338. { "CRj", FR30_OPERAND_CRJ, HW_H_CR, 8, 4,
  339. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CRJ] } },
  340. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  341. /* Rs1: dedicated register */
  342. { "Rs1", FR30_OPERAND_RS1, HW_H_DR, 8, 4,
  343. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS1] } },
  344. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  345. /* Rs2: dedicated register */
  346. { "Rs2", FR30_OPERAND_RS2, HW_H_DR, 12, 4,
  347. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_RS2] } },
  348. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  349. /* R13: General Register 13 */
  350. { "R13", FR30_OPERAND_R13, HW_H_R13, 0, 0,
  351. { 0, { (const PTR) 0 } },
  352. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  353. /* R14: General Register 14 */
  354. { "R14", FR30_OPERAND_R14, HW_H_R14, 0, 0,
  355. { 0, { (const PTR) 0 } },
  356. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  357. /* R15: General Register 15 */
  358. { "R15", FR30_OPERAND_R15, HW_H_R15, 0, 0,
  359. { 0, { (const PTR) 0 } },
  360. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  361. /* ps: Program Status register */
  362. { "ps", FR30_OPERAND_PS, HW_H_PS, 0, 0,
  363. { 0, { (const PTR) 0 } },
  364. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  365. /* u4: 4 bit unsigned immediate */
  366. { "u4", FR30_OPERAND_U4, HW_H_UINT, 8, 4,
  367. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4] } },
  368. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  369. /* u4c: 4 bit unsigned immediate */
  370. { "u4c", FR30_OPERAND_U4C, HW_H_UINT, 12, 4,
  371. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U4C] } },
  372. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  373. /* u8: 8 bit unsigned immediate */
  374. { "u8", FR30_OPERAND_U8, HW_H_UINT, 8, 8,
  375. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U8] } },
  376. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  377. /* i8: 8 bit unsigned immediate */
  378. { "i8", FR30_OPERAND_I8, HW_H_UINT, 4, 8,
  379. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I8] } },
  380. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  381. /* udisp6: 6 bit unsigned immediate */
  382. { "udisp6", FR30_OPERAND_UDISP6, HW_H_UINT, 8, 4,
  383. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_UDISP6] } },
  384. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  385. /* disp8: 8 bit signed immediate */
  386. { "disp8", FR30_OPERAND_DISP8, HW_H_SINT, 4, 8,
  387. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP8] } },
  388. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  389. /* disp9: 9 bit signed immediate */
  390. { "disp9", FR30_OPERAND_DISP9, HW_H_SINT, 4, 8,
  391. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP9] } },
  392. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  393. /* disp10: 10 bit signed immediate */
  394. { "disp10", FR30_OPERAND_DISP10, HW_H_SINT, 4, 8,
  395. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DISP10] } },
  396. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  397. /* s10: 10 bit signed immediate */
  398. { "s10", FR30_OPERAND_S10, HW_H_SINT, 8, 8,
  399. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_S10] } },
  400. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  401. /* u10: 10 bit unsigned immediate */
  402. { "u10", FR30_OPERAND_U10, HW_H_UINT, 8, 8,
  403. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_U10] } },
  404. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  405. /* i32: 32 bit immediate */
  406. { "i32", FR30_OPERAND_I32, HW_H_UINT, 0, 32,
  407. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_I32] } },
  408. { 0|A(HASH_PREFIX)|A(SIGN_OPT), { { { (1<<MACH_BASE), 0 } } } } },
  409. /* m4: 4 bit negative immediate */
  410. { "m4", FR30_OPERAND_M4, HW_H_SINT, 8, 4,
  411. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_M4] } },
  412. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  413. /* i20: 20 bit immediate */
  414. { "i20", FR30_OPERAND_I20, HW_H_UINT, 0, 20,
  415. { 2, { (const PTR) &FR30_F_I20_MULTI_IFIELD[0] } },
  416. { 0|A(HASH_PREFIX)|A(VIRTUAL), { { { (1<<MACH_BASE), 0 } } } } },
  417. /* dir8: 8 bit direct address */
  418. { "dir8", FR30_OPERAND_DIR8, HW_H_UINT, 8, 8,
  419. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR8] } },
  420. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  421. /* dir9: 9 bit direct address */
  422. { "dir9", FR30_OPERAND_DIR9, HW_H_UINT, 8, 8,
  423. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR9] } },
  424. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  425. /* dir10: 10 bit direct address */
  426. { "dir10", FR30_OPERAND_DIR10, HW_H_UINT, 8, 8,
  427. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_DIR10] } },
  428. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  429. /* label9: 9 bit pc relative address */
  430. { "label9", FR30_OPERAND_LABEL9, HW_H_IADDR, 8, 8,
  431. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL9] } },
  432. { 0|A(PCREL_ADDR), { { { (1<<MACH_BASE), 0 } } } } },
  433. /* label12: 12 bit pc relative address */
  434. { "label12", FR30_OPERAND_LABEL12, HW_H_IADDR, 5, 11,
  435. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REL12] } },
  436. { 0|A(PCREL_ADDR), { { { (1<<MACH_BASE), 0 } } } } },
  437. /* reglist_low_ld: 8 bit low register mask for ldm */
  438. { "reglist_low_ld", FR30_OPERAND_REGLIST_LOW_LD, HW_H_UINT, 8, 8,
  439. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_LD] } },
  440. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  441. /* reglist_hi_ld: 8 bit high register mask for ldm */
  442. { "reglist_hi_ld", FR30_OPERAND_REGLIST_HI_LD, HW_H_UINT, 8, 8,
  443. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_LD] } },
  444. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  445. /* reglist_low_st: 8 bit low register mask for stm */
  446. { "reglist_low_st", FR30_OPERAND_REGLIST_LOW_ST, HW_H_UINT, 8, 8,
  447. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_LOW_ST] } },
  448. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  449. /* reglist_hi_st: 8 bit high register mask for stm */
  450. { "reglist_hi_st", FR30_OPERAND_REGLIST_HI_ST, HW_H_UINT, 8, 8,
  451. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_REGLIST_HI_ST] } },
  452. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  453. /* cc: condition codes */
  454. { "cc", FR30_OPERAND_CC, HW_H_UINT, 4, 4,
  455. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CC] } },
  456. { 0, { { { (1<<MACH_BASE), 0 } } } } },
  457. /* ccc: coprocessor calc */
  458. { "ccc", FR30_OPERAND_CCC, HW_H_UINT, 0, 8,
  459. { 0, { (const PTR) &fr30_cgen_ifld_table[FR30_F_CCC] } },
  460. { 0|A(HASH_PREFIX), { { { (1<<MACH_BASE), 0 } } } } },
  461. /* nbit: negative bit */
  462. { "nbit", FR30_OPERAND_NBIT, HW_H_NBIT, 0, 0,
  463. { 0, { (const PTR) 0 } },
  464. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  465. /* vbit: overflow bit */
  466. { "vbit", FR30_OPERAND_VBIT, HW_H_VBIT, 0, 0,
  467. { 0, { (const PTR) 0 } },
  468. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  469. /* zbit: zero bit */
  470. { "zbit", FR30_OPERAND_ZBIT, HW_H_ZBIT, 0, 0,
  471. { 0, { (const PTR) 0 } },
  472. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  473. /* cbit: carry bit */
  474. { "cbit", FR30_OPERAND_CBIT, HW_H_CBIT, 0, 0,
  475. { 0, { (const PTR) 0 } },
  476. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  477. /* ibit: interrupt bit */
  478. { "ibit", FR30_OPERAND_IBIT, HW_H_IBIT, 0, 0,
  479. { 0, { (const PTR) 0 } },
  480. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  481. /* sbit: stack bit */
  482. { "sbit", FR30_OPERAND_SBIT, HW_H_SBIT, 0, 0,
  483. { 0, { (const PTR) 0 } },
  484. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  485. /* tbit: trace trap bit */
  486. { "tbit", FR30_OPERAND_TBIT, HW_H_TBIT, 0, 0,
  487. { 0, { (const PTR) 0 } },
  488. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  489. /* d0bit: division 0 bit */
  490. { "d0bit", FR30_OPERAND_D0BIT, HW_H_D0BIT, 0, 0,
  491. { 0, { (const PTR) 0 } },
  492. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  493. /* d1bit: division 1 bit */
  494. { "d1bit", FR30_OPERAND_D1BIT, HW_H_D1BIT, 0, 0,
  495. { 0, { (const PTR) 0 } },
  496. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  497. /* ccr: condition code bits */
  498. { "ccr", FR30_OPERAND_CCR, HW_H_CCR, 0, 0,
  499. { 0, { (const PTR) 0 } },
  500. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  501. /* scr: system condition bits */
  502. { "scr", FR30_OPERAND_SCR, HW_H_SCR, 0, 0,
  503. { 0, { (const PTR) 0 } },
  504. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  505. /* ilm: interrupt level mask */
  506. { "ilm", FR30_OPERAND_ILM, HW_H_ILM, 0, 0,
  507. { 0, { (const PTR) 0 } },
  508. { 0|A(SEM_ONLY), { { { (1<<MACH_BASE), 0 } } } } },
  509. /* sentinel */
  510. { 0, 0, 0, 0, 0,
  511. { 0, { (const PTR) 0 } },
  512. { 0, { { { (1<<MACH_BASE), 0 } } } } }
  513. };
  514. #undef A
  515. /* The instruction table. */
  516. #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
  517. #define A(a) (1 << CGEN_INSN_##a)
  518. static const CGEN_IBASE fr30_cgen_insn_table[MAX_INSNS] =
  519. {
  520. /* Special null first entry.
  521. A `num' value of zero is thus invalid.
  522. Also, the special `invalid' insn resides here. */
  523. { 0, 0, 0, 0, { 0, { { { (1<<MACH_BASE), 0 } } } } },
  524. /* add $Rj,$Ri */
  525. {
  526. FR30_INSN_ADD, "add", "add", 16,
  527. { 0, { { { (1<<MACH_BASE), 0 } } } }
  528. },
  529. /* add $u4,$Ri */
  530. {
  531. FR30_INSN_ADDI, "addi", "add", 16,
  532. { 0, { { { (1<<MACH_BASE), 0 } } } }
  533. },
  534. /* add2 $m4,$Ri */
  535. {
  536. FR30_INSN_ADD2, "add2", "add2", 16,
  537. { 0, { { { (1<<MACH_BASE), 0 } } } }
  538. },
  539. /* addc $Rj,$Ri */
  540. {
  541. FR30_INSN_ADDC, "addc", "addc", 16,
  542. { 0, { { { (1<<MACH_BASE), 0 } } } }
  543. },
  544. /* addn $Rj,$Ri */
  545. {
  546. FR30_INSN_ADDN, "addn", "addn", 16,
  547. { 0, { { { (1<<MACH_BASE), 0 } } } }
  548. },
  549. /* addn $u4,$Ri */
  550. {
  551. FR30_INSN_ADDNI, "addni", "addn", 16,
  552. { 0, { { { (1<<MACH_BASE), 0 } } } }
  553. },
  554. /* addn2 $m4,$Ri */
  555. {
  556. FR30_INSN_ADDN2, "addn2", "addn2", 16,
  557. { 0, { { { (1<<MACH_BASE), 0 } } } }
  558. },
  559. /* sub $Rj,$Ri */
  560. {
  561. FR30_INSN_SUB, "sub", "sub", 16,
  562. { 0, { { { (1<<MACH_BASE), 0 } } } }
  563. },
  564. /* subc $Rj,$Ri */
  565. {
  566. FR30_INSN_SUBC, "subc", "subc", 16,
  567. { 0, { { { (1<<MACH_BASE), 0 } } } }
  568. },
  569. /* subn $Rj,$Ri */
  570. {
  571. FR30_INSN_SUBN, "subn", "subn", 16,
  572. { 0, { { { (1<<MACH_BASE), 0 } } } }
  573. },
  574. /* cmp $Rj,$Ri */
  575. {
  576. FR30_INSN_CMP, "cmp", "cmp", 16,
  577. { 0, { { { (1<<MACH_BASE), 0 } } } }
  578. },
  579. /* cmp $u4,$Ri */
  580. {
  581. FR30_INSN_CMPI, "cmpi", "cmp", 16,
  582. { 0, { { { (1<<MACH_BASE), 0 } } } }
  583. },
  584. /* cmp2 $m4,$Ri */
  585. {
  586. FR30_INSN_CMP2, "cmp2", "cmp2", 16,
  587. { 0, { { { (1<<MACH_BASE), 0 } } } }
  588. },
  589. /* and $Rj,$Ri */
  590. {
  591. FR30_INSN_AND, "and", "and", 16,
  592. { 0, { { { (1<<MACH_BASE), 0 } } } }
  593. },
  594. /* or $Rj,$Ri */
  595. {
  596. FR30_INSN_OR, "or", "or", 16,
  597. { 0, { { { (1<<MACH_BASE), 0 } } } }
  598. },
  599. /* eor $Rj,$Ri */
  600. {
  601. FR30_INSN_EOR, "eor", "eor", 16,
  602. { 0, { { { (1<<MACH_BASE), 0 } } } }
  603. },
  604. /* and $Rj,@$Ri */
  605. {
  606. FR30_INSN_ANDM, "andm", "and", 16,
  607. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  608. },
  609. /* andh $Rj,@$Ri */
  610. {
  611. FR30_INSN_ANDH, "andh", "andh", 16,
  612. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  613. },
  614. /* andb $Rj,@$Ri */
  615. {
  616. FR30_INSN_ANDB, "andb", "andb", 16,
  617. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  618. },
  619. /* or $Rj,@$Ri */
  620. {
  621. FR30_INSN_ORM, "orm", "or", 16,
  622. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  623. },
  624. /* orh $Rj,@$Ri */
  625. {
  626. FR30_INSN_ORH, "orh", "orh", 16,
  627. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  628. },
  629. /* orb $Rj,@$Ri */
  630. {
  631. FR30_INSN_ORB, "orb", "orb", 16,
  632. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  633. },
  634. /* eor $Rj,@$Ri */
  635. {
  636. FR30_INSN_EORM, "eorm", "eor", 16,
  637. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  638. },
  639. /* eorh $Rj,@$Ri */
  640. {
  641. FR30_INSN_EORH, "eorh", "eorh", 16,
  642. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  643. },
  644. /* eorb $Rj,@$Ri */
  645. {
  646. FR30_INSN_EORB, "eorb", "eorb", 16,
  647. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  648. },
  649. /* bandl $u4,@$Ri */
  650. {
  651. FR30_INSN_BANDL, "bandl", "bandl", 16,
  652. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  653. },
  654. /* borl $u4,@$Ri */
  655. {
  656. FR30_INSN_BORL, "borl", "borl", 16,
  657. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  658. },
  659. /* beorl $u4,@$Ri */
  660. {
  661. FR30_INSN_BEORL, "beorl", "beorl", 16,
  662. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  663. },
  664. /* bandh $u4,@$Ri */
  665. {
  666. FR30_INSN_BANDH, "bandh", "bandh", 16,
  667. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  668. },
  669. /* borh $u4,@$Ri */
  670. {
  671. FR30_INSN_BORH, "borh", "borh", 16,
  672. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  673. },
  674. /* beorh $u4,@$Ri */
  675. {
  676. FR30_INSN_BEORH, "beorh", "beorh", 16,
  677. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  678. },
  679. /* btstl $u4,@$Ri */
  680. {
  681. FR30_INSN_BTSTL, "btstl", "btstl", 16,
  682. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  683. },
  684. /* btsth $u4,@$Ri */
  685. {
  686. FR30_INSN_BTSTH, "btsth", "btsth", 16,
  687. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  688. },
  689. /* mul $Rj,$Ri */
  690. {
  691. FR30_INSN_MUL, "mul", "mul", 16,
  692. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  693. },
  694. /* mulu $Rj,$Ri */
  695. {
  696. FR30_INSN_MULU, "mulu", "mulu", 16,
  697. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  698. },
  699. /* mulh $Rj,$Ri */
  700. {
  701. FR30_INSN_MULH, "mulh", "mulh", 16,
  702. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  703. },
  704. /* muluh $Rj,$Ri */
  705. {
  706. FR30_INSN_MULUH, "muluh", "muluh", 16,
  707. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  708. },
  709. /* div0s $Ri */
  710. {
  711. FR30_INSN_DIV0S, "div0s", "div0s", 16,
  712. { 0, { { { (1<<MACH_BASE), 0 } } } }
  713. },
  714. /* div0u $Ri */
  715. {
  716. FR30_INSN_DIV0U, "div0u", "div0u", 16,
  717. { 0, { { { (1<<MACH_BASE), 0 } } } }
  718. },
  719. /* div1 $Ri */
  720. {
  721. FR30_INSN_DIV1, "div1", "div1", 16,
  722. { 0, { { { (1<<MACH_BASE), 0 } } } }
  723. },
  724. /* div2 $Ri */
  725. {
  726. FR30_INSN_DIV2, "div2", "div2", 16,
  727. { 0, { { { (1<<MACH_BASE), 0 } } } }
  728. },
  729. /* div3 */
  730. {
  731. FR30_INSN_DIV3, "div3", "div3", 16,
  732. { 0, { { { (1<<MACH_BASE), 0 } } } }
  733. },
  734. /* div4s */
  735. {
  736. FR30_INSN_DIV4S, "div4s", "div4s", 16,
  737. { 0, { { { (1<<MACH_BASE), 0 } } } }
  738. },
  739. /* lsl $Rj,$Ri */
  740. {
  741. FR30_INSN_LSL, "lsl", "lsl", 16,
  742. { 0, { { { (1<<MACH_BASE), 0 } } } }
  743. },
  744. /* lsl $u4,$Ri */
  745. {
  746. FR30_INSN_LSLI, "lsli", "lsl", 16,
  747. { 0, { { { (1<<MACH_BASE), 0 } } } }
  748. },
  749. /* lsl2 $u4,$Ri */
  750. {
  751. FR30_INSN_LSL2, "lsl2", "lsl2", 16,
  752. { 0, { { { (1<<MACH_BASE), 0 } } } }
  753. },
  754. /* lsr $Rj,$Ri */
  755. {
  756. FR30_INSN_LSR, "lsr", "lsr", 16,
  757. { 0, { { { (1<<MACH_BASE), 0 } } } }
  758. },
  759. /* lsr $u4,$Ri */
  760. {
  761. FR30_INSN_LSRI, "lsri", "lsr", 16,
  762. { 0, { { { (1<<MACH_BASE), 0 } } } }
  763. },
  764. /* lsr2 $u4,$Ri */
  765. {
  766. FR30_INSN_LSR2, "lsr2", "lsr2", 16,
  767. { 0, { { { (1<<MACH_BASE), 0 } } } }
  768. },
  769. /* asr $Rj,$Ri */
  770. {
  771. FR30_INSN_ASR, "asr", "asr", 16,
  772. { 0, { { { (1<<MACH_BASE), 0 } } } }
  773. },
  774. /* asr $u4,$Ri */
  775. {
  776. FR30_INSN_ASRI, "asri", "asr", 16,
  777. { 0, { { { (1<<MACH_BASE), 0 } } } }
  778. },
  779. /* asr2 $u4,$Ri */
  780. {
  781. FR30_INSN_ASR2, "asr2", "asr2", 16,
  782. { 0, { { { (1<<MACH_BASE), 0 } } } }
  783. },
  784. /* ldi:8 $i8,$Ri */
  785. {
  786. FR30_INSN_LDI8, "ldi8", "ldi:8", 16,
  787. { 0, { { { (1<<MACH_BASE), 0 } } } }
  788. },
  789. /* ldi:20 $i20,$Ri */
  790. {
  791. FR30_INSN_LDI20, "ldi20", "ldi:20", 32,
  792. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  793. },
  794. /* ldi:32 $i32,$Ri */
  795. {
  796. FR30_INSN_LDI32, "ldi32", "ldi:32", 48,
  797. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  798. },
  799. /* ld @$Rj,$Ri */
  800. {
  801. FR30_INSN_LD, "ld", "ld", 16,
  802. { 0, { { { (1<<MACH_BASE), 0 } } } }
  803. },
  804. /* lduh @$Rj,$Ri */
  805. {
  806. FR30_INSN_LDUH, "lduh", "lduh", 16,
  807. { 0, { { { (1<<MACH_BASE), 0 } } } }
  808. },
  809. /* ldub @$Rj,$Ri */
  810. {
  811. FR30_INSN_LDUB, "ldub", "ldub", 16,
  812. { 0, { { { (1<<MACH_BASE), 0 } } } }
  813. },
  814. /* ld @($R13,$Rj),$Ri */
  815. {
  816. FR30_INSN_LDR13, "ldr13", "ld", 16,
  817. { 0, { { { (1<<MACH_BASE), 0 } } } }
  818. },
  819. /* lduh @($R13,$Rj),$Ri */
  820. {
  821. FR30_INSN_LDR13UH, "ldr13uh", "lduh", 16,
  822. { 0, { { { (1<<MACH_BASE), 0 } } } }
  823. },
  824. /* ldub @($R13,$Rj),$Ri */
  825. {
  826. FR30_INSN_LDR13UB, "ldr13ub", "ldub", 16,
  827. { 0, { { { (1<<MACH_BASE), 0 } } } }
  828. },
  829. /* ld @($R14,$disp10),$Ri */
  830. {
  831. FR30_INSN_LDR14, "ldr14", "ld", 16,
  832. { 0, { { { (1<<MACH_BASE), 0 } } } }
  833. },
  834. /* lduh @($R14,$disp9),$Ri */
  835. {
  836. FR30_INSN_LDR14UH, "ldr14uh", "lduh", 16,
  837. { 0, { { { (1<<MACH_BASE), 0 } } } }
  838. },
  839. /* ldub @($R14,$disp8),$Ri */
  840. {
  841. FR30_INSN_LDR14UB, "ldr14ub", "ldub", 16,
  842. { 0, { { { (1<<MACH_BASE), 0 } } } }
  843. },
  844. /* ld @($R15,$udisp6),$Ri */
  845. {
  846. FR30_INSN_LDR15, "ldr15", "ld", 16,
  847. { 0, { { { (1<<MACH_BASE), 0 } } } }
  848. },
  849. /* ld @$R15+,$Ri */
  850. {
  851. FR30_INSN_LDR15GR, "ldr15gr", "ld", 16,
  852. { 0, { { { (1<<MACH_BASE), 0 } } } }
  853. },
  854. /* ld @$R15+,$Rs2 */
  855. {
  856. FR30_INSN_LDR15DR, "ldr15dr", "ld", 16,
  857. { 0, { { { (1<<MACH_BASE), 0 } } } }
  858. },
  859. /* ld @$R15+,$ps */
  860. {
  861. FR30_INSN_LDR15PS, "ldr15ps", "ld", 16,
  862. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  863. },
  864. /* st $Ri,@$Rj */
  865. {
  866. FR30_INSN_ST, "st", "st", 16,
  867. { 0, { { { (1<<MACH_BASE), 0 } } } }
  868. },
  869. /* sth $Ri,@$Rj */
  870. {
  871. FR30_INSN_STH, "sth", "sth", 16,
  872. { 0, { { { (1<<MACH_BASE), 0 } } } }
  873. },
  874. /* stb $Ri,@$Rj */
  875. {
  876. FR30_INSN_STB, "stb", "stb", 16,
  877. { 0, { { { (1<<MACH_BASE), 0 } } } }
  878. },
  879. /* st $Ri,@($R13,$Rj) */
  880. {
  881. FR30_INSN_STR13, "str13", "st", 16,
  882. { 0, { { { (1<<MACH_BASE), 0 } } } }
  883. },
  884. /* sth $Ri,@($R13,$Rj) */
  885. {
  886. FR30_INSN_STR13H, "str13h", "sth", 16,
  887. { 0, { { { (1<<MACH_BASE), 0 } } } }
  888. },
  889. /* stb $Ri,@($R13,$Rj) */
  890. {
  891. FR30_INSN_STR13B, "str13b", "stb", 16,
  892. { 0, { { { (1<<MACH_BASE), 0 } } } }
  893. },
  894. /* st $Ri,@($R14,$disp10) */
  895. {
  896. FR30_INSN_STR14, "str14", "st", 16,
  897. { 0, { { { (1<<MACH_BASE), 0 } } } }
  898. },
  899. /* sth $Ri,@($R14,$disp9) */
  900. {
  901. FR30_INSN_STR14H, "str14h", "sth", 16,
  902. { 0, { { { (1<<MACH_BASE), 0 } } } }
  903. },
  904. /* stb $Ri,@($R14,$disp8) */
  905. {
  906. FR30_INSN_STR14B, "str14b", "stb", 16,
  907. { 0, { { { (1<<MACH_BASE), 0 } } } }
  908. },
  909. /* st $Ri,@($R15,$udisp6) */
  910. {
  911. FR30_INSN_STR15, "str15", "st", 16,
  912. { 0, { { { (1<<MACH_BASE), 0 } } } }
  913. },
  914. /* st $Ri,@-$R15 */
  915. {
  916. FR30_INSN_STR15GR, "str15gr", "st", 16,
  917. { 0, { { { (1<<MACH_BASE), 0 } } } }
  918. },
  919. /* st $Rs2,@-$R15 */
  920. {
  921. FR30_INSN_STR15DR, "str15dr", "st", 16,
  922. { 0, { { { (1<<MACH_BASE), 0 } } } }
  923. },
  924. /* st $ps,@-$R15 */
  925. {
  926. FR30_INSN_STR15PS, "str15ps", "st", 16,
  927. { 0, { { { (1<<MACH_BASE), 0 } } } }
  928. },
  929. /* mov $Rj,$Ri */
  930. {
  931. FR30_INSN_MOV, "mov", "mov", 16,
  932. { 0, { { { (1<<MACH_BASE), 0 } } } }
  933. },
  934. /* mov $Rs1,$Ri */
  935. {
  936. FR30_INSN_MOVDR, "movdr", "mov", 16,
  937. { 0, { { { (1<<MACH_BASE), 0 } } } }
  938. },
  939. /* mov $ps,$Ri */
  940. {
  941. FR30_INSN_MOVPS, "movps", "mov", 16,
  942. { 0, { { { (1<<MACH_BASE), 0 } } } }
  943. },
  944. /* mov $Ri,$Rs1 */
  945. {
  946. FR30_INSN_MOV2DR, "mov2dr", "mov", 16,
  947. { 0, { { { (1<<MACH_BASE), 0 } } } }
  948. },
  949. /* mov $Ri,$ps */
  950. {
  951. FR30_INSN_MOV2PS, "mov2ps", "mov", 16,
  952. { 0, { { { (1<<MACH_BASE), 0 } } } }
  953. },
  954. /* jmp @$Ri */
  955. {
  956. FR30_INSN_JMP, "jmp", "jmp", 16,
  957. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  958. },
  959. /* jmp:d @$Ri */
  960. {
  961. FR30_INSN_JMPD, "jmpd", "jmp:d", 16,
  962. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  963. },
  964. /* call @$Ri */
  965. {
  966. FR30_INSN_CALLR, "callr", "call", 16,
  967. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  968. },
  969. /* call:d @$Ri */
  970. {
  971. FR30_INSN_CALLRD, "callrd", "call:d", 16,
  972. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  973. },
  974. /* call $label12 */
  975. {
  976. FR30_INSN_CALL, "call", "call", 16,
  977. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  978. },
  979. /* call:d $label12 */
  980. {
  981. FR30_INSN_CALLD, "calld", "call:d", 16,
  982. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  983. },
  984. /* ret */
  985. {
  986. FR30_INSN_RET, "ret", "ret", 16,
  987. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  988. },
  989. /* ret:d */
  990. {
  991. FR30_INSN_RET_D, "ret:d", "ret:d", 16,
  992. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  993. },
  994. /* int $u8 */
  995. {
  996. FR30_INSN_INT, "int", "int", 16,
  997. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  998. },
  999. /* inte */
  1000. {
  1001. FR30_INSN_INTE, "inte", "inte", 16,
  1002. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1003. },
  1004. /* reti */
  1005. {
  1006. FR30_INSN_RETI, "reti", "reti", 16,
  1007. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1008. },
  1009. /* bra:d $label9 */
  1010. {
  1011. FR30_INSN_BRAD, "brad", "bra:d", 16,
  1012. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1013. },
  1014. /* bra $label9 */
  1015. {
  1016. FR30_INSN_BRA, "bra", "bra", 16,
  1017. { 0|A(NOT_IN_DELAY_SLOT)|A(UNCOND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1018. },
  1019. /* bno:d $label9 */
  1020. {
  1021. FR30_INSN_BNOD, "bnod", "bno:d", 16,
  1022. { 0|A(NOT_IN_DELAY_SLOT)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1023. },
  1024. /* bno $label9 */
  1025. {
  1026. FR30_INSN_BNO, "bno", "bno", 16,
  1027. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1028. },
  1029. /* beq:d $label9 */
  1030. {
  1031. FR30_INSN_BEQD, "beqd", "beq:d", 16,
  1032. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1033. },
  1034. /* beq $label9 */
  1035. {
  1036. FR30_INSN_BEQ, "beq", "beq", 16,
  1037. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1038. },
  1039. /* bne:d $label9 */
  1040. {
  1041. FR30_INSN_BNED, "bned", "bne:d", 16,
  1042. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1043. },
  1044. /* bne $label9 */
  1045. {
  1046. FR30_INSN_BNE, "bne", "bne", 16,
  1047. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1048. },
  1049. /* bc:d $label9 */
  1050. {
  1051. FR30_INSN_BCD, "bcd", "bc:d", 16,
  1052. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1053. },
  1054. /* bc $label9 */
  1055. {
  1056. FR30_INSN_BC, "bc", "bc", 16,
  1057. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1058. },
  1059. /* bnc:d $label9 */
  1060. {
  1061. FR30_INSN_BNCD, "bncd", "bnc:d", 16,
  1062. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1063. },
  1064. /* bnc $label9 */
  1065. {
  1066. FR30_INSN_BNC, "bnc", "bnc", 16,
  1067. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1068. },
  1069. /* bn:d $label9 */
  1070. {
  1071. FR30_INSN_BND, "bnd", "bn:d", 16,
  1072. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1073. },
  1074. /* bn $label9 */
  1075. {
  1076. FR30_INSN_BN, "bn", "bn", 16,
  1077. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1078. },
  1079. /* bp:d $label9 */
  1080. {
  1081. FR30_INSN_BPD, "bpd", "bp:d", 16,
  1082. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1083. },
  1084. /* bp $label9 */
  1085. {
  1086. FR30_INSN_BP, "bp", "bp", 16,
  1087. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1088. },
  1089. /* bv:d $label9 */
  1090. {
  1091. FR30_INSN_BVD, "bvd", "bv:d", 16,
  1092. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1093. },
  1094. /* bv $label9 */
  1095. {
  1096. FR30_INSN_BV, "bv", "bv", 16,
  1097. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1098. },
  1099. /* bnv:d $label9 */
  1100. {
  1101. FR30_INSN_BNVD, "bnvd", "bnv:d", 16,
  1102. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1103. },
  1104. /* bnv $label9 */
  1105. {
  1106. FR30_INSN_BNV, "bnv", "bnv", 16,
  1107. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1108. },
  1109. /* blt:d $label9 */
  1110. {
  1111. FR30_INSN_BLTD, "bltd", "blt:d", 16,
  1112. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1113. },
  1114. /* blt $label9 */
  1115. {
  1116. FR30_INSN_BLT, "blt", "blt", 16,
  1117. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1118. },
  1119. /* bge:d $label9 */
  1120. {
  1121. FR30_INSN_BGED, "bged", "bge:d", 16,
  1122. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1123. },
  1124. /* bge $label9 */
  1125. {
  1126. FR30_INSN_BGE, "bge", "bge", 16,
  1127. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1128. },
  1129. /* ble:d $label9 */
  1130. {
  1131. FR30_INSN_BLED, "bled", "ble:d", 16,
  1132. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1133. },
  1134. /* ble $label9 */
  1135. {
  1136. FR30_INSN_BLE, "ble", "ble", 16,
  1137. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1138. },
  1139. /* bgt:d $label9 */
  1140. {
  1141. FR30_INSN_BGTD, "bgtd", "bgt:d", 16,
  1142. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1143. },
  1144. /* bgt $label9 */
  1145. {
  1146. FR30_INSN_BGT, "bgt", "bgt", 16,
  1147. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1148. },
  1149. /* bls:d $label9 */
  1150. {
  1151. FR30_INSN_BLSD, "blsd", "bls:d", 16,
  1152. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1153. },
  1154. /* bls $label9 */
  1155. {
  1156. FR30_INSN_BLS, "bls", "bls", 16,
  1157. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1158. },
  1159. /* bhi:d $label9 */
  1160. {
  1161. FR30_INSN_BHID, "bhid", "bhi:d", 16,
  1162. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1163. },
  1164. /* bhi $label9 */
  1165. {
  1166. FR30_INSN_BHI, "bhi", "bhi", 16,
  1167. { 0|A(NOT_IN_DELAY_SLOT)|A(COND_CTI), { { { (1<<MACH_BASE), 0 } } } }
  1168. },
  1169. /* dmov $R13,@$dir10 */
  1170. {
  1171. FR30_INSN_DMOVR13, "dmovr13", "dmov", 16,
  1172. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1173. },
  1174. /* dmovh $R13,@$dir9 */
  1175. {
  1176. FR30_INSN_DMOVR13H, "dmovr13h", "dmovh", 16,
  1177. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1178. },
  1179. /* dmovb $R13,@$dir8 */
  1180. {
  1181. FR30_INSN_DMOVR13B, "dmovr13b", "dmovb", 16,
  1182. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1183. },
  1184. /* dmov @$R13+,@$dir10 */
  1185. {
  1186. FR30_INSN_DMOVR13PI, "dmovr13pi", "dmov", 16,
  1187. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1188. },
  1189. /* dmovh @$R13+,@$dir9 */
  1190. {
  1191. FR30_INSN_DMOVR13PIH, "dmovr13pih", "dmovh", 16,
  1192. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1193. },
  1194. /* dmovb @$R13+,@$dir8 */
  1195. {
  1196. FR30_INSN_DMOVR13PIB, "dmovr13pib", "dmovb", 16,
  1197. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1198. },
  1199. /* dmov @$R15+,@$dir10 */
  1200. {
  1201. FR30_INSN_DMOVR15PI, "dmovr15pi", "dmov", 16,
  1202. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1203. },
  1204. /* dmov @$dir10,$R13 */
  1205. {
  1206. FR30_INSN_DMOV2R13, "dmov2r13", "dmov", 16,
  1207. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1208. },
  1209. /* dmovh @$dir9,$R13 */
  1210. {
  1211. FR30_INSN_DMOV2R13H, "dmov2r13h", "dmovh", 16,
  1212. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1213. },
  1214. /* dmovb @$dir8,$R13 */
  1215. {
  1216. FR30_INSN_DMOV2R13B, "dmov2r13b", "dmovb", 16,
  1217. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1218. },
  1219. /* dmov @$dir10,@$R13+ */
  1220. {
  1221. FR30_INSN_DMOV2R13PI, "dmov2r13pi", "dmov", 16,
  1222. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1223. },
  1224. /* dmovh @$dir9,@$R13+ */
  1225. {
  1226. FR30_INSN_DMOV2R13PIH, "dmov2r13pih", "dmovh", 16,
  1227. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1228. },
  1229. /* dmovb @$dir8,@$R13+ */
  1230. {
  1231. FR30_INSN_DMOV2R13PIB, "dmov2r13pib", "dmovb", 16,
  1232. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1233. },
  1234. /* dmov @$dir10,@-$R15 */
  1235. {
  1236. FR30_INSN_DMOV2R15PD, "dmov2r15pd", "dmov", 16,
  1237. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1238. },
  1239. /* ldres @$Ri+,$u4 */
  1240. {
  1241. FR30_INSN_LDRES, "ldres", "ldres", 16,
  1242. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1243. },
  1244. /* stres $u4,@$Ri+ */
  1245. {
  1246. FR30_INSN_STRES, "stres", "stres", 16,
  1247. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1248. },
  1249. /* copop $u4c,$ccc,$CRj,$CRi */
  1250. {
  1251. FR30_INSN_COPOP, "copop", "copop", 32,
  1252. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1253. },
  1254. /* copld $u4c,$ccc,$Rjc,$CRi */
  1255. {
  1256. FR30_INSN_COPLD, "copld", "copld", 32,
  1257. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1258. },
  1259. /* copst $u4c,$ccc,$CRj,$Ric */
  1260. {
  1261. FR30_INSN_COPST, "copst", "copst", 32,
  1262. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1263. },
  1264. /* copsv $u4c,$ccc,$CRj,$Ric */
  1265. {
  1266. FR30_INSN_COPSV, "copsv", "copsv", 32,
  1267. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1268. },
  1269. /* nop */
  1270. {
  1271. FR30_INSN_NOP, "nop", "nop", 16,
  1272. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1273. },
  1274. /* andccr $u8 */
  1275. {
  1276. FR30_INSN_ANDCCR, "andccr", "andccr", 16,
  1277. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1278. },
  1279. /* orccr $u8 */
  1280. {
  1281. FR30_INSN_ORCCR, "orccr", "orccr", 16,
  1282. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1283. },
  1284. /* stilm $u8 */
  1285. {
  1286. FR30_INSN_STILM, "stilm", "stilm", 16,
  1287. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1288. },
  1289. /* addsp $s10 */
  1290. {
  1291. FR30_INSN_ADDSP, "addsp", "addsp", 16,
  1292. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1293. },
  1294. /* extsb $Ri */
  1295. {
  1296. FR30_INSN_EXTSB, "extsb", "extsb", 16,
  1297. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1298. },
  1299. /* extub $Ri */
  1300. {
  1301. FR30_INSN_EXTUB, "extub", "extub", 16,
  1302. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1303. },
  1304. /* extsh $Ri */
  1305. {
  1306. FR30_INSN_EXTSH, "extsh", "extsh", 16,
  1307. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1308. },
  1309. /* extuh $Ri */
  1310. {
  1311. FR30_INSN_EXTUH, "extuh", "extuh", 16,
  1312. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1313. },
  1314. /* ldm0 ($reglist_low_ld) */
  1315. {
  1316. FR30_INSN_LDM0, "ldm0", "ldm0", 16,
  1317. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1318. },
  1319. /* ldm1 ($reglist_hi_ld) */
  1320. {
  1321. FR30_INSN_LDM1, "ldm1", "ldm1", 16,
  1322. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1323. },
  1324. /* stm0 ($reglist_low_st) */
  1325. {
  1326. FR30_INSN_STM0, "stm0", "stm0", 16,
  1327. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1328. },
  1329. /* stm1 ($reglist_hi_st) */
  1330. {
  1331. FR30_INSN_STM1, "stm1", "stm1", 16,
  1332. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1333. },
  1334. /* enter $u10 */
  1335. {
  1336. FR30_INSN_ENTER, "enter", "enter", 16,
  1337. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1338. },
  1339. /* leave */
  1340. {
  1341. FR30_INSN_LEAVE, "leave", "leave", 16,
  1342. { 0, { { { (1<<MACH_BASE), 0 } } } }
  1343. },
  1344. /* xchb @$Rj,$Ri */
  1345. {
  1346. FR30_INSN_XCHB, "xchb", "xchb", 16,
  1347. { 0|A(NOT_IN_DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
  1348. },
  1349. };
  1350. #undef OP
  1351. #undef A
  1352. /* Initialize anything needed to be done once, before any cpu_open call. */
  1353. static void
  1354. init_tables (void)
  1355. {
  1356. }
  1357. #ifndef opcodes_error_handler
  1358. #define opcodes_error_handler(...) \
  1359. fprintf (stderr, __VA_ARGS__); fputc ('\n', stderr)
  1360. #endif
  1361. static const CGEN_MACH * lookup_mach_via_bfd_name (const CGEN_MACH *, const char *);
  1362. static void build_hw_table (CGEN_CPU_TABLE *);
  1363. static void build_ifield_table (CGEN_CPU_TABLE *);
  1364. static void build_operand_table (CGEN_CPU_TABLE *);
  1365. static void build_insn_table (CGEN_CPU_TABLE *);
  1366. static void fr30_cgen_rebuild_tables (CGEN_CPU_TABLE *);
  1367. /* Subroutine of fr30_cgen_cpu_open to look up a mach via its bfd name. */
  1368. static const CGEN_MACH *
  1369. lookup_mach_via_bfd_name (const CGEN_MACH *table, const char *name)
  1370. {
  1371. while (table->name)
  1372. {
  1373. if (strcmp (name, table->bfd_name) == 0)
  1374. return table;
  1375. ++table;
  1376. }
  1377. return NULL;
  1378. }
  1379. /* Subroutine of fr30_cgen_cpu_open to build the hardware table. */
  1380. static void
  1381. build_hw_table (CGEN_CPU_TABLE *cd)
  1382. {
  1383. int i;
  1384. int machs = cd->machs;
  1385. const CGEN_HW_ENTRY *init = & fr30_cgen_hw_table[0];
  1386. /* MAX_HW is only an upper bound on the number of selected entries.
  1387. However each entry is indexed by it's enum so there can be holes in
  1388. the table. */
  1389. const CGEN_HW_ENTRY **selected =
  1390. (const CGEN_HW_ENTRY **) xmalloc (MAX_HW * sizeof (CGEN_HW_ENTRY *));
  1391. cd->hw_table.init_entries = init;
  1392. cd->hw_table.entry_size = sizeof (CGEN_HW_ENTRY);
  1393. memset (selected, 0, MAX_HW * sizeof (CGEN_HW_ENTRY *));
  1394. /* ??? For now we just use machs to determine which ones we want. */
  1395. for (i = 0; init[i].name != NULL; ++i)
  1396. if (CGEN_HW_ATTR_VALUE (&init[i], CGEN_HW_MACH)
  1397. & machs)
  1398. selected[init[i].type] = &init[i];
  1399. cd->hw_table.entries = selected;
  1400. cd->hw_table.num_entries = MAX_HW;
  1401. }
  1402. /* Subroutine of fr30_cgen_cpu_open to build the hardware table. */
  1403. static void
  1404. build_ifield_table (CGEN_CPU_TABLE *cd)
  1405. {
  1406. cd->ifld_table = & fr30_cgen_ifld_table[0];
  1407. }
  1408. /* Subroutine of fr30_cgen_cpu_open to build the hardware table. */
  1409. static void
  1410. build_operand_table (CGEN_CPU_TABLE *cd)
  1411. {
  1412. int i;
  1413. int machs = cd->machs;
  1414. const CGEN_OPERAND *init = & fr30_cgen_operand_table[0];
  1415. /* MAX_OPERANDS is only an upper bound on the number of selected entries.
  1416. However each entry is indexed by it's enum so there can be holes in
  1417. the table. */
  1418. const CGEN_OPERAND **selected = xmalloc (MAX_OPERANDS * sizeof (* selected));
  1419. cd->operand_table.init_entries = init;
  1420. cd->operand_table.entry_size = sizeof (CGEN_OPERAND);
  1421. memset (selected, 0, MAX_OPERANDS * sizeof (CGEN_OPERAND *));
  1422. /* ??? For now we just use mach to determine which ones we want. */
  1423. for (i = 0; init[i].name != NULL; ++i)
  1424. if (CGEN_OPERAND_ATTR_VALUE (&init[i], CGEN_OPERAND_MACH)
  1425. & machs)
  1426. selected[init[i].type] = &init[i];
  1427. cd->operand_table.entries = selected;
  1428. cd->operand_table.num_entries = MAX_OPERANDS;
  1429. }
  1430. /* Subroutine of fr30_cgen_cpu_open to build the hardware table.
  1431. ??? This could leave out insns not supported by the specified mach/isa,
  1432. but that would cause errors like "foo only supported by bar" to become
  1433. "unknown insn", so for now we include all insns and require the app to
  1434. do the checking later.
  1435. ??? On the other hand, parsing of such insns may require their hardware or
  1436. operand elements to be in the table [which they mightn't be]. */
  1437. static void
  1438. build_insn_table (CGEN_CPU_TABLE *cd)
  1439. {
  1440. int i;
  1441. const CGEN_IBASE *ib = & fr30_cgen_insn_table[0];
  1442. CGEN_INSN *insns = xmalloc (MAX_INSNS * sizeof (CGEN_INSN));
  1443. memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN));
  1444. for (i = 0; i < MAX_INSNS; ++i)
  1445. insns[i].base = &ib[i];
  1446. cd->insn_table.init_entries = insns;
  1447. cd->insn_table.entry_size = sizeof (CGEN_IBASE);
  1448. cd->insn_table.num_init_entries = MAX_INSNS;
  1449. }
  1450. /* Subroutine of fr30_cgen_cpu_open to rebuild the tables. */
  1451. static void
  1452. fr30_cgen_rebuild_tables (CGEN_CPU_TABLE *cd)
  1453. {
  1454. int i;
  1455. CGEN_BITSET *isas = cd->isas;
  1456. unsigned int machs = cd->machs;
  1457. cd->int_insn_p = CGEN_INT_INSN_P;
  1458. /* Data derived from the isa spec. */
  1459. #define UNSET (CGEN_SIZE_UNKNOWN + 1)
  1460. cd->default_insn_bitsize = UNSET;
  1461. cd->base_insn_bitsize = UNSET;
  1462. cd->min_insn_bitsize = 65535; /* Some ridiculously big number. */
  1463. cd->max_insn_bitsize = 0;
  1464. for (i = 0; i < MAX_ISAS; ++i)
  1465. if (cgen_bitset_contains (isas, i))
  1466. {
  1467. const CGEN_ISA *isa = & fr30_cgen_isa_table[i];
  1468. /* Default insn sizes of all selected isas must be
  1469. equal or we set the result to 0, meaning "unknown". */
  1470. if (cd->default_insn_bitsize == UNSET)
  1471. cd->default_insn_bitsize = isa->default_insn_bitsize;
  1472. else if (isa->default_insn_bitsize == cd->default_insn_bitsize)
  1473. ; /* This is ok. */
  1474. else
  1475. cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN;
  1476. /* Base insn sizes of all selected isas must be equal
  1477. or we set the result to 0, meaning "unknown". */
  1478. if (cd->base_insn_bitsize == UNSET)
  1479. cd->base_insn_bitsize = isa->base_insn_bitsize;
  1480. else if (isa->base_insn_bitsize == cd->base_insn_bitsize)
  1481. ; /* This is ok. */
  1482. else
  1483. cd->base_insn_bitsize = CGEN_SIZE_UNKNOWN;
  1484. /* Set min,max insn sizes. */
  1485. if (isa->min_insn_bitsize < cd->min_insn_bitsize)
  1486. cd->min_insn_bitsize = isa->min_insn_bitsize;
  1487. if (isa->max_insn_bitsize > cd->max_insn_bitsize)
  1488. cd->max_insn_bitsize = isa->max_insn_bitsize;
  1489. }
  1490. /* Data derived from the mach spec. */
  1491. for (i = 0; i < MAX_MACHS; ++i)
  1492. if (((1 << i) & machs) != 0)
  1493. {
  1494. const CGEN_MACH *mach = & fr30_cgen_mach_table[i];
  1495. if (mach->insn_chunk_bitsize != 0)
  1496. {
  1497. if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize)
  1498. {
  1499. opcodes_error_handler
  1500. (/* xgettext:c-format */
  1501. _("internal error: fr30_cgen_rebuild_tables: "
  1502. "conflicting insn-chunk-bitsize values: `%d' vs. `%d'"),
  1503. cd->insn_chunk_bitsize, mach->insn_chunk_bitsize);
  1504. abort ();
  1505. }
  1506. cd->insn_chunk_bitsize = mach->insn_chunk_bitsize;
  1507. }
  1508. }
  1509. /* Determine which hw elements are used by MACH. */
  1510. build_hw_table (cd);
  1511. /* Build the ifield table. */
  1512. build_ifield_table (cd);
  1513. /* Determine which operands are used by MACH/ISA. */
  1514. build_operand_table (cd);
  1515. /* Build the instruction table. */
  1516. build_insn_table (cd);
  1517. }
  1518. /* Initialize a cpu table and return a descriptor.
  1519. It's much like opening a file, and must be the first function called.
  1520. The arguments are a set of (type/value) pairs, terminated with
  1521. CGEN_CPU_OPEN_END.
  1522. Currently supported values:
  1523. CGEN_CPU_OPEN_ISAS: bitmap of values in enum isa_attr
  1524. CGEN_CPU_OPEN_MACHS: bitmap of values in enum mach_attr
  1525. CGEN_CPU_OPEN_BFDMACH: specify 1 mach using bfd name
  1526. CGEN_CPU_OPEN_ENDIAN: specify endian choice
  1527. CGEN_CPU_OPEN_INSN_ENDIAN: specify instruction endian choice
  1528. CGEN_CPU_OPEN_END: terminates arguments
  1529. ??? Simultaneous multiple isas might not make sense, but it's not (yet)
  1530. precluded. */
  1531. CGEN_CPU_DESC
  1532. fr30_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...)
  1533. {
  1534. CGEN_CPU_TABLE *cd = (CGEN_CPU_TABLE *) xmalloc (sizeof (CGEN_CPU_TABLE));
  1535. static int init_p;
  1536. CGEN_BITSET *isas = 0; /* 0 = "unspecified" */
  1537. unsigned int machs = 0; /* 0 = "unspecified" */
  1538. enum cgen_endian endian = CGEN_ENDIAN_UNKNOWN;
  1539. enum cgen_endian insn_endian = CGEN_ENDIAN_UNKNOWN;
  1540. va_list ap;
  1541. if (! init_p)
  1542. {
  1543. init_tables ();
  1544. init_p = 1;
  1545. }
  1546. memset (cd, 0, sizeof (*cd));
  1547. va_start (ap, arg_type);
  1548. while (arg_type != CGEN_CPU_OPEN_END)
  1549. {
  1550. switch (arg_type)
  1551. {
  1552. case CGEN_CPU_OPEN_ISAS :
  1553. isas = va_arg (ap, CGEN_BITSET *);
  1554. break;
  1555. case CGEN_CPU_OPEN_MACHS :
  1556. machs = va_arg (ap, unsigned int);
  1557. break;
  1558. case CGEN_CPU_OPEN_BFDMACH :
  1559. {
  1560. const char *name = va_arg (ap, const char *);
  1561. const CGEN_MACH *mach =
  1562. lookup_mach_via_bfd_name (fr30_cgen_mach_table, name);
  1563. if (mach != NULL)
  1564. machs |= 1 << mach->num;
  1565. break;
  1566. }
  1567. case CGEN_CPU_OPEN_ENDIAN :
  1568. endian = va_arg (ap, enum cgen_endian);
  1569. break;
  1570. case CGEN_CPU_OPEN_INSN_ENDIAN :
  1571. insn_endian = va_arg (ap, enum cgen_endian);
  1572. break;
  1573. default :
  1574. opcodes_error_handler
  1575. (/* xgettext:c-format */
  1576. _("internal error: fr30_cgen_cpu_open: "
  1577. "unsupported argument `%d'"),
  1578. arg_type);
  1579. abort (); /* ??? return NULL? */
  1580. }
  1581. arg_type = va_arg (ap, enum cgen_cpu_open_arg);
  1582. }
  1583. va_end (ap);
  1584. /* Mach unspecified means "all". */
  1585. if (machs == 0)
  1586. machs = (1 << MAX_MACHS) - 1;
  1587. /* Base mach is always selected. */
  1588. machs |= 1;
  1589. if (endian == CGEN_ENDIAN_UNKNOWN)
  1590. {
  1591. /* ??? If target has only one, could have a default. */
  1592. opcodes_error_handler
  1593. (/* xgettext:c-format */
  1594. _("internal error: fr30_cgen_cpu_open: no endianness specified"));
  1595. abort ();
  1596. }
  1597. cd->isas = cgen_bitset_copy (isas);
  1598. cd->machs = machs;
  1599. cd->endian = endian;
  1600. cd->insn_endian
  1601. = (insn_endian == CGEN_ENDIAN_UNKNOWN ? endian : insn_endian);
  1602. /* Table (re)builder. */
  1603. cd->rebuild_tables = fr30_cgen_rebuild_tables;
  1604. fr30_cgen_rebuild_tables (cd);
  1605. /* Default to not allowing signed overflow. */
  1606. cd->signed_overflow_ok_p = 0;
  1607. return (CGEN_CPU_DESC) cd;
  1608. }
  1609. /* Cover fn to fr30_cgen_cpu_open to handle the simple case of 1 isa, 1 mach.
  1610. MACH_NAME is the bfd name of the mach. */
  1611. CGEN_CPU_DESC
  1612. fr30_cgen_cpu_open_1 (const char *mach_name, enum cgen_endian endian)
  1613. {
  1614. return fr30_cgen_cpu_open (CGEN_CPU_OPEN_BFDMACH, mach_name,
  1615. CGEN_CPU_OPEN_ENDIAN, endian,
  1616. CGEN_CPU_OPEN_END);
  1617. }
  1618. /* Close a cpu table.
  1619. ??? This can live in a machine independent file, but there's currently
  1620. no place to put this file (there's no libcgen). libopcodes is the wrong
  1621. place as some simulator ports use this but they don't use libopcodes. */
  1622. void
  1623. fr30_cgen_cpu_close (CGEN_CPU_DESC cd)
  1624. {
  1625. unsigned int i;
  1626. const CGEN_INSN *insns;
  1627. if (cd->macro_insn_table.init_entries)
  1628. {
  1629. insns = cd->macro_insn_table.init_entries;
  1630. for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns)
  1631. if (CGEN_INSN_RX ((insns)))
  1632. regfree (CGEN_INSN_RX (insns));
  1633. }
  1634. if (cd->insn_table.init_entries)
  1635. {
  1636. insns = cd->insn_table.init_entries;
  1637. for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns)
  1638. if (CGEN_INSN_RX (insns))
  1639. regfree (CGEN_INSN_RX (insns));
  1640. }
  1641. free ((CGEN_INSN *) cd->macro_insn_table.init_entries);
  1642. free ((CGEN_INSN *) cd->insn_table.init_entries);
  1643. free ((CGEN_HW_ENTRY *) cd->hw_table.entries);
  1644. free ((CGEN_HW_ENTRY *) cd->operand_table.entries);
  1645. free (cd);
  1646. }