v850-opc.c 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912
  1. /* Assemble V850 instructions.
  2. Copyright (C) 1996-2022 Free Software Foundation, Inc.
  3. This file is part of the GNU opcodes library.
  4. This library is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. It is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  11. License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #include "sysdep.h"
  17. #include <stdio.h>
  18. #include "opcode/v850.h"
  19. #include "bfd.h"
  20. #include "opintl.h"
  21. /* Regular opcodes. */
  22. #define OP(x) ((x & 0x3f) << 5)
  23. #define OP_MASK OP (0x3f)
  24. /* Conditional branch opcodes (Format III). */
  25. #define BOP(x) ((0x58 << 4) | (x & 0x0f))
  26. #define BOP_MASK ((0x78 << 4) | 0x0f)
  27. /* Conditional branch opcodes (Format VII). */
  28. #define BOP7(x) (0x107e0 | (x & 0xf))
  29. #define BOP7_MASK (0x1ffe0 | 0xf)
  30. /* One-word opcodes. */
  31. #define one(x) ((unsigned int) (x))
  32. /* Two-word opcodes. */
  33. #define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16))
  34. /* The functions used to insert and extract complicated operands. */
  35. /* Note: There is a conspiracy between these functions and
  36. v850_insert_operand() in gas/config/tc-v850.c. Error messages
  37. containing the string 'out of range' will be ignored unless a
  38. specific command line option is given to GAS. */
  39. static const char * not_valid = N_ ("displacement value is not in range and is not aligned");
  40. static const char * out_of_range = N_ ("displacement value is out of range");
  41. static const char * not_aligned = N_ ("displacement value is not aligned");
  42. static const char * immediate_out_of_range = N_ ("immediate value is out of range");
  43. static const char * branch_out_of_range = N_ ("branch value out of range");
  44. static const char * branch_out_of_range_and_odd_offset = N_ ("branch value not in range and to odd offset");
  45. static const char * branch_to_odd_offset = N_ ("branch to odd offset");
  46. static const char * pos_out_of_range = N_ ("position value is out of range");
  47. static const char * width_out_of_range = N_ ("width value is out of range");
  48. static const char * selid_out_of_range = N_ ("SelID is out of range");
  49. static const char * vector8_out_of_range = N_ ("vector8 is out of range");
  50. static const char * vector5_out_of_range = N_ ("vector5 is out of range");
  51. static const char * imm10_out_of_range = N_ ("imm10 is out of range");
  52. static const char * sr_selid_out_of_range = N_ ("SR/SelID is out of range");
  53. int
  54. v850_msg_is_out_of_range (const char* msg)
  55. {
  56. return msg == out_of_range
  57. || msg == immediate_out_of_range
  58. || msg == branch_out_of_range;
  59. }
  60. static unsigned long
  61. insert_i5div1 (unsigned long insn, unsigned long value, const char ** errmsg)
  62. {
  63. if (value > 30 || value < 2)
  64. {
  65. if (value & 1)
  66. * errmsg = _(not_valid);
  67. else
  68. * errmsg = _(out_of_range);
  69. }
  70. else if (value & 1)
  71. * errmsg = _(not_aligned);
  72. value = (32 - value)/2;
  73. return (insn | ((value << (2+16)) & 0x3c0000));
  74. }
  75. static unsigned long
  76. extract_i5div1 (unsigned long insn, int * invalid)
  77. {
  78. unsigned long ret = (insn & 0x003c0000) >> (16+2);
  79. ret = 32 - (ret * 2);
  80. if (invalid != 0)
  81. *invalid = (ret > 30 || ret < 2) ? 1 : 0;
  82. return ret;
  83. }
  84. static unsigned long
  85. insert_i5div2 (unsigned long insn, unsigned long value, const char ** errmsg)
  86. {
  87. if (value > 30 || value < 4)
  88. {
  89. if (value & 1)
  90. * errmsg = _(not_valid);
  91. else
  92. * errmsg = _(out_of_range);
  93. }
  94. else if (value & 1)
  95. * errmsg = _(not_aligned);
  96. value = (32 - value)/2;
  97. return insn | ((value << (2 + 16)) & 0x3c0000);
  98. }
  99. static unsigned long
  100. extract_i5div2 (unsigned long insn, int * invalid)
  101. {
  102. unsigned long ret = (insn & 0x003c0000) >> (16+2);
  103. ret = 32 - (ret * 2);
  104. if (invalid != 0)
  105. *invalid = (ret > 30 || ret < 4) ? 1 : 0;
  106. return ret;
  107. }
  108. static unsigned long
  109. insert_i5div3 (unsigned long insn, unsigned long value, const char ** errmsg)
  110. {
  111. if (value > 32 || value < 2)
  112. {
  113. if (value & 1)
  114. * errmsg = _(not_valid);
  115. else
  116. * errmsg = _(out_of_range);
  117. }
  118. else if (value & 1)
  119. * errmsg = _(not_aligned);
  120. value = (32 - value)/2;
  121. return insn | ((value << (2+16)) & 0x3c0000);
  122. }
  123. static unsigned long
  124. extract_i5div3 (unsigned long insn, int * invalid)
  125. {
  126. unsigned long ret = (insn & 0x003c0000) >> (16+2);
  127. ret = 32 - (ret * 2);
  128. if (invalid != 0)
  129. *invalid = (ret > 32 || ret < 2) ? 1 : 0;
  130. return ret;
  131. }
  132. static unsigned long
  133. insert_d5_4 (unsigned long insn, unsigned long value, const char ** errmsg)
  134. {
  135. if (value > 0x1f)
  136. {
  137. if (value & 1)
  138. * errmsg = _(not_valid);
  139. else
  140. * errmsg = _(out_of_range);
  141. }
  142. else if (value & 1)
  143. * errmsg = _(not_aligned);
  144. value >>= 1;
  145. return insn | (value & 0x0f);
  146. }
  147. static unsigned long
  148. extract_d5_4 (unsigned long insn, int * invalid)
  149. {
  150. unsigned long ret = (insn & 0x0f);
  151. ret <<= 1;
  152. if (invalid != 0)
  153. *invalid = 0;
  154. return ret;
  155. }
  156. static unsigned long
  157. insert_d8_6 (unsigned long insn, unsigned long value, const char ** errmsg)
  158. {
  159. if (value > 0xff)
  160. {
  161. if ((value % 4) != 0)
  162. * errmsg = _(not_valid);
  163. else
  164. * errmsg = _(out_of_range);
  165. }
  166. else if ((value % 4) != 0)
  167. * errmsg = _(not_aligned);
  168. value >>= 1;
  169. return insn | (value & 0x7e);
  170. }
  171. static unsigned long
  172. extract_d8_6 (unsigned long insn, int * invalid)
  173. {
  174. unsigned long ret = (insn & 0x7e);
  175. ret <<= 1;
  176. if (invalid != 0)
  177. *invalid = 0;
  178. return ret;
  179. }
  180. static unsigned long
  181. insert_d8_7 (unsigned long insn, unsigned long value, const char ** errmsg)
  182. {
  183. if (value > 0xff)
  184. {
  185. if ((value % 2) != 0)
  186. * errmsg = _(not_valid);
  187. else
  188. * errmsg = _(out_of_range);
  189. }
  190. else if ((value % 2) != 0)
  191. * errmsg = _(not_aligned);
  192. value >>= 1;
  193. return insn | (value & 0x7f);
  194. }
  195. static unsigned long
  196. extract_d8_7 (unsigned long insn, int * invalid)
  197. {
  198. unsigned long ret = (insn & 0x7f);
  199. ret <<= 1;
  200. if (invalid != 0)
  201. *invalid = 0;
  202. return ret;
  203. }
  204. static unsigned long
  205. insert_v8 (unsigned long insn, unsigned long value, const char ** errmsg)
  206. {
  207. if (value > 0xff)
  208. * errmsg = _(immediate_out_of_range);
  209. return insn | (value & 0x1f) | ((value & 0xe0) << (27-5));
  210. }
  211. static unsigned long
  212. extract_v8 (unsigned long insn, int * invalid)
  213. {
  214. unsigned long ret = (insn & 0x1f) | ((insn >> (27-5)) & 0xe0);
  215. if (invalid != 0)
  216. *invalid = 0;
  217. return ret;
  218. }
  219. static unsigned long
  220. insert_d9 (unsigned long insn, unsigned long value, const char ** errmsg)
  221. {
  222. if (value + 0x100 > 0x1ff)
  223. {
  224. if ((value % 2) != 0)
  225. * errmsg = branch_out_of_range_and_odd_offset;
  226. else
  227. * errmsg = branch_out_of_range;
  228. }
  229. else if ((value % 2) != 0)
  230. * errmsg = branch_to_odd_offset;
  231. return insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3);
  232. }
  233. static unsigned long
  234. extract_d9 (unsigned long insn, int * invalid)
  235. {
  236. unsigned long ret = ((insn >> 7) & 0x1f0) | ((insn >> 3) & 0x0e);
  237. ret = (ret ^ 0x100) - 0x100;
  238. if (invalid != 0)
  239. *invalid = 0;
  240. return ret;
  241. }
  242. static unsigned long
  243. insert_u16_loop (unsigned long insn, unsigned long value, const char ** errmsg)
  244. {
  245. /* Loop displacement is encoded as a positive value,
  246. even though the instruction branches backwards. */
  247. if (value > 0xffff)
  248. {
  249. if ((value % 2) != 0)
  250. * errmsg = branch_out_of_range_and_odd_offset;
  251. else
  252. * errmsg = branch_out_of_range;
  253. }
  254. else if ((value % 2) != 0)
  255. * errmsg = branch_to_odd_offset;
  256. return insn | ((value & 0xfffe) << 16);
  257. }
  258. static unsigned long
  259. extract_u16_loop (unsigned long insn, int * invalid)
  260. {
  261. long ret = (insn >> 16) & 0xfffe;
  262. if (invalid != 0)
  263. *invalid = 0;
  264. return ret;
  265. }
  266. static unsigned long
  267. insert_d16_15 (unsigned long insn, unsigned long value, const char ** errmsg)
  268. {
  269. if (value + 0x8000 > 0xffff)
  270. {
  271. if ((value % 2) != 0)
  272. * errmsg = _(not_valid);
  273. else
  274. * errmsg = _(out_of_range);
  275. }
  276. else if ((value % 2) != 0)
  277. * errmsg = _(not_aligned);
  278. return insn | ((value & 0xfffe) << 16);
  279. }
  280. static unsigned long
  281. extract_d16_15 (unsigned long insn, int * invalid)
  282. {
  283. unsigned long ret = (insn >> 16) & 0xfffe;
  284. ret = (ret ^ 0x8000) - 0x8000;
  285. if (invalid != 0)
  286. *invalid = 0;
  287. return ret;
  288. }
  289. static unsigned long
  290. insert_d16_16 (unsigned long insn, unsigned long value, const char ** errmsg)
  291. {
  292. if (value + 0x8000 > 0xffff)
  293. * errmsg = _(out_of_range);
  294. return insn | ((value & 0xfffe) << 16) | ((value & 1) << 5);
  295. }
  296. static unsigned long
  297. extract_d16_16 (unsigned long insn, int * invalid)
  298. {
  299. unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn >> 5) & 1);
  300. ret = (ret ^ 0x8000) - 0x8000;
  301. if (invalid != 0)
  302. *invalid = 0;
  303. return ret;
  304. }
  305. static unsigned long
  306. insert_d17_16 (unsigned long insn, unsigned long value, const char ** errmsg)
  307. {
  308. if (value + 0x10000 > 0x1ffff)
  309. * errmsg = _(out_of_range);
  310. return insn | ((value & 0xfffe) << 16) | ((value & 0x10000) >> (16 - 4));
  311. }
  312. static unsigned long
  313. extract_d17_16 (unsigned long insn, int * invalid)
  314. {
  315. unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn << (16 - 4)) & 0x10000);
  316. ret = (ret ^ 0x10000) - 0x10000;
  317. if (invalid != 0)
  318. *invalid = 0;
  319. return ret;
  320. }
  321. static unsigned long
  322. insert_d22 (unsigned long insn, unsigned long value, const char ** errmsg)
  323. {
  324. if (value + 0x200000 > 0x3fffff)
  325. {
  326. if ((value % 2) != 0)
  327. * errmsg = branch_out_of_range_and_odd_offset;
  328. else
  329. * errmsg = branch_out_of_range;
  330. }
  331. else if ((value % 2) != 0)
  332. * errmsg = branch_to_odd_offset;
  333. return insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16);
  334. }
  335. static unsigned long
  336. extract_d22 (unsigned long insn, int * invalid)
  337. {
  338. unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn << 16) & 0x3f0000);
  339. ret = (ret ^ 0x200000) - 0x200000;
  340. if (invalid != 0)
  341. *invalid = 0;
  342. return ret;
  343. }
  344. static unsigned long
  345. insert_d23 (unsigned long insn, unsigned long value, const char ** errmsg)
  346. {
  347. if (value + 0x400000 > 0x7fffff)
  348. * errmsg = out_of_range;
  349. return insn | ((value & 0x7f) << 4) | ((value & 0x7fff80) << (16-7));
  350. }
  351. static unsigned long
  352. insert_d23_align1 (unsigned long insn, unsigned long value, const char ** errmsg)
  353. {
  354. if (value + 0x400000 > 0x7fffff)
  355. {
  356. if (value & 0x1)
  357. * errmsg = _(not_valid);
  358. else
  359. * errmsg = _(out_of_range);
  360. }
  361. else if (value & 0x1)
  362. * errmsg = _(not_aligned);
  363. return insn | ((value & 0x7e) << 4) | ((value & 0x7fff80) << (16 - 7));
  364. }
  365. static unsigned long
  366. extract_d23 (unsigned long insn, int * invalid)
  367. {
  368. unsigned long ret = ((insn >> 4) & 0x7f) | ((insn >> (16-7)) & 0x7fff80);
  369. ret = (ret ^ 0x400000) - 0x400000;
  370. if (invalid != 0)
  371. *invalid = 0;
  372. return ret;
  373. }
  374. static unsigned long
  375. insert_i9 (unsigned long insn, unsigned long value, const char ** errmsg)
  376. {
  377. if (value + 0x100 > 0x1ff)
  378. * errmsg = _(immediate_out_of_range);
  379. return insn | ((value & 0x1e0) << 13) | (value & 0x1f);
  380. }
  381. static unsigned long
  382. extract_i9 (unsigned long insn, int * invalid)
  383. {
  384. unsigned long ret = ((insn >> 13) & 0x1e0) | (insn & 0x1f);
  385. ret = (ret ^ 0x100) - 0x100;
  386. if (invalid != 0)
  387. *invalid = 0;
  388. return ret;
  389. }
  390. static unsigned long
  391. insert_u9 (unsigned long insn, unsigned long value, const char ** errmsg)
  392. {
  393. if (value > 0x1ff)
  394. * errmsg = _(immediate_out_of_range);
  395. return insn | ((value & 0x1e0) << 13) | (value & 0x1f);
  396. }
  397. static unsigned long
  398. extract_u9 (unsigned long insn, int * invalid)
  399. {
  400. unsigned long ret = ((insn >> 13) & 0x1e0) | (insn & 0x1f);
  401. if (invalid != 0)
  402. *invalid = 0;
  403. return ret;
  404. }
  405. static unsigned long
  406. insert_spe (unsigned long insn, unsigned long value, const char ** errmsg)
  407. {
  408. if (value != 3)
  409. * errmsg = _("invalid register for stack adjustment");
  410. return insn & ~0x180000;
  411. }
  412. static unsigned long
  413. extract_spe (unsigned long insn ATTRIBUTE_UNUSED, int * invalid)
  414. {
  415. if (invalid != 0)
  416. *invalid = 0;
  417. return 3;
  418. }
  419. static unsigned long
  420. insert_r4 (unsigned long insn, unsigned long value, const char ** errmsg)
  421. {
  422. if (value >= 32)
  423. * errmsg = _("invalid register name");
  424. return insn | ((value & 0x01) << 23) | ((value & 0x1e) << 16);
  425. }
  426. static unsigned long
  427. extract_r4 (unsigned long insn, int * invalid)
  428. {
  429. unsigned long r4;
  430. unsigned long insn2;
  431. insn2 = insn >> 16;
  432. r4 = (((insn2 & 0x0080) >> 7) | (insn2 & 0x001e));
  433. if (invalid != 0)
  434. *invalid = 0;
  435. return r4;
  436. }
  437. static unsigned long G_pos;
  438. static unsigned long
  439. insert_POS (unsigned long insn, unsigned long pos, const char ** errmsg)
  440. {
  441. if (pos > 0x1f)
  442. * errmsg = _(pos_out_of_range);
  443. G_pos = pos;
  444. return insn; /* Not an oparaton until WIDTH. */
  445. }
  446. static unsigned long
  447. extract_POS_U (unsigned long insn, int * invalid)
  448. {
  449. unsigned long pos,lsb;
  450. unsigned long insn2;
  451. insn2 = insn >> 16;
  452. lsb = ((insn2 & 0x0800) >> 8)
  453. | ((insn2 & 0x000e) >> 1);
  454. lsb += 16;
  455. pos = lsb;
  456. if (invalid != 0)
  457. *invalid = 0;
  458. return pos;
  459. }
  460. static unsigned long
  461. extract_POS_L (unsigned long insn, int * invalid)
  462. {
  463. unsigned long pos,lsb;
  464. unsigned long insn2;
  465. insn2 = insn >> 16;
  466. lsb = ((insn2 & 0x0800) >> 8)
  467. | ((insn2 & 0x000e) >> 1);
  468. pos = lsb;
  469. if (invalid != 0)
  470. *invalid = 0;
  471. return pos;
  472. }
  473. static unsigned long
  474. insert_WIDTH (unsigned long insn, unsigned long width, const char ** errmsg)
  475. {
  476. unsigned long msb, lsb, opc, ret;
  477. unsigned long msb_expand, lsb_expand;
  478. msb = width + G_pos - 1;
  479. lsb = G_pos;
  480. opc = 0;
  481. G_pos = 0;
  482. if (width > 0x20)
  483. * errmsg = _(width_out_of_range);
  484. if ((msb >= 16) && (lsb >= 16))
  485. opc = 0x0090;
  486. else if ((msb >= 16) && (lsb < 16))
  487. opc = 0x00b0;
  488. else if ((msb < 16) && (lsb < 16))
  489. opc = 0x00d0;
  490. else
  491. * errmsg = _(width_out_of_range);
  492. msb &= 0x0f;
  493. msb_expand = msb << 12;
  494. lsb &= 0x0f;
  495. lsb_expand = ((lsb & 0x8) << 8)|((lsb & 0x7) << 1);
  496. ret = (insn & 0x0000ffff) | ((opc | msb_expand | lsb_expand) << 16);
  497. return ret;
  498. }
  499. static unsigned long
  500. extract_WIDTH_U (unsigned long insn, int * invalid)
  501. {
  502. unsigned long width, msb, lsb;
  503. unsigned long insn2;
  504. insn2 = insn >> 16;
  505. msb = ((insn2 & 0xf000) >> 12);
  506. msb += 16;
  507. lsb = ((insn2 & 0x0800) >> 8)
  508. | ((insn2 & 0x000e) >> 1);
  509. lsb += 16;
  510. if (invalid != 0)
  511. *invalid = 0;
  512. width = msb - lsb + 1;
  513. return width;
  514. }
  515. static unsigned long
  516. extract_WIDTH_M (unsigned long insn, int * invalid)
  517. {
  518. unsigned long width, msb, lsb;
  519. unsigned long insn2;
  520. insn2 = insn >> 16;
  521. msb = ((insn2 & 0xf000) >> 12) ;
  522. msb += 16;
  523. lsb = ((insn2 & 0x0800) >> 8)
  524. | ((insn2 & 0x000e) >> 1);
  525. if (invalid != 0)
  526. *invalid = 0;
  527. width = msb - lsb + 1;
  528. return width;
  529. }
  530. static unsigned long
  531. extract_WIDTH_L (unsigned long insn, int * invalid)
  532. {
  533. unsigned long width, msb, lsb;
  534. unsigned long insn2;
  535. insn2 = insn >> 16;
  536. msb = ((insn2 & 0xf000) >> 12) ;
  537. lsb = ((insn2 & 0x0800) >> 8)
  538. | ((insn2 & 0x000e) >> 1);
  539. if (invalid != 0)
  540. *invalid = 0;
  541. width = msb - lsb + 1;
  542. return width;
  543. }
  544. static unsigned long
  545. insert_SELID (unsigned long insn, unsigned long selid, const char ** errmsg)
  546. {
  547. if (selid > 0x1f)
  548. * errmsg = _(selid_out_of_range);
  549. return insn | ((selid & 0x1fUL) << 27);
  550. }
  551. static unsigned long
  552. extract_SELID (unsigned long insn, int * invalid)
  553. {
  554. unsigned long selid;
  555. unsigned long insn2;
  556. insn2 = insn >> 16;
  557. selid = ((insn2 & 0xf800) >> 11);
  558. if (invalid != 0)
  559. *invalid = 0;
  560. return selid;
  561. }
  562. static unsigned long
  563. insert_VECTOR8 (unsigned long insn, unsigned long vector8, const char ** errmsg)
  564. {
  565. unsigned long ret;
  566. unsigned long VVV, vvvvv;
  567. if (vector8 > 0xff)
  568. * errmsg = _(vector8_out_of_range);
  569. VVV = (vector8 & 0xe0) >> 5;
  570. vvvvv = (vector8 & 0x1f);
  571. ret = (insn | (VVV << 27) | vvvvv);
  572. return ret;
  573. }
  574. static unsigned long
  575. extract_VECTOR8 (unsigned long insn, int * invalid)
  576. {
  577. unsigned long vector8;
  578. unsigned long VVV,vvvvv;
  579. unsigned long insn2;
  580. insn2 = insn >> 16;
  581. VVV = ((insn2 & 0x3800) >> 11);
  582. vvvvv = (insn & 0x001f);
  583. vector8 = VVV << 5 | vvvvv;
  584. if (invalid != 0)
  585. *invalid = 0;
  586. return vector8;
  587. }
  588. static unsigned long
  589. insert_VECTOR5 (unsigned long insn, unsigned long vector5, const char ** errmsg)
  590. {
  591. unsigned long ret;
  592. unsigned long vvvvv;
  593. if (vector5 > 0x1f)
  594. * errmsg = _(vector5_out_of_range);
  595. vvvvv = (vector5 & 0x1f);
  596. ret = (insn | vvvvv);
  597. return ret;
  598. }
  599. static unsigned long
  600. extract_VECTOR5 (unsigned long insn, int * invalid)
  601. {
  602. unsigned long vector5;
  603. vector5 = (insn & 0x001f);
  604. if (invalid != 0)
  605. *invalid = 0;
  606. return vector5;
  607. }
  608. static unsigned long
  609. insert_CACHEOP (unsigned long insn, unsigned long cacheop, const char ** errmsg ATTRIBUTE_UNUSED)
  610. {
  611. unsigned long ret;
  612. unsigned long pp, PPPPP;
  613. pp = (cacheop & 0x60) >> 5;
  614. PPPPP = (cacheop & 0x1f);
  615. ret = insn | (pp << 11) | (PPPPP << 27);
  616. return ret;
  617. }
  618. static unsigned long
  619. extract_CACHEOP (unsigned long insn, int * invalid)
  620. {
  621. unsigned long ret;
  622. unsigned long pp, PPPPP;
  623. unsigned long insn2;
  624. insn2 = insn >> 16;
  625. PPPPP = ((insn2 & 0xf800) >> 11);
  626. pp = ((insn & 0x1800) >> 11);
  627. ret = (pp << 5) | PPPPP;
  628. if (invalid != 0)
  629. *invalid = 0;
  630. return ret;
  631. }
  632. static unsigned long
  633. insert_PREFOP (unsigned long insn, unsigned long prefop, const char ** errmsg ATTRIBUTE_UNUSED)
  634. {
  635. unsigned long ret;
  636. unsigned long PPPPP;
  637. PPPPP = (prefop & 0x1f);
  638. ret = insn | (PPPPP << 27);
  639. return ret;
  640. }
  641. static unsigned long
  642. extract_PREFOP (unsigned long insn, int * invalid)
  643. {
  644. unsigned long ret;
  645. unsigned long PPPPP;
  646. unsigned long insn2;
  647. insn2 = insn >> 16;
  648. PPPPP = (insn2 & 0xf800) >> 11;
  649. ret = PPPPP;
  650. if (invalid != 0)
  651. *invalid = 0;
  652. return ret;
  653. }
  654. static unsigned long
  655. insert_IMM10U (unsigned long insn, unsigned long value, const char ** errmsg)
  656. {
  657. unsigned long imm10, ret;
  658. unsigned long iiiii,IIIII;
  659. if (value > 0x3ff)
  660. * errmsg = _(imm10_out_of_range);
  661. imm10 = value & 0x3ff;
  662. IIIII = (imm10 >> 5) & 0x1f;
  663. iiiii = imm10 & 0x1f;
  664. ret = insn | IIIII << 27 | iiiii;
  665. return ret;
  666. }
  667. static unsigned long
  668. extract_IMM10U (unsigned long insn, int * invalid)
  669. {
  670. unsigned long ret;
  671. unsigned long iiiii,IIIII;
  672. unsigned long insn2;
  673. insn2 = insn >> 16;
  674. IIIII = ((insn2 & 0xf800) >> 11);
  675. iiiii = (insn & 0x001f);
  676. ret = (IIIII << 5) | iiiii;
  677. if (invalid != 0)
  678. *invalid = 0;
  679. return ret;
  680. }
  681. static unsigned long
  682. insert_SRSEL1 (unsigned long insn, unsigned long value, const char ** errmsg)
  683. {
  684. unsigned long imm10, ret;
  685. unsigned long sr,selid;
  686. if (value > 0x3ff)
  687. * errmsg = _(sr_selid_out_of_range);
  688. imm10 = value;
  689. selid = (imm10 & 0x3e0) >> 5;
  690. sr = imm10 & 0x1f;
  691. ret = insn | selid << 27 | sr;
  692. return ret;
  693. }
  694. static unsigned long
  695. extract_SRSEL1 (unsigned long insn, int * invalid)
  696. {
  697. unsigned long ret;
  698. unsigned long sr, selid;
  699. unsigned long insn2;
  700. insn2 = insn >> 16;
  701. selid = ((insn2 & 0xf800) >> 11);
  702. sr = (insn & 0x001f);
  703. ret = (selid << 5) | sr;
  704. if (invalid != 0)
  705. *invalid = 0;
  706. return ret;
  707. }
  708. static unsigned long
  709. insert_SRSEL2 (unsigned long insn, unsigned long value, const char ** errmsg)
  710. {
  711. unsigned long imm10, ret;
  712. unsigned long sr, selid;
  713. if (value > 0x3ff)
  714. * errmsg = _(sr_selid_out_of_range);
  715. imm10 = value;
  716. selid = (imm10 & 0x3e0) >> 5;
  717. sr = imm10 & 0x1f;
  718. ret = insn | selid << 27 | sr << 11;
  719. return ret;
  720. }
  721. static unsigned long
  722. extract_SRSEL2 (unsigned long insn, int * invalid)
  723. {
  724. unsigned long ret;
  725. unsigned long sr, selid;
  726. unsigned long insn2;
  727. insn2 = insn >> 16;
  728. selid = ((insn2 & 0xf800) >> 11);
  729. sr = ((insn & 0xf800) >> 11);
  730. ret = (selid << 5) | sr;
  731. if (invalid != 0)
  732. *invalid = 0;
  733. return ret;
  734. }
  735. /* Warning: code in gas/config/tc-v850.c examines the contents of this array.
  736. If you change any of the values here, be sure to look for side effects in
  737. that code. */
  738. const struct v850_operand v850_operands[] =
  739. {
  740. #define UNUSED 0
  741. { 0, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  742. /* The R1 field in a format 1, 6, 7, 9, C insn. */
  743. #define R1 (UNUSED + 1)
  744. { 5, 0, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE },
  745. /* As above, but register 0 is not allowed. */
  746. #define R1_NOTR0 (R1 + 1)
  747. { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE },
  748. /* Even register is allowed. */
  749. #define R1_EVEN (R1_NOTR0 + 1)
  750. { 4, 1, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE },
  751. /* Bang (bit reverse). */
  752. #define R1_BANG (R1_EVEN + 1)
  753. { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_OPERAND_BANG, BFD_RELOC_NONE },
  754. /* Percent (modulo). */
  755. #define R1_PERCENT (R1_BANG + 1)
  756. { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_OPERAND_PERCENT, BFD_RELOC_NONE },
  757. /* The R2 field in a format 1, 2, 4, 5, 6, 7, 9, C insn. */
  758. #define R2 (R1_PERCENT + 1)
  759. { 5, 11, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE },
  760. /* As above, but register 0 is not allowed. */
  761. #define R2_NOTR0 (R2 + 1)
  762. { 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE },
  763. /* Even register is allowed. */
  764. #define R2_EVEN (R2_NOTR0 + 1)
  765. { 4, 12, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE },
  766. /* Reg2 in dispose instruction. */
  767. #define R2_DISPOSE (R2_EVEN + 1)
  768. { 5, 16, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE },
  769. /* The R3 field in a format 11, 12, C insn. */
  770. #define R3 (R2_DISPOSE + 1)
  771. { 5, 27, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE },
  772. /* As above, but register 0 is not allowed. */
  773. #define R3_NOTR0 (R3 + 1)
  774. { 5, 27, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE },
  775. /* As above, but odd number registers are not allowed. */
  776. #define R3_EVEN (R3_NOTR0 + 1)
  777. { 4, 28, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE },
  778. /* As above, but register 0 is not allowed. */
  779. #define R3_EVEN_NOTR0 (R3_EVEN + 1)
  780. { 4, 28, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN | V850_NOT_R0, BFD_RELOC_NONE },
  781. /* Forth register in FPU Instruction. */
  782. #define R4 (R3_EVEN_NOTR0 + 1)
  783. { 5, 0, insert_r4, extract_r4, V850_OPERAND_REG, BFD_RELOC_NONE },
  784. /* As above, but odd number registers are not allowed. */
  785. #define R4_EVEN (R4 + 1)
  786. { 4, 17, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE },
  787. /* Stack pointer in prepare instruction. */
  788. #define SP (R4_EVEN + 1)
  789. { 2, 0, insert_spe, extract_spe, V850_OPERAND_REG, BFD_RELOC_NONE },
  790. /* EP Register. */
  791. #define EP (SP + 1)
  792. { 0, 0, NULL, NULL, V850_OPERAND_EP, BFD_RELOC_NONE },
  793. /* A list of registers in a prepare/dispose instruction. */
  794. #define LIST12 (EP + 1)
  795. { -1, 0xffe00001, NULL, NULL, V850E_OPERAND_REG_LIST, BFD_RELOC_NONE },
  796. /* System register operands. */
  797. #define OLDSR1 (LIST12 + 1)
  798. { 5, 0, NULL, NULL, V850_OPERAND_SRG, BFD_RELOC_NONE },
  799. #define SR1 (OLDSR1 + 1)
  800. { 0, 0, insert_SRSEL1, extract_SRSEL1, V850_OPERAND_SRG, BFD_RELOC_NONE },
  801. /* The R2 field as a system register. */
  802. #define OLDSR2 (SR1 + 1)
  803. { 5, 11, NULL, NULL, V850_OPERAND_SRG, BFD_RELOC_NONE },
  804. #define SR2 (OLDSR2 + 1)
  805. { 0, 0, insert_SRSEL2, extract_SRSEL2, V850_OPERAND_SRG, BFD_RELOC_NONE },
  806. /* FPU CC bit position. */
  807. #define FFF (SR2 + 1)
  808. { 3, 17, NULL, NULL, 0, BFD_RELOC_NONE },
  809. /* The 4 bit condition code in a setf instruction. */
  810. #define CCCC (FFF + 1)
  811. { 4, 0, NULL, NULL, V850_OPERAND_CC, BFD_RELOC_NONE },
  812. /* Condition code in adf,sdf. */
  813. #define CCCC_NOTSA (CCCC + 1)
  814. { 4, 17, NULL, NULL, V850_OPERAND_CC|V850_NOT_SA, BFD_RELOC_NONE },
  815. /* Condition code in conditional moves. */
  816. #define MOVCC (CCCC_NOTSA + 1)
  817. { 4, 17, NULL, NULL, V850_OPERAND_CC, BFD_RELOC_NONE },
  818. /* Condition code in FPU. */
  819. #define FLOAT_CCCC (MOVCC + 1)
  820. { 4, 27, NULL, NULL, V850_OPERAND_FLOAT_CC, BFD_RELOC_NONE },
  821. /* The 1 bit immediate field in format C insn. */
  822. #define VI1 (FLOAT_CCCC + 1)
  823. { 1, 3, NULL, NULL, 0, BFD_RELOC_NONE },
  824. /* The 1 bit immediate field in format C insn. */
  825. #define VC1 (VI1 + 1)
  826. { 1, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  827. /* The 2 bit immediate field in format C insn. */
  828. #define DI2 (VC1 + 1)
  829. { 2, 17, NULL, NULL, 0, BFD_RELOC_NONE },
  830. /* The 2 bit immediate field in format C insn. */
  831. #define VI2 (DI2 + 1)
  832. { 2, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  833. /* The 2 bit immediate field in format C - DUP insn. */
  834. #define VI2DUP (VI2 + 1)
  835. { 2, 2, NULL, NULL, 0, BFD_RELOC_NONE },
  836. /* The 3 bit immediate field in format 8 insn. */
  837. #define B3 (VI2DUP + 1)
  838. { 3, 11, NULL, NULL, 0, BFD_RELOC_NONE },
  839. /* The 3 bit immediate field in format C insn. */
  840. #define DI3 (B3 + 1)
  841. { 3, 17, NULL, NULL, 0, BFD_RELOC_NONE },
  842. /* The 3 bit immediate field in format C insn. */
  843. #define I3U (DI3 + 1)
  844. { 3, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  845. /* The 4 bit immediate field in format C insn. */
  846. #define I4U (I3U + 1)
  847. { 4, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  848. /* The 4 bit immediate field in fetrap. */
  849. #define I4U_NOTIMM0 (I4U + 1)
  850. { 4, 11, NULL, NULL, V850_NOT_IMM0, BFD_RELOC_NONE },
  851. /* The unsigned disp4 field in a sld.bu. */
  852. #define D4U (I4U_NOTIMM0 + 1)
  853. { 4, 0, NULL, NULL, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_4_4_OFFSET },
  854. /* The imm5 field in a format 2 insn. */
  855. #define I5 (D4U + 1)
  856. { 5, 0, NULL, NULL, V850_OPERAND_SIGNED, BFD_RELOC_NONE },
  857. /* The imm5 field in a format 11 insn. */
  858. #define I5DIV1 (I5 + 1)
  859. { 5, 0, insert_i5div1, extract_i5div1, 0, BFD_RELOC_NONE },
  860. #define I5DIV2 (I5DIV1 + 1)
  861. { 5, 0, insert_i5div2, extract_i5div2, 0, BFD_RELOC_NONE },
  862. #define I5DIV3 (I5DIV2 + 1)
  863. { 5, 0, insert_i5div3, extract_i5div3, 0, BFD_RELOC_NONE },
  864. /* The unsigned imm5 field in a format 2 insn. */
  865. #define I5U (I5DIV3 + 1)
  866. { 5, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  867. /* The imm5 field in a prepare/dispose instruction. */
  868. #define IMM5 (I5U + 1)
  869. { 5, 1, NULL, NULL, 0, BFD_RELOC_NONE },
  870. /* The unsigned disp5 field in a sld.hu. */
  871. #define D5_4U (IMM5 + 1)
  872. { 5, 0, insert_d5_4, extract_d5_4, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_4_5_OFFSET },
  873. /* The IMM6 field in a callt instruction. */
  874. #define IMM6 (D5_4U + 1)
  875. { 6, 0, NULL, NULL, 0, BFD_RELOC_V850_CALLT_6_7_OFFSET },
  876. /* The signed disp7 field in a format 4 insn. */
  877. #define D7U (IMM6 + 1)
  878. { 7, 0, NULL, NULL, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_7_7_OFFSET },
  879. /* The unsigned DISP8 field in a format 4 insn. */
  880. #define D8_7U (D7U + 1)
  881. { 8, 0, insert_d8_7, extract_d8_7, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_7_8_OFFSET },
  882. /* The unsigned DISP8 field in a format 4 insn. */
  883. #define D8_6U (D8_7U + 1)
  884. { 8, 0, insert_d8_6, extract_d8_6, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_6_8_OFFSET },
  885. /* The unsigned DISP8 field in a format 4 insn. */
  886. #define V8 (D8_6U + 1)
  887. { 8, 0, insert_v8, extract_v8, 0, BFD_RELOC_NONE },
  888. /* The imm9 field in a multiply word. */
  889. #define I9 (V8 + 1)
  890. { 9, 0, insert_i9, extract_i9, V850_OPERAND_SIGNED, BFD_RELOC_NONE },
  891. /* The unsigned imm9 field in a multiply word. */
  892. #define U9 (I9 + 1)
  893. { 9, 0, insert_u9, extract_u9, 0, BFD_RELOC_NONE },
  894. /* The DISP9 field in a format 3 insn. */
  895. #define D9 (U9 + 1)
  896. { 9, 0, insert_d9, extract_d9, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_9_PCREL },
  897. /* The DISP9 field in a format 3 insn, relaxable. */
  898. #define D9_RELAX (D9 + 1)
  899. { 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_9_PCREL },
  900. /* The imm16 field in a format 6 insn. */
  901. #define I16 (D9_RELAX + 1)
  902. { 16, 16, NULL, NULL, V850_OPERAND_SIGNED, BFD_RELOC_16 },
  903. /* The signed 16 bit immediate following a prepare instruction. */
  904. #define IMM16LO (I16 + 1)
  905. { 16, 32, NULL, NULL, V850E_IMMEDIATE16 | V850_OPERAND_SIGNED, BFD_RELOC_LO16 },
  906. /* The hi 16 bit immediate following a 32 bit instruction. */
  907. #define IMM16HI (IMM16LO + 1)
  908. { 16, 16, NULL, NULL, V850E_IMMEDIATE16HI, BFD_RELOC_HI16 },
  909. /* The unsigned imm16 in a format 6 insn. */
  910. #define I16U (IMM16HI + 1)
  911. { 16, 16, NULL, NULL, 0, BFD_RELOC_16 },
  912. /* The disp16 field in a format 8 insn. */
  913. #define D16 (I16U + 1)
  914. { 16, 16, NULL, NULL, V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_LO16_SPLIT_OFFSET },
  915. /* The disp16 field in an format 7 unsigned byte load insn. */
  916. #define D16_16 (D16 + 1)
  917. { 16, 0, insert_d16_16, extract_d16_16, V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_16_SPLIT_OFFSET },
  918. /* The disp16 field in a format 6 insn. */
  919. #define D16_15 (D16_16 + 1)
  920. { 16, 0, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED | V850_OPERAND_DISP , BFD_RELOC_V850_16_S1 },
  921. /* The unsigned DISP16 field in a format 7 insn. */
  922. #define D16_LOOP (D16_15 + 1)
  923. { 16, 0, insert_u16_loop, extract_u16_loop, V850_OPERAND_RELAX | V850_OPERAND_DISP | V850_PCREL | V850_INVERSE_PCREL, BFD_RELOC_V850_16_PCREL },
  924. /* The DISP17 field in a format 7 insn. */
  925. #define D17_16 (D16_LOOP + 1)
  926. { 17, 0, insert_d17_16, extract_d17_16, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_17_PCREL },
  927. /* The DISP22 field in a format 4 insn, relaxable.
  928. This _must_ follow D9_RELAX; the assembler assumes that the longer
  929. version immediately follows the shorter version for relaxing. */
  930. #define D22 (D17_16 + 1)
  931. { 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_22_PCREL },
  932. #define D23 (D22 + 1)
  933. { 23, 0, insert_d23, extract_d23, V850E_IMMEDIATE23 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_23 },
  934. #define D23_ALIGN1 (D23 + 1)
  935. { 23, 0, insert_d23_align1, extract_d23, V850E_IMMEDIATE23 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_23 },
  936. /* The 32 bit immediate following a 32 bit instruction. */
  937. #define IMM32 (D23_ALIGN1 + 1)
  938. { 32, 32, NULL, NULL, V850E_IMMEDIATE32, BFD_RELOC_32 },
  939. #define D32_31 (IMM32 + 1)
  940. { 32, 32, NULL, NULL, V850E_IMMEDIATE32 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_32_ABS },
  941. #define D32_31_PCREL (D32_31 + 1)
  942. { 32, 32, NULL, NULL, V850E_IMMEDIATE32 | V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_32_PCREL },
  943. #define POS_U (D32_31_PCREL + 1)
  944. { 0, 0, insert_POS, extract_POS_U, 0, BFD_RELOC_NONE },
  945. #define POS_M (POS_U + 1)
  946. { 0, 0, insert_POS, extract_POS_L, 0, BFD_RELOC_NONE },
  947. #define POS_L (POS_M + 1)
  948. { 0, 0, insert_POS, extract_POS_L, 0, BFD_RELOC_NONE },
  949. #define WIDTH_U (POS_L + 1)
  950. { 0, 0, insert_WIDTH, extract_WIDTH_U, 0, BFD_RELOC_NONE },
  951. #define WIDTH_M (WIDTH_U + 1)
  952. { 0, 0, insert_WIDTH, extract_WIDTH_M, 0, BFD_RELOC_NONE },
  953. #define WIDTH_L (WIDTH_M + 1)
  954. { 0, 0, insert_WIDTH, extract_WIDTH_L, 0, BFD_RELOC_NONE },
  955. #define SELID (WIDTH_L + 1)
  956. { 5, 27, insert_SELID, extract_SELID, 0, BFD_RELOC_NONE },
  957. #define RIE_IMM5 (SELID + 1)
  958. { 5, 11, NULL, NULL, 0, BFD_RELOC_NONE },
  959. #define RIE_IMM4 (RIE_IMM5 + 1)
  960. { 4, 0, NULL, NULL, 0, BFD_RELOC_NONE },
  961. #define VECTOR8 (RIE_IMM4 + 1)
  962. { 0, 0, insert_VECTOR8, extract_VECTOR8, 0, BFD_RELOC_NONE },
  963. #define VECTOR5 (VECTOR8 + 1)
  964. { 0, 0, insert_VECTOR5, extract_VECTOR5, 0, BFD_RELOC_NONE },
  965. #define VR1 (VECTOR5 + 1)
  966. { 5, 0, NULL, NULL, V850_OPERAND_VREG, BFD_RELOC_NONE },
  967. #define VR2 (VR1 + 1)
  968. { 5, 11, NULL, NULL, V850_OPERAND_VREG, BFD_RELOC_NONE },
  969. #define CACHEOP (VR2 + 1)
  970. { 0, 0, insert_CACHEOP, extract_CACHEOP, V850_OPERAND_CACHEOP, BFD_RELOC_NONE },
  971. #define PREFOP (CACHEOP + 1)
  972. { 0, 0, insert_PREFOP, extract_PREFOP, V850_OPERAND_PREFOP, BFD_RELOC_NONE },
  973. #define IMM10U (PREFOP + 1)
  974. { 0, 0, insert_IMM10U, extract_IMM10U, 0, BFD_RELOC_NONE },
  975. };
  976. /* Reg - Reg instruction format (Format I). */
  977. #define IF1 {R1, R2}
  978. /* Imm - Reg instruction format (Format II). */
  979. #define IF2 {I5, R2}
  980. /* Conditional branch instruction format (Format III). */
  981. #define IF3 {D9_RELAX}
  982. /* 3 operand instruction (Format VI). */
  983. #define IF6 {I16, R1, R2}
  984. /* 3 operand instruction (Format VI). */
  985. #define IF6U {I16U, R1, R2}
  986. /* Conditional branch instruction format (Format VII). */
  987. #define IF7 {D17_16}
  988. /* The opcode table.
  989. The format of the opcode table is:
  990. NAME OPCODE MASK { OPERANDS } MEMOP PROCESSOR
  991. NAME is the name of the instruction.
  992. OPCODE is the instruction opcode.
  993. MASK is the opcode mask; this is used to tell the disassembler
  994. which bits in the actual opcode must match OPCODE.
  995. OPERANDS is the list of operands.
  996. MEMOP specifies which operand (if any) is a memory operand.
  997. PROCESSORS specifies which CPU(s) support the opcode.
  998. The disassembler reads the table in order and prints the first
  999. instruction which matches, so this table is sorted to put more
  1000. specific instructions before more general instructions. It is also
  1001. sorted by major opcode.
  1002. The table is also sorted by name. This is used by the assembler.
  1003. When parsing an instruction the assembler finds the first occurance
  1004. of the name of the instruciton in this table and then attempts to
  1005. match the instruction's arguments with description of the operands
  1006. associated with the entry it has just found in this table. If the
  1007. match fails the assembler looks at the next entry in this table.
  1008. If that entry has the same name as the previous entry, then it
  1009. tries to match the instruction against that entry and so on. This
  1010. is how the assembler copes with multiple, different formats of the
  1011. same instruction. */
  1012. const struct v850_opcode v850_opcodes[] =
  1013. {
  1014. /* Standard instructions. */
  1015. { "add", OP (0x0e), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1016. { "add", OP (0x12), OP_MASK, IF2, 0, PROCESSOR_ALL },
  1017. { "addi", OP (0x30), OP_MASK, IF6, 0, PROCESSOR_ALL },
  1018. { "adf", two (0x07e0, 0x03a0), two (0x07e0, 0x07e1), {CCCC_NOTSA, R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1019. { "and", OP (0x0a), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1020. { "andi", OP (0x36), OP_MASK, IF6U, 0, PROCESSOR_ALL },
  1021. /* Signed integer. */
  1022. { "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1023. { "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1024. { "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1025. { "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1026. /* Unsigned integer. */
  1027. { "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1028. { "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1029. { "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1030. { "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1031. /* Common. */
  1032. { "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1033. { "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1034. /* Others. */
  1035. { "bc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1036. { "bf", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1037. { "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1038. { "bnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1039. { "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1040. { "bnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1041. { "bp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1042. { "br", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1043. { "bsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1044. { "bt", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1045. { "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1046. { "bz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1047. /* Signed integer. */
  1048. { "bge", two (0x07ee, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1049. { "bgt", two (0x07ef, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1050. { "ble", two (0x07e7, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1051. { "blt", two (0x07e6, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1052. /* Unsigned integer. */
  1053. { "bh", two (0x07eb, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1054. { "bl", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1055. { "bnh", two (0x07e3, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1056. { "bnl", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1057. /* Common. */
  1058. { "be", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1059. { "bne", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1060. /* Others. */
  1061. { "bc", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1062. { "bf", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1063. { "bn", two (0x07e4, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1064. { "bnc", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1065. { "bnv", two (0x07e8, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1066. { "bnz", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1067. { "bp", two (0x07ec, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1068. { "br", two (0x07e5, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1069. { "bsa", two (0x07ed, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1070. { "bt", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1071. { "bv", two (0x07e0, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1072. { "bz", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP },
  1073. /* Bcond disp17 Gas local alias(not defined in spec). */
  1074. /* Signed integer. */
  1075. { "bge17", two (0x07ee, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1076. { "bgt17", two (0x07ef, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1077. { "ble17", two (0x07e7, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1078. { "blt17", two (0x07e6, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1079. /* Unsigned integer. */
  1080. { "bh17", two (0x07eb, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1081. { "bl17", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1082. { "bnh17", two (0x07e3, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1083. { "bnl17", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1084. /* Common. */
  1085. { "be17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1086. { "bne17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1087. /* Others. */
  1088. { "bc17", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1089. { "bf17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1090. { "bn17", two (0x07e4, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1091. { "bnc17", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1092. { "bnv17", two (0x07e8, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1093. { "bnz17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1094. { "bp17", two (0x07ec, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1095. { "br17", two (0x07e5, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1096. { "bsa17", two (0x07ed, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1097. { "bt17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1098. { "bv17", two (0x07e0, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1099. { "bz17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1100. { "bsh", two (0x07e0, 0x0342), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
  1101. { "bsw", two (0x07e0, 0x0340), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
  1102. /* v850e3v5 bitfield instructions. */
  1103. { "bins", two (0x07e0, 0x0090), two (0x07e0, 0x07f1), {R1, POS_U, WIDTH_U, R2}, 0, PROCESSOR_V850E3V5_UP },
  1104. { "bins", two (0x07e0, 0x00b0), two (0x07e0, 0x07f1), {R1, POS_M, WIDTH_M, R2}, 0, PROCESSOR_V850E3V5_UP },
  1105. { "bins", two (0x07e0, 0x00d0), two (0x07e0, 0x07f1), {R1, POS_L, WIDTH_L, R2}, 0, PROCESSOR_V850E3V5_UP },
  1106. /* Gas local alias(not defined in spec). */
  1107. { "binsu",two (0x07e0, 0x0090), two (0x07e0, 0x07f1), {R1, POS_U, WIDTH_U, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1108. { "binsm",two (0x07e0, 0x00b0), two (0x07e0, 0x07f1), {R1, POS_M, WIDTH_M, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1109. { "binsl",two (0x07e0, 0x00d0), two (0x07e0, 0x07f1), {R1, POS_L, WIDTH_L, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1110. { "cache", two (0xe7e0, 0x0160), two (0xe7e0, 0x07ff), {CACHEOP, R1}, 2, PROCESSOR_V850E3V5_UP },
  1111. { "callt", one (0x0200), one (0xffc0), {IMM6}, 0, PROCESSOR_NOT_V850 },
  1112. { "caxi", two (0x07e0, 0x00ee), two (0x07e0, 0x07ff), {R1, R2, R3}, 1, PROCESSOR_V850E2_UP },
  1113. { "clr1", two (0x87c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL },
  1114. { "clr1", two (0x07e0, 0x00e4), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 },
  1115. { "cmov", two (0x07e0, 0x0320), two (0x07e0, 0x07e1), {MOVCC, R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1116. { "cmov", two (0x07e0, 0x0300), two (0x07e0, 0x07e1), {MOVCC, I5, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1117. { "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1118. { "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL },
  1119. { "ctret", two (0x07e0, 0x0144), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 },
  1120. { "dbcp", one (0xe840), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1121. { "dbhvtrap", one (0xe040), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1122. { "dbpush", two (0x5fe0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP },
  1123. { "dbret", two (0x07e0, 0x0146), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 },
  1124. { "dbtag", two (0xcfe0, 0x0160), two (0xffe0, 0x07ff), {IMM10U}, 0, PROCESSOR_V850E3V5_UP },
  1125. { "dbtrap", one (0xf840), one (0xffff), {0}, 0, PROCESSOR_NOT_V850 },
  1126. { "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
  1127. { "dispose", two (0x0640, 0x0000), two (0xffc0, 0x0000), {IMM5, LIST12, R2_DISPOSE},3, PROCESSOR_NOT_V850 },
  1128. { "dispose", two (0x0640, 0x0000), two (0xffc0, 0x001f), {IMM5, LIST12}, 0, PROCESSOR_NOT_V850 },
  1129. { "div", two (0x07e0, 0x02c0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1130. { "divh", two (0x07e0, 0x0280), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1131. { "divh", OP (0x02), OP_MASK, {R1_NOTR0, R2_NOTR0}, 0, PROCESSOR_ALL },
  1132. { "divhn", two (0x07e0, 0x0280), two (0x07e0, 0x07c3), {I5DIV1, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1133. { "divhu", two (0x07e0, 0x0282), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1134. { "divhun", two (0x07e0, 0x0282), two (0x07e0, 0x07c3), {I5DIV1, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1135. { "divn", two (0x07e0, 0x02c0), two (0x07e0, 0x07c3), {I5DIV2, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1136. { "divq", two (0x07e0, 0x02fc), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1137. { "divqu", two (0x07e0, 0x02fe), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1138. { "divu", two (0x07e0, 0x02c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1139. { "divun", two (0x07e0, 0x02c2), two (0x07e0, 0x07c3), {I5DIV2, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1140. { "dst", two (0x07e0, 0x0134), two (0xfffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1141. { "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
  1142. { "eiret", two (0x07e0, 0x0148), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2_UP },
  1143. { "est", two (0x07e0, 0x0132), two (0xfffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1144. { "feret", two (0x07e0, 0x014a), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2_UP },
  1145. { "fetrap", one (0x0040), one (0x87ff), {I4U_NOTIMM0}, 0, PROCESSOR_V850E2_UP },
  1146. { "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
  1147. { "hsh", two (0x07e0, 0x0346), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP },
  1148. { "hsw", two (0x07e0, 0x0344), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
  1149. { "hvcall", two (0xd7e0, 0x4160), two (0xffe0, 0x41ff), {VECTOR8}, 0, PROCESSOR_V850E3V5_UP },
  1150. { "hvtrap", two (0x07e0, 0x0110), two (0xffe0, 0xffff), {VECTOR5}, 0, PROCESSOR_V850E3V5_UP },
  1151. { "jarl", two (0xc7e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3_NOTR0}, 1, PROCESSOR_V850E3V5_UP},
  1152. { "jarl", two (0x0780, 0x0000), two (0x07c0, 0x0001), {D22, R2_NOTR0}, 0, PROCESSOR_ALL},
  1153. { "jarl", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP },
  1154. /* Gas local alias (not defined in spec). */
  1155. { "jarlr", two (0xc7e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3_NOTR0}, 1, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS},
  1156. /* Gas local alias of jarl imm22 (not defined in spec). */
  1157. { "jarl22", two (0x0780, 0x0000), two (0x07c0, 0x0001), {D22, R2_NOTR0}, 0, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS},
  1158. /* Gas local alias of jarl imm32 (not defined in spec). */
  1159. { "jarl32", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1160. { "jarlw", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1161. { "jmp", two (0x06e0, 0x0000), two (0xffe0, 0x0001), {D32_31, R1}, 2, PROCESSOR_V850E3V5_UP },
  1162. { "jmp", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2 | PROCESSOR_V850E2V3 },
  1163. { "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL },
  1164. /* Gas local alias of jmp disp22(not defined in spec). */
  1165. { "jmp22", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS },
  1166. /* Gas local alias of jmp disp32(not defined in spec). */
  1167. { "jmp32", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1168. { "jmpw", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1169. { "jr", two (0x0780, 0x0000), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL },
  1170. { "jr", one (0x02e0), one (0xffff), {D32_31_PCREL}, 0, PROCESSOR_V850E2_UP },
  1171. /* Gas local alias of mov imm22(not defined in spec). */
  1172. { "jr22", two (0x0780, 0x0000), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS },
  1173. /* Gas local alias of mov imm32(not defined in spec). */
  1174. { "jr32", one (0x02e0), one (0xffff), {D32_31_PCREL}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1175. /* Alias of bcond (same as CA850). */
  1176. { "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1177. { "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1178. { "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1179. { "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1180. /* Unsigned integer. */
  1181. { "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1182. { "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1183. { "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1184. { "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1185. /* Common. */
  1186. { "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1187. { "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1188. /* Others. */
  1189. { "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1190. { "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1191. { "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1192. { "jp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1193. { "jc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1194. { "jnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1195. { "jz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1196. { "jnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1197. { "jbr", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL },
  1198. { "ldacc", two (0x07e0, 0x0bc4), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION },
  1199. { "ld.b", two (0x0700, 0x0000), two (0x07e0, 0x0000), {D16, R1, R2}, 2, PROCESSOR_ALL },
  1200. { "ld.b", two (0x0780, 0x0005), two (0xffe0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP },
  1201. { "ld.b23", two (0x0780, 0x0005), two (0x07e0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1202. { "ld.bu", two (0x0780, 0x0001), two (0x07c0, 0x0001), {D16_16, R1, R2_NOTR0}, 2, PROCESSOR_NOT_V850 },
  1203. { "ld.bu", two (0x07a0, 0x0005), two (0xffe0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP },
  1204. { "ld.bu23", two (0x07a0, 0x0005), two (0x07e0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1205. { "ld.dw", two (0x07a0, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3_EVEN}, 2, PROCESSOR_V850E3V5_UP },
  1206. { "ld.dw23", two (0x07a0, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3_EVEN}, 2, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1207. { "ld.h", two (0x0720, 0x0000), two (0x07e0, 0x0001), {D16_15, R1, R2}, 2, PROCESSOR_ALL },
  1208. { "ld.h", two (0x0780, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP },
  1209. { "ld.h23", two (0x0780, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1210. { "ld.hu", two (0x07e0, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2_NOTR0}, 2, PROCESSOR_NOT_V850 },
  1211. { "ld.hu", two (0x07a0, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP },
  1212. { "ld.hu23", two (0x07a0, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1213. { "ld.w", two (0x0720, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2}, 2, PROCESSOR_ALL },
  1214. { "ld.w", two (0x0780, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP },
  1215. { "ld.w23", two (0x0780, 0x0009), two (0x07e0, 0x001f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1216. { "ldl.w", two (0x07e0, 0x0378), two (0xffe0, 0x07ff), {R1, R3}, 1, PROCESSOR_V850E3V5_UP },
  1217. { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1218. { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP },
  1219. { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, OLDSR2}, 0, (PROCESSOR_ALL & (~ PROCESSOR_V850E3V5_UP)) },
  1220. { "ldtc.gr", two (0x07e0, 0x0032), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1221. { "ldtc.sr", two (0x07e0, 0x0030), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1222. { "ldtc.sr", two (0x07e0, 0x0030), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP },
  1223. { "ldtc.vr", two (0x07e0, 0x0832), two (0x07e0, 0xffff), {R1, VR2}, 0, PROCESSOR_V850E3V5_UP },
  1224. { "ldtc.pc", two (0x07e0, 0xf832), two (0x07e0, 0xffff), {R1}, 0, PROCESSOR_V850E3V5_UP },
  1225. { "ldvc.sr", two (0x07e0, 0x0034), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1226. { "ldvc.sr", two (0x07e0, 0x0034), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP },
  1227. { "loop", two (0x06e0, 0x0001), two (0xffe0, 0x0001), {R1, D16_LOOP}, 0, PROCESSOR_V850E3V5_UP },
  1228. { "macacc", two (0x07e0, 0x0bc0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION },
  1229. { "mac", two (0x07e0, 0x03c0), two (0x07e0, 0x0fe1), {R1, R2, R3_EVEN, R4_EVEN}, 0, PROCESSOR_V850E2_UP },
  1230. { "macu", two (0x07e0, 0x03e0), two (0x07e0, 0x0fe1), {R1, R2, R3_EVEN, R4_EVEN}, 0, PROCESSOR_V850E2_UP },
  1231. { "macuacc", two (0x07e0, 0x0bc2), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION },
  1232. { "mov", OP (0x00), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1233. { "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
  1234. { "mov", one (0x0620), one (0xffe0), {IMM32, R1}, 0, PROCESSOR_NOT_V850 },
  1235. /* Gas local alias of mov imm32(not defined in spec). */
  1236. { "movl", one (0x0620), one (0xffe0), {IMM32, R1}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_ALIAS },
  1237. { "movea", OP (0x31), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1238. { "movhi", OP (0x32), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1239. { "mul", two (0x07e0, 0x0220), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1240. { "mul", two (0x07e0, 0x0240), two (0x07e0, 0x07c3), {I9, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1241. { "mulh", OP (0x17), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
  1242. { "mulh", OP (0x07), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1243. { "mulhi", OP (0x37), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1244. { "mulu", two (0x07e0, 0x0222), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1245. { "mulu", two (0x07e0, 0x0242), two (0x07e0, 0x07c3), {U9, R2, R3}, 0, PROCESSOR_NOT_V850 },
  1246. { "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL },
  1247. { "not", OP (0x01), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1248. { "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL },
  1249. { "not1", two (0x07e0, 0x00e2), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 },
  1250. { "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1251. { "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL },
  1252. { "popsp", two (0x67e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP },
  1253. { "pref", two (0xdfe0, 0x0160), two (0xffe0, 0x07ff), {PREFOP, R1}, 2, PROCESSOR_V850E3V5_UP },
  1254. { "prepare", two (0x0780, 0x0003), two (0xffc0, 0x001f), {LIST12, IMM5, SP}, 0, PROCESSOR_NOT_V850 },
  1255. { "prepare", two (0x0780, 0x000b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16LO},0, PROCESSOR_NOT_V850 },
  1256. { "prepare", two (0x0780, 0x0013), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16HI},0, PROCESSOR_NOT_V850 },
  1257. { "prepare", two (0x0780, 0x001b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM32}, 0, PROCESSOR_NOT_V850 },
  1258. { "prepare", two (0x0780, 0x0001), two (0xffc0, 0x001f), {LIST12, IMM5}, 0, PROCESSOR_NOT_V850 },
  1259. { "pushsp", two (0x47e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP },
  1260. { "rotl", two (0x07e0, 0x00c6), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1261. { "rotl", two (0x07e0, 0x00c4), two (0x07e0, 0x07ff), {I5U, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1262. { "reti", two (0x07e0, 0x0140), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
  1263. { "sar", two (0x07e0, 0x00a2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1264. { "sar", OP (0x15), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
  1265. { "sar", two (0x07e0, 0x00a0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
  1266. { "sasf", two (0x07e0, 0x0200), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_NOT_V850 },
  1267. { "satadd", two (0x07e0, 0x03ba), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1268. { "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
  1269. { "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1270. { "satsub", two (0x07e0, 0x039a), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1271. { "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1272. { "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1273. { "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
  1274. { "sbf", two (0x07e0, 0x0380), two (0x07e0, 0x07e1), {CCCC_NOTSA, R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1275. { "sch0l", two (0x07e0, 0x0364), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP },
  1276. { "sch0r", two (0x07e0, 0x0360), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP },
  1277. { "sch1l", two (0x07e0, 0x0366), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP },
  1278. { "sch1r", two (0x07e0, 0x0362), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP },
  1279. { "sdivhn", two (0x07e0, 0x0180), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1280. { "sdivhun", two (0x07e0, 0x0182), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1281. { "sdivn", two (0x07e0, 0x01c0), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1282. { "sdivun", two (0x07e0, 0x01c2), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION },
  1283. { "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL },
  1284. { "set1", two (0x07e0, 0x00e0), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 },
  1285. { "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL },
  1286. { "shl", two (0x07e0, 0x00c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1287. { "shl", OP (0x16), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
  1288. { "shl", two (0x07e0, 0x00c0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
  1289. { "shr", two (0x07e0, 0x0082), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP },
  1290. { "shr", OP (0x14), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL },
  1291. { "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
  1292. { "sld.b", one (0x0300), one (0x0780), {D7U, EP, R2}, 2, PROCESSOR_ALL },
  1293. { "sld.bu", one (0x0060), one (0x07f0), {D4U, EP, R2_NOTR0}, 2, PROCESSOR_NOT_V850 },
  1294. { "sld.h", one (0x0400), one (0x0780), {D8_7U,EP, R2}, 2, PROCESSOR_ALL },
  1295. { "sld.hu", one (0x0070), one (0x07f0), {D5_4U,EP, R2_NOTR0}, 2, PROCESSOR_NOT_V850 },
  1296. { "sld.w", one (0x0500), one (0x0781), {D8_6U,EP, R2}, 2, PROCESSOR_ALL },
  1297. { "snooze", two (0x0fe0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1298. { "sst.b", one (0x0380), one (0x0780), {R2, D7U, EP}, 3, PROCESSOR_ALL },
  1299. { "sst.h", one (0x0480), one (0x0780), {R2, D8_7U,EP}, 3, PROCESSOR_ALL },
  1300. { "sst.w", one (0x0501), one (0x0781), {R2, D8_6U,EP}, 3, PROCESSOR_ALL },
  1301. { "stacch", two (0x07e0, 0x0bca), two (0x07ff, 0xffff), {R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION },
  1302. { "staccl", two (0x07e0, 0x0bc8), two (0x07ff, 0xffff), {R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION },
  1303. { "st.b", two (0x0740, 0x0000), two (0x07e0, 0x0000), {R2, D16, R1}, 3, PROCESSOR_ALL },
  1304. { "st.b", two (0x0780, 0x000d), two (0x07e0, 0x000f), {R3, D23, R1}, 3, PROCESSOR_V850E2_UP },
  1305. { "st.b23", two (0x0780, 0x000d), two (0x07e0, 0x000f), {R3, D23, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1306. { "st.dw", two (0x07a0, 0x000f), two (0xffe0, 0x001f), {R3_EVEN, D23_ALIGN1, R1}, 3, PROCESSOR_V850E3V5_UP },
  1307. { "st.dw23", two (0x07a0, 0x000f), two (0xffe0, 0x001f), {R3_EVEN, D23_ALIGN1, R1}, 3, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS },
  1308. { "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 3, PROCESSOR_ALL },
  1309. { "st.h", two (0x07a0, 0x000d), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP },
  1310. { "st.h23", two (0x07a0, 0x000d), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1311. { "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 3, PROCESSOR_ALL },
  1312. { "st.w", two (0x0780, 0x000f), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP },
  1313. { "st.w23", two (0x0780, 0x000f), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS },
  1314. { "stc.w", two (0x07e0, 0x037a), two (0xffe0, 0x07ff), {R3, R1}, 2, PROCESSOR_V850E3V5_UP },
  1315. { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1316. { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1317. { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {OLDSR1, R2}, 0, (PROCESSOR_ALL & (~ PROCESSOR_V850E3V5_UP)) },
  1318. { "sttc.gr", two (0x07e0, 0x0052), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1319. { "sttc.sr", two (0x07e0, 0x0050), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1320. { "sttc.sr", two (0x07e0, 0x0050), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1321. { "sttc.vr", two (0x07e0, 0x0852), two (0x07e0, 0xffff), {VR1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1322. { "sttc.pc", two (0x07e0, 0xf852), two (0x07e0, 0xffff), {R2}, 0, PROCESSOR_V850E3V5_UP },
  1323. { "stvc.sr", two (0x07e0, 0x0054), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP },
  1324. { "stvc.sr", two (0x07e0, 0x0054), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP },
  1325. { "sub", OP (0x0d), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1326. { "subr", OP (0x0c), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1327. { "switch", one (0x0040), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
  1328. { "sxb", one (0x00a0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 },
  1329. { "sxh", one (0x00e0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 },
  1330. { "tlbai", two (0x87e0, 0x8960), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1331. { "tlbr", two (0x87e0, 0xe960), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1332. { "tlbs", two (0x87e0, 0xc160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1333. { "tlbvi", two (0x87e0, 0x8160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1334. { "tlbw", two (0x87e0, 0xe160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1335. { "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL },
  1336. { "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1337. { "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL },
  1338. { "tst1", two (0x07e0, 0x00e6), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 },
  1339. { "xor", OP (0x09), OP_MASK, IF1, 0, PROCESSOR_ALL },
  1340. { "xori", OP (0x35), OP_MASK, IF6U, 0, PROCESSOR_ALL },
  1341. { "zxb", one (0x0080), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 },
  1342. { "zxh", one (0x00c0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 },
  1343. /* Floating point operation. */
  1344. { "absf.d", two (0x07e0, 0x0458), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1345. { "absf.s", two (0x07e0, 0x0448), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1346. { "addf.d", two (0x07e0, 0x0470), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1347. { "addf.s", two (0x07e0, 0x0460), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1348. { "ceilf.dl", two (0x07e2, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1349. { "ceilf.dul", two (0x07f2, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1350. { "ceilf.duw", two (0x07f2, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1351. { "ceilf.dw", two (0x07e2, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1352. { "ceilf.sl", two (0x07e2, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1353. { "ceilf.sul", two (0x07f2, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1354. { "ceilf.suw", two (0x07f2, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1355. { "ceilf.sw", two (0x07e2, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1356. { "cmovf.d", two (0x07e0, 0x0410), two (0x0fe1, 0x0ff1), {FFF, R1_EVEN, R2_EVEN, R3_EVEN_NOTR0}, 0, PROCESSOR_V850E2V3_UP },
  1357. /* Default value for FFF is 0(not defined in spec). */
  1358. { "cmovf.d", two (0x07e0, 0x0410), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN_NOTR0}, 0, PROCESSOR_V850E2V3_UP },
  1359. { "cmovf.s", two (0x07e0, 0x0400), two (0x07e0, 0x07f1), {FFF, R1, R2, R3_NOTR0}, 0, PROCESSOR_V850E2V3_UP },
  1360. /* Default value for FFF is 0(not defined in spec). */
  1361. { "cmovf.s", two (0x07e0, 0x0400), two (0x07e0, 0x07ff), {R1, R2, R3_NOTR0}, 0, PROCESSOR_V850E2V3_UP },
  1362. { "cmpf.d", two (0x07e0, 0x0430), two (0x0fe1, 0x87f1), {FLOAT_CCCC, R2_EVEN, R1_EVEN, FFF}, 0, PROCESSOR_V850E2V3_UP },
  1363. { "cmpf.d", two (0x07e0, 0x0430), two (0x0fe1, 0x87ff), {FLOAT_CCCC, R2_EVEN, R1_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1364. { "cmpf.s", two (0x07e0, 0x0420), two (0x07e0, 0x87f1), {FLOAT_CCCC, R2, R1, FFF}, 0, PROCESSOR_V850E2V3_UP },
  1365. { "cmpf.s", two (0x07e0, 0x0420), two (0x07e0, 0x87ff), {FLOAT_CCCC, R2, R1}, 0, PROCESSOR_V850E2V3_UP },
  1366. { "cvtf.dl", two (0x07e4, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1367. { "cvtf.ds", two (0x07e3, 0x0452), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1368. { "cvtf.dul", two (0x07f4, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1369. { "cvtf.duw", two (0x07f4, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1370. { "cvtf.dw", two (0x07e4, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1371. { "cvtf.hs", two (0x07e2, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1372. { "cvtf.ld", two (0x07e1, 0x0452), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1373. { "cvtf.ls", two (0x07e1, 0x0442), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1374. { "cvtf.sd", two (0x07e2, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1375. { "cvtf.sl", two (0x07e4, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1376. { "cvtf.sh", two (0x07e3, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1377. { "cvtf.sul", two (0x07f4, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1378. { "cvtf.suw", two (0x07f4, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1379. { "cvtf.sw", two (0x07e4, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1380. { "cvtf.uld", two (0x07f1, 0x0452), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1381. { "cvtf.uls", two (0x07f1, 0x0442), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1382. { "cvtf.uwd", two (0x07f0, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1383. { "cvtf.uws", two (0x07f0, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1384. { "cvtf.wd", two (0x07e0, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1385. { "cvtf.ws", two (0x07e0, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1386. { "divf.d", two (0x07e0, 0x047e), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1387. { "divf.s", two (0x07e0, 0x046e), two (0x07e0, 0x07ff), {R1_NOTR0, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1388. { "floorf.dl", two (0x07e3, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1389. { "floorf.dul", two (0x07f3, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1390. { "floorf.duw", two (0x07f3, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1391. { "floorf.dw", two (0x07e3, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1392. { "floorf.sl", two (0x07e3, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1393. { "floorf.sul", two (0x07f3, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1394. { "floorf.suw", two (0x07f3, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1395. { "floorf.sw", two (0x07e3, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1396. { "maddf.s", two (0x07e0, 0x0500), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 },
  1397. { "fmaf.s", two (0x07e0, 0x04e0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1398. { "maxf.d", two (0x07e0, 0x0478), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1399. { "maxf.s", two (0x07e0, 0x0468), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1400. { "minf.d", two (0x07e0, 0x047a), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1401. { "minf.s", two (0x07e0, 0x046a), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1402. { "msubf.s", two (0x07e0, 0x0520), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 },
  1403. { "fmsf.s", two (0x07e0, 0x04e2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1404. { "mulf.d", two (0x07e0, 0x0474), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1405. { "mulf.s", two (0x07e0, 0x0464), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1406. { "negf.d", two (0x07e1, 0x0458), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1407. { "negf.s", two (0x07e1, 0x0448), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1408. { "nmaddf.s", two (0x07e0, 0x0540), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 },
  1409. { "fnmaf.s", two (0x07e0, 0x04e4), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1410. { "nmsubf.s", two (0x07e0, 0x0560), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 },
  1411. { "fnmsf.s", two (0x07e0, 0x04e6), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP },
  1412. { "recipf.d", two (0x07e1, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1413. { "recipf.s", two (0x07e1, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1414. { "roundf.dl", two (0x07e0, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1415. { "roundf.dul", two (0x07f0, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1416. { "roundf.duw", two (0x07f0, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1417. { "roundf.dw", two (0x07e0, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1418. { "roundf.sl", two (0x07e0, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1419. { "roundf.sul", two (0x07f0, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1420. { "roundf.suw", two (0x07f0, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1421. { "roundf.sw", two (0x07e0, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION },
  1422. { "rsqrtf.d", two (0x07e2, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1423. { "rsqrtf.s", two (0x07e2, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1424. { "sqrtf.d", two (0x07e0, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1425. { "sqrtf.s", two (0x07e0, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1426. { "subf.d", two (0x07e0, 0x0472), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1427. { "subf.s", two (0x07e0, 0x0462), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1428. { "trfsr", two (0x07e0, 0x0400), two (0xffff, 0xfff1), {FFF}, 0, PROCESSOR_V850E2V3_UP },
  1429. { "trfsr", two (0x07e0, 0x0400), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1430. { "trncf.dl", two (0x07e1, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1431. { "trncf.dul", two (0x07f1, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1432. { "trncf.duw", two (0x07f1, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1433. { "trncf.dw", two (0x07e1, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP },
  1434. { "trncf.sl", two (0x07e1, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP },
  1435. { "trncf.sul", two (0x07f1, 0x0444), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1436. { "trncf.suw", two (0x07f1, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1437. { "trncf.sw", two (0x07e1, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP },
  1438. /* Special instruction (from gdb) mov 1, r0. */
  1439. { "breakpoint", one (0x0001), one (0xffff), {UNUSED}, 0, PROCESSOR_ALL },
  1440. { "synci", one (0x001c), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP },
  1441. { "synce", one (0x001d), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1442. { "syncm", one (0x001e), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1443. { "syncp", one (0x001f), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1444. { "syscall", two (0xd7e0, 0x0160), two (0xffe0, 0xc7ff), {V8}, 0, PROCESSOR_V850E2V3_UP },
  1445. /* Alias of syncp. */
  1446. { "sync", one (0x001f), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_ALIAS },
  1447. { "rmtrap", one (0xf040), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1448. { "rie", one (0x0040), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP },
  1449. { "rie", two (0x07f0, 0x0000), two (0x07f0, 0xffff), {RIE_IMM5,RIE_IMM4}, 0, PROCESSOR_V850E2V3_UP },
  1450. { 0, 0, 0, {0}, 0, 0 },
  1451. } ;
  1452. const int v850_num_opcodes =
  1453. sizeof (v850_opcodes) / sizeof (v850_opcodes[0]);