opcode_tilepro.h 37 KB

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