tile-desc_32.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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 opcode_tilepro_h
  21. #define opcode_tilepro_h
  22. #include <arch/opcode.h>
  23. enum
  24. {
  25. TILEPRO_MAX_OPERANDS = 5 /* mm */
  26. };
  27. typedef enum
  28. {
  29. TILEPRO_OPC_BPT,
  30. TILEPRO_OPC_INFO,
  31. TILEPRO_OPC_INFOL,
  32. TILEPRO_OPC_J,
  33. TILEPRO_OPC_JAL,
  34. TILEPRO_OPC_MOVE,
  35. TILEPRO_OPC_MOVE_SN,
  36. TILEPRO_OPC_MOVEI,
  37. TILEPRO_OPC_MOVEI_SN,
  38. TILEPRO_OPC_MOVELI,
  39. TILEPRO_OPC_MOVELI_SN,
  40. TILEPRO_OPC_MOVELIS,
  41. TILEPRO_OPC_PREFETCH,
  42. TILEPRO_OPC_RAISE,
  43. TILEPRO_OPC_ADD,
  44. TILEPRO_OPC_ADD_SN,
  45. TILEPRO_OPC_ADDB,
  46. TILEPRO_OPC_ADDB_SN,
  47. TILEPRO_OPC_ADDBS_U,
  48. TILEPRO_OPC_ADDBS_U_SN,
  49. TILEPRO_OPC_ADDH,
  50. TILEPRO_OPC_ADDH_SN,
  51. TILEPRO_OPC_ADDHS,
  52. TILEPRO_OPC_ADDHS_SN,
  53. TILEPRO_OPC_ADDI,
  54. TILEPRO_OPC_ADDI_SN,
  55. TILEPRO_OPC_ADDIB,
  56. TILEPRO_OPC_ADDIB_SN,
  57. TILEPRO_OPC_ADDIH,
  58. TILEPRO_OPC_ADDIH_SN,
  59. TILEPRO_OPC_ADDLI,
  60. TILEPRO_OPC_ADDLI_SN,
  61. TILEPRO_OPC_ADDLIS,
  62. TILEPRO_OPC_ADDS,
  63. TILEPRO_OPC_ADDS_SN,
  64. TILEPRO_OPC_ADIFFB_U,
  65. TILEPRO_OPC_ADIFFB_U_SN,
  66. TILEPRO_OPC_ADIFFH,
  67. TILEPRO_OPC_ADIFFH_SN,
  68. TILEPRO_OPC_AND,
  69. TILEPRO_OPC_AND_SN,
  70. TILEPRO_OPC_ANDI,
  71. TILEPRO_OPC_ANDI_SN,
  72. TILEPRO_OPC_AULI,
  73. TILEPRO_OPC_AVGB_U,
  74. TILEPRO_OPC_AVGB_U_SN,
  75. TILEPRO_OPC_AVGH,
  76. TILEPRO_OPC_AVGH_SN,
  77. TILEPRO_OPC_BBNS,
  78. TILEPRO_OPC_BBNS_SN,
  79. TILEPRO_OPC_BBNST,
  80. TILEPRO_OPC_BBNST_SN,
  81. TILEPRO_OPC_BBS,
  82. TILEPRO_OPC_BBS_SN,
  83. TILEPRO_OPC_BBST,
  84. TILEPRO_OPC_BBST_SN,
  85. TILEPRO_OPC_BGEZ,
  86. TILEPRO_OPC_BGEZ_SN,
  87. TILEPRO_OPC_BGEZT,
  88. TILEPRO_OPC_BGEZT_SN,
  89. TILEPRO_OPC_BGZ,
  90. TILEPRO_OPC_BGZ_SN,
  91. TILEPRO_OPC_BGZT,
  92. TILEPRO_OPC_BGZT_SN,
  93. TILEPRO_OPC_BITX,
  94. TILEPRO_OPC_BITX_SN,
  95. TILEPRO_OPC_BLEZ,
  96. TILEPRO_OPC_BLEZ_SN,
  97. TILEPRO_OPC_BLEZT,
  98. TILEPRO_OPC_BLEZT_SN,
  99. TILEPRO_OPC_BLZ,
  100. TILEPRO_OPC_BLZ_SN,
  101. TILEPRO_OPC_BLZT,
  102. TILEPRO_OPC_BLZT_SN,
  103. TILEPRO_OPC_BNZ,
  104. TILEPRO_OPC_BNZ_SN,
  105. TILEPRO_OPC_BNZT,
  106. TILEPRO_OPC_BNZT_SN,
  107. TILEPRO_OPC_BYTEX,
  108. TILEPRO_OPC_BYTEX_SN,
  109. TILEPRO_OPC_BZ,
  110. TILEPRO_OPC_BZ_SN,
  111. TILEPRO_OPC_BZT,
  112. TILEPRO_OPC_BZT_SN,
  113. TILEPRO_OPC_CLZ,
  114. TILEPRO_OPC_CLZ_SN,
  115. TILEPRO_OPC_CRC32_32,
  116. TILEPRO_OPC_CRC32_32_SN,
  117. TILEPRO_OPC_CRC32_8,
  118. TILEPRO_OPC_CRC32_8_SN,
  119. TILEPRO_OPC_CTZ,
  120. TILEPRO_OPC_CTZ_SN,
  121. TILEPRO_OPC_DRAIN,
  122. TILEPRO_OPC_DTLBPR,
  123. TILEPRO_OPC_DWORD_ALIGN,
  124. TILEPRO_OPC_DWORD_ALIGN_SN,
  125. TILEPRO_OPC_FINV,
  126. TILEPRO_OPC_FLUSH,
  127. TILEPRO_OPC_FNOP,
  128. TILEPRO_OPC_ICOH,
  129. TILEPRO_OPC_ILL,
  130. TILEPRO_OPC_INTHB,
  131. TILEPRO_OPC_INTHB_SN,
  132. TILEPRO_OPC_INTHH,
  133. TILEPRO_OPC_INTHH_SN,
  134. TILEPRO_OPC_INTLB,
  135. TILEPRO_OPC_INTLB_SN,
  136. TILEPRO_OPC_INTLH,
  137. TILEPRO_OPC_INTLH_SN,
  138. TILEPRO_OPC_INV,
  139. TILEPRO_OPC_IRET,
  140. TILEPRO_OPC_JALB,
  141. TILEPRO_OPC_JALF,
  142. TILEPRO_OPC_JALR,
  143. TILEPRO_OPC_JALRP,
  144. TILEPRO_OPC_JB,
  145. TILEPRO_OPC_JF,
  146. TILEPRO_OPC_JR,
  147. TILEPRO_OPC_JRP,
  148. TILEPRO_OPC_LB,
  149. TILEPRO_OPC_LB_SN,
  150. TILEPRO_OPC_LB_U,
  151. TILEPRO_OPC_LB_U_SN,
  152. TILEPRO_OPC_LBADD,
  153. TILEPRO_OPC_LBADD_SN,
  154. TILEPRO_OPC_LBADD_U,
  155. TILEPRO_OPC_LBADD_U_SN,
  156. TILEPRO_OPC_LH,
  157. TILEPRO_OPC_LH_SN,
  158. TILEPRO_OPC_LH_U,
  159. TILEPRO_OPC_LH_U_SN,
  160. TILEPRO_OPC_LHADD,
  161. TILEPRO_OPC_LHADD_SN,
  162. TILEPRO_OPC_LHADD_U,
  163. TILEPRO_OPC_LHADD_U_SN,
  164. TILEPRO_OPC_LNK,
  165. TILEPRO_OPC_LNK_SN,
  166. TILEPRO_OPC_LW,
  167. TILEPRO_OPC_LW_SN,
  168. TILEPRO_OPC_LW_NA,
  169. TILEPRO_OPC_LW_NA_SN,
  170. TILEPRO_OPC_LWADD,
  171. TILEPRO_OPC_LWADD_SN,
  172. TILEPRO_OPC_LWADD_NA,
  173. TILEPRO_OPC_LWADD_NA_SN,
  174. TILEPRO_OPC_MAXB_U,
  175. TILEPRO_OPC_MAXB_U_SN,
  176. TILEPRO_OPC_MAXH,
  177. TILEPRO_OPC_MAXH_SN,
  178. TILEPRO_OPC_MAXIB_U,
  179. TILEPRO_OPC_MAXIB_U_SN,
  180. TILEPRO_OPC_MAXIH,
  181. TILEPRO_OPC_MAXIH_SN,
  182. TILEPRO_OPC_MF,
  183. TILEPRO_OPC_MFSPR,
  184. TILEPRO_OPC_MINB_U,
  185. TILEPRO_OPC_MINB_U_SN,
  186. TILEPRO_OPC_MINH,
  187. TILEPRO_OPC_MINH_SN,
  188. TILEPRO_OPC_MINIB_U,
  189. TILEPRO_OPC_MINIB_U_SN,
  190. TILEPRO_OPC_MINIH,
  191. TILEPRO_OPC_MINIH_SN,
  192. TILEPRO_OPC_MM,
  193. TILEPRO_OPC_MNZ,
  194. TILEPRO_OPC_MNZ_SN,
  195. TILEPRO_OPC_MNZB,
  196. TILEPRO_OPC_MNZB_SN,
  197. TILEPRO_OPC_MNZH,
  198. TILEPRO_OPC_MNZH_SN,
  199. TILEPRO_OPC_MTSPR,
  200. TILEPRO_OPC_MULHH_SS,
  201. TILEPRO_OPC_MULHH_SS_SN,
  202. TILEPRO_OPC_MULHH_SU,
  203. TILEPRO_OPC_MULHH_SU_SN,
  204. TILEPRO_OPC_MULHH_UU,
  205. TILEPRO_OPC_MULHH_UU_SN,
  206. TILEPRO_OPC_MULHHA_SS,
  207. TILEPRO_OPC_MULHHA_SS_SN,
  208. TILEPRO_OPC_MULHHA_SU,
  209. TILEPRO_OPC_MULHHA_SU_SN,
  210. TILEPRO_OPC_MULHHA_UU,
  211. TILEPRO_OPC_MULHHA_UU_SN,
  212. TILEPRO_OPC_MULHHSA_UU,
  213. TILEPRO_OPC_MULHHSA_UU_SN,
  214. TILEPRO_OPC_MULHL_SS,
  215. TILEPRO_OPC_MULHL_SS_SN,
  216. TILEPRO_OPC_MULHL_SU,
  217. TILEPRO_OPC_MULHL_SU_SN,
  218. TILEPRO_OPC_MULHL_US,
  219. TILEPRO_OPC_MULHL_US_SN,
  220. TILEPRO_OPC_MULHL_UU,
  221. TILEPRO_OPC_MULHL_UU_SN,
  222. TILEPRO_OPC_MULHLA_SS,
  223. TILEPRO_OPC_MULHLA_SS_SN,
  224. TILEPRO_OPC_MULHLA_SU,
  225. TILEPRO_OPC_MULHLA_SU_SN,
  226. TILEPRO_OPC_MULHLA_US,
  227. TILEPRO_OPC_MULHLA_US_SN,
  228. TILEPRO_OPC_MULHLA_UU,
  229. TILEPRO_OPC_MULHLA_UU_SN,
  230. TILEPRO_OPC_MULHLSA_UU,
  231. TILEPRO_OPC_MULHLSA_UU_SN,
  232. TILEPRO_OPC_MULLL_SS,
  233. TILEPRO_OPC_MULLL_SS_SN,
  234. TILEPRO_OPC_MULLL_SU,
  235. TILEPRO_OPC_MULLL_SU_SN,
  236. TILEPRO_OPC_MULLL_UU,
  237. TILEPRO_OPC_MULLL_UU_SN,
  238. TILEPRO_OPC_MULLLA_SS,
  239. TILEPRO_OPC_MULLLA_SS_SN,
  240. TILEPRO_OPC_MULLLA_SU,
  241. TILEPRO_OPC_MULLLA_SU_SN,
  242. TILEPRO_OPC_MULLLA_UU,
  243. TILEPRO_OPC_MULLLA_UU_SN,
  244. TILEPRO_OPC_MULLLSA_UU,
  245. TILEPRO_OPC_MULLLSA_UU_SN,
  246. TILEPRO_OPC_MVNZ,
  247. TILEPRO_OPC_MVNZ_SN,
  248. TILEPRO_OPC_MVZ,
  249. TILEPRO_OPC_MVZ_SN,
  250. TILEPRO_OPC_MZ,
  251. TILEPRO_OPC_MZ_SN,
  252. TILEPRO_OPC_MZB,
  253. TILEPRO_OPC_MZB_SN,
  254. TILEPRO_OPC_MZH,
  255. TILEPRO_OPC_MZH_SN,
  256. TILEPRO_OPC_NAP,
  257. TILEPRO_OPC_NOP,
  258. TILEPRO_OPC_NOR,
  259. TILEPRO_OPC_NOR_SN,
  260. TILEPRO_OPC_OR,
  261. TILEPRO_OPC_OR_SN,
  262. TILEPRO_OPC_ORI,
  263. TILEPRO_OPC_ORI_SN,
  264. TILEPRO_OPC_PACKBS_U,
  265. TILEPRO_OPC_PACKBS_U_SN,
  266. TILEPRO_OPC_PACKHB,
  267. TILEPRO_OPC_PACKHB_SN,
  268. TILEPRO_OPC_PACKHS,
  269. TILEPRO_OPC_PACKHS_SN,
  270. TILEPRO_OPC_PACKLB,
  271. TILEPRO_OPC_PACKLB_SN,
  272. TILEPRO_OPC_PCNT,
  273. TILEPRO_OPC_PCNT_SN,
  274. TILEPRO_OPC_RL,
  275. TILEPRO_OPC_RL_SN,
  276. TILEPRO_OPC_RLI,
  277. TILEPRO_OPC_RLI_SN,
  278. TILEPRO_OPC_S1A,
  279. TILEPRO_OPC_S1A_SN,
  280. TILEPRO_OPC_S2A,
  281. TILEPRO_OPC_S2A_SN,
  282. TILEPRO_OPC_S3A,
  283. TILEPRO_OPC_S3A_SN,
  284. TILEPRO_OPC_SADAB_U,
  285. TILEPRO_OPC_SADAB_U_SN,
  286. TILEPRO_OPC_SADAH,
  287. TILEPRO_OPC_SADAH_SN,
  288. TILEPRO_OPC_SADAH_U,
  289. TILEPRO_OPC_SADAH_U_SN,
  290. TILEPRO_OPC_SADB_U,
  291. TILEPRO_OPC_SADB_U_SN,
  292. TILEPRO_OPC_SADH,
  293. TILEPRO_OPC_SADH_SN,
  294. TILEPRO_OPC_SADH_U,
  295. TILEPRO_OPC_SADH_U_SN,
  296. TILEPRO_OPC_SB,
  297. TILEPRO_OPC_SBADD,
  298. TILEPRO_OPC_SEQ,
  299. TILEPRO_OPC_SEQ_SN,
  300. TILEPRO_OPC_SEQB,
  301. TILEPRO_OPC_SEQB_SN,
  302. TILEPRO_OPC_SEQH,
  303. TILEPRO_OPC_SEQH_SN,
  304. TILEPRO_OPC_SEQI,
  305. TILEPRO_OPC_SEQI_SN,
  306. TILEPRO_OPC_SEQIB,
  307. TILEPRO_OPC_SEQIB_SN,
  308. TILEPRO_OPC_SEQIH,
  309. TILEPRO_OPC_SEQIH_SN,
  310. TILEPRO_OPC_SH,
  311. TILEPRO_OPC_SHADD,
  312. TILEPRO_OPC_SHL,
  313. TILEPRO_OPC_SHL_SN,
  314. TILEPRO_OPC_SHLB,
  315. TILEPRO_OPC_SHLB_SN,
  316. TILEPRO_OPC_SHLH,
  317. TILEPRO_OPC_SHLH_SN,
  318. TILEPRO_OPC_SHLI,
  319. TILEPRO_OPC_SHLI_SN,
  320. TILEPRO_OPC_SHLIB,
  321. TILEPRO_OPC_SHLIB_SN,
  322. TILEPRO_OPC_SHLIH,
  323. TILEPRO_OPC_SHLIH_SN,
  324. TILEPRO_OPC_SHR,
  325. TILEPRO_OPC_SHR_SN,
  326. TILEPRO_OPC_SHRB,
  327. TILEPRO_OPC_SHRB_SN,
  328. TILEPRO_OPC_SHRH,
  329. TILEPRO_OPC_SHRH_SN,
  330. TILEPRO_OPC_SHRI,
  331. TILEPRO_OPC_SHRI_SN,
  332. TILEPRO_OPC_SHRIB,
  333. TILEPRO_OPC_SHRIB_SN,
  334. TILEPRO_OPC_SHRIH,
  335. TILEPRO_OPC_SHRIH_SN,
  336. TILEPRO_OPC_SLT,
  337. TILEPRO_OPC_SLT_SN,
  338. TILEPRO_OPC_SLT_U,
  339. TILEPRO_OPC_SLT_U_SN,
  340. TILEPRO_OPC_SLTB,
  341. TILEPRO_OPC_SLTB_SN,
  342. TILEPRO_OPC_SLTB_U,
  343. TILEPRO_OPC_SLTB_U_SN,
  344. TILEPRO_OPC_SLTE,
  345. TILEPRO_OPC_SLTE_SN,
  346. TILEPRO_OPC_SLTE_U,
  347. TILEPRO_OPC_SLTE_U_SN,
  348. TILEPRO_OPC_SLTEB,
  349. TILEPRO_OPC_SLTEB_SN,
  350. TILEPRO_OPC_SLTEB_U,
  351. TILEPRO_OPC_SLTEB_U_SN,
  352. TILEPRO_OPC_SLTEH,
  353. TILEPRO_OPC_SLTEH_SN,
  354. TILEPRO_OPC_SLTEH_U,
  355. TILEPRO_OPC_SLTEH_U_SN,
  356. TILEPRO_OPC_SLTH,
  357. TILEPRO_OPC_SLTH_SN,
  358. TILEPRO_OPC_SLTH_U,
  359. TILEPRO_OPC_SLTH_U_SN,
  360. TILEPRO_OPC_SLTI,
  361. TILEPRO_OPC_SLTI_SN,
  362. TILEPRO_OPC_SLTI_U,
  363. TILEPRO_OPC_SLTI_U_SN,
  364. TILEPRO_OPC_SLTIB,
  365. TILEPRO_OPC_SLTIB_SN,
  366. TILEPRO_OPC_SLTIB_U,
  367. TILEPRO_OPC_SLTIB_U_SN,
  368. TILEPRO_OPC_SLTIH,
  369. TILEPRO_OPC_SLTIH_SN,
  370. TILEPRO_OPC_SLTIH_U,
  371. TILEPRO_OPC_SLTIH_U_SN,
  372. TILEPRO_OPC_SNE,
  373. TILEPRO_OPC_SNE_SN,
  374. TILEPRO_OPC_SNEB,
  375. TILEPRO_OPC_SNEB_SN,
  376. TILEPRO_OPC_SNEH,
  377. TILEPRO_OPC_SNEH_SN,
  378. TILEPRO_OPC_SRA,
  379. TILEPRO_OPC_SRA_SN,
  380. TILEPRO_OPC_SRAB,
  381. TILEPRO_OPC_SRAB_SN,
  382. TILEPRO_OPC_SRAH,
  383. TILEPRO_OPC_SRAH_SN,
  384. TILEPRO_OPC_SRAI,
  385. TILEPRO_OPC_SRAI_SN,
  386. TILEPRO_OPC_SRAIB,
  387. TILEPRO_OPC_SRAIB_SN,
  388. TILEPRO_OPC_SRAIH,
  389. TILEPRO_OPC_SRAIH_SN,
  390. TILEPRO_OPC_SUB,
  391. TILEPRO_OPC_SUB_SN,
  392. TILEPRO_OPC_SUBB,
  393. TILEPRO_OPC_SUBB_SN,
  394. TILEPRO_OPC_SUBBS_U,
  395. TILEPRO_OPC_SUBBS_U_SN,
  396. TILEPRO_OPC_SUBH,
  397. TILEPRO_OPC_SUBH_SN,
  398. TILEPRO_OPC_SUBHS,
  399. TILEPRO_OPC_SUBHS_SN,
  400. TILEPRO_OPC_SUBS,
  401. TILEPRO_OPC_SUBS_SN,
  402. TILEPRO_OPC_SW,
  403. TILEPRO_OPC_SWADD,
  404. TILEPRO_OPC_SWINT0,
  405. TILEPRO_OPC_SWINT1,
  406. TILEPRO_OPC_SWINT2,
  407. TILEPRO_OPC_SWINT3,
  408. TILEPRO_OPC_TBLIDXB0,
  409. TILEPRO_OPC_TBLIDXB0_SN,
  410. TILEPRO_OPC_TBLIDXB1,
  411. TILEPRO_OPC_TBLIDXB1_SN,
  412. TILEPRO_OPC_TBLIDXB2,
  413. TILEPRO_OPC_TBLIDXB2_SN,
  414. TILEPRO_OPC_TBLIDXB3,
  415. TILEPRO_OPC_TBLIDXB3_SN,
  416. TILEPRO_OPC_TNS,
  417. TILEPRO_OPC_TNS_SN,
  418. TILEPRO_OPC_WH64,
  419. TILEPRO_OPC_XOR,
  420. TILEPRO_OPC_XOR_SN,
  421. TILEPRO_OPC_XORI,
  422. TILEPRO_OPC_XORI_SN,
  423. TILEPRO_OPC_NONE
  424. } tilepro_mnemonic;
  425. typedef enum
  426. {
  427. TILEPRO_PIPELINE_X0,
  428. TILEPRO_PIPELINE_X1,
  429. TILEPRO_PIPELINE_Y0,
  430. TILEPRO_PIPELINE_Y1,
  431. TILEPRO_PIPELINE_Y2,
  432. } tilepro_pipeline;
  433. #define tilepro_is_x_pipeline(p) ((int)(p) <= (int)TILEPRO_PIPELINE_X1)
  434. typedef enum
  435. {
  436. TILEPRO_OP_TYPE_REGISTER,
  437. TILEPRO_OP_TYPE_IMMEDIATE,
  438. TILEPRO_OP_TYPE_ADDRESS,
  439. TILEPRO_OP_TYPE_SPR
  440. } tilepro_operand_type;
  441. struct tilepro_operand
  442. {
  443. /* Is this operand a register, immediate or address? */
  444. tilepro_operand_type type;
  445. /* The default relocation type for this operand. */
  446. signed int default_reloc : 16;
  447. /* How many bits is this value? (used for range checking) */
  448. unsigned int num_bits : 5;
  449. /* Is the value signed? (used for range checking) */
  450. unsigned int is_signed : 1;
  451. /* Is this operand a source register? */
  452. unsigned int is_src_reg : 1;
  453. /* Is this operand written? (i.e. is it a destination register) */
  454. unsigned int is_dest_reg : 1;
  455. /* Is this operand PC-relative? */
  456. unsigned int is_pc_relative : 1;
  457. /* By how many bits do we right shift the value before inserting? */
  458. unsigned int rightshift : 2;
  459. /* Return the bits for this operand to be ORed into an existing bundle. */
  460. tilepro_bundle_bits (*insert) (int op);
  461. /* Extract this operand and return it. */
  462. unsigned int (*extract) (tilepro_bundle_bits bundle);
  463. };
  464. extern const struct tilepro_operand tilepro_operands[];
  465. /* One finite-state machine per pipe for rapid instruction decoding. */
  466. extern const unsigned short * const
  467. tilepro_bundle_decoder_fsms[TILEPRO_NUM_PIPELINE_ENCODINGS];
  468. struct tilepro_opcode
  469. {
  470. /* The opcode mnemonic, e.g. "add" */
  471. const char *name;
  472. /* The enum value for this mnemonic. */
  473. tilepro_mnemonic mnemonic;
  474. /* A bit mask of which of the five pipes this instruction
  475. is compatible with:
  476. X0 0x01
  477. X1 0x02
  478. Y0 0x04
  479. Y1 0x08
  480. Y2 0x10 */
  481. unsigned char pipes;
  482. /* How many operands are there? */
  483. unsigned char num_operands;
  484. /* Which register does this write implicitly, or TREG_ZERO if none? */
  485. unsigned char implicitly_written_register;
  486. /* Can this be bundled with other instructions (almost always true). */
  487. unsigned char can_bundle;
  488. /* The description of the operands. Each of these is an
  489. * index into the tilepro_operands[] table. */
  490. unsigned char operands[TILEPRO_NUM_PIPELINE_ENCODINGS][TILEPRO_MAX_OPERANDS];
  491. };
  492. extern const struct tilepro_opcode tilepro_opcodes[];
  493. /* Used for non-textual disassembly into structs. */
  494. struct tilepro_decoded_instruction
  495. {
  496. const struct tilepro_opcode *opcode;
  497. const struct tilepro_operand *operands[TILEPRO_MAX_OPERANDS];
  498. int operand_values[TILEPRO_MAX_OPERANDS];
  499. };
  500. /* Disassemble a bundle into a struct for machine processing. */
  501. extern int parse_insn_tilepro(tilepro_bundle_bits bits,
  502. unsigned int pc,
  503. struct tilepro_decoded_instruction
  504. decoded[TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE]);
  505. /* Given a set of bundle bits and a specific pipe, returns which
  506. * instruction the bundle contains in that pipe.
  507. */
  508. extern const struct tilepro_opcode *
  509. find_opcode(tilepro_bundle_bits bits, tilepro_pipeline pipe);
  510. #endif /* opcode_tilepro_h */