opcode_tilepro.h 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471
  1. /* TILEPro opcode information.
  2. *
  3. * Copyright 2011 Tilera Corporation. All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation, version 2.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  12. * NON INFRINGEMENT. See the GNU General Public License for
  13. * more details.
  14. *
  15. *
  16. *
  17. *
  18. *
  19. */
  20. #ifndef __ARCH_OPCODE_H__
  21. #define __ARCH_OPCODE_H__
  22. #ifndef __ASSEMBLER__
  23. typedef unsigned long long tilepro_bundle_bits;
  24. /* This is the bit that determines if a bundle is in the Y encoding. */
  25. #define TILEPRO_BUNDLE_Y_ENCODING_MASK ((tilepro_bundle_bits)1 << 63)
  26. enum
  27. {
  28. /* Maximum number of instructions in a bundle (2 for X, 3 for Y). */
  29. TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE = 3,
  30. /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */
  31. TILEPRO_NUM_PIPELINE_ENCODINGS = 5,
  32. /* Log base 2 of TILEPRO_BUNDLE_SIZE_IN_BYTES. */
  33. TILEPRO_LOG2_BUNDLE_SIZE_IN_BYTES = 3,
  34. /* Instructions take this many bytes. */
  35. TILEPRO_BUNDLE_SIZE_IN_BYTES = 1 << TILEPRO_LOG2_BUNDLE_SIZE_IN_BYTES,
  36. /* Log base 2 of TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES. */
  37. TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES = 3,
  38. /* Bundles should be aligned modulo this number of bytes. */
  39. TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES =
  40. (1 << TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES),
  41. /* Log base 2 of TILEPRO_SN_INSTRUCTION_SIZE_IN_BYTES. */
  42. TILEPRO_LOG2_SN_INSTRUCTION_SIZE_IN_BYTES = 1,
  43. /* Static network instructions take this many bytes. */
  44. TILEPRO_SN_INSTRUCTION_SIZE_IN_BYTES =
  45. (1 << TILEPRO_LOG2_SN_INSTRUCTION_SIZE_IN_BYTES),
  46. /* Number of registers (some are magic, such as network I/O). */
  47. TILEPRO_NUM_REGISTERS = 64,
  48. /* Number of static network registers. */
  49. TILEPRO_NUM_SN_REGISTERS = 4
  50. };
  51. /* Make a few "tile_" variables to simplify common code between
  52. architectures. */
  53. typedef tilepro_bundle_bits tile_bundle_bits;
  54. #define TILE_BUNDLE_SIZE_IN_BYTES TILEPRO_BUNDLE_SIZE_IN_BYTES
  55. #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES
  56. #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
  57. TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
  58. /* 64-bit pattern for a { bpt ; nop } bundle. */
  59. #define TILEPRO_BPT_BUNDLE 0x400b3cae70166000ULL
  60. static __inline unsigned int
  61. get_BrOff_SN(tilepro_bundle_bits num)
  62. {
  63. const unsigned int n = (unsigned int)num;
  64. return (((n >> 0)) & 0x3ff);
  65. }
  66. static __inline unsigned int
  67. get_BrOff_X1(tilepro_bundle_bits n)
  68. {
  69. return (((unsigned int)(n >> 43)) & 0x00007fff) |
  70. (((unsigned int)(n >> 20)) & 0x00018000);
  71. }
  72. static __inline unsigned int
  73. get_BrType_X1(tilepro_bundle_bits n)
  74. {
  75. return (((unsigned int)(n >> 31)) & 0xf);
  76. }
  77. static __inline unsigned int
  78. get_Dest_Imm8_X1(tilepro_bundle_bits n)
  79. {
  80. return (((unsigned int)(n >> 31)) & 0x0000003f) |
  81. (((unsigned int)(n >> 43)) & 0x000000c0);
  82. }
  83. static __inline unsigned int
  84. get_Dest_SN(tilepro_bundle_bits num)
  85. {
  86. const unsigned int n = (unsigned int)num;
  87. return (((n >> 2)) & 0x3);
  88. }
  89. static __inline unsigned int
  90. get_Dest_X0(tilepro_bundle_bits num)
  91. {
  92. const unsigned int n = (unsigned int)num;
  93. return (((n >> 0)) & 0x3f);
  94. }
  95. static __inline unsigned int
  96. get_Dest_X1(tilepro_bundle_bits n)
  97. {
  98. return (((unsigned int)(n >> 31)) & 0x3f);
  99. }
  100. static __inline unsigned int
  101. get_Dest_Y0(tilepro_bundle_bits num)
  102. {
  103. const unsigned int n = (unsigned int)num;
  104. return (((n >> 0)) & 0x3f);
  105. }
  106. static __inline unsigned int
  107. get_Dest_Y1(tilepro_bundle_bits n)
  108. {
  109. return (((unsigned int)(n >> 31)) & 0x3f);
  110. }
  111. static __inline unsigned int
  112. get_Imm16_X0(tilepro_bundle_bits num)
  113. {
  114. const unsigned int n = (unsigned int)num;
  115. return (((n >> 12)) & 0xffff);
  116. }
  117. static __inline unsigned int
  118. get_Imm16_X1(tilepro_bundle_bits n)
  119. {
  120. return (((unsigned int)(n >> 43)) & 0xffff);
  121. }
  122. static __inline unsigned int
  123. get_Imm8_SN(tilepro_bundle_bits num)
  124. {
  125. const unsigned int n = (unsigned int)num;
  126. return (((n >> 0)) & 0xff);
  127. }
  128. static __inline unsigned int
  129. get_Imm8_X0(tilepro_bundle_bits num)
  130. {
  131. const unsigned int n = (unsigned int)num;
  132. return (((n >> 12)) & 0xff);
  133. }
  134. static __inline unsigned int
  135. get_Imm8_X1(tilepro_bundle_bits n)
  136. {
  137. return (((unsigned int)(n >> 43)) & 0xff);
  138. }
  139. static __inline unsigned int
  140. get_Imm8_Y0(tilepro_bundle_bits num)
  141. {
  142. const unsigned int n = (unsigned int)num;
  143. return (((n >> 12)) & 0xff);
  144. }
  145. static __inline unsigned int
  146. get_Imm8_Y1(tilepro_bundle_bits n)
  147. {
  148. return (((unsigned int)(n >> 43)) & 0xff);
  149. }
  150. static __inline unsigned int
  151. get_ImmOpcodeExtension_X0(tilepro_bundle_bits num)
  152. {
  153. const unsigned int n = (unsigned int)num;
  154. return (((n >> 20)) & 0x7f);
  155. }
  156. static __inline unsigned int
  157. get_ImmOpcodeExtension_X1(tilepro_bundle_bits n)
  158. {
  159. return (((unsigned int)(n >> 51)) & 0x7f);
  160. }
  161. static __inline unsigned int
  162. get_ImmRROpcodeExtension_SN(tilepro_bundle_bits num)
  163. {
  164. const unsigned int n = (unsigned int)num;
  165. return (((n >> 8)) & 0x3);
  166. }
  167. static __inline unsigned int
  168. get_JOffLong_X1(tilepro_bundle_bits n)
  169. {
  170. return (((unsigned int)(n >> 43)) & 0x00007fff) |
  171. (((unsigned int)(n >> 20)) & 0x00018000) |
  172. (((unsigned int)(n >> 14)) & 0x001e0000) |
  173. (((unsigned int)(n >> 16)) & 0x07e00000) |
  174. (((unsigned int)(n >> 31)) & 0x18000000);
  175. }
  176. static __inline unsigned int
  177. get_JOff_X1(tilepro_bundle_bits n)
  178. {
  179. return (((unsigned int)(n >> 43)) & 0x00007fff) |
  180. (((unsigned int)(n >> 20)) & 0x00018000) |
  181. (((unsigned int)(n >> 14)) & 0x001e0000) |
  182. (((unsigned int)(n >> 16)) & 0x07e00000) |
  183. (((unsigned int)(n >> 31)) & 0x08000000);
  184. }
  185. static __inline unsigned int
  186. get_MF_Imm15_X1(tilepro_bundle_bits n)
  187. {
  188. return (((unsigned int)(n >> 37)) & 0x00003fff) |
  189. (((unsigned int)(n >> 44)) & 0x00004000);
  190. }
  191. static __inline unsigned int
  192. get_MMEnd_X0(tilepro_bundle_bits num)
  193. {
  194. const unsigned int n = (unsigned int)num;
  195. return (((n >> 18)) & 0x1f);
  196. }
  197. static __inline unsigned int
  198. get_MMEnd_X1(tilepro_bundle_bits n)
  199. {
  200. return (((unsigned int)(n >> 49)) & 0x1f);
  201. }
  202. static __inline unsigned int
  203. get_MMStart_X0(tilepro_bundle_bits num)
  204. {
  205. const unsigned int n = (unsigned int)num;
  206. return (((n >> 23)) & 0x1f);
  207. }
  208. static __inline unsigned int
  209. get_MMStart_X1(tilepro_bundle_bits n)
  210. {
  211. return (((unsigned int)(n >> 54)) & 0x1f);
  212. }
  213. static __inline unsigned int
  214. get_MT_Imm15_X1(tilepro_bundle_bits n)
  215. {
  216. return (((unsigned int)(n >> 31)) & 0x0000003f) |
  217. (((unsigned int)(n >> 37)) & 0x00003fc0) |
  218. (((unsigned int)(n >> 44)) & 0x00004000);
  219. }
  220. static __inline unsigned int
  221. get_Mode(tilepro_bundle_bits n)
  222. {
  223. return (((unsigned int)(n >> 63)) & 0x1);
  224. }
  225. static __inline unsigned int
  226. get_NoRegOpcodeExtension_SN(tilepro_bundle_bits num)
  227. {
  228. const unsigned int n = (unsigned int)num;
  229. return (((n >> 0)) & 0xf);
  230. }
  231. static __inline unsigned int
  232. get_Opcode_SN(tilepro_bundle_bits num)
  233. {
  234. const unsigned int n = (unsigned int)num;
  235. return (((n >> 10)) & 0x3f);
  236. }
  237. static __inline unsigned int
  238. get_Opcode_X0(tilepro_bundle_bits num)
  239. {
  240. const unsigned int n = (unsigned int)num;
  241. return (((n >> 28)) & 0x7);
  242. }
  243. static __inline unsigned int
  244. get_Opcode_X1(tilepro_bundle_bits n)
  245. {
  246. return (((unsigned int)(n >> 59)) & 0xf);
  247. }
  248. static __inline unsigned int
  249. get_Opcode_Y0(tilepro_bundle_bits num)
  250. {
  251. const unsigned int n = (unsigned int)num;
  252. return (((n >> 27)) & 0xf);
  253. }
  254. static __inline unsigned int
  255. get_Opcode_Y1(tilepro_bundle_bits n)
  256. {
  257. return (((unsigned int)(n >> 59)) & 0xf);
  258. }
  259. static __inline unsigned int
  260. get_Opcode_Y2(tilepro_bundle_bits n)
  261. {
  262. return (((unsigned int)(n >> 56)) & 0x7);
  263. }
  264. static __inline unsigned int
  265. get_RROpcodeExtension_SN(tilepro_bundle_bits num)
  266. {
  267. const unsigned int n = (unsigned int)num;
  268. return (((n >> 4)) & 0xf);
  269. }
  270. static __inline unsigned int
  271. get_RRROpcodeExtension_X0(tilepro_bundle_bits num)
  272. {
  273. const unsigned int n = (unsigned int)num;
  274. return (((n >> 18)) & 0x1ff);
  275. }
  276. static __inline unsigned int
  277. get_RRROpcodeExtension_X1(tilepro_bundle_bits n)
  278. {
  279. return (((unsigned int)(n >> 49)) & 0x1ff);
  280. }
  281. static __inline unsigned int
  282. get_RRROpcodeExtension_Y0(tilepro_bundle_bits num)
  283. {
  284. const unsigned int n = (unsigned int)num;
  285. return (((n >> 18)) & 0x3);
  286. }
  287. static __inline unsigned int
  288. get_RRROpcodeExtension_Y1(tilepro_bundle_bits n)
  289. {
  290. return (((unsigned int)(n >> 49)) & 0x3);
  291. }
  292. static __inline unsigned int
  293. get_RouteOpcodeExtension_SN(tilepro_bundle_bits num)
  294. {
  295. const unsigned int n = (unsigned int)num;
  296. return (((n >> 0)) & 0x3ff);
  297. }
  298. static __inline unsigned int
  299. get_S_X0(tilepro_bundle_bits num)
  300. {
  301. const unsigned int n = (unsigned int)num;
  302. return (((n >> 27)) & 0x1);
  303. }
  304. static __inline unsigned int
  305. get_S_X1(tilepro_bundle_bits n)
  306. {
  307. return (((unsigned int)(n >> 58)) & 0x1);
  308. }
  309. static __inline unsigned int
  310. get_ShAmt_X0(tilepro_bundle_bits num)
  311. {
  312. const unsigned int n = (unsigned int)num;
  313. return (((n >> 12)) & 0x1f);
  314. }
  315. static __inline unsigned int
  316. get_ShAmt_X1(tilepro_bundle_bits n)
  317. {
  318. return (((unsigned int)(n >> 43)) & 0x1f);
  319. }
  320. static __inline unsigned int
  321. get_ShAmt_Y0(tilepro_bundle_bits num)
  322. {
  323. const unsigned int n = (unsigned int)num;
  324. return (((n >> 12)) & 0x1f);
  325. }
  326. static __inline unsigned int
  327. get_ShAmt_Y1(tilepro_bundle_bits n)
  328. {
  329. return (((unsigned int)(n >> 43)) & 0x1f);
  330. }
  331. static __inline unsigned int
  332. get_SrcA_X0(tilepro_bundle_bits num)
  333. {
  334. const unsigned int n = (unsigned int)num;
  335. return (((n >> 6)) & 0x3f);
  336. }
  337. static __inline unsigned int
  338. get_SrcA_X1(tilepro_bundle_bits n)
  339. {
  340. return (((unsigned int)(n >> 37)) & 0x3f);
  341. }
  342. static __inline unsigned int
  343. get_SrcA_Y0(tilepro_bundle_bits num)
  344. {
  345. const unsigned int n = (unsigned int)num;
  346. return (((n >> 6)) & 0x3f);
  347. }
  348. static __inline unsigned int
  349. get_SrcA_Y1(tilepro_bundle_bits n)
  350. {
  351. return (((unsigned int)(n >> 37)) & 0x3f);
  352. }
  353. static __inline unsigned int
  354. get_SrcA_Y2(tilepro_bundle_bits n)
  355. {
  356. return (((n >> 26)) & 0x00000001) |
  357. (((unsigned int)(n >> 50)) & 0x0000003e);
  358. }
  359. static __inline unsigned int
  360. get_SrcBDest_Y2(tilepro_bundle_bits num)
  361. {
  362. const unsigned int n = (unsigned int)num;
  363. return (((n >> 20)) & 0x3f);
  364. }
  365. static __inline unsigned int
  366. get_SrcB_X0(tilepro_bundle_bits num)
  367. {
  368. const unsigned int n = (unsigned int)num;
  369. return (((n >> 12)) & 0x3f);
  370. }
  371. static __inline unsigned int
  372. get_SrcB_X1(tilepro_bundle_bits n)
  373. {
  374. return (((unsigned int)(n >> 43)) & 0x3f);
  375. }
  376. static __inline unsigned int
  377. get_SrcB_Y0(tilepro_bundle_bits num)
  378. {
  379. const unsigned int n = (unsigned int)num;
  380. return (((n >> 12)) & 0x3f);
  381. }
  382. static __inline unsigned int
  383. get_SrcB_Y1(tilepro_bundle_bits n)
  384. {
  385. return (((unsigned int)(n >> 43)) & 0x3f);
  386. }
  387. static __inline unsigned int
  388. get_Src_SN(tilepro_bundle_bits num)
  389. {
  390. const unsigned int n = (unsigned int)num;
  391. return (((n >> 0)) & 0x3);
  392. }
  393. static __inline unsigned int
  394. get_UnOpcodeExtension_X0(tilepro_bundle_bits num)
  395. {
  396. const unsigned int n = (unsigned int)num;
  397. return (((n >> 12)) & 0x1f);
  398. }
  399. static __inline unsigned int
  400. get_UnOpcodeExtension_X1(tilepro_bundle_bits n)
  401. {
  402. return (((unsigned int)(n >> 43)) & 0x1f);
  403. }
  404. static __inline unsigned int
  405. get_UnOpcodeExtension_Y0(tilepro_bundle_bits num)
  406. {
  407. const unsigned int n = (unsigned int)num;
  408. return (((n >> 12)) & 0x1f);
  409. }
  410. static __inline unsigned int
  411. get_UnOpcodeExtension_Y1(tilepro_bundle_bits n)
  412. {
  413. return (((unsigned int)(n >> 43)) & 0x1f);
  414. }
  415. static __inline unsigned int
  416. get_UnShOpcodeExtension_X0(tilepro_bundle_bits num)
  417. {
  418. const unsigned int n = (unsigned int)num;
  419. return (((n >> 17)) & 0x3ff);
  420. }
  421. static __inline unsigned int
  422. get_UnShOpcodeExtension_X1(tilepro_bundle_bits n)
  423. {
  424. return (((unsigned int)(n >> 48)) & 0x3ff);
  425. }
  426. static __inline unsigned int
  427. get_UnShOpcodeExtension_Y0(tilepro_bundle_bits num)
  428. {
  429. const unsigned int n = (unsigned int)num;
  430. return (((n >> 17)) & 0x7);
  431. }
  432. static __inline unsigned int
  433. get_UnShOpcodeExtension_Y1(tilepro_bundle_bits n)
  434. {
  435. return (((unsigned int)(n >> 48)) & 0x7);
  436. }
  437. static __inline int
  438. sign_extend(int n, int num_bits)
  439. {
  440. int shift = (int)(sizeof(int) * 8 - num_bits);
  441. return (n << shift) >> shift;
  442. }
  443. static __inline tilepro_bundle_bits
  444. create_BrOff_SN(int num)
  445. {
  446. const unsigned int n = (unsigned int)num;
  447. return ((n & 0x3ff) << 0);
  448. }
  449. static __inline tilepro_bundle_bits
  450. create_BrOff_X1(int num)
  451. {
  452. const unsigned int n = (unsigned int)num;
  453. return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
  454. (((tilepro_bundle_bits)(n & 0x00018000)) << 20);
  455. }
  456. static __inline tilepro_bundle_bits
  457. create_BrType_X1(int num)
  458. {
  459. const unsigned int n = (unsigned int)num;
  460. return (((tilepro_bundle_bits)(n & 0xf)) << 31);
  461. }
  462. static __inline tilepro_bundle_bits
  463. create_Dest_Imm8_X1(int num)
  464. {
  465. const unsigned int n = (unsigned int)num;
  466. return (((tilepro_bundle_bits)(n & 0x0000003f)) << 31) |
  467. (((tilepro_bundle_bits)(n & 0x000000c0)) << 43);
  468. }
  469. static __inline tilepro_bundle_bits
  470. create_Dest_SN(int num)
  471. {
  472. const unsigned int n = (unsigned int)num;
  473. return ((n & 0x3) << 2);
  474. }
  475. static __inline tilepro_bundle_bits
  476. create_Dest_X0(int num)
  477. {
  478. const unsigned int n = (unsigned int)num;
  479. return ((n & 0x3f) << 0);
  480. }
  481. static __inline tilepro_bundle_bits
  482. create_Dest_X1(int num)
  483. {
  484. const unsigned int n = (unsigned int)num;
  485. return (((tilepro_bundle_bits)(n & 0x3f)) << 31);
  486. }
  487. static __inline tilepro_bundle_bits
  488. create_Dest_Y0(int num)
  489. {
  490. const unsigned int n = (unsigned int)num;
  491. return ((n & 0x3f) << 0);
  492. }
  493. static __inline tilepro_bundle_bits
  494. create_Dest_Y1(int num)
  495. {
  496. const unsigned int n = (unsigned int)num;
  497. return (((tilepro_bundle_bits)(n & 0x3f)) << 31);
  498. }
  499. static __inline tilepro_bundle_bits
  500. create_Imm16_X0(int num)
  501. {
  502. const unsigned int n = (unsigned int)num;
  503. return ((n & 0xffff) << 12);
  504. }
  505. static __inline tilepro_bundle_bits
  506. create_Imm16_X1(int num)
  507. {
  508. const unsigned int n = (unsigned int)num;
  509. return (((tilepro_bundle_bits)(n & 0xffff)) << 43);
  510. }
  511. static __inline tilepro_bundle_bits
  512. create_Imm8_SN(int num)
  513. {
  514. const unsigned int n = (unsigned int)num;
  515. return ((n & 0xff) << 0);
  516. }
  517. static __inline tilepro_bundle_bits
  518. create_Imm8_X0(int num)
  519. {
  520. const unsigned int n = (unsigned int)num;
  521. return ((n & 0xff) << 12);
  522. }
  523. static __inline tilepro_bundle_bits
  524. create_Imm8_X1(int num)
  525. {
  526. const unsigned int n = (unsigned int)num;
  527. return (((tilepro_bundle_bits)(n & 0xff)) << 43);
  528. }
  529. static __inline tilepro_bundle_bits
  530. create_Imm8_Y0(int num)
  531. {
  532. const unsigned int n = (unsigned int)num;
  533. return ((n & 0xff) << 12);
  534. }
  535. static __inline tilepro_bundle_bits
  536. create_Imm8_Y1(int num)
  537. {
  538. const unsigned int n = (unsigned int)num;
  539. return (((tilepro_bundle_bits)(n & 0xff)) << 43);
  540. }
  541. static __inline tilepro_bundle_bits
  542. create_ImmOpcodeExtension_X0(int num)
  543. {
  544. const unsigned int n = (unsigned int)num;
  545. return ((n & 0x7f) << 20);
  546. }
  547. static __inline tilepro_bundle_bits
  548. create_ImmOpcodeExtension_X1(int num)
  549. {
  550. const unsigned int n = (unsigned int)num;
  551. return (((tilepro_bundle_bits)(n & 0x7f)) << 51);
  552. }
  553. static __inline tilepro_bundle_bits
  554. create_ImmRROpcodeExtension_SN(int num)
  555. {
  556. const unsigned int n = (unsigned int)num;
  557. return ((n & 0x3) << 8);
  558. }
  559. static __inline tilepro_bundle_bits
  560. create_JOffLong_X1(int num)
  561. {
  562. const unsigned int n = (unsigned int)num;
  563. return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
  564. (((tilepro_bundle_bits)(n & 0x00018000)) << 20) |
  565. (((tilepro_bundle_bits)(n & 0x001e0000)) << 14) |
  566. (((tilepro_bundle_bits)(n & 0x07e00000)) << 16) |
  567. (((tilepro_bundle_bits)(n & 0x18000000)) << 31);
  568. }
  569. static __inline tilepro_bundle_bits
  570. create_JOff_X1(int num)
  571. {
  572. const unsigned int n = (unsigned int)num;
  573. return (((tilepro_bundle_bits)(n & 0x00007fff)) << 43) |
  574. (((tilepro_bundle_bits)(n & 0x00018000)) << 20) |
  575. (((tilepro_bundle_bits)(n & 0x001e0000)) << 14) |
  576. (((tilepro_bundle_bits)(n & 0x07e00000)) << 16) |
  577. (((tilepro_bundle_bits)(n & 0x08000000)) << 31);
  578. }
  579. static __inline tilepro_bundle_bits
  580. create_MF_Imm15_X1(int num)
  581. {
  582. const unsigned int n = (unsigned int)num;
  583. return (((tilepro_bundle_bits)(n & 0x00003fff)) << 37) |
  584. (((tilepro_bundle_bits)(n & 0x00004000)) << 44);
  585. }
  586. static __inline tilepro_bundle_bits
  587. create_MMEnd_X0(int num)
  588. {
  589. const unsigned int n = (unsigned int)num;
  590. return ((n & 0x1f) << 18);
  591. }
  592. static __inline tilepro_bundle_bits
  593. create_MMEnd_X1(int num)
  594. {
  595. const unsigned int n = (unsigned int)num;
  596. return (((tilepro_bundle_bits)(n & 0x1f)) << 49);
  597. }
  598. static __inline tilepro_bundle_bits
  599. create_MMStart_X0(int num)
  600. {
  601. const unsigned int n = (unsigned int)num;
  602. return ((n & 0x1f) << 23);
  603. }
  604. static __inline tilepro_bundle_bits
  605. create_MMStart_X1(int num)
  606. {
  607. const unsigned int n = (unsigned int)num;
  608. return (((tilepro_bundle_bits)(n & 0x1f)) << 54);
  609. }
  610. static __inline tilepro_bundle_bits
  611. create_MT_Imm15_X1(int num)
  612. {
  613. const unsigned int n = (unsigned int)num;
  614. return (((tilepro_bundle_bits)(n & 0x0000003f)) << 31) |
  615. (((tilepro_bundle_bits)(n & 0x00003fc0)) << 37) |
  616. (((tilepro_bundle_bits)(n & 0x00004000)) << 44);
  617. }
  618. static __inline tilepro_bundle_bits
  619. create_Mode(int num)
  620. {
  621. const unsigned int n = (unsigned int)num;
  622. return (((tilepro_bundle_bits)(n & 0x1)) << 63);
  623. }
  624. static __inline tilepro_bundle_bits
  625. create_NoRegOpcodeExtension_SN(int num)
  626. {
  627. const unsigned int n = (unsigned int)num;
  628. return ((n & 0xf) << 0);
  629. }
  630. static __inline tilepro_bundle_bits
  631. create_Opcode_SN(int num)
  632. {
  633. const unsigned int n = (unsigned int)num;
  634. return ((n & 0x3f) << 10);
  635. }
  636. static __inline tilepro_bundle_bits
  637. create_Opcode_X0(int num)
  638. {
  639. const unsigned int n = (unsigned int)num;
  640. return ((n & 0x7) << 28);
  641. }
  642. static __inline tilepro_bundle_bits
  643. create_Opcode_X1(int num)
  644. {
  645. const unsigned int n = (unsigned int)num;
  646. return (((tilepro_bundle_bits)(n & 0xf)) << 59);
  647. }
  648. static __inline tilepro_bundle_bits
  649. create_Opcode_Y0(int num)
  650. {
  651. const unsigned int n = (unsigned int)num;
  652. return ((n & 0xf) << 27);
  653. }
  654. static __inline tilepro_bundle_bits
  655. create_Opcode_Y1(int num)
  656. {
  657. const unsigned int n = (unsigned int)num;
  658. return (((tilepro_bundle_bits)(n & 0xf)) << 59);
  659. }
  660. static __inline tilepro_bundle_bits
  661. create_Opcode_Y2(int num)
  662. {
  663. const unsigned int n = (unsigned int)num;
  664. return (((tilepro_bundle_bits)(n & 0x7)) << 56);
  665. }
  666. static __inline tilepro_bundle_bits
  667. create_RROpcodeExtension_SN(int num)
  668. {
  669. const unsigned int n = (unsigned int)num;
  670. return ((n & 0xf) << 4);
  671. }
  672. static __inline tilepro_bundle_bits
  673. create_RRROpcodeExtension_X0(int num)
  674. {
  675. const unsigned int n = (unsigned int)num;
  676. return ((n & 0x1ff) << 18);
  677. }
  678. static __inline tilepro_bundle_bits
  679. create_RRROpcodeExtension_X1(int num)
  680. {
  681. const unsigned int n = (unsigned int)num;
  682. return (((tilepro_bundle_bits)(n & 0x1ff)) << 49);
  683. }
  684. static __inline tilepro_bundle_bits
  685. create_RRROpcodeExtension_Y0(int num)
  686. {
  687. const unsigned int n = (unsigned int)num;
  688. return ((n & 0x3) << 18);
  689. }
  690. static __inline tilepro_bundle_bits
  691. create_RRROpcodeExtension_Y1(int num)
  692. {
  693. const unsigned int n = (unsigned int)num;
  694. return (((tilepro_bundle_bits)(n & 0x3)) << 49);
  695. }
  696. static __inline tilepro_bundle_bits
  697. create_RouteOpcodeExtension_SN(int num)
  698. {
  699. const unsigned int n = (unsigned int)num;
  700. return ((n & 0x3ff) << 0);
  701. }
  702. static __inline tilepro_bundle_bits
  703. create_S_X0(int num)
  704. {
  705. const unsigned int n = (unsigned int)num;
  706. return ((n & 0x1) << 27);
  707. }
  708. static __inline tilepro_bundle_bits
  709. create_S_X1(int num)
  710. {
  711. const unsigned int n = (unsigned int)num;
  712. return (((tilepro_bundle_bits)(n & 0x1)) << 58);
  713. }
  714. static __inline tilepro_bundle_bits
  715. create_ShAmt_X0(int num)
  716. {
  717. const unsigned int n = (unsigned int)num;
  718. return ((n & 0x1f) << 12);
  719. }
  720. static __inline tilepro_bundle_bits
  721. create_ShAmt_X1(int num)
  722. {
  723. const unsigned int n = (unsigned int)num;
  724. return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
  725. }
  726. static __inline tilepro_bundle_bits
  727. create_ShAmt_Y0(int num)
  728. {
  729. const unsigned int n = (unsigned int)num;
  730. return ((n & 0x1f) << 12);
  731. }
  732. static __inline tilepro_bundle_bits
  733. create_ShAmt_Y1(int num)
  734. {
  735. const unsigned int n = (unsigned int)num;
  736. return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
  737. }
  738. static __inline tilepro_bundle_bits
  739. create_SrcA_X0(int num)
  740. {
  741. const unsigned int n = (unsigned int)num;
  742. return ((n & 0x3f) << 6);
  743. }
  744. static __inline tilepro_bundle_bits
  745. create_SrcA_X1(int num)
  746. {
  747. const unsigned int n = (unsigned int)num;
  748. return (((tilepro_bundle_bits)(n & 0x3f)) << 37);
  749. }
  750. static __inline tilepro_bundle_bits
  751. create_SrcA_Y0(int num)
  752. {
  753. const unsigned int n = (unsigned int)num;
  754. return ((n & 0x3f) << 6);
  755. }
  756. static __inline tilepro_bundle_bits
  757. create_SrcA_Y1(int num)
  758. {
  759. const unsigned int n = (unsigned int)num;
  760. return (((tilepro_bundle_bits)(n & 0x3f)) << 37);
  761. }
  762. static __inline tilepro_bundle_bits
  763. create_SrcA_Y2(int num)
  764. {
  765. const unsigned int n = (unsigned int)num;
  766. return ((n & 0x00000001) << 26) |
  767. (((tilepro_bundle_bits)(n & 0x0000003e)) << 50);
  768. }
  769. static __inline tilepro_bundle_bits
  770. create_SrcBDest_Y2(int num)
  771. {
  772. const unsigned int n = (unsigned int)num;
  773. return ((n & 0x3f) << 20);
  774. }
  775. static __inline tilepro_bundle_bits
  776. create_SrcB_X0(int num)
  777. {
  778. const unsigned int n = (unsigned int)num;
  779. return ((n & 0x3f) << 12);
  780. }
  781. static __inline tilepro_bundle_bits
  782. create_SrcB_X1(int num)
  783. {
  784. const unsigned int n = (unsigned int)num;
  785. return (((tilepro_bundle_bits)(n & 0x3f)) << 43);
  786. }
  787. static __inline tilepro_bundle_bits
  788. create_SrcB_Y0(int num)
  789. {
  790. const unsigned int n = (unsigned int)num;
  791. return ((n & 0x3f) << 12);
  792. }
  793. static __inline tilepro_bundle_bits
  794. create_SrcB_Y1(int num)
  795. {
  796. const unsigned int n = (unsigned int)num;
  797. return (((tilepro_bundle_bits)(n & 0x3f)) << 43);
  798. }
  799. static __inline tilepro_bundle_bits
  800. create_Src_SN(int num)
  801. {
  802. const unsigned int n = (unsigned int)num;
  803. return ((n & 0x3) << 0);
  804. }
  805. static __inline tilepro_bundle_bits
  806. create_UnOpcodeExtension_X0(int num)
  807. {
  808. const unsigned int n = (unsigned int)num;
  809. return ((n & 0x1f) << 12);
  810. }
  811. static __inline tilepro_bundle_bits
  812. create_UnOpcodeExtension_X1(int num)
  813. {
  814. const unsigned int n = (unsigned int)num;
  815. return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
  816. }
  817. static __inline tilepro_bundle_bits
  818. create_UnOpcodeExtension_Y0(int num)
  819. {
  820. const unsigned int n = (unsigned int)num;
  821. return ((n & 0x1f) << 12);
  822. }
  823. static __inline tilepro_bundle_bits
  824. create_UnOpcodeExtension_Y1(int num)
  825. {
  826. const unsigned int n = (unsigned int)num;
  827. return (((tilepro_bundle_bits)(n & 0x1f)) << 43);
  828. }
  829. static __inline tilepro_bundle_bits
  830. create_UnShOpcodeExtension_X0(int num)
  831. {
  832. const unsigned int n = (unsigned int)num;
  833. return ((n & 0x3ff) << 17);
  834. }
  835. static __inline tilepro_bundle_bits
  836. create_UnShOpcodeExtension_X1(int num)
  837. {
  838. const unsigned int n = (unsigned int)num;
  839. return (((tilepro_bundle_bits)(n & 0x3ff)) << 48);
  840. }
  841. static __inline tilepro_bundle_bits
  842. create_UnShOpcodeExtension_Y0(int num)
  843. {
  844. const unsigned int n = (unsigned int)num;
  845. return ((n & 0x7) << 17);
  846. }
  847. static __inline tilepro_bundle_bits
  848. create_UnShOpcodeExtension_Y1(int num)
  849. {
  850. const unsigned int n = (unsigned int)num;
  851. return (((tilepro_bundle_bits)(n & 0x7)) << 48);
  852. }
  853. enum
  854. {
  855. ADDBS_U_SPECIAL_0_OPCODE_X0 = 98,
  856. ADDBS_U_SPECIAL_0_OPCODE_X1 = 68,
  857. ADDB_SPECIAL_0_OPCODE_X0 = 1,
  858. ADDB_SPECIAL_0_OPCODE_X1 = 1,
  859. ADDHS_SPECIAL_0_OPCODE_X0 = 99,
  860. ADDHS_SPECIAL_0_OPCODE_X1 = 69,
  861. ADDH_SPECIAL_0_OPCODE_X0 = 2,
  862. ADDH_SPECIAL_0_OPCODE_X1 = 2,
  863. ADDIB_IMM_0_OPCODE_X0 = 1,
  864. ADDIB_IMM_0_OPCODE_X1 = 1,
  865. ADDIH_IMM_0_OPCODE_X0 = 2,
  866. ADDIH_IMM_0_OPCODE_X1 = 2,
  867. ADDI_IMM_0_OPCODE_X0 = 3,
  868. ADDI_IMM_0_OPCODE_X1 = 3,
  869. ADDI_IMM_1_OPCODE_SN = 1,
  870. ADDI_OPCODE_Y0 = 9,
  871. ADDI_OPCODE_Y1 = 7,
  872. ADDLIS_OPCODE_X0 = 1,
  873. ADDLIS_OPCODE_X1 = 2,
  874. ADDLI_OPCODE_X0 = 2,
  875. ADDLI_OPCODE_X1 = 3,
  876. ADDS_SPECIAL_0_OPCODE_X0 = 96,
  877. ADDS_SPECIAL_0_OPCODE_X1 = 66,
  878. ADD_SPECIAL_0_OPCODE_X0 = 3,
  879. ADD_SPECIAL_0_OPCODE_X1 = 3,
  880. ADD_SPECIAL_0_OPCODE_Y0 = 0,
  881. ADD_SPECIAL_0_OPCODE_Y1 = 0,
  882. ADIFFB_U_SPECIAL_0_OPCODE_X0 = 4,
  883. ADIFFH_SPECIAL_0_OPCODE_X0 = 5,
  884. ANDI_IMM_0_OPCODE_X0 = 1,
  885. ANDI_IMM_0_OPCODE_X1 = 4,
  886. ANDI_OPCODE_Y0 = 10,
  887. ANDI_OPCODE_Y1 = 8,
  888. AND_SPECIAL_0_OPCODE_X0 = 6,
  889. AND_SPECIAL_0_OPCODE_X1 = 4,
  890. AND_SPECIAL_2_OPCODE_Y0 = 0,
  891. AND_SPECIAL_2_OPCODE_Y1 = 0,
  892. AULI_OPCODE_X0 = 3,
  893. AULI_OPCODE_X1 = 4,
  894. AVGB_U_SPECIAL_0_OPCODE_X0 = 7,
  895. AVGH_SPECIAL_0_OPCODE_X0 = 8,
  896. BBNST_BRANCH_OPCODE_X1 = 15,
  897. BBNS_BRANCH_OPCODE_X1 = 14,
  898. BBNS_OPCODE_SN = 63,
  899. BBST_BRANCH_OPCODE_X1 = 13,
  900. BBS_BRANCH_OPCODE_X1 = 12,
  901. BBS_OPCODE_SN = 62,
  902. BGEZT_BRANCH_OPCODE_X1 = 7,
  903. BGEZ_BRANCH_OPCODE_X1 = 6,
  904. BGEZ_OPCODE_SN = 61,
  905. BGZT_BRANCH_OPCODE_X1 = 5,
  906. BGZ_BRANCH_OPCODE_X1 = 4,
  907. BGZ_OPCODE_SN = 58,
  908. BITX_UN_0_SHUN_0_OPCODE_X0 = 1,
  909. BITX_UN_0_SHUN_0_OPCODE_Y0 = 1,
  910. BLEZT_BRANCH_OPCODE_X1 = 11,
  911. BLEZ_BRANCH_OPCODE_X1 = 10,
  912. BLEZ_OPCODE_SN = 59,
  913. BLZT_BRANCH_OPCODE_X1 = 9,
  914. BLZ_BRANCH_OPCODE_X1 = 8,
  915. BLZ_OPCODE_SN = 60,
  916. BNZT_BRANCH_OPCODE_X1 = 3,
  917. BNZ_BRANCH_OPCODE_X1 = 2,
  918. BNZ_OPCODE_SN = 57,
  919. BPT_NOREG_RR_IMM_0_OPCODE_SN = 1,
  920. BRANCH_OPCODE_X1 = 5,
  921. BYTEX_UN_0_SHUN_0_OPCODE_X0 = 2,
  922. BYTEX_UN_0_SHUN_0_OPCODE_Y0 = 2,
  923. BZT_BRANCH_OPCODE_X1 = 1,
  924. BZ_BRANCH_OPCODE_X1 = 0,
  925. BZ_OPCODE_SN = 56,
  926. CLZ_UN_0_SHUN_0_OPCODE_X0 = 3,
  927. CLZ_UN_0_SHUN_0_OPCODE_Y0 = 3,
  928. CRC32_32_SPECIAL_0_OPCODE_X0 = 9,
  929. CRC32_8_SPECIAL_0_OPCODE_X0 = 10,
  930. CTZ_UN_0_SHUN_0_OPCODE_X0 = 4,
  931. CTZ_UN_0_SHUN_0_OPCODE_Y0 = 4,
  932. DRAIN_UN_0_SHUN_0_OPCODE_X1 = 1,
  933. DTLBPR_UN_0_SHUN_0_OPCODE_X1 = 2,
  934. DWORD_ALIGN_SPECIAL_0_OPCODE_X0 = 95,
  935. FINV_UN_0_SHUN_0_OPCODE_X1 = 3,
  936. FLUSH_UN_0_SHUN_0_OPCODE_X1 = 4,
  937. FNOP_NOREG_RR_IMM_0_OPCODE_SN = 3,
  938. FNOP_UN_0_SHUN_0_OPCODE_X0 = 5,
  939. FNOP_UN_0_SHUN_0_OPCODE_X1 = 5,
  940. FNOP_UN_0_SHUN_0_OPCODE_Y0 = 5,
  941. FNOP_UN_0_SHUN_0_OPCODE_Y1 = 1,
  942. HALT_NOREG_RR_IMM_0_OPCODE_SN = 0,
  943. ICOH_UN_0_SHUN_0_OPCODE_X1 = 6,
  944. ILL_UN_0_SHUN_0_OPCODE_X1 = 7,
  945. ILL_UN_0_SHUN_0_OPCODE_Y1 = 2,
  946. IMM_0_OPCODE_SN = 0,
  947. IMM_0_OPCODE_X0 = 4,
  948. IMM_0_OPCODE_X1 = 6,
  949. IMM_1_OPCODE_SN = 1,
  950. IMM_OPCODE_0_X0 = 5,
  951. INTHB_SPECIAL_0_OPCODE_X0 = 11,
  952. INTHB_SPECIAL_0_OPCODE_X1 = 5,
  953. INTHH_SPECIAL_0_OPCODE_X0 = 12,
  954. INTHH_SPECIAL_0_OPCODE_X1 = 6,
  955. INTLB_SPECIAL_0_OPCODE_X0 = 13,
  956. INTLB_SPECIAL_0_OPCODE_X1 = 7,
  957. INTLH_SPECIAL_0_OPCODE_X0 = 14,
  958. INTLH_SPECIAL_0_OPCODE_X1 = 8,
  959. INV_UN_0_SHUN_0_OPCODE_X1 = 8,
  960. IRET_UN_0_SHUN_0_OPCODE_X1 = 9,
  961. JALB_OPCODE_X1 = 13,
  962. JALF_OPCODE_X1 = 12,
  963. JALRP_SPECIAL_0_OPCODE_X1 = 9,
  964. JALRR_IMM_1_OPCODE_SN = 3,
  965. JALR_RR_IMM_0_OPCODE_SN = 5,
  966. JALR_SPECIAL_0_OPCODE_X1 = 10,
  967. JB_OPCODE_X1 = 11,
  968. JF_OPCODE_X1 = 10,
  969. JRP_SPECIAL_0_OPCODE_X1 = 11,
  970. JRR_IMM_1_OPCODE_SN = 2,
  971. JR_RR_IMM_0_OPCODE_SN = 4,
  972. JR_SPECIAL_0_OPCODE_X1 = 12,
  973. LBADD_IMM_0_OPCODE_X1 = 22,
  974. LBADD_U_IMM_0_OPCODE_X1 = 23,
  975. LB_OPCODE_Y2 = 0,
  976. LB_UN_0_SHUN_0_OPCODE_X1 = 10,
  977. LB_U_OPCODE_Y2 = 1,
  978. LB_U_UN_0_SHUN_0_OPCODE_X1 = 11,
  979. LHADD_IMM_0_OPCODE_X1 = 24,
  980. LHADD_U_IMM_0_OPCODE_X1 = 25,
  981. LH_OPCODE_Y2 = 2,
  982. LH_UN_0_SHUN_0_OPCODE_X1 = 12,
  983. LH_U_OPCODE_Y2 = 3,
  984. LH_U_UN_0_SHUN_0_OPCODE_X1 = 13,
  985. LNK_SPECIAL_0_OPCODE_X1 = 13,
  986. LWADD_IMM_0_OPCODE_X1 = 26,
  987. LWADD_NA_IMM_0_OPCODE_X1 = 27,
  988. LW_NA_UN_0_SHUN_0_OPCODE_X1 = 24,
  989. LW_OPCODE_Y2 = 4,
  990. LW_UN_0_SHUN_0_OPCODE_X1 = 14,
  991. MAXB_U_SPECIAL_0_OPCODE_X0 = 15,
  992. MAXB_U_SPECIAL_0_OPCODE_X1 = 14,
  993. MAXH_SPECIAL_0_OPCODE_X0 = 16,
  994. MAXH_SPECIAL_0_OPCODE_X1 = 15,
  995. MAXIB_U_IMM_0_OPCODE_X0 = 4,
  996. MAXIB_U_IMM_0_OPCODE_X1 = 5,
  997. MAXIH_IMM_0_OPCODE_X0 = 5,
  998. MAXIH_IMM_0_OPCODE_X1 = 6,
  999. MFSPR_IMM_0_OPCODE_X1 = 7,
  1000. MF_UN_0_SHUN_0_OPCODE_X1 = 15,
  1001. MINB_U_SPECIAL_0_OPCODE_X0 = 17,
  1002. MINB_U_SPECIAL_0_OPCODE_X1 = 16,
  1003. MINH_SPECIAL_0_OPCODE_X0 = 18,
  1004. MINH_SPECIAL_0_OPCODE_X1 = 17,
  1005. MINIB_U_IMM_0_OPCODE_X0 = 6,
  1006. MINIB_U_IMM_0_OPCODE_X1 = 8,
  1007. MINIH_IMM_0_OPCODE_X0 = 7,
  1008. MINIH_IMM_0_OPCODE_X1 = 9,
  1009. MM_OPCODE_X0 = 6,
  1010. MM_OPCODE_X1 = 7,
  1011. MNZB_SPECIAL_0_OPCODE_X0 = 19,
  1012. MNZB_SPECIAL_0_OPCODE_X1 = 18,
  1013. MNZH_SPECIAL_0_OPCODE_X0 = 20,
  1014. MNZH_SPECIAL_0_OPCODE_X1 = 19,
  1015. MNZ_SPECIAL_0_OPCODE_X0 = 21,
  1016. MNZ_SPECIAL_0_OPCODE_X1 = 20,
  1017. MNZ_SPECIAL_1_OPCODE_Y0 = 0,
  1018. MNZ_SPECIAL_1_OPCODE_Y1 = 1,
  1019. MOVEI_IMM_1_OPCODE_SN = 0,
  1020. MOVE_RR_IMM_0_OPCODE_SN = 8,
  1021. MTSPR_IMM_0_OPCODE_X1 = 10,
  1022. MULHHA_SS_SPECIAL_0_OPCODE_X0 = 22,
  1023. MULHHA_SS_SPECIAL_7_OPCODE_Y0 = 0,
  1024. MULHHA_SU_SPECIAL_0_OPCODE_X0 = 23,
  1025. MULHHA_UU_SPECIAL_0_OPCODE_X0 = 24,
  1026. MULHHA_UU_SPECIAL_7_OPCODE_Y0 = 1,
  1027. MULHHSA_UU_SPECIAL_0_OPCODE_X0 = 25,
  1028. MULHH_SS_SPECIAL_0_OPCODE_X0 = 26,
  1029. MULHH_SS_SPECIAL_6_OPCODE_Y0 = 0,
  1030. MULHH_SU_SPECIAL_0_OPCODE_X0 = 27,
  1031. MULHH_UU_SPECIAL_0_OPCODE_X0 = 28,
  1032. MULHH_UU_SPECIAL_6_OPCODE_Y0 = 1,
  1033. MULHLA_SS_SPECIAL_0_OPCODE_X0 = 29,
  1034. MULHLA_SU_SPECIAL_0_OPCODE_X0 = 30,
  1035. MULHLA_US_SPECIAL_0_OPCODE_X0 = 31,
  1036. MULHLA_UU_SPECIAL_0_OPCODE_X0 = 32,
  1037. MULHLSA_UU_SPECIAL_0_OPCODE_X0 = 33,
  1038. MULHLSA_UU_SPECIAL_5_OPCODE_Y0 = 0,
  1039. MULHL_SS_SPECIAL_0_OPCODE_X0 = 34,
  1040. MULHL_SU_SPECIAL_0_OPCODE_X0 = 35,
  1041. MULHL_US_SPECIAL_0_OPCODE_X0 = 36,
  1042. MULHL_UU_SPECIAL_0_OPCODE_X0 = 37,
  1043. MULLLA_SS_SPECIAL_0_OPCODE_X0 = 38,
  1044. MULLLA_SS_SPECIAL_7_OPCODE_Y0 = 2,
  1045. MULLLA_SU_SPECIAL_0_OPCODE_X0 = 39,
  1046. MULLLA_UU_SPECIAL_0_OPCODE_X0 = 40,
  1047. MULLLA_UU_SPECIAL_7_OPCODE_Y0 = 3,
  1048. MULLLSA_UU_SPECIAL_0_OPCODE_X0 = 41,
  1049. MULLL_SS_SPECIAL_0_OPCODE_X0 = 42,
  1050. MULLL_SS_SPECIAL_6_OPCODE_Y0 = 2,
  1051. MULLL_SU_SPECIAL_0_OPCODE_X0 = 43,
  1052. MULLL_UU_SPECIAL_0_OPCODE_X0 = 44,
  1053. MULLL_UU_SPECIAL_6_OPCODE_Y0 = 3,
  1054. MVNZ_SPECIAL_0_OPCODE_X0 = 45,
  1055. MVNZ_SPECIAL_1_OPCODE_Y0 = 1,
  1056. MVZ_SPECIAL_0_OPCODE_X0 = 46,
  1057. MVZ_SPECIAL_1_OPCODE_Y0 = 2,
  1058. MZB_SPECIAL_0_OPCODE_X0 = 47,
  1059. MZB_SPECIAL_0_OPCODE_X1 = 21,
  1060. MZH_SPECIAL_0_OPCODE_X0 = 48,
  1061. MZH_SPECIAL_0_OPCODE_X1 = 22,
  1062. MZ_SPECIAL_0_OPCODE_X0 = 49,
  1063. MZ_SPECIAL_0_OPCODE_X1 = 23,
  1064. MZ_SPECIAL_1_OPCODE_Y0 = 3,
  1065. MZ_SPECIAL_1_OPCODE_Y1 = 2,
  1066. NAP_UN_0_SHUN_0_OPCODE_X1 = 16,
  1067. NOP_NOREG_RR_IMM_0_OPCODE_SN = 2,
  1068. NOP_UN_0_SHUN_0_OPCODE_X0 = 6,
  1069. NOP_UN_0_SHUN_0_OPCODE_X1 = 17,
  1070. NOP_UN_0_SHUN_0_OPCODE_Y0 = 6,
  1071. NOP_UN_0_SHUN_0_OPCODE_Y1 = 3,
  1072. NOREG_RR_IMM_0_OPCODE_SN = 0,
  1073. NOR_SPECIAL_0_OPCODE_X0 = 50,
  1074. NOR_SPECIAL_0_OPCODE_X1 = 24,
  1075. NOR_SPECIAL_2_OPCODE_Y0 = 1,
  1076. NOR_SPECIAL_2_OPCODE_Y1 = 1,
  1077. ORI_IMM_0_OPCODE_X0 = 8,
  1078. ORI_IMM_0_OPCODE_X1 = 11,
  1079. ORI_OPCODE_Y0 = 11,
  1080. ORI_OPCODE_Y1 = 9,
  1081. OR_SPECIAL_0_OPCODE_X0 = 51,
  1082. OR_SPECIAL_0_OPCODE_X1 = 25,
  1083. OR_SPECIAL_2_OPCODE_Y0 = 2,
  1084. OR_SPECIAL_2_OPCODE_Y1 = 2,
  1085. PACKBS_U_SPECIAL_0_OPCODE_X0 = 103,
  1086. PACKBS_U_SPECIAL_0_OPCODE_X1 = 73,
  1087. PACKHB_SPECIAL_0_OPCODE_X0 = 52,
  1088. PACKHB_SPECIAL_0_OPCODE_X1 = 26,
  1089. PACKHS_SPECIAL_0_OPCODE_X0 = 102,
  1090. PACKHS_SPECIAL_0_OPCODE_X1 = 72,
  1091. PACKLB_SPECIAL_0_OPCODE_X0 = 53,
  1092. PACKLB_SPECIAL_0_OPCODE_X1 = 27,
  1093. PCNT_UN_0_SHUN_0_OPCODE_X0 = 7,
  1094. PCNT_UN_0_SHUN_0_OPCODE_Y0 = 7,
  1095. RLI_SHUN_0_OPCODE_X0 = 1,
  1096. RLI_SHUN_0_OPCODE_X1 = 1,
  1097. RLI_SHUN_0_OPCODE_Y0 = 1,
  1098. RLI_SHUN_0_OPCODE_Y1 = 1,
  1099. RL_SPECIAL_0_OPCODE_X0 = 54,
  1100. RL_SPECIAL_0_OPCODE_X1 = 28,
  1101. RL_SPECIAL_3_OPCODE_Y0 = 0,
  1102. RL_SPECIAL_3_OPCODE_Y1 = 0,
  1103. RR_IMM_0_OPCODE_SN = 0,
  1104. S1A_SPECIAL_0_OPCODE_X0 = 55,
  1105. S1A_SPECIAL_0_OPCODE_X1 = 29,
  1106. S1A_SPECIAL_0_OPCODE_Y0 = 1,
  1107. S1A_SPECIAL_0_OPCODE_Y1 = 1,
  1108. S2A_SPECIAL_0_OPCODE_X0 = 56,
  1109. S2A_SPECIAL_0_OPCODE_X1 = 30,
  1110. S2A_SPECIAL_0_OPCODE_Y0 = 2,
  1111. S2A_SPECIAL_0_OPCODE_Y1 = 2,
  1112. S3A_SPECIAL_0_OPCODE_X0 = 57,
  1113. S3A_SPECIAL_0_OPCODE_X1 = 31,
  1114. S3A_SPECIAL_5_OPCODE_Y0 = 1,
  1115. S3A_SPECIAL_5_OPCODE_Y1 = 1,
  1116. SADAB_U_SPECIAL_0_OPCODE_X0 = 58,
  1117. SADAH_SPECIAL_0_OPCODE_X0 = 59,
  1118. SADAH_U_SPECIAL_0_OPCODE_X0 = 60,
  1119. SADB_U_SPECIAL_0_OPCODE_X0 = 61,
  1120. SADH_SPECIAL_0_OPCODE_X0 = 62,
  1121. SADH_U_SPECIAL_0_OPCODE_X0 = 63,
  1122. SBADD_IMM_0_OPCODE_X1 = 28,
  1123. SB_OPCODE_Y2 = 5,
  1124. SB_SPECIAL_0_OPCODE_X1 = 32,
  1125. SEQB_SPECIAL_0_OPCODE_X0 = 64,
  1126. SEQB_SPECIAL_0_OPCODE_X1 = 33,
  1127. SEQH_SPECIAL_0_OPCODE_X0 = 65,
  1128. SEQH_SPECIAL_0_OPCODE_X1 = 34,
  1129. SEQIB_IMM_0_OPCODE_X0 = 9,
  1130. SEQIB_IMM_0_OPCODE_X1 = 12,
  1131. SEQIH_IMM_0_OPCODE_X0 = 10,
  1132. SEQIH_IMM_0_OPCODE_X1 = 13,
  1133. SEQI_IMM_0_OPCODE_X0 = 11,
  1134. SEQI_IMM_0_OPCODE_X1 = 14,
  1135. SEQI_OPCODE_Y0 = 12,
  1136. SEQI_OPCODE_Y1 = 10,
  1137. SEQ_SPECIAL_0_OPCODE_X0 = 66,
  1138. SEQ_SPECIAL_0_OPCODE_X1 = 35,
  1139. SEQ_SPECIAL_5_OPCODE_Y0 = 2,
  1140. SEQ_SPECIAL_5_OPCODE_Y1 = 2,
  1141. SHADD_IMM_0_OPCODE_X1 = 29,
  1142. SHL8II_IMM_0_OPCODE_SN = 3,
  1143. SHLB_SPECIAL_0_OPCODE_X0 = 67,
  1144. SHLB_SPECIAL_0_OPCODE_X1 = 36,
  1145. SHLH_SPECIAL_0_OPCODE_X0 = 68,
  1146. SHLH_SPECIAL_0_OPCODE_X1 = 37,
  1147. SHLIB_SHUN_0_OPCODE_X0 = 2,
  1148. SHLIB_SHUN_0_OPCODE_X1 = 2,
  1149. SHLIH_SHUN_0_OPCODE_X0 = 3,
  1150. SHLIH_SHUN_0_OPCODE_X1 = 3,
  1151. SHLI_SHUN_0_OPCODE_X0 = 4,
  1152. SHLI_SHUN_0_OPCODE_X1 = 4,
  1153. SHLI_SHUN_0_OPCODE_Y0 = 2,
  1154. SHLI_SHUN_0_OPCODE_Y1 = 2,
  1155. SHL_SPECIAL_0_OPCODE_X0 = 69,
  1156. SHL_SPECIAL_0_OPCODE_X1 = 38,
  1157. SHL_SPECIAL_3_OPCODE_Y0 = 1,
  1158. SHL_SPECIAL_3_OPCODE_Y1 = 1,
  1159. SHR1_RR_IMM_0_OPCODE_SN = 9,
  1160. SHRB_SPECIAL_0_OPCODE_X0 = 70,
  1161. SHRB_SPECIAL_0_OPCODE_X1 = 39,
  1162. SHRH_SPECIAL_0_OPCODE_X0 = 71,
  1163. SHRH_SPECIAL_0_OPCODE_X1 = 40,
  1164. SHRIB_SHUN_0_OPCODE_X0 = 5,
  1165. SHRIB_SHUN_0_OPCODE_X1 = 5,
  1166. SHRIH_SHUN_0_OPCODE_X0 = 6,
  1167. SHRIH_SHUN_0_OPCODE_X1 = 6,
  1168. SHRI_SHUN_0_OPCODE_X0 = 7,
  1169. SHRI_SHUN_0_OPCODE_X1 = 7,
  1170. SHRI_SHUN_0_OPCODE_Y0 = 3,
  1171. SHRI_SHUN_0_OPCODE_Y1 = 3,
  1172. SHR_SPECIAL_0_OPCODE_X0 = 72,
  1173. SHR_SPECIAL_0_OPCODE_X1 = 41,
  1174. SHR_SPECIAL_3_OPCODE_Y0 = 2,
  1175. SHR_SPECIAL_3_OPCODE_Y1 = 2,
  1176. SHUN_0_OPCODE_X0 = 7,
  1177. SHUN_0_OPCODE_X1 = 8,
  1178. SHUN_0_OPCODE_Y0 = 13,
  1179. SHUN_0_OPCODE_Y1 = 11,
  1180. SH_OPCODE_Y2 = 6,
  1181. SH_SPECIAL_0_OPCODE_X1 = 42,
  1182. SLTB_SPECIAL_0_OPCODE_X0 = 73,
  1183. SLTB_SPECIAL_0_OPCODE_X1 = 43,
  1184. SLTB_U_SPECIAL_0_OPCODE_X0 = 74,
  1185. SLTB_U_SPECIAL_0_OPCODE_X1 = 44,
  1186. SLTEB_SPECIAL_0_OPCODE_X0 = 75,
  1187. SLTEB_SPECIAL_0_OPCODE_X1 = 45,
  1188. SLTEB_U_SPECIAL_0_OPCODE_X0 = 76,
  1189. SLTEB_U_SPECIAL_0_OPCODE_X1 = 46,
  1190. SLTEH_SPECIAL_0_OPCODE_X0 = 77,
  1191. SLTEH_SPECIAL_0_OPCODE_X1 = 47,
  1192. SLTEH_U_SPECIAL_0_OPCODE_X0 = 78,
  1193. SLTEH_U_SPECIAL_0_OPCODE_X1 = 48,
  1194. SLTE_SPECIAL_0_OPCODE_X0 = 79,
  1195. SLTE_SPECIAL_0_OPCODE_X1 = 49,
  1196. SLTE_SPECIAL_4_OPCODE_Y0 = 0,
  1197. SLTE_SPECIAL_4_OPCODE_Y1 = 0,
  1198. SLTE_U_SPECIAL_0_OPCODE_X0 = 80,
  1199. SLTE_U_SPECIAL_0_OPCODE_X1 = 50,
  1200. SLTE_U_SPECIAL_4_OPCODE_Y0 = 1,
  1201. SLTE_U_SPECIAL_4_OPCODE_Y1 = 1,
  1202. SLTH_SPECIAL_0_OPCODE_X0 = 81,
  1203. SLTH_SPECIAL_0_OPCODE_X1 = 51,
  1204. SLTH_U_SPECIAL_0_OPCODE_X0 = 82,
  1205. SLTH_U_SPECIAL_0_OPCODE_X1 = 52,
  1206. SLTIB_IMM_0_OPCODE_X0 = 12,
  1207. SLTIB_IMM_0_OPCODE_X1 = 15,
  1208. SLTIB_U_IMM_0_OPCODE_X0 = 13,
  1209. SLTIB_U_IMM_0_OPCODE_X1 = 16,
  1210. SLTIH_IMM_0_OPCODE_X0 = 14,
  1211. SLTIH_IMM_0_OPCODE_X1 = 17,
  1212. SLTIH_U_IMM_0_OPCODE_X0 = 15,
  1213. SLTIH_U_IMM_0_OPCODE_X1 = 18,
  1214. SLTI_IMM_0_OPCODE_X0 = 16,
  1215. SLTI_IMM_0_OPCODE_X1 = 19,
  1216. SLTI_OPCODE_Y0 = 14,
  1217. SLTI_OPCODE_Y1 = 12,
  1218. SLTI_U_IMM_0_OPCODE_X0 = 17,
  1219. SLTI_U_IMM_0_OPCODE_X1 = 20,
  1220. SLTI_U_OPCODE_Y0 = 15,
  1221. SLTI_U_OPCODE_Y1 = 13,
  1222. SLT_SPECIAL_0_OPCODE_X0 = 83,
  1223. SLT_SPECIAL_0_OPCODE_X1 = 53,
  1224. SLT_SPECIAL_4_OPCODE_Y0 = 2,
  1225. SLT_SPECIAL_4_OPCODE_Y1 = 2,
  1226. SLT_U_SPECIAL_0_OPCODE_X0 = 84,
  1227. SLT_U_SPECIAL_0_OPCODE_X1 = 54,
  1228. SLT_U_SPECIAL_4_OPCODE_Y0 = 3,
  1229. SLT_U_SPECIAL_4_OPCODE_Y1 = 3,
  1230. SNEB_SPECIAL_0_OPCODE_X0 = 85,
  1231. SNEB_SPECIAL_0_OPCODE_X1 = 55,
  1232. SNEH_SPECIAL_0_OPCODE_X0 = 86,
  1233. SNEH_SPECIAL_0_OPCODE_X1 = 56,
  1234. SNE_SPECIAL_0_OPCODE_X0 = 87,
  1235. SNE_SPECIAL_0_OPCODE_X1 = 57,
  1236. SNE_SPECIAL_5_OPCODE_Y0 = 3,
  1237. SNE_SPECIAL_5_OPCODE_Y1 = 3,
  1238. SPECIAL_0_OPCODE_X0 = 0,
  1239. SPECIAL_0_OPCODE_X1 = 1,
  1240. SPECIAL_0_OPCODE_Y0 = 1,
  1241. SPECIAL_0_OPCODE_Y1 = 1,
  1242. SPECIAL_1_OPCODE_Y0 = 2,
  1243. SPECIAL_1_OPCODE_Y1 = 2,
  1244. SPECIAL_2_OPCODE_Y0 = 3,
  1245. SPECIAL_2_OPCODE_Y1 = 3,
  1246. SPECIAL_3_OPCODE_Y0 = 4,
  1247. SPECIAL_3_OPCODE_Y1 = 4,
  1248. SPECIAL_4_OPCODE_Y0 = 5,
  1249. SPECIAL_4_OPCODE_Y1 = 5,
  1250. SPECIAL_5_OPCODE_Y0 = 6,
  1251. SPECIAL_5_OPCODE_Y1 = 6,
  1252. SPECIAL_6_OPCODE_Y0 = 7,
  1253. SPECIAL_7_OPCODE_Y0 = 8,
  1254. SRAB_SPECIAL_0_OPCODE_X0 = 88,
  1255. SRAB_SPECIAL_0_OPCODE_X1 = 58,
  1256. SRAH_SPECIAL_0_OPCODE_X0 = 89,
  1257. SRAH_SPECIAL_0_OPCODE_X1 = 59,
  1258. SRAIB_SHUN_0_OPCODE_X0 = 8,
  1259. SRAIB_SHUN_0_OPCODE_X1 = 8,
  1260. SRAIH_SHUN_0_OPCODE_X0 = 9,
  1261. SRAIH_SHUN_0_OPCODE_X1 = 9,
  1262. SRAI_SHUN_0_OPCODE_X0 = 10,
  1263. SRAI_SHUN_0_OPCODE_X1 = 10,
  1264. SRAI_SHUN_0_OPCODE_Y0 = 4,
  1265. SRAI_SHUN_0_OPCODE_Y1 = 4,
  1266. SRA_SPECIAL_0_OPCODE_X0 = 90,
  1267. SRA_SPECIAL_0_OPCODE_X1 = 60,
  1268. SRA_SPECIAL_3_OPCODE_Y0 = 3,
  1269. SRA_SPECIAL_3_OPCODE_Y1 = 3,
  1270. SUBBS_U_SPECIAL_0_OPCODE_X0 = 100,
  1271. SUBBS_U_SPECIAL_0_OPCODE_X1 = 70,
  1272. SUBB_SPECIAL_0_OPCODE_X0 = 91,
  1273. SUBB_SPECIAL_0_OPCODE_X1 = 61,
  1274. SUBHS_SPECIAL_0_OPCODE_X0 = 101,
  1275. SUBHS_SPECIAL_0_OPCODE_X1 = 71,
  1276. SUBH_SPECIAL_0_OPCODE_X0 = 92,
  1277. SUBH_SPECIAL_0_OPCODE_X1 = 62,
  1278. SUBS_SPECIAL_0_OPCODE_X0 = 97,
  1279. SUBS_SPECIAL_0_OPCODE_X1 = 67,
  1280. SUB_SPECIAL_0_OPCODE_X0 = 93,
  1281. SUB_SPECIAL_0_OPCODE_X1 = 63,
  1282. SUB_SPECIAL_0_OPCODE_Y0 = 3,
  1283. SUB_SPECIAL_0_OPCODE_Y1 = 3,
  1284. SWADD_IMM_0_OPCODE_X1 = 30,
  1285. SWINT0_UN_0_SHUN_0_OPCODE_X1 = 18,
  1286. SWINT1_UN_0_SHUN_0_OPCODE_X1 = 19,
  1287. SWINT2_UN_0_SHUN_0_OPCODE_X1 = 20,
  1288. SWINT3_UN_0_SHUN_0_OPCODE_X1 = 21,
  1289. SW_OPCODE_Y2 = 7,
  1290. SW_SPECIAL_0_OPCODE_X1 = 64,
  1291. TBLIDXB0_UN_0_SHUN_0_OPCODE_X0 = 8,
  1292. TBLIDXB0_UN_0_SHUN_0_OPCODE_Y0 = 8,
  1293. TBLIDXB1_UN_0_SHUN_0_OPCODE_X0 = 9,
  1294. TBLIDXB1_UN_0_SHUN_0_OPCODE_Y0 = 9,
  1295. TBLIDXB2_UN_0_SHUN_0_OPCODE_X0 = 10,
  1296. TBLIDXB2_UN_0_SHUN_0_OPCODE_Y0 = 10,
  1297. TBLIDXB3_UN_0_SHUN_0_OPCODE_X0 = 11,
  1298. TBLIDXB3_UN_0_SHUN_0_OPCODE_Y0 = 11,
  1299. TNS_UN_0_SHUN_0_OPCODE_X1 = 22,
  1300. UN_0_SHUN_0_OPCODE_X0 = 11,
  1301. UN_0_SHUN_0_OPCODE_X1 = 11,
  1302. UN_0_SHUN_0_OPCODE_Y0 = 5,
  1303. UN_0_SHUN_0_OPCODE_Y1 = 5,
  1304. WH64_UN_0_SHUN_0_OPCODE_X1 = 23,
  1305. XORI_IMM_0_OPCODE_X0 = 2,
  1306. XORI_IMM_0_OPCODE_X1 = 21,
  1307. XOR_SPECIAL_0_OPCODE_X0 = 94,
  1308. XOR_SPECIAL_0_OPCODE_X1 = 65,
  1309. XOR_SPECIAL_2_OPCODE_Y0 = 3,
  1310. XOR_SPECIAL_2_OPCODE_Y1 = 3
  1311. };
  1312. #endif /* __ASSEMBLER__ */
  1313. #endif /* __ARCH_OPCODE_H__ */