opcode_tilegx.h 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406
  1. /* TILE-Gx 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 OPCODE_TILEGX_H
  21. #define OPCODE_TILEGX_H
  22. #ifndef __ASSEMBLER__
  23. typedef uint64_t tilegx_bundle_bits;
  24. /* These are the bits that determine if a bundle is in the X encoding. */
  25. #define TILEGX_BUNDLE_MODE_MASK ((tilegx_bundle_bits)3 << 62)
  26. enum
  27. {
  28. /* Maximum number of instructions in a bundle (2 for X, 3 for Y). */
  29. TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE = 3,
  30. /* How many different pipeline encodings are there? X0, X1, Y0, Y1, Y2. */
  31. TILEGX_NUM_PIPELINE_ENCODINGS = 5,
  32. /* Log base 2 of TILEGX_BUNDLE_SIZE_IN_BYTES. */
  33. TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES = 3,
  34. /* Instructions take this many bytes. */
  35. TILEGX_BUNDLE_SIZE_IN_BYTES = 1 << TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES,
  36. /* Log base 2 of TILEGX_BUNDLE_ALIGNMENT_IN_BYTES. */
  37. TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES = 3,
  38. /* Bundles should be aligned modulo this number of bytes. */
  39. TILEGX_BUNDLE_ALIGNMENT_IN_BYTES =
  40. (1 << TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES),
  41. /* Number of registers (some are magic, such as network I/O). */
  42. TILEGX_NUM_REGISTERS = 64,
  43. };
  44. /* Make a few "tile_" variables to simplify common code between
  45. architectures. */
  46. typedef tilegx_bundle_bits tile_bundle_bits;
  47. #define TILE_BUNDLE_SIZE_IN_BYTES TILEGX_BUNDLE_SIZE_IN_BYTES
  48. #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES
  49. #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
  50. TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
  51. #define TILE_BPT_BUNDLE TILEGX_BPT_BUNDLE
  52. /* 64-bit pattern for a { bpt ; nop } bundle. */
  53. #define TILEGX_BPT_BUNDLE 0x286a44ae51485000ULL
  54. static inline unsigned int
  55. get_BFEnd_X0(tilegx_bundle_bits num)
  56. {
  57. const unsigned int n = (unsigned int)num;
  58. return (((n >> 12)) & 0x3f);
  59. }
  60. static inline unsigned int
  61. get_BFOpcodeExtension_X0(tilegx_bundle_bits num)
  62. {
  63. const unsigned int n = (unsigned int)num;
  64. return (((n >> 24)) & 0xf);
  65. }
  66. static inline unsigned int
  67. get_BFStart_X0(tilegx_bundle_bits num)
  68. {
  69. const unsigned int n = (unsigned int)num;
  70. return (((n >> 18)) & 0x3f);
  71. }
  72. static inline unsigned int
  73. get_BrOff_X1(tilegx_bundle_bits n)
  74. {
  75. return (((unsigned int)(n >> 31)) & 0x0000003f) |
  76. (((unsigned int)(n >> 37)) & 0x0001ffc0);
  77. }
  78. static inline unsigned int
  79. get_BrType_X1(tilegx_bundle_bits n)
  80. {
  81. return (((unsigned int)(n >> 54)) & 0x1f);
  82. }
  83. static inline unsigned int
  84. get_Dest_Imm8_X1(tilegx_bundle_bits n)
  85. {
  86. return (((unsigned int)(n >> 31)) & 0x0000003f) |
  87. (((unsigned int)(n >> 43)) & 0x000000c0);
  88. }
  89. static inline unsigned int
  90. get_Dest_X0(tilegx_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(tilegx_bundle_bits n)
  97. {
  98. return (((unsigned int)(n >> 31)) & 0x3f);
  99. }
  100. static inline unsigned int
  101. get_Dest_Y0(tilegx_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(tilegx_bundle_bits n)
  108. {
  109. return (((unsigned int)(n >> 31)) & 0x3f);
  110. }
  111. static inline unsigned int
  112. get_Imm16_X0(tilegx_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(tilegx_bundle_bits n)
  119. {
  120. return (((unsigned int)(n >> 43)) & 0xffff);
  121. }
  122. static inline unsigned int
  123. get_Imm8OpcodeExtension_X0(tilegx_bundle_bits num)
  124. {
  125. const unsigned int n = (unsigned int)num;
  126. return (((n >> 20)) & 0xff);
  127. }
  128. static inline unsigned int
  129. get_Imm8OpcodeExtension_X1(tilegx_bundle_bits n)
  130. {
  131. return (((unsigned int)(n >> 51)) & 0xff);
  132. }
  133. static inline unsigned int
  134. get_Imm8_X0(tilegx_bundle_bits num)
  135. {
  136. const unsigned int n = (unsigned int)num;
  137. return (((n >> 12)) & 0xff);
  138. }
  139. static inline unsigned int
  140. get_Imm8_X1(tilegx_bundle_bits n)
  141. {
  142. return (((unsigned int)(n >> 43)) & 0xff);
  143. }
  144. static inline unsigned int
  145. get_Imm8_Y0(tilegx_bundle_bits num)
  146. {
  147. const unsigned int n = (unsigned int)num;
  148. return (((n >> 12)) & 0xff);
  149. }
  150. static inline unsigned int
  151. get_Imm8_Y1(tilegx_bundle_bits n)
  152. {
  153. return (((unsigned int)(n >> 43)) & 0xff);
  154. }
  155. static inline unsigned int
  156. get_JumpOff_X1(tilegx_bundle_bits n)
  157. {
  158. return (((unsigned int)(n >> 31)) & 0x7ffffff);
  159. }
  160. static inline unsigned int
  161. get_JumpOpcodeExtension_X1(tilegx_bundle_bits n)
  162. {
  163. return (((unsigned int)(n >> 58)) & 0x1);
  164. }
  165. static inline unsigned int
  166. get_MF_Imm14_X1(tilegx_bundle_bits n)
  167. {
  168. return (((unsigned int)(n >> 37)) & 0x3fff);
  169. }
  170. static inline unsigned int
  171. get_MT_Imm14_X1(tilegx_bundle_bits n)
  172. {
  173. return (((unsigned int)(n >> 31)) & 0x0000003f) |
  174. (((unsigned int)(n >> 37)) & 0x00003fc0);
  175. }
  176. static inline unsigned int
  177. get_Mode(tilegx_bundle_bits n)
  178. {
  179. return (((unsigned int)(n >> 62)) & 0x3);
  180. }
  181. static inline unsigned int
  182. get_Opcode_X0(tilegx_bundle_bits num)
  183. {
  184. const unsigned int n = (unsigned int)num;
  185. return (((n >> 28)) & 0x7);
  186. }
  187. static inline unsigned int
  188. get_Opcode_X1(tilegx_bundle_bits n)
  189. {
  190. return (((unsigned int)(n >> 59)) & 0x7);
  191. }
  192. static inline unsigned int
  193. get_Opcode_Y0(tilegx_bundle_bits num)
  194. {
  195. const unsigned int n = (unsigned int)num;
  196. return (((n >> 27)) & 0xf);
  197. }
  198. static inline unsigned int
  199. get_Opcode_Y1(tilegx_bundle_bits n)
  200. {
  201. return (((unsigned int)(n >> 58)) & 0xf);
  202. }
  203. static inline unsigned int
  204. get_Opcode_Y2(tilegx_bundle_bits n)
  205. {
  206. return (((n >> 26)) & 0x00000001) |
  207. (((unsigned int)(n >> 56)) & 0x00000002);
  208. }
  209. static inline unsigned int
  210. get_RRROpcodeExtension_X0(tilegx_bundle_bits num)
  211. {
  212. const unsigned int n = (unsigned int)num;
  213. return (((n >> 18)) & 0x3ff);
  214. }
  215. static inline unsigned int
  216. get_RRROpcodeExtension_X1(tilegx_bundle_bits n)
  217. {
  218. return (((unsigned int)(n >> 49)) & 0x3ff);
  219. }
  220. static inline unsigned int
  221. get_RRROpcodeExtension_Y0(tilegx_bundle_bits num)
  222. {
  223. const unsigned int n = (unsigned int)num;
  224. return (((n >> 18)) & 0x3);
  225. }
  226. static inline unsigned int
  227. get_RRROpcodeExtension_Y1(tilegx_bundle_bits n)
  228. {
  229. return (((unsigned int)(n >> 49)) & 0x3);
  230. }
  231. static inline unsigned int
  232. get_ShAmt_X0(tilegx_bundle_bits num)
  233. {
  234. const unsigned int n = (unsigned int)num;
  235. return (((n >> 12)) & 0x3f);
  236. }
  237. static inline unsigned int
  238. get_ShAmt_X1(tilegx_bundle_bits n)
  239. {
  240. return (((unsigned int)(n >> 43)) & 0x3f);
  241. }
  242. static inline unsigned int
  243. get_ShAmt_Y0(tilegx_bundle_bits num)
  244. {
  245. const unsigned int n = (unsigned int)num;
  246. return (((n >> 12)) & 0x3f);
  247. }
  248. static inline unsigned int
  249. get_ShAmt_Y1(tilegx_bundle_bits n)
  250. {
  251. return (((unsigned int)(n >> 43)) & 0x3f);
  252. }
  253. static inline unsigned int
  254. get_ShiftOpcodeExtension_X0(tilegx_bundle_bits num)
  255. {
  256. const unsigned int n = (unsigned int)num;
  257. return (((n >> 18)) & 0x3ff);
  258. }
  259. static inline unsigned int
  260. get_ShiftOpcodeExtension_X1(tilegx_bundle_bits n)
  261. {
  262. return (((unsigned int)(n >> 49)) & 0x3ff);
  263. }
  264. static inline unsigned int
  265. get_ShiftOpcodeExtension_Y0(tilegx_bundle_bits num)
  266. {
  267. const unsigned int n = (unsigned int)num;
  268. return (((n >> 18)) & 0x3);
  269. }
  270. static inline unsigned int
  271. get_ShiftOpcodeExtension_Y1(tilegx_bundle_bits n)
  272. {
  273. return (((unsigned int)(n >> 49)) & 0x3);
  274. }
  275. static inline unsigned int
  276. get_SrcA_X0(tilegx_bundle_bits num)
  277. {
  278. const unsigned int n = (unsigned int)num;
  279. return (((n >> 6)) & 0x3f);
  280. }
  281. static inline unsigned int
  282. get_SrcA_X1(tilegx_bundle_bits n)
  283. {
  284. return (((unsigned int)(n >> 37)) & 0x3f);
  285. }
  286. static inline unsigned int
  287. get_SrcA_Y0(tilegx_bundle_bits num)
  288. {
  289. const unsigned int n = (unsigned int)num;
  290. return (((n >> 6)) & 0x3f);
  291. }
  292. static inline unsigned int
  293. get_SrcA_Y1(tilegx_bundle_bits n)
  294. {
  295. return (((unsigned int)(n >> 37)) & 0x3f);
  296. }
  297. static inline unsigned int
  298. get_SrcA_Y2(tilegx_bundle_bits num)
  299. {
  300. const unsigned int n = (unsigned int)num;
  301. return (((n >> 20)) & 0x3f);
  302. }
  303. static inline unsigned int
  304. get_SrcBDest_Y2(tilegx_bundle_bits n)
  305. {
  306. return (((unsigned int)(n >> 51)) & 0x3f);
  307. }
  308. static inline unsigned int
  309. get_SrcB_X0(tilegx_bundle_bits num)
  310. {
  311. const unsigned int n = (unsigned int)num;
  312. return (((n >> 12)) & 0x3f);
  313. }
  314. static inline unsigned int
  315. get_SrcB_X1(tilegx_bundle_bits n)
  316. {
  317. return (((unsigned int)(n >> 43)) & 0x3f);
  318. }
  319. static inline unsigned int
  320. get_SrcB_Y0(tilegx_bundle_bits num)
  321. {
  322. const unsigned int n = (unsigned int)num;
  323. return (((n >> 12)) & 0x3f);
  324. }
  325. static inline unsigned int
  326. get_SrcB_Y1(tilegx_bundle_bits n)
  327. {
  328. return (((unsigned int)(n >> 43)) & 0x3f);
  329. }
  330. static inline unsigned int
  331. get_UnaryOpcodeExtension_X0(tilegx_bundle_bits num)
  332. {
  333. const unsigned int n = (unsigned int)num;
  334. return (((n >> 12)) & 0x3f);
  335. }
  336. static inline unsigned int
  337. get_UnaryOpcodeExtension_X1(tilegx_bundle_bits n)
  338. {
  339. return (((unsigned int)(n >> 43)) & 0x3f);
  340. }
  341. static inline unsigned int
  342. get_UnaryOpcodeExtension_Y0(tilegx_bundle_bits num)
  343. {
  344. const unsigned int n = (unsigned int)num;
  345. return (((n >> 12)) & 0x3f);
  346. }
  347. static inline unsigned int
  348. get_UnaryOpcodeExtension_Y1(tilegx_bundle_bits n)
  349. {
  350. return (((unsigned int)(n >> 43)) & 0x3f);
  351. }
  352. static inline int
  353. sign_extend(int n, int num_bits)
  354. {
  355. int shift = (int)(sizeof(int) * 8 - num_bits);
  356. return (n << shift) >> shift;
  357. }
  358. static inline tilegx_bundle_bits
  359. create_BFEnd_X0(int num)
  360. {
  361. const unsigned int n = (unsigned int)num;
  362. return ((n & 0x3f) << 12);
  363. }
  364. static inline tilegx_bundle_bits
  365. create_BFOpcodeExtension_X0(int num)
  366. {
  367. const unsigned int n = (unsigned int)num;
  368. return ((n & 0xf) << 24);
  369. }
  370. static inline tilegx_bundle_bits
  371. create_BFStart_X0(int num)
  372. {
  373. const unsigned int n = (unsigned int)num;
  374. return ((n & 0x3f) << 18);
  375. }
  376. static inline tilegx_bundle_bits
  377. create_BrOff_X1(int num)
  378. {
  379. const unsigned int n = (unsigned int)num;
  380. return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) |
  381. (((tilegx_bundle_bits)(n & 0x0001ffc0)) << 37);
  382. }
  383. static inline tilegx_bundle_bits
  384. create_BrType_X1(int num)
  385. {
  386. const unsigned int n = (unsigned int)num;
  387. return (((tilegx_bundle_bits)(n & 0x1f)) << 54);
  388. }
  389. static inline tilegx_bundle_bits
  390. create_Dest_Imm8_X1(int num)
  391. {
  392. const unsigned int n = (unsigned int)num;
  393. return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) |
  394. (((tilegx_bundle_bits)(n & 0x000000c0)) << 43);
  395. }
  396. static inline tilegx_bundle_bits
  397. create_Dest_X0(int num)
  398. {
  399. const unsigned int n = (unsigned int)num;
  400. return ((n & 0x3f) << 0);
  401. }
  402. static inline tilegx_bundle_bits
  403. create_Dest_X1(int num)
  404. {
  405. const unsigned int n = (unsigned int)num;
  406. return (((tilegx_bundle_bits)(n & 0x3f)) << 31);
  407. }
  408. static inline tilegx_bundle_bits
  409. create_Dest_Y0(int num)
  410. {
  411. const unsigned int n = (unsigned int)num;
  412. return ((n & 0x3f) << 0);
  413. }
  414. static inline tilegx_bundle_bits
  415. create_Dest_Y1(int num)
  416. {
  417. const unsigned int n = (unsigned int)num;
  418. return (((tilegx_bundle_bits)(n & 0x3f)) << 31);
  419. }
  420. static inline tilegx_bundle_bits
  421. create_Imm16_X0(int num)
  422. {
  423. const unsigned int n = (unsigned int)num;
  424. return ((n & 0xffff) << 12);
  425. }
  426. static inline tilegx_bundle_bits
  427. create_Imm16_X1(int num)
  428. {
  429. const unsigned int n = (unsigned int)num;
  430. return (((tilegx_bundle_bits)(n & 0xffff)) << 43);
  431. }
  432. static inline tilegx_bundle_bits
  433. create_Imm8OpcodeExtension_X0(int num)
  434. {
  435. const unsigned int n = (unsigned int)num;
  436. return ((n & 0xff) << 20);
  437. }
  438. static inline tilegx_bundle_bits
  439. create_Imm8OpcodeExtension_X1(int num)
  440. {
  441. const unsigned int n = (unsigned int)num;
  442. return (((tilegx_bundle_bits)(n & 0xff)) << 51);
  443. }
  444. static inline tilegx_bundle_bits
  445. create_Imm8_X0(int num)
  446. {
  447. const unsigned int n = (unsigned int)num;
  448. return ((n & 0xff) << 12);
  449. }
  450. static inline tilegx_bundle_bits
  451. create_Imm8_X1(int num)
  452. {
  453. const unsigned int n = (unsigned int)num;
  454. return (((tilegx_bundle_bits)(n & 0xff)) << 43);
  455. }
  456. static inline tilegx_bundle_bits
  457. create_Imm8_Y0(int num)
  458. {
  459. const unsigned int n = (unsigned int)num;
  460. return ((n & 0xff) << 12);
  461. }
  462. static inline tilegx_bundle_bits
  463. create_Imm8_Y1(int num)
  464. {
  465. const unsigned int n = (unsigned int)num;
  466. return (((tilegx_bundle_bits)(n & 0xff)) << 43);
  467. }
  468. static inline tilegx_bundle_bits
  469. create_JumpOff_X1(int num)
  470. {
  471. const unsigned int n = (unsigned int)num;
  472. return (((tilegx_bundle_bits)(n & 0x7ffffff)) << 31);
  473. }
  474. static inline tilegx_bundle_bits
  475. create_JumpOpcodeExtension_X1(int num)
  476. {
  477. const unsigned int n = (unsigned int)num;
  478. return (((tilegx_bundle_bits)(n & 0x1)) << 58);
  479. }
  480. static inline tilegx_bundle_bits
  481. create_MF_Imm14_X1(int num)
  482. {
  483. const unsigned int n = (unsigned int)num;
  484. return (((tilegx_bundle_bits)(n & 0x3fff)) << 37);
  485. }
  486. static inline tilegx_bundle_bits
  487. create_MT_Imm14_X1(int num)
  488. {
  489. const unsigned int n = (unsigned int)num;
  490. return (((tilegx_bundle_bits)(n & 0x0000003f)) << 31) |
  491. (((tilegx_bundle_bits)(n & 0x00003fc0)) << 37);
  492. }
  493. static inline tilegx_bundle_bits
  494. create_Mode(int num)
  495. {
  496. const unsigned int n = (unsigned int)num;
  497. return (((tilegx_bundle_bits)(n & 0x3)) << 62);
  498. }
  499. static inline tilegx_bundle_bits
  500. create_Opcode_X0(int num)
  501. {
  502. const unsigned int n = (unsigned int)num;
  503. return ((n & 0x7) << 28);
  504. }
  505. static inline tilegx_bundle_bits
  506. create_Opcode_X1(int num)
  507. {
  508. const unsigned int n = (unsigned int)num;
  509. return (((tilegx_bundle_bits)(n & 0x7)) << 59);
  510. }
  511. static inline tilegx_bundle_bits
  512. create_Opcode_Y0(int num)
  513. {
  514. const unsigned int n = (unsigned int)num;
  515. return ((n & 0xf) << 27);
  516. }
  517. static inline tilegx_bundle_bits
  518. create_Opcode_Y1(int num)
  519. {
  520. const unsigned int n = (unsigned int)num;
  521. return (((tilegx_bundle_bits)(n & 0xf)) << 58);
  522. }
  523. static inline tilegx_bundle_bits
  524. create_Opcode_Y2(int num)
  525. {
  526. const unsigned int n = (unsigned int)num;
  527. return ((n & 0x00000001) << 26) |
  528. (((tilegx_bundle_bits)(n & 0x00000002)) << 56);
  529. }
  530. static inline tilegx_bundle_bits
  531. create_RRROpcodeExtension_X0(int num)
  532. {
  533. const unsigned int n = (unsigned int)num;
  534. return ((n & 0x3ff) << 18);
  535. }
  536. static inline tilegx_bundle_bits
  537. create_RRROpcodeExtension_X1(int num)
  538. {
  539. const unsigned int n = (unsigned int)num;
  540. return (((tilegx_bundle_bits)(n & 0x3ff)) << 49);
  541. }
  542. static inline tilegx_bundle_bits
  543. create_RRROpcodeExtension_Y0(int num)
  544. {
  545. const unsigned int n = (unsigned int)num;
  546. return ((n & 0x3) << 18);
  547. }
  548. static inline tilegx_bundle_bits
  549. create_RRROpcodeExtension_Y1(int num)
  550. {
  551. const unsigned int n = (unsigned int)num;
  552. return (((tilegx_bundle_bits)(n & 0x3)) << 49);
  553. }
  554. static inline tilegx_bundle_bits
  555. create_ShAmt_X0(int num)
  556. {
  557. const unsigned int n = (unsigned int)num;
  558. return ((n & 0x3f) << 12);
  559. }
  560. static inline tilegx_bundle_bits
  561. create_ShAmt_X1(int num)
  562. {
  563. const unsigned int n = (unsigned int)num;
  564. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  565. }
  566. static inline tilegx_bundle_bits
  567. create_ShAmt_Y0(int num)
  568. {
  569. const unsigned int n = (unsigned int)num;
  570. return ((n & 0x3f) << 12);
  571. }
  572. static inline tilegx_bundle_bits
  573. create_ShAmt_Y1(int num)
  574. {
  575. const unsigned int n = (unsigned int)num;
  576. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  577. }
  578. static inline tilegx_bundle_bits
  579. create_ShiftOpcodeExtension_X0(int num)
  580. {
  581. const unsigned int n = (unsigned int)num;
  582. return ((n & 0x3ff) << 18);
  583. }
  584. static inline tilegx_bundle_bits
  585. create_ShiftOpcodeExtension_X1(int num)
  586. {
  587. const unsigned int n = (unsigned int)num;
  588. return (((tilegx_bundle_bits)(n & 0x3ff)) << 49);
  589. }
  590. static inline tilegx_bundle_bits
  591. create_ShiftOpcodeExtension_Y0(int num)
  592. {
  593. const unsigned int n = (unsigned int)num;
  594. return ((n & 0x3) << 18);
  595. }
  596. static inline tilegx_bundle_bits
  597. create_ShiftOpcodeExtension_Y1(int num)
  598. {
  599. const unsigned int n = (unsigned int)num;
  600. return (((tilegx_bundle_bits)(n & 0x3)) << 49);
  601. }
  602. static inline tilegx_bundle_bits
  603. create_SrcA_X0(int num)
  604. {
  605. const unsigned int n = (unsigned int)num;
  606. return ((n & 0x3f) << 6);
  607. }
  608. static inline tilegx_bundle_bits
  609. create_SrcA_X1(int num)
  610. {
  611. const unsigned int n = (unsigned int)num;
  612. return (((tilegx_bundle_bits)(n & 0x3f)) << 37);
  613. }
  614. static inline tilegx_bundle_bits
  615. create_SrcA_Y0(int num)
  616. {
  617. const unsigned int n = (unsigned int)num;
  618. return ((n & 0x3f) << 6);
  619. }
  620. static inline tilegx_bundle_bits
  621. create_SrcA_Y1(int num)
  622. {
  623. const unsigned int n = (unsigned int)num;
  624. return (((tilegx_bundle_bits)(n & 0x3f)) << 37);
  625. }
  626. static inline tilegx_bundle_bits
  627. create_SrcA_Y2(int num)
  628. {
  629. const unsigned int n = (unsigned int)num;
  630. return ((n & 0x3f) << 20);
  631. }
  632. static inline tilegx_bundle_bits
  633. create_SrcBDest_Y2(int num)
  634. {
  635. const unsigned int n = (unsigned int)num;
  636. return (((tilegx_bundle_bits)(n & 0x3f)) << 51);
  637. }
  638. static inline tilegx_bundle_bits
  639. create_SrcB_X0(int num)
  640. {
  641. const unsigned int n = (unsigned int)num;
  642. return ((n & 0x3f) << 12);
  643. }
  644. static inline tilegx_bundle_bits
  645. create_SrcB_X1(int num)
  646. {
  647. const unsigned int n = (unsigned int)num;
  648. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  649. }
  650. static inline tilegx_bundle_bits
  651. create_SrcB_Y0(int num)
  652. {
  653. const unsigned int n = (unsigned int)num;
  654. return ((n & 0x3f) << 12);
  655. }
  656. static inline tilegx_bundle_bits
  657. create_SrcB_Y1(int num)
  658. {
  659. const unsigned int n = (unsigned int)num;
  660. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  661. }
  662. static inline tilegx_bundle_bits
  663. create_UnaryOpcodeExtension_X0(int num)
  664. {
  665. const unsigned int n = (unsigned int)num;
  666. return ((n & 0x3f) << 12);
  667. }
  668. static inline tilegx_bundle_bits
  669. create_UnaryOpcodeExtension_X1(int num)
  670. {
  671. const unsigned int n = (unsigned int)num;
  672. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  673. }
  674. static inline tilegx_bundle_bits
  675. create_UnaryOpcodeExtension_Y0(int num)
  676. {
  677. const unsigned int n = (unsigned int)num;
  678. return ((n & 0x3f) << 12);
  679. }
  680. static inline tilegx_bundle_bits
  681. create_UnaryOpcodeExtension_Y1(int num)
  682. {
  683. const unsigned int n = (unsigned int)num;
  684. return (((tilegx_bundle_bits)(n & 0x3f)) << 43);
  685. }
  686. enum
  687. {
  688. ADDI_IMM8_OPCODE_X0 = 1,
  689. ADDI_IMM8_OPCODE_X1 = 1,
  690. ADDI_OPCODE_Y0 = 0,
  691. ADDI_OPCODE_Y1 = 1,
  692. ADDLI_OPCODE_X0 = 1,
  693. ADDLI_OPCODE_X1 = 0,
  694. ADDXI_IMM8_OPCODE_X0 = 2,
  695. ADDXI_IMM8_OPCODE_X1 = 2,
  696. ADDXI_OPCODE_Y0 = 1,
  697. ADDXI_OPCODE_Y1 = 2,
  698. ADDXLI_OPCODE_X0 = 2,
  699. ADDXLI_OPCODE_X1 = 1,
  700. ADDXSC_RRR_0_OPCODE_X0 = 1,
  701. ADDXSC_RRR_0_OPCODE_X1 = 1,
  702. ADDX_RRR_0_OPCODE_X0 = 2,
  703. ADDX_RRR_0_OPCODE_X1 = 2,
  704. ADDX_RRR_0_OPCODE_Y0 = 0,
  705. ADDX_RRR_0_OPCODE_Y1 = 0,
  706. ADD_RRR_0_OPCODE_X0 = 3,
  707. ADD_RRR_0_OPCODE_X1 = 3,
  708. ADD_RRR_0_OPCODE_Y0 = 1,
  709. ADD_RRR_0_OPCODE_Y1 = 1,
  710. ANDI_IMM8_OPCODE_X0 = 3,
  711. ANDI_IMM8_OPCODE_X1 = 3,
  712. ANDI_OPCODE_Y0 = 2,
  713. ANDI_OPCODE_Y1 = 3,
  714. AND_RRR_0_OPCODE_X0 = 4,
  715. AND_RRR_0_OPCODE_X1 = 4,
  716. AND_RRR_5_OPCODE_Y0 = 0,
  717. AND_RRR_5_OPCODE_Y1 = 0,
  718. BEQZT_BRANCH_OPCODE_X1 = 16,
  719. BEQZ_BRANCH_OPCODE_X1 = 17,
  720. BFEXTS_BF_OPCODE_X0 = 4,
  721. BFEXTU_BF_OPCODE_X0 = 5,
  722. BFINS_BF_OPCODE_X0 = 6,
  723. BF_OPCODE_X0 = 3,
  724. BGEZT_BRANCH_OPCODE_X1 = 18,
  725. BGEZ_BRANCH_OPCODE_X1 = 19,
  726. BGTZT_BRANCH_OPCODE_X1 = 20,
  727. BGTZ_BRANCH_OPCODE_X1 = 21,
  728. BLBCT_BRANCH_OPCODE_X1 = 22,
  729. BLBC_BRANCH_OPCODE_X1 = 23,
  730. BLBST_BRANCH_OPCODE_X1 = 24,
  731. BLBS_BRANCH_OPCODE_X1 = 25,
  732. BLEZT_BRANCH_OPCODE_X1 = 26,
  733. BLEZ_BRANCH_OPCODE_X1 = 27,
  734. BLTZT_BRANCH_OPCODE_X1 = 28,
  735. BLTZ_BRANCH_OPCODE_X1 = 29,
  736. BNEZT_BRANCH_OPCODE_X1 = 30,
  737. BNEZ_BRANCH_OPCODE_X1 = 31,
  738. BRANCH_OPCODE_X1 = 2,
  739. CMOVEQZ_RRR_0_OPCODE_X0 = 5,
  740. CMOVEQZ_RRR_4_OPCODE_Y0 = 0,
  741. CMOVNEZ_RRR_0_OPCODE_X0 = 6,
  742. CMOVNEZ_RRR_4_OPCODE_Y0 = 1,
  743. CMPEQI_IMM8_OPCODE_X0 = 4,
  744. CMPEQI_IMM8_OPCODE_X1 = 4,
  745. CMPEQI_OPCODE_Y0 = 3,
  746. CMPEQI_OPCODE_Y1 = 4,
  747. CMPEQ_RRR_0_OPCODE_X0 = 7,
  748. CMPEQ_RRR_0_OPCODE_X1 = 5,
  749. CMPEQ_RRR_3_OPCODE_Y0 = 0,
  750. CMPEQ_RRR_3_OPCODE_Y1 = 2,
  751. CMPEXCH4_RRR_0_OPCODE_X1 = 6,
  752. CMPEXCH_RRR_0_OPCODE_X1 = 7,
  753. CMPLES_RRR_0_OPCODE_X0 = 8,
  754. CMPLES_RRR_0_OPCODE_X1 = 8,
  755. CMPLES_RRR_2_OPCODE_Y0 = 0,
  756. CMPLES_RRR_2_OPCODE_Y1 = 0,
  757. CMPLEU_RRR_0_OPCODE_X0 = 9,
  758. CMPLEU_RRR_0_OPCODE_X1 = 9,
  759. CMPLEU_RRR_2_OPCODE_Y0 = 1,
  760. CMPLEU_RRR_2_OPCODE_Y1 = 1,
  761. CMPLTSI_IMM8_OPCODE_X0 = 5,
  762. CMPLTSI_IMM8_OPCODE_X1 = 5,
  763. CMPLTSI_OPCODE_Y0 = 4,
  764. CMPLTSI_OPCODE_Y1 = 5,
  765. CMPLTS_RRR_0_OPCODE_X0 = 10,
  766. CMPLTS_RRR_0_OPCODE_X1 = 10,
  767. CMPLTS_RRR_2_OPCODE_Y0 = 2,
  768. CMPLTS_RRR_2_OPCODE_Y1 = 2,
  769. CMPLTUI_IMM8_OPCODE_X0 = 6,
  770. CMPLTUI_IMM8_OPCODE_X1 = 6,
  771. CMPLTU_RRR_0_OPCODE_X0 = 11,
  772. CMPLTU_RRR_0_OPCODE_X1 = 11,
  773. CMPLTU_RRR_2_OPCODE_Y0 = 3,
  774. CMPLTU_RRR_2_OPCODE_Y1 = 3,
  775. CMPNE_RRR_0_OPCODE_X0 = 12,
  776. CMPNE_RRR_0_OPCODE_X1 = 12,
  777. CMPNE_RRR_3_OPCODE_Y0 = 1,
  778. CMPNE_RRR_3_OPCODE_Y1 = 3,
  779. CMULAF_RRR_0_OPCODE_X0 = 13,
  780. CMULA_RRR_0_OPCODE_X0 = 14,
  781. CMULFR_RRR_0_OPCODE_X0 = 15,
  782. CMULF_RRR_0_OPCODE_X0 = 16,
  783. CMULHR_RRR_0_OPCODE_X0 = 17,
  784. CMULH_RRR_0_OPCODE_X0 = 18,
  785. CMUL_RRR_0_OPCODE_X0 = 19,
  786. CNTLZ_UNARY_OPCODE_X0 = 1,
  787. CNTLZ_UNARY_OPCODE_Y0 = 1,
  788. CNTTZ_UNARY_OPCODE_X0 = 2,
  789. CNTTZ_UNARY_OPCODE_Y0 = 2,
  790. CRC32_32_RRR_0_OPCODE_X0 = 20,
  791. CRC32_8_RRR_0_OPCODE_X0 = 21,
  792. DBLALIGN2_RRR_0_OPCODE_X0 = 22,
  793. DBLALIGN2_RRR_0_OPCODE_X1 = 13,
  794. DBLALIGN4_RRR_0_OPCODE_X0 = 23,
  795. DBLALIGN4_RRR_0_OPCODE_X1 = 14,
  796. DBLALIGN6_RRR_0_OPCODE_X0 = 24,
  797. DBLALIGN6_RRR_0_OPCODE_X1 = 15,
  798. DBLALIGN_RRR_0_OPCODE_X0 = 25,
  799. DRAIN_UNARY_OPCODE_X1 = 1,
  800. DTLBPR_UNARY_OPCODE_X1 = 2,
  801. EXCH4_RRR_0_OPCODE_X1 = 16,
  802. EXCH_RRR_0_OPCODE_X1 = 17,
  803. FDOUBLE_ADDSUB_RRR_0_OPCODE_X0 = 26,
  804. FDOUBLE_ADD_FLAGS_RRR_0_OPCODE_X0 = 27,
  805. FDOUBLE_MUL_FLAGS_RRR_0_OPCODE_X0 = 28,
  806. FDOUBLE_PACK1_RRR_0_OPCODE_X0 = 29,
  807. FDOUBLE_PACK2_RRR_0_OPCODE_X0 = 30,
  808. FDOUBLE_SUB_FLAGS_RRR_0_OPCODE_X0 = 31,
  809. FDOUBLE_UNPACK_MAX_RRR_0_OPCODE_X0 = 32,
  810. FDOUBLE_UNPACK_MIN_RRR_0_OPCODE_X0 = 33,
  811. FETCHADD4_RRR_0_OPCODE_X1 = 18,
  812. FETCHADDGEZ4_RRR_0_OPCODE_X1 = 19,
  813. FETCHADDGEZ_RRR_0_OPCODE_X1 = 20,
  814. FETCHADD_RRR_0_OPCODE_X1 = 21,
  815. FETCHAND4_RRR_0_OPCODE_X1 = 22,
  816. FETCHAND_RRR_0_OPCODE_X1 = 23,
  817. FETCHOR4_RRR_0_OPCODE_X1 = 24,
  818. FETCHOR_RRR_0_OPCODE_X1 = 25,
  819. FINV_UNARY_OPCODE_X1 = 3,
  820. FLUSHWB_UNARY_OPCODE_X1 = 4,
  821. FLUSH_UNARY_OPCODE_X1 = 5,
  822. FNOP_UNARY_OPCODE_X0 = 3,
  823. FNOP_UNARY_OPCODE_X1 = 6,
  824. FNOP_UNARY_OPCODE_Y0 = 3,
  825. FNOP_UNARY_OPCODE_Y1 = 8,
  826. FSINGLE_ADD1_RRR_0_OPCODE_X0 = 34,
  827. FSINGLE_ADDSUB2_RRR_0_OPCODE_X0 = 35,
  828. FSINGLE_MUL1_RRR_0_OPCODE_X0 = 36,
  829. FSINGLE_MUL2_RRR_0_OPCODE_X0 = 37,
  830. FSINGLE_PACK1_UNARY_OPCODE_X0 = 4,
  831. FSINGLE_PACK1_UNARY_OPCODE_Y0 = 4,
  832. FSINGLE_PACK2_RRR_0_OPCODE_X0 = 38,
  833. FSINGLE_SUB1_RRR_0_OPCODE_X0 = 39,
  834. ICOH_UNARY_OPCODE_X1 = 7,
  835. ILL_UNARY_OPCODE_X1 = 8,
  836. ILL_UNARY_OPCODE_Y1 = 9,
  837. IMM8_OPCODE_X0 = 4,
  838. IMM8_OPCODE_X1 = 3,
  839. INV_UNARY_OPCODE_X1 = 9,
  840. IRET_UNARY_OPCODE_X1 = 10,
  841. JALRP_UNARY_OPCODE_X1 = 11,
  842. JALRP_UNARY_OPCODE_Y1 = 10,
  843. JALR_UNARY_OPCODE_X1 = 12,
  844. JALR_UNARY_OPCODE_Y1 = 11,
  845. JAL_JUMP_OPCODE_X1 = 0,
  846. JRP_UNARY_OPCODE_X1 = 13,
  847. JRP_UNARY_OPCODE_Y1 = 12,
  848. JR_UNARY_OPCODE_X1 = 14,
  849. JR_UNARY_OPCODE_Y1 = 13,
  850. JUMP_OPCODE_X1 = 4,
  851. J_JUMP_OPCODE_X1 = 1,
  852. LD1S_ADD_IMM8_OPCODE_X1 = 7,
  853. LD1S_OPCODE_Y2 = 0,
  854. LD1S_UNARY_OPCODE_X1 = 15,
  855. LD1U_ADD_IMM8_OPCODE_X1 = 8,
  856. LD1U_OPCODE_Y2 = 1,
  857. LD1U_UNARY_OPCODE_X1 = 16,
  858. LD2S_ADD_IMM8_OPCODE_X1 = 9,
  859. LD2S_OPCODE_Y2 = 2,
  860. LD2S_UNARY_OPCODE_X1 = 17,
  861. LD2U_ADD_IMM8_OPCODE_X1 = 10,
  862. LD2U_OPCODE_Y2 = 3,
  863. LD2U_UNARY_OPCODE_X1 = 18,
  864. LD4S_ADD_IMM8_OPCODE_X1 = 11,
  865. LD4S_OPCODE_Y2 = 1,
  866. LD4S_UNARY_OPCODE_X1 = 19,
  867. LD4U_ADD_IMM8_OPCODE_X1 = 12,
  868. LD4U_OPCODE_Y2 = 2,
  869. LD4U_UNARY_OPCODE_X1 = 20,
  870. LDNA_UNARY_OPCODE_X1 = 21,
  871. LDNT1S_ADD_IMM8_OPCODE_X1 = 13,
  872. LDNT1S_UNARY_OPCODE_X1 = 22,
  873. LDNT1U_ADD_IMM8_OPCODE_X1 = 14,
  874. LDNT1U_UNARY_OPCODE_X1 = 23,
  875. LDNT2S_ADD_IMM8_OPCODE_X1 = 15,
  876. LDNT2S_UNARY_OPCODE_X1 = 24,
  877. LDNT2U_ADD_IMM8_OPCODE_X1 = 16,
  878. LDNT2U_UNARY_OPCODE_X1 = 25,
  879. LDNT4S_ADD_IMM8_OPCODE_X1 = 17,
  880. LDNT4S_UNARY_OPCODE_X1 = 26,
  881. LDNT4U_ADD_IMM8_OPCODE_X1 = 18,
  882. LDNT4U_UNARY_OPCODE_X1 = 27,
  883. LDNT_ADD_IMM8_OPCODE_X1 = 19,
  884. LDNT_UNARY_OPCODE_X1 = 28,
  885. LD_ADD_IMM8_OPCODE_X1 = 20,
  886. LD_OPCODE_Y2 = 3,
  887. LD_UNARY_OPCODE_X1 = 29,
  888. LNK_UNARY_OPCODE_X1 = 30,
  889. LNK_UNARY_OPCODE_Y1 = 14,
  890. LDNA_ADD_IMM8_OPCODE_X1 = 21,
  891. MFSPR_IMM8_OPCODE_X1 = 22,
  892. MF_UNARY_OPCODE_X1 = 31,
  893. MM_BF_OPCODE_X0 = 7,
  894. MNZ_RRR_0_OPCODE_X0 = 40,
  895. MNZ_RRR_0_OPCODE_X1 = 26,
  896. MNZ_RRR_4_OPCODE_Y0 = 2,
  897. MNZ_RRR_4_OPCODE_Y1 = 2,
  898. MODE_OPCODE_YA2 = 1,
  899. MODE_OPCODE_YB2 = 2,
  900. MODE_OPCODE_YC2 = 3,
  901. MTSPR_IMM8_OPCODE_X1 = 23,
  902. MULAX_RRR_0_OPCODE_X0 = 41,
  903. MULAX_RRR_3_OPCODE_Y0 = 2,
  904. MULA_HS_HS_RRR_0_OPCODE_X0 = 42,
  905. MULA_HS_HS_RRR_9_OPCODE_Y0 = 0,
  906. MULA_HS_HU_RRR_0_OPCODE_X0 = 43,
  907. MULA_HS_LS_RRR_0_OPCODE_X0 = 44,
  908. MULA_HS_LU_RRR_0_OPCODE_X0 = 45,
  909. MULA_HU_HU_RRR_0_OPCODE_X0 = 46,
  910. MULA_HU_HU_RRR_9_OPCODE_Y0 = 1,
  911. MULA_HU_LS_RRR_0_OPCODE_X0 = 47,
  912. MULA_HU_LU_RRR_0_OPCODE_X0 = 48,
  913. MULA_LS_LS_RRR_0_OPCODE_X0 = 49,
  914. MULA_LS_LS_RRR_9_OPCODE_Y0 = 2,
  915. MULA_LS_LU_RRR_0_OPCODE_X0 = 50,
  916. MULA_LU_LU_RRR_0_OPCODE_X0 = 51,
  917. MULA_LU_LU_RRR_9_OPCODE_Y0 = 3,
  918. MULX_RRR_0_OPCODE_X0 = 52,
  919. MULX_RRR_3_OPCODE_Y0 = 3,
  920. MUL_HS_HS_RRR_0_OPCODE_X0 = 53,
  921. MUL_HS_HS_RRR_8_OPCODE_Y0 = 0,
  922. MUL_HS_HU_RRR_0_OPCODE_X0 = 54,
  923. MUL_HS_LS_RRR_0_OPCODE_X0 = 55,
  924. MUL_HS_LU_RRR_0_OPCODE_X0 = 56,
  925. MUL_HU_HU_RRR_0_OPCODE_X0 = 57,
  926. MUL_HU_HU_RRR_8_OPCODE_Y0 = 1,
  927. MUL_HU_LS_RRR_0_OPCODE_X0 = 58,
  928. MUL_HU_LU_RRR_0_OPCODE_X0 = 59,
  929. MUL_LS_LS_RRR_0_OPCODE_X0 = 60,
  930. MUL_LS_LS_RRR_8_OPCODE_Y0 = 2,
  931. MUL_LS_LU_RRR_0_OPCODE_X0 = 61,
  932. MUL_LU_LU_RRR_0_OPCODE_X0 = 62,
  933. MUL_LU_LU_RRR_8_OPCODE_Y0 = 3,
  934. MZ_RRR_0_OPCODE_X0 = 63,
  935. MZ_RRR_0_OPCODE_X1 = 27,
  936. MZ_RRR_4_OPCODE_Y0 = 3,
  937. MZ_RRR_4_OPCODE_Y1 = 3,
  938. NAP_UNARY_OPCODE_X1 = 32,
  939. NOP_UNARY_OPCODE_X0 = 5,
  940. NOP_UNARY_OPCODE_X1 = 33,
  941. NOP_UNARY_OPCODE_Y0 = 5,
  942. NOP_UNARY_OPCODE_Y1 = 15,
  943. NOR_RRR_0_OPCODE_X0 = 64,
  944. NOR_RRR_0_OPCODE_X1 = 28,
  945. NOR_RRR_5_OPCODE_Y0 = 1,
  946. NOR_RRR_5_OPCODE_Y1 = 1,
  947. ORI_IMM8_OPCODE_X0 = 7,
  948. ORI_IMM8_OPCODE_X1 = 24,
  949. OR_RRR_0_OPCODE_X0 = 65,
  950. OR_RRR_0_OPCODE_X1 = 29,
  951. OR_RRR_5_OPCODE_Y0 = 2,
  952. OR_RRR_5_OPCODE_Y1 = 2,
  953. PCNT_UNARY_OPCODE_X0 = 6,
  954. PCNT_UNARY_OPCODE_Y0 = 6,
  955. REVBITS_UNARY_OPCODE_X0 = 7,
  956. REVBITS_UNARY_OPCODE_Y0 = 7,
  957. REVBYTES_UNARY_OPCODE_X0 = 8,
  958. REVBYTES_UNARY_OPCODE_Y0 = 8,
  959. ROTLI_SHIFT_OPCODE_X0 = 1,
  960. ROTLI_SHIFT_OPCODE_X1 = 1,
  961. ROTLI_SHIFT_OPCODE_Y0 = 0,
  962. ROTLI_SHIFT_OPCODE_Y1 = 0,
  963. ROTL_RRR_0_OPCODE_X0 = 66,
  964. ROTL_RRR_0_OPCODE_X1 = 30,
  965. ROTL_RRR_6_OPCODE_Y0 = 0,
  966. ROTL_RRR_6_OPCODE_Y1 = 0,
  967. RRR_0_OPCODE_X0 = 5,
  968. RRR_0_OPCODE_X1 = 5,
  969. RRR_0_OPCODE_Y0 = 5,
  970. RRR_0_OPCODE_Y1 = 6,
  971. RRR_1_OPCODE_Y0 = 6,
  972. RRR_1_OPCODE_Y1 = 7,
  973. RRR_2_OPCODE_Y0 = 7,
  974. RRR_2_OPCODE_Y1 = 8,
  975. RRR_3_OPCODE_Y0 = 8,
  976. RRR_3_OPCODE_Y1 = 9,
  977. RRR_4_OPCODE_Y0 = 9,
  978. RRR_4_OPCODE_Y1 = 10,
  979. RRR_5_OPCODE_Y0 = 10,
  980. RRR_5_OPCODE_Y1 = 11,
  981. RRR_6_OPCODE_Y0 = 11,
  982. RRR_6_OPCODE_Y1 = 12,
  983. RRR_7_OPCODE_Y0 = 12,
  984. RRR_7_OPCODE_Y1 = 13,
  985. RRR_8_OPCODE_Y0 = 13,
  986. RRR_9_OPCODE_Y0 = 14,
  987. SHIFT_OPCODE_X0 = 6,
  988. SHIFT_OPCODE_X1 = 6,
  989. SHIFT_OPCODE_Y0 = 15,
  990. SHIFT_OPCODE_Y1 = 14,
  991. SHL16INSLI_OPCODE_X0 = 7,
  992. SHL16INSLI_OPCODE_X1 = 7,
  993. SHL1ADDX_RRR_0_OPCODE_X0 = 67,
  994. SHL1ADDX_RRR_0_OPCODE_X1 = 31,
  995. SHL1ADDX_RRR_7_OPCODE_Y0 = 1,
  996. SHL1ADDX_RRR_7_OPCODE_Y1 = 1,
  997. SHL1ADD_RRR_0_OPCODE_X0 = 68,
  998. SHL1ADD_RRR_0_OPCODE_X1 = 32,
  999. SHL1ADD_RRR_1_OPCODE_Y0 = 0,
  1000. SHL1ADD_RRR_1_OPCODE_Y1 = 0,
  1001. SHL2ADDX_RRR_0_OPCODE_X0 = 69,
  1002. SHL2ADDX_RRR_0_OPCODE_X1 = 33,
  1003. SHL2ADDX_RRR_7_OPCODE_Y0 = 2,
  1004. SHL2ADDX_RRR_7_OPCODE_Y1 = 2,
  1005. SHL2ADD_RRR_0_OPCODE_X0 = 70,
  1006. SHL2ADD_RRR_0_OPCODE_X1 = 34,
  1007. SHL2ADD_RRR_1_OPCODE_Y0 = 1,
  1008. SHL2ADD_RRR_1_OPCODE_Y1 = 1,
  1009. SHL3ADDX_RRR_0_OPCODE_X0 = 71,
  1010. SHL3ADDX_RRR_0_OPCODE_X1 = 35,
  1011. SHL3ADDX_RRR_7_OPCODE_Y0 = 3,
  1012. SHL3ADDX_RRR_7_OPCODE_Y1 = 3,
  1013. SHL3ADD_RRR_0_OPCODE_X0 = 72,
  1014. SHL3ADD_RRR_0_OPCODE_X1 = 36,
  1015. SHL3ADD_RRR_1_OPCODE_Y0 = 2,
  1016. SHL3ADD_RRR_1_OPCODE_Y1 = 2,
  1017. SHLI_SHIFT_OPCODE_X0 = 2,
  1018. SHLI_SHIFT_OPCODE_X1 = 2,
  1019. SHLI_SHIFT_OPCODE_Y0 = 1,
  1020. SHLI_SHIFT_OPCODE_Y1 = 1,
  1021. SHLXI_SHIFT_OPCODE_X0 = 3,
  1022. SHLXI_SHIFT_OPCODE_X1 = 3,
  1023. SHLX_RRR_0_OPCODE_X0 = 73,
  1024. SHLX_RRR_0_OPCODE_X1 = 37,
  1025. SHL_RRR_0_OPCODE_X0 = 74,
  1026. SHL_RRR_0_OPCODE_X1 = 38,
  1027. SHL_RRR_6_OPCODE_Y0 = 1,
  1028. SHL_RRR_6_OPCODE_Y1 = 1,
  1029. SHRSI_SHIFT_OPCODE_X0 = 4,
  1030. SHRSI_SHIFT_OPCODE_X1 = 4,
  1031. SHRSI_SHIFT_OPCODE_Y0 = 2,
  1032. SHRSI_SHIFT_OPCODE_Y1 = 2,
  1033. SHRS_RRR_0_OPCODE_X0 = 75,
  1034. SHRS_RRR_0_OPCODE_X1 = 39,
  1035. SHRS_RRR_6_OPCODE_Y0 = 2,
  1036. SHRS_RRR_6_OPCODE_Y1 = 2,
  1037. SHRUI_SHIFT_OPCODE_X0 = 5,
  1038. SHRUI_SHIFT_OPCODE_X1 = 5,
  1039. SHRUI_SHIFT_OPCODE_Y0 = 3,
  1040. SHRUI_SHIFT_OPCODE_Y1 = 3,
  1041. SHRUXI_SHIFT_OPCODE_X0 = 6,
  1042. SHRUXI_SHIFT_OPCODE_X1 = 6,
  1043. SHRUX_RRR_0_OPCODE_X0 = 76,
  1044. SHRUX_RRR_0_OPCODE_X1 = 40,
  1045. SHRU_RRR_0_OPCODE_X0 = 77,
  1046. SHRU_RRR_0_OPCODE_X1 = 41,
  1047. SHRU_RRR_6_OPCODE_Y0 = 3,
  1048. SHRU_RRR_6_OPCODE_Y1 = 3,
  1049. SHUFFLEBYTES_RRR_0_OPCODE_X0 = 78,
  1050. ST1_ADD_IMM8_OPCODE_X1 = 25,
  1051. ST1_OPCODE_Y2 = 0,
  1052. ST1_RRR_0_OPCODE_X1 = 42,
  1053. ST2_ADD_IMM8_OPCODE_X1 = 26,
  1054. ST2_OPCODE_Y2 = 1,
  1055. ST2_RRR_0_OPCODE_X1 = 43,
  1056. ST4_ADD_IMM8_OPCODE_X1 = 27,
  1057. ST4_OPCODE_Y2 = 2,
  1058. ST4_RRR_0_OPCODE_X1 = 44,
  1059. STNT1_ADD_IMM8_OPCODE_X1 = 28,
  1060. STNT1_RRR_0_OPCODE_X1 = 45,
  1061. STNT2_ADD_IMM8_OPCODE_X1 = 29,
  1062. STNT2_RRR_0_OPCODE_X1 = 46,
  1063. STNT4_ADD_IMM8_OPCODE_X1 = 30,
  1064. STNT4_RRR_0_OPCODE_X1 = 47,
  1065. STNT_ADD_IMM8_OPCODE_X1 = 31,
  1066. STNT_RRR_0_OPCODE_X1 = 48,
  1067. ST_ADD_IMM8_OPCODE_X1 = 32,
  1068. ST_OPCODE_Y2 = 3,
  1069. ST_RRR_0_OPCODE_X1 = 49,
  1070. SUBXSC_RRR_0_OPCODE_X0 = 79,
  1071. SUBXSC_RRR_0_OPCODE_X1 = 50,
  1072. SUBX_RRR_0_OPCODE_X0 = 80,
  1073. SUBX_RRR_0_OPCODE_X1 = 51,
  1074. SUBX_RRR_0_OPCODE_Y0 = 2,
  1075. SUBX_RRR_0_OPCODE_Y1 = 2,
  1076. SUB_RRR_0_OPCODE_X0 = 81,
  1077. SUB_RRR_0_OPCODE_X1 = 52,
  1078. SUB_RRR_0_OPCODE_Y0 = 3,
  1079. SUB_RRR_0_OPCODE_Y1 = 3,
  1080. SWINT0_UNARY_OPCODE_X1 = 34,
  1081. SWINT1_UNARY_OPCODE_X1 = 35,
  1082. SWINT2_UNARY_OPCODE_X1 = 36,
  1083. SWINT3_UNARY_OPCODE_X1 = 37,
  1084. TBLIDXB0_UNARY_OPCODE_X0 = 9,
  1085. TBLIDXB0_UNARY_OPCODE_Y0 = 9,
  1086. TBLIDXB1_UNARY_OPCODE_X0 = 10,
  1087. TBLIDXB1_UNARY_OPCODE_Y0 = 10,
  1088. TBLIDXB2_UNARY_OPCODE_X0 = 11,
  1089. TBLIDXB2_UNARY_OPCODE_Y0 = 11,
  1090. TBLIDXB3_UNARY_OPCODE_X0 = 12,
  1091. TBLIDXB3_UNARY_OPCODE_Y0 = 12,
  1092. UNARY_RRR_0_OPCODE_X0 = 82,
  1093. UNARY_RRR_0_OPCODE_X1 = 53,
  1094. UNARY_RRR_1_OPCODE_Y0 = 3,
  1095. UNARY_RRR_1_OPCODE_Y1 = 3,
  1096. V1ADDI_IMM8_OPCODE_X0 = 8,
  1097. V1ADDI_IMM8_OPCODE_X1 = 33,
  1098. V1ADDUC_RRR_0_OPCODE_X0 = 83,
  1099. V1ADDUC_RRR_0_OPCODE_X1 = 54,
  1100. V1ADD_RRR_0_OPCODE_X0 = 84,
  1101. V1ADD_RRR_0_OPCODE_X1 = 55,
  1102. V1ADIFFU_RRR_0_OPCODE_X0 = 85,
  1103. V1AVGU_RRR_0_OPCODE_X0 = 86,
  1104. V1CMPEQI_IMM8_OPCODE_X0 = 9,
  1105. V1CMPEQI_IMM8_OPCODE_X1 = 34,
  1106. V1CMPEQ_RRR_0_OPCODE_X0 = 87,
  1107. V1CMPEQ_RRR_0_OPCODE_X1 = 56,
  1108. V1CMPLES_RRR_0_OPCODE_X0 = 88,
  1109. V1CMPLES_RRR_0_OPCODE_X1 = 57,
  1110. V1CMPLEU_RRR_0_OPCODE_X0 = 89,
  1111. V1CMPLEU_RRR_0_OPCODE_X1 = 58,
  1112. V1CMPLTSI_IMM8_OPCODE_X0 = 10,
  1113. V1CMPLTSI_IMM8_OPCODE_X1 = 35,
  1114. V1CMPLTS_RRR_0_OPCODE_X0 = 90,
  1115. V1CMPLTS_RRR_0_OPCODE_X1 = 59,
  1116. V1CMPLTUI_IMM8_OPCODE_X0 = 11,
  1117. V1CMPLTUI_IMM8_OPCODE_X1 = 36,
  1118. V1CMPLTU_RRR_0_OPCODE_X0 = 91,
  1119. V1CMPLTU_RRR_0_OPCODE_X1 = 60,
  1120. V1CMPNE_RRR_0_OPCODE_X0 = 92,
  1121. V1CMPNE_RRR_0_OPCODE_X1 = 61,
  1122. V1DDOTPUA_RRR_0_OPCODE_X0 = 161,
  1123. V1DDOTPUSA_RRR_0_OPCODE_X0 = 93,
  1124. V1DDOTPUS_RRR_0_OPCODE_X0 = 94,
  1125. V1DDOTPU_RRR_0_OPCODE_X0 = 162,
  1126. V1DOTPA_RRR_0_OPCODE_X0 = 95,
  1127. V1DOTPUA_RRR_0_OPCODE_X0 = 163,
  1128. V1DOTPUSA_RRR_0_OPCODE_X0 = 96,
  1129. V1DOTPUS_RRR_0_OPCODE_X0 = 97,
  1130. V1DOTPU_RRR_0_OPCODE_X0 = 164,
  1131. V1DOTP_RRR_0_OPCODE_X0 = 98,
  1132. V1INT_H_RRR_0_OPCODE_X0 = 99,
  1133. V1INT_H_RRR_0_OPCODE_X1 = 62,
  1134. V1INT_L_RRR_0_OPCODE_X0 = 100,
  1135. V1INT_L_RRR_0_OPCODE_X1 = 63,
  1136. V1MAXUI_IMM8_OPCODE_X0 = 12,
  1137. V1MAXUI_IMM8_OPCODE_X1 = 37,
  1138. V1MAXU_RRR_0_OPCODE_X0 = 101,
  1139. V1MAXU_RRR_0_OPCODE_X1 = 64,
  1140. V1MINUI_IMM8_OPCODE_X0 = 13,
  1141. V1MINUI_IMM8_OPCODE_X1 = 38,
  1142. V1MINU_RRR_0_OPCODE_X0 = 102,
  1143. V1MINU_RRR_0_OPCODE_X1 = 65,
  1144. V1MNZ_RRR_0_OPCODE_X0 = 103,
  1145. V1MNZ_RRR_0_OPCODE_X1 = 66,
  1146. V1MULTU_RRR_0_OPCODE_X0 = 104,
  1147. V1MULUS_RRR_0_OPCODE_X0 = 105,
  1148. V1MULU_RRR_0_OPCODE_X0 = 106,
  1149. V1MZ_RRR_0_OPCODE_X0 = 107,
  1150. V1MZ_RRR_0_OPCODE_X1 = 67,
  1151. V1SADAU_RRR_0_OPCODE_X0 = 108,
  1152. V1SADU_RRR_0_OPCODE_X0 = 109,
  1153. V1SHLI_SHIFT_OPCODE_X0 = 7,
  1154. V1SHLI_SHIFT_OPCODE_X1 = 7,
  1155. V1SHL_RRR_0_OPCODE_X0 = 110,
  1156. V1SHL_RRR_0_OPCODE_X1 = 68,
  1157. V1SHRSI_SHIFT_OPCODE_X0 = 8,
  1158. V1SHRSI_SHIFT_OPCODE_X1 = 8,
  1159. V1SHRS_RRR_0_OPCODE_X0 = 111,
  1160. V1SHRS_RRR_0_OPCODE_X1 = 69,
  1161. V1SHRUI_SHIFT_OPCODE_X0 = 9,
  1162. V1SHRUI_SHIFT_OPCODE_X1 = 9,
  1163. V1SHRU_RRR_0_OPCODE_X0 = 112,
  1164. V1SHRU_RRR_0_OPCODE_X1 = 70,
  1165. V1SUBUC_RRR_0_OPCODE_X0 = 113,
  1166. V1SUBUC_RRR_0_OPCODE_X1 = 71,
  1167. V1SUB_RRR_0_OPCODE_X0 = 114,
  1168. V1SUB_RRR_0_OPCODE_X1 = 72,
  1169. V2ADDI_IMM8_OPCODE_X0 = 14,
  1170. V2ADDI_IMM8_OPCODE_X1 = 39,
  1171. V2ADDSC_RRR_0_OPCODE_X0 = 115,
  1172. V2ADDSC_RRR_0_OPCODE_X1 = 73,
  1173. V2ADD_RRR_0_OPCODE_X0 = 116,
  1174. V2ADD_RRR_0_OPCODE_X1 = 74,
  1175. V2ADIFFS_RRR_0_OPCODE_X0 = 117,
  1176. V2AVGS_RRR_0_OPCODE_X0 = 118,
  1177. V2CMPEQI_IMM8_OPCODE_X0 = 15,
  1178. V2CMPEQI_IMM8_OPCODE_X1 = 40,
  1179. V2CMPEQ_RRR_0_OPCODE_X0 = 119,
  1180. V2CMPEQ_RRR_0_OPCODE_X1 = 75,
  1181. V2CMPLES_RRR_0_OPCODE_X0 = 120,
  1182. V2CMPLES_RRR_0_OPCODE_X1 = 76,
  1183. V2CMPLEU_RRR_0_OPCODE_X0 = 121,
  1184. V2CMPLEU_RRR_0_OPCODE_X1 = 77,
  1185. V2CMPLTSI_IMM8_OPCODE_X0 = 16,
  1186. V2CMPLTSI_IMM8_OPCODE_X1 = 41,
  1187. V2CMPLTS_RRR_0_OPCODE_X0 = 122,
  1188. V2CMPLTS_RRR_0_OPCODE_X1 = 78,
  1189. V2CMPLTUI_IMM8_OPCODE_X0 = 17,
  1190. V2CMPLTUI_IMM8_OPCODE_X1 = 42,
  1191. V2CMPLTU_RRR_0_OPCODE_X0 = 123,
  1192. V2CMPLTU_RRR_0_OPCODE_X1 = 79,
  1193. V2CMPNE_RRR_0_OPCODE_X0 = 124,
  1194. V2CMPNE_RRR_0_OPCODE_X1 = 80,
  1195. V2DOTPA_RRR_0_OPCODE_X0 = 125,
  1196. V2DOTP_RRR_0_OPCODE_X0 = 126,
  1197. V2INT_H_RRR_0_OPCODE_X0 = 127,
  1198. V2INT_H_RRR_0_OPCODE_X1 = 81,
  1199. V2INT_L_RRR_0_OPCODE_X0 = 128,
  1200. V2INT_L_RRR_0_OPCODE_X1 = 82,
  1201. V2MAXSI_IMM8_OPCODE_X0 = 18,
  1202. V2MAXSI_IMM8_OPCODE_X1 = 43,
  1203. V2MAXS_RRR_0_OPCODE_X0 = 129,
  1204. V2MAXS_RRR_0_OPCODE_X1 = 83,
  1205. V2MINSI_IMM8_OPCODE_X0 = 19,
  1206. V2MINSI_IMM8_OPCODE_X1 = 44,
  1207. V2MINS_RRR_0_OPCODE_X0 = 130,
  1208. V2MINS_RRR_0_OPCODE_X1 = 84,
  1209. V2MNZ_RRR_0_OPCODE_X0 = 131,
  1210. V2MNZ_RRR_0_OPCODE_X1 = 85,
  1211. V2MULFSC_RRR_0_OPCODE_X0 = 132,
  1212. V2MULS_RRR_0_OPCODE_X0 = 133,
  1213. V2MULTS_RRR_0_OPCODE_X0 = 134,
  1214. V2MZ_RRR_0_OPCODE_X0 = 135,
  1215. V2MZ_RRR_0_OPCODE_X1 = 86,
  1216. V2PACKH_RRR_0_OPCODE_X0 = 136,
  1217. V2PACKH_RRR_0_OPCODE_X1 = 87,
  1218. V2PACKL_RRR_0_OPCODE_X0 = 137,
  1219. V2PACKL_RRR_0_OPCODE_X1 = 88,
  1220. V2PACKUC_RRR_0_OPCODE_X0 = 138,
  1221. V2PACKUC_RRR_0_OPCODE_X1 = 89,
  1222. V2SADAS_RRR_0_OPCODE_X0 = 139,
  1223. V2SADAU_RRR_0_OPCODE_X0 = 140,
  1224. V2SADS_RRR_0_OPCODE_X0 = 141,
  1225. V2SADU_RRR_0_OPCODE_X0 = 142,
  1226. V2SHLI_SHIFT_OPCODE_X0 = 10,
  1227. V2SHLI_SHIFT_OPCODE_X1 = 10,
  1228. V2SHLSC_RRR_0_OPCODE_X0 = 143,
  1229. V2SHLSC_RRR_0_OPCODE_X1 = 90,
  1230. V2SHL_RRR_0_OPCODE_X0 = 144,
  1231. V2SHL_RRR_0_OPCODE_X1 = 91,
  1232. V2SHRSI_SHIFT_OPCODE_X0 = 11,
  1233. V2SHRSI_SHIFT_OPCODE_X1 = 11,
  1234. V2SHRS_RRR_0_OPCODE_X0 = 145,
  1235. V2SHRS_RRR_0_OPCODE_X1 = 92,
  1236. V2SHRUI_SHIFT_OPCODE_X0 = 12,
  1237. V2SHRUI_SHIFT_OPCODE_X1 = 12,
  1238. V2SHRU_RRR_0_OPCODE_X0 = 146,
  1239. V2SHRU_RRR_0_OPCODE_X1 = 93,
  1240. V2SUBSC_RRR_0_OPCODE_X0 = 147,
  1241. V2SUBSC_RRR_0_OPCODE_X1 = 94,
  1242. V2SUB_RRR_0_OPCODE_X0 = 148,
  1243. V2SUB_RRR_0_OPCODE_X1 = 95,
  1244. V4ADDSC_RRR_0_OPCODE_X0 = 149,
  1245. V4ADDSC_RRR_0_OPCODE_X1 = 96,
  1246. V4ADD_RRR_0_OPCODE_X0 = 150,
  1247. V4ADD_RRR_0_OPCODE_X1 = 97,
  1248. V4INT_H_RRR_0_OPCODE_X0 = 151,
  1249. V4INT_H_RRR_0_OPCODE_X1 = 98,
  1250. V4INT_L_RRR_0_OPCODE_X0 = 152,
  1251. V4INT_L_RRR_0_OPCODE_X1 = 99,
  1252. V4PACKSC_RRR_0_OPCODE_X0 = 153,
  1253. V4PACKSC_RRR_0_OPCODE_X1 = 100,
  1254. V4SHLSC_RRR_0_OPCODE_X0 = 154,
  1255. V4SHLSC_RRR_0_OPCODE_X1 = 101,
  1256. V4SHL_RRR_0_OPCODE_X0 = 155,
  1257. V4SHL_RRR_0_OPCODE_X1 = 102,
  1258. V4SHRS_RRR_0_OPCODE_X0 = 156,
  1259. V4SHRS_RRR_0_OPCODE_X1 = 103,
  1260. V4SHRU_RRR_0_OPCODE_X0 = 157,
  1261. V4SHRU_RRR_0_OPCODE_X1 = 104,
  1262. V4SUBSC_RRR_0_OPCODE_X0 = 158,
  1263. V4SUBSC_RRR_0_OPCODE_X1 = 105,
  1264. V4SUB_RRR_0_OPCODE_X0 = 159,
  1265. V4SUB_RRR_0_OPCODE_X1 = 106,
  1266. WH64_UNARY_OPCODE_X1 = 38,
  1267. XORI_IMM8_OPCODE_X0 = 20,
  1268. XORI_IMM8_OPCODE_X1 = 45,
  1269. XOR_RRR_0_OPCODE_X0 = 160,
  1270. XOR_RRR_0_OPCODE_X1 = 107,
  1271. XOR_RRR_5_OPCODE_Y0 = 3,
  1272. XOR_RRR_5_OPCODE_Y1 = 3
  1273. };
  1274. #endif /* __ASSEMBLER__ */
  1275. #endif /* OPCODE_TILEGX_H */