Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1518 lines
46 KiB

  1. /*
  2. * Copyright (c) 2000, Intel Corporation
  3. * All rights reserved.
  4. *
  5. * WARRANTY DISCLAIMER
  6. *
  7. * THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
  11. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  14. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  15. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
  16. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
  17. * MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18. *
  19. * Intel Corporation is the author of the Materials, and requests that all
  20. * problem reports or change requests be submitted to it directly at
  21. * http://developer.intel.com/opensource.
  22. */
  23. #ifndef EM_DECODER_H
  24. #define EM_DECODER_H
  25. #include "inst_ids.h"
  26. #include "emdb_types.h"
  27. #include "EM.h"
  28. #define EM_DECODER_INST_NONE EM_INST_NONE
  29. typedef Inst_id_t EM_Decoder_Inst_Id;
  30. typedef unsigned char EM_Decoder_imp_oper_t;
  31. #include "EM_tools.h"
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. typedef enum em_cmp_rel_s
  36. {
  37. EM_CMP_REL_NONE = 0,
  38. EM_CMP_REL_GEU = 1,
  39. EM_CMP_REL_LTU = 2,
  40. EM_CMP_REL_EQ = 3,
  41. EM_CMP_REL_NE = 4,
  42. EM_CMP_REL_LT = 5,
  43. EM_CMP_REL_GE = 6,
  44. EM_CMP_REL_GT = 7,
  45. EM_CMP_REL_LE = 8,
  46. EM_CMP_REL_UNORD = 9,
  47. EM_CMP_REL_ORD = 10,
  48. EM_CMP_REL_NEQ = 11,
  49. EM_CMP_REL_NLT = 12,
  50. EM_CMP_REL_NLE = 13,
  51. EM_CMP_REL_LAST = 14
  52. } EM_cmp_rel_t;
  53. typedef enum em_fp_precision_s
  54. {
  55. EM_FP_PRECISION_NONE = 0,
  56. EM_FP_PRECISION_SINGLE = 1,
  57. EM_FP_PRECISION_DOUBLE = 2,
  58. EM_FP_PRECISION_DYNAMIC = 3,
  59. EM_FP_PRECISION_LAST = 4
  60. } EM_fp_precision_t;
  61. typedef enum em_fp_status_s
  62. {
  63. EM_FP_STATUS_NONE = 0,
  64. EM_FP_STATUS_S0 = 1,
  65. EM_FP_STATUS_S1 = 2,
  66. EM_FP_STATUS_S2 = 3,
  67. EM_FP_STATUS_S3 = 4,
  68. EM_FP_STATUS_LAST = 5
  69. } EM_fp_status_t;
  70. typedef enum EM_decoder_imp_operand
  71. {
  72. EM_DECODER_IMP_OPERAND_NONE = 0,
  73. EM_DECODER_IMP_OPERAND_AR_LC,
  74. EM_DECODER_IMP_OPERAND_RR,
  75. EM_DECODER_IMP_OPERAND_AR_BSPSTORE,
  76. EM_DECODER_IMP_OPERAND_APP_REG_GRP_HIGH,
  77. EM_DECODER_IMP_OPERAND_DTR,
  78. EM_DECODER_IMP_OPERAND_AR_UNAT,
  79. EM_DECODER_IMP_OPERAND_CR_IIM,
  80. EM_DECODER_IMP_OPERAND_PSR,
  81. EM_DECODER_IMP_OPERAND_CFM,
  82. EM_DECODER_IMP_OPERAND_CR_IFS,
  83. EM_DECODER_IMP_OPERAND_CR_ISR,
  84. EM_DECODER_IMP_OPERAND_AR_BSP,
  85. EM_DECODER_IMP_OPERAND_AR_RSC,
  86. EM_DECODER_IMP_OPERAND_AR_EC,
  87. EM_DECODER_IMP_OPERAND_AR_PFS,
  88. EM_DECODER_IMP_OPERAND_FPSR,
  89. EM_DECODER_IMP_OPERAND_APP_CCV,
  90. EM_DECODER_IMP_OPERAND_PR63,
  91. EM_DECODER_IMP_OPERAND_DCR,
  92. EM_DECODER_IMP_OPERAND_CR_IIP,
  93. EM_DECODER_IMP_OPERAND_IPSR,
  94. EM_DECODER_IMP_OPERAND_CSD,
  95. EM_DECODER_IMP_OPERAND_IP,
  96. EM_DECODER_IMP_OPERAND_EIP,
  97. EM_DECODER_IMP_OPERAND_MSR_XIP,
  98. EM_DECODER_IMP_OPERAND_MSR_XPSR,
  99. EM_DECODER_IMP_OPERAND_MSR_XFS,
  100. EM_DECODER_IMP_OPERAND_AR_ITC,
  101. EM_DECODER_IMP_OPERAND_AR_RNAT,
  102. EM_DECODER_IMP_OPERAND_AR_RCS,
  103. EM_DECODER_IMP_OPERAND_CR_CMCV,
  104. EM_DECODER_IMP_OPERAND_CR_EOI,
  105. EM_DECODER_IMP_OPERAND_CR_GPTA,
  106. EM_DECODER_IMP_OPERAND_CR_IFA,
  107. EM_DECODER_IMP_OPERAND_CR_IHA,
  108. EM_DECODER_IMP_OPERAND_CR_IIPA,
  109. EM_DECODER_IMP_OPERAND_CR_ITIR,
  110. EM_DECODER_IMP_OPERAND_CR_ITM,
  111. EM_DECODER_IMP_OPERAND_CR_ITV,
  112. EM_DECODER_IMP_OPERAND_CR_IVA,
  113. EM_DECODER_IMP_OPERAND_CR_IVR,
  114. EM_DECODER_IMP_OPERAND_CR_LID,
  115. EM_DECODER_IMP_OPERAND_CR_PMV,
  116. EM_DECODER_IMP_OPERAND_CR_PTA,
  117. EM_DECODER_IMP_OPERAND_CR_TPR,
  118. EM_DECODER_IMP_OPERAND_LAST
  119. } EM_Decoder_Imp_Operand;
  120. typedef enum EM_decoder_err
  121. {
  122. EM_DECODER_NO_ERROR = 0,
  123. EM_DECODER_INVALID_SLOT_BRANCH_INST,
  124. EM_DECODER_MUST_BE_GROUP_LAST,
  125. EM_DECODER_BASE_EQUAL_DEST,
  126. EM_DECODER_EQUAL_DESTS,
  127. EM_DECODER_ODD_EVEN_DESTS,
  128. EM_DECODER_WRITE_TO_ZERO_REGISTER,
  129. EM_DECODER_WRITE_TO_SPECIAL_FP_REGISTER,
  130. EM_DECODER_REGISTER_VALUE_OUT_OF_RANGE,
  131. EM_DECODER_REGISTER_RESERVED_VALUE,
  132. EM_DECODER_IMMEDIATE_VALUE_OUT_OF_RANGE,
  133. EM_DECODER_IMMEDIATE_INVALID_VALUE,
  134. EM_DECODER_STACK_FRAME_SIZE_OUT_OF_RANGE,
  135. EM_DECODER_LOCALS_SIZE_LARGER_STACK_FRAME,
  136. EM_DECODER_ROTATING_SIZE_LARGER_STACK_FRAME,
  137. EM_DECODER_HARD_CODED_PREDICATE_INVALID_VALUE,
  138. EM_DECODER_FIRST_FATAL_INST_ERROR,
  139. EM_DECODER_INVALID_PRM_OPCODE = EM_DECODER_FIRST_FATAL_INST_ERROR,
  140. EM_DECODER_INVALID_INST_SLOT,
  141. EM_DECODER_FIRST_FATAL_ERROR,
  142. EM_DECODER_INVALID_TEMPLATE = EM_DECODER_FIRST_FATAL_ERROR,
  143. EM_DECODER_INVALID_CLIENT_ID,
  144. EM_DECODER_NULL_PTR,
  145. EM_DECODER_TOO_SHORT_ERR,
  146. EM_DECODER_ASSOCIATE_MISS,
  147. EM_DECODER_INVALID_INST_ID,
  148. EM_DECODER_INVALID_MACHINE_MODE,
  149. EM_DECODER_INVALID_MACHINE_TYPE,
  150. EM_DECODER_INTERNAL_ERROR,
  151. EM_DECODER_LAST_ERROR
  152. } EM_Decoder_Err;
  153. typedef EM_Decoder_Err DecErr();
  154. typedef enum EM_decoder_machine_type
  155. {
  156. EM_DECODER_CPU_NO_CHANGE=0,
  157. EM_DECODER_CPU_DEFAULT,
  158. EM_DECODER_CPU_P7 = 4,
  159. EM_DECODER_CPU_LAST = 7
  160. } EM_Decoder_Machine_Type;
  161. typedef enum EM_decoder_machine_mode
  162. {
  163. EM_DECODER_MODE_NO_CHANGE = 0,
  164. EM_DECODER_MODE_DEFAULT,
  165. EM_DECODER_MODE_EM = 8,
  166. EM_DECODER_MODE_LAST = 9
  167. } EM_Decoder_Machine_Mode;
  168. typedef enum EM_decoder_operand_type
  169. {
  170. EM_DECODER_NO_OPER = 0,
  171. EM_DECODER_REGISTER,
  172. EM_DECODER_MEMORY,
  173. EM_DECODER_IMMEDIATE,
  174. EM_DECODER_IP_RELATIVE,
  175. EM_DECODER_REGFILE,
  176. EM_DECODER_OPERAND_LAST
  177. } EM_Decoder_Operand_Type;
  178. typedef enum EM_decoder_reg_type
  179. {
  180. EM_DECODER_NO_REG_TYPE = 0,
  181. EM_DECODER_INT_REG = 7,
  182. EM_DECODER_FP_REG,
  183. EM_DECODER_APP_REG,
  184. EM_DECODER_BR_REG,
  185. EM_DECODER_PRED_REG = 13,
  186. EM_DECODER_CR_REG,
  187. EM_DECODER_APP_CCV_REG,
  188. EM_DECODER_APP_PFS_REG,
  189. EM_DECODER_PR_REG,
  190. EM_DECODER_PR_ROT_REG,
  191. EM_DECODER_PSR_REG,
  192. EM_DECODER_PSR_L_REG,
  193. EM_DECODER_PSR_UM_REG = 20,
  194. EM_DECODER_IP_REG, /* IP register type */
  195. EM_DECODER_REG_TYPE_LAST
  196. } EM_Decoder_Reg_Type;
  197. typedef enum EM_decoder_reg_name
  198. {
  199. EM_DECODER_NO_REG=0,
  200. EM_DECODER_REG_R0 = 98,
  201. EM_DECODER_REG_R1,
  202. EM_DECODER_REG_R2,
  203. EM_DECODER_REG_R3,
  204. EM_DECODER_REG_R4,
  205. EM_DECODER_REG_R5,
  206. EM_DECODER_REG_R6,
  207. EM_DECODER_REG_R7,
  208. EM_DECODER_REG_R8,
  209. EM_DECODER_REG_R9,
  210. EM_DECODER_REG_R10,
  211. EM_DECODER_REG_R11,
  212. EM_DECODER_REG_R12,
  213. EM_DECODER_REG_R13,
  214. EM_DECODER_REG_R14,
  215. EM_DECODER_REG_R15,
  216. EM_DECODER_REG_R16,
  217. EM_DECODER_REG_R17,
  218. EM_DECODER_REG_R18,
  219. EM_DECODER_REG_R19,
  220. EM_DECODER_REG_R20,
  221. EM_DECODER_REG_R21,
  222. EM_DECODER_REG_R22,
  223. EM_DECODER_REG_R23,
  224. EM_DECODER_REG_R24,
  225. EM_DECODER_REG_R25,
  226. EM_DECODER_REG_R26,
  227. EM_DECODER_REG_R27,
  228. EM_DECODER_REG_R28,
  229. EM_DECODER_REG_R29,
  230. EM_DECODER_REG_R30,
  231. EM_DECODER_REG_R31,
  232. EM_DECODER_REG_R32,
  233. EM_DECODER_REG_R33,
  234. EM_DECODER_REG_R34,
  235. EM_DECODER_REG_R35,
  236. EM_DECODER_REG_R36,
  237. EM_DECODER_REG_R37,
  238. EM_DECODER_REG_R38,
  239. EM_DECODER_REG_R39,
  240. EM_DECODER_REG_R40,
  241. EM_DECODER_REG_R41,
  242. EM_DECODER_REG_R42,
  243. EM_DECODER_REG_R43,
  244. EM_DECODER_REG_R44,
  245. EM_DECODER_REG_R45,
  246. EM_DECODER_REG_R46,
  247. EM_DECODER_REG_R47,
  248. EM_DECODER_REG_R48,
  249. EM_DECODER_REG_R49,
  250. EM_DECODER_REG_R50,
  251. EM_DECODER_REG_R51,
  252. EM_DECODER_REG_R52,
  253. EM_DECODER_REG_R53,
  254. EM_DECODER_REG_R54,
  255. EM_DECODER_REG_R55,
  256. EM_DECODER_REG_R56,
  257. EM_DECODER_REG_R57,
  258. EM_DECODER_REG_R58,
  259. EM_DECODER_REG_R59,
  260. EM_DECODER_REG_R60,
  261. EM_DECODER_REG_R61,
  262. EM_DECODER_REG_R62,
  263. EM_DECODER_REG_R63,
  264. EM_DECODER_REG_R64,
  265. EM_DECODER_REG_R65,
  266. EM_DECODER_REG_R66,
  267. EM_DECODER_REG_R67,
  268. EM_DECODER_REG_R68,
  269. EM_DECODER_REG_R69,
  270. EM_DECODER_REG_R70,
  271. EM_DECODER_REG_R71,
  272. EM_DECODER_REG_R72,
  273. EM_DECODER_REG_R73,
  274. EM_DECODER_REG_R74,
  275. EM_DECODER_REG_R75,
  276. EM_DECODER_REG_R76,
  277. EM_DECODER_REG_R77,
  278. EM_DECODER_REG_R78,
  279. EM_DECODER_REG_R79,
  280. EM_DECODER_REG_R80,
  281. EM_DECODER_REG_R81,
  282. EM_DECODER_REG_R82,
  283. EM_DECODER_REG_R83,
  284. EM_DECODER_REG_R84,
  285. EM_DECODER_REG_R85,
  286. EM_DECODER_REG_R86,
  287. EM_DECODER_REG_R87,
  288. EM_DECODER_REG_R88,
  289. EM_DECODER_REG_R89,
  290. EM_DECODER_REG_R90,
  291. EM_DECODER_REG_R91,
  292. EM_DECODER_REG_R92,
  293. EM_DECODER_REG_R93,
  294. EM_DECODER_REG_R94,
  295. EM_DECODER_REG_R95,
  296. EM_DECODER_REG_R96,
  297. EM_DECODER_REG_R97,
  298. EM_DECODER_REG_R98,
  299. EM_DECODER_REG_R99,
  300. EM_DECODER_REG_R100,
  301. EM_DECODER_REG_R101,
  302. EM_DECODER_REG_R102,
  303. EM_DECODER_REG_R103,
  304. EM_DECODER_REG_R104,
  305. EM_DECODER_REG_R105,
  306. EM_DECODER_REG_R106,
  307. EM_DECODER_REG_R107,
  308. EM_DECODER_REG_R108,
  309. EM_DECODER_REG_R109,
  310. EM_DECODER_REG_R110,
  311. EM_DECODER_REG_R111,
  312. EM_DECODER_REG_R112,
  313. EM_DECODER_REG_R113,
  314. EM_DECODER_REG_R114,
  315. EM_DECODER_REG_R115,
  316. EM_DECODER_REG_R116,
  317. EM_DECODER_REG_R117,
  318. EM_DECODER_REG_R118,
  319. EM_DECODER_REG_R119,
  320. EM_DECODER_REG_R120,
  321. EM_DECODER_REG_R121,
  322. EM_DECODER_REG_R122,
  323. EM_DECODER_REG_R123,
  324. EM_DECODER_REG_R124,
  325. EM_DECODER_REG_R125,
  326. EM_DECODER_REG_R126,
  327. EM_DECODER_REG_R127,
  328. EM_DECODER_REG_F0,
  329. EM_DECODER_REG_F1,
  330. EM_DECODER_REG_F2,
  331. EM_DECODER_REG_F3,
  332. EM_DECODER_REG_F4,
  333. EM_DECODER_REG_F5,
  334. EM_DECODER_REG_F6,
  335. EM_DECODER_REG_F7,
  336. EM_DECODER_REG_F8,
  337. EM_DECODER_REG_F9,
  338. EM_DECODER_REG_F10,
  339. EM_DECODER_REG_F11,
  340. EM_DECODER_REG_F12,
  341. EM_DECODER_REG_F13,
  342. EM_DECODER_REG_F14,
  343. EM_DECODER_REG_F15,
  344. EM_DECODER_REG_F16,
  345. EM_DECODER_REG_F17,
  346. EM_DECODER_REG_F18,
  347. EM_DECODER_REG_F19,
  348. EM_DECODER_REG_F20,
  349. EM_DECODER_REG_F21,
  350. EM_DECODER_REG_F22,
  351. EM_DECODER_REG_F23,
  352. EM_DECODER_REG_F24,
  353. EM_DECODER_REG_F25,
  354. EM_DECODER_REG_F26,
  355. EM_DECODER_REG_F27,
  356. EM_DECODER_REG_F28,
  357. EM_DECODER_REG_F29,
  358. EM_DECODER_REG_F30,
  359. EM_DECODER_REG_F31,
  360. EM_DECODER_REG_F32,
  361. EM_DECODER_REG_F33,
  362. EM_DECODER_REG_F34,
  363. EM_DECODER_REG_F35,
  364. EM_DECODER_REG_F36,
  365. EM_DECODER_REG_F37,
  366. EM_DECODER_REG_F38,
  367. EM_DECODER_REG_F39,
  368. EM_DECODER_REG_F40,
  369. EM_DECODER_REG_F41,
  370. EM_DECODER_REG_F42,
  371. EM_DECODER_REG_F43,
  372. EM_DECODER_REG_F44,
  373. EM_DECODER_REG_F45,
  374. EM_DECODER_REG_F46,
  375. EM_DECODER_REG_F47,
  376. EM_DECODER_REG_F48,
  377. EM_DECODER_REG_F49,
  378. EM_DECODER_REG_F50,
  379. EM_DECODER_REG_F51,
  380. EM_DECODER_REG_F52,
  381. EM_DECODER_REG_F53,
  382. EM_DECODER_REG_F54,
  383. EM_DECODER_REG_F55,
  384. EM_DECODER_REG_F56,
  385. EM_DECODER_REG_F57,
  386. EM_DECODER_REG_F58,
  387. EM_DECODER_REG_F59,
  388. EM_DECODER_REG_F60,
  389. EM_DECODER_REG_F61,
  390. EM_DECODER_REG_F62,
  391. EM_DECODER_REG_F63,
  392. EM_DECODER_REG_F64,
  393. EM_DECODER_REG_F65,
  394. EM_DECODER_REG_F66,
  395. EM_DECODER_REG_F67,
  396. EM_DECODER_REG_F68,
  397. EM_DECODER_REG_F69,
  398. EM_DECODER_REG_F70,
  399. EM_DECODER_REG_F71,
  400. EM_DECODER_REG_F72,
  401. EM_DECODER_REG_F73,
  402. EM_DECODER_REG_F74,
  403. EM_DECODER_REG_F75,
  404. EM_DECODER_REG_F76,
  405. EM_DECODER_REG_F77,
  406. EM_DECODER_REG_F78,
  407. EM_DECODER_REG_F79,
  408. EM_DECODER_REG_F80,
  409. EM_DECODER_REG_F81,
  410. EM_DECODER_REG_F82,
  411. EM_DECODER_REG_F83,
  412. EM_DECODER_REG_F84,
  413. EM_DECODER_REG_F85,
  414. EM_DECODER_REG_F86,
  415. EM_DECODER_REG_F87,
  416. EM_DECODER_REG_F88,
  417. EM_DECODER_REG_F89,
  418. EM_DECODER_REG_F90,
  419. EM_DECODER_REG_F91,
  420. EM_DECODER_REG_F92,
  421. EM_DECODER_REG_F93,
  422. EM_DECODER_REG_F94,
  423. EM_DECODER_REG_F95,
  424. EM_DECODER_REG_F96,
  425. EM_DECODER_REG_F97,
  426. EM_DECODER_REG_F98,
  427. EM_DECODER_REG_F99,
  428. EM_DECODER_REG_F100,
  429. EM_DECODER_REG_F101,
  430. EM_DECODER_REG_F102,
  431. EM_DECODER_REG_F103,
  432. EM_DECODER_REG_F104,
  433. EM_DECODER_REG_F105,
  434. EM_DECODER_REG_F106,
  435. EM_DECODER_REG_F107,
  436. EM_DECODER_REG_F108,
  437. EM_DECODER_REG_F109,
  438. EM_DECODER_REG_F110,
  439. EM_DECODER_REG_F111,
  440. EM_DECODER_REG_F112,
  441. EM_DECODER_REG_F113,
  442. EM_DECODER_REG_F114,
  443. EM_DECODER_REG_F115,
  444. EM_DECODER_REG_F116,
  445. EM_DECODER_REG_F117,
  446. EM_DECODER_REG_F118,
  447. EM_DECODER_REG_F119,
  448. EM_DECODER_REG_F120,
  449. EM_DECODER_REG_F121,
  450. EM_DECODER_REG_F122,
  451. EM_DECODER_REG_F123,
  452. EM_DECODER_REG_F124,
  453. EM_DECODER_REG_F125,
  454. EM_DECODER_REG_F126,
  455. EM_DECODER_REG_F127,
  456. EM_DECODER_REG_AR0,
  457. EM_DECODER_REG_AR1,
  458. EM_DECODER_REG_AR2,
  459. EM_DECODER_REG_AR3,
  460. EM_DECODER_REG_AR4,
  461. EM_DECODER_REG_AR5,
  462. EM_DECODER_REG_AR6,
  463. EM_DECODER_REG_AR7,
  464. EM_DECODER_REG_AR8,
  465. EM_DECODER_REG_AR9,
  466. EM_DECODER_REG_AR10,
  467. EM_DECODER_REG_AR11,
  468. EM_DECODER_REG_AR12,
  469. EM_DECODER_REG_AR13,
  470. EM_DECODER_REG_AR14,
  471. EM_DECODER_REG_AR15,
  472. EM_DECODER_REG_AR16,
  473. EM_DECODER_REG_AR17,
  474. EM_DECODER_REG_AR18,
  475. EM_DECODER_REG_AR19,
  476. EM_DECODER_REG_AR20,
  477. EM_DECODER_REG_AR21,
  478. EM_DECODER_REG_AR22,
  479. EM_DECODER_REG_AR23,
  480. EM_DECODER_REG_AR24,
  481. EM_DECODER_REG_AR25,
  482. EM_DECODER_REG_AR26,
  483. EM_DECODER_REG_AR27,
  484. EM_DECODER_REG_AR28,
  485. EM_DECODER_REG_AR29,
  486. EM_DECODER_REG_AR30,
  487. EM_DECODER_REG_AR31,
  488. EM_DECODER_REG_AR32,
  489. EM_DECODER_REG_AR33,
  490. EM_DECODER_REG_AR34,
  491. EM_DECODER_REG_AR35,
  492. EM_DECODER_REG_AR36,
  493. EM_DECODER_REG_AR37,
  494. EM_DECODER_REG_AR38,
  495. EM_DECODER_REG_AR39,
  496. EM_DECODER_REG_AR40,
  497. EM_DECODER_REG_AR41,
  498. EM_DECODER_REG_AR42,
  499. EM_DECODER_REG_AR43,
  500. EM_DECODER_REG_AR44,
  501. EM_DECODER_REG_AR45,
  502. EM_DECODER_REG_AR46,
  503. EM_DECODER_REG_AR47,
  504. EM_DECODER_REG_AR48,
  505. EM_DECODER_REG_AR49,
  506. EM_DECODER_REG_AR50,
  507. EM_DECODER_REG_AR51,
  508. EM_DECODER_REG_AR52,
  509. EM_DECODER_REG_AR53,
  510. EM_DECODER_REG_AR54,
  511. EM_DECODER_REG_AR55,
  512. EM_DECODER_REG_AR56,
  513. EM_DECODER_REG_AR57,
  514. EM_DECODER_REG_AR58,
  515. EM_DECODER_REG_AR59,
  516. EM_DECODER_REG_AR60,
  517. EM_DECODER_REG_AR61,
  518. EM_DECODER_REG_AR62,
  519. EM_DECODER_REG_AR63,
  520. EM_DECODER_REG_AR64,
  521. EM_DECODER_REG_AR65,
  522. EM_DECODER_REG_AR66,
  523. EM_DECODER_REG_AR67,
  524. EM_DECODER_REG_AR68,
  525. EM_DECODER_REG_AR69,
  526. EM_DECODER_REG_AR70,
  527. EM_DECODER_REG_AR71,
  528. EM_DECODER_REG_AR72,
  529. EM_DECODER_REG_AR73,
  530. EM_DECODER_REG_AR74,
  531. EM_DECODER_REG_AR75,
  532. EM_DECODER_REG_AR76,
  533. EM_DECODER_REG_AR77,
  534. EM_DECODER_REG_AR78,
  535. EM_DECODER_REG_AR79,
  536. EM_DECODER_REG_AR80,
  537. EM_DECODER_REG_AR81,
  538. EM_DECODER_REG_AR82,
  539. EM_DECODER_REG_AR83,
  540. EM_DECODER_REG_AR84,
  541. EM_DECODER_REG_AR85,
  542. EM_DECODER_REG_AR86,
  543. EM_DECODER_REG_AR87,
  544. EM_DECODER_REG_AR88,
  545. EM_DECODER_REG_AR89,
  546. EM_DECODER_REG_AR90,
  547. EM_DECODER_REG_AR91,
  548. EM_DECODER_REG_AR92,
  549. EM_DECODER_REG_AR93,
  550. EM_DECODER_REG_AR94,
  551. EM_DECODER_REG_AR95,
  552. EM_DECODER_REG_AR96,
  553. EM_DECODER_REG_AR97,
  554. EM_DECODER_REG_AR98,
  555. EM_DECODER_REG_AR99,
  556. EM_DECODER_REG_AR100,
  557. EM_DECODER_REG_AR101,
  558. EM_DECODER_REG_AR102,
  559. EM_DECODER_REG_AR103,
  560. EM_DECODER_REG_AR104,
  561. EM_DECODER_REG_AR105,
  562. EM_DECODER_REG_AR106,
  563. EM_DECODER_REG_AR107,
  564. EM_DECODER_REG_AR108,
  565. EM_DECODER_REG_AR109,
  566. EM_DECODER_REG_AR110,
  567. EM_DECODER_REG_AR111,
  568. EM_DECODER_REG_AR112,
  569. EM_DECODER_REG_AR113,
  570. EM_DECODER_REG_AR114,
  571. EM_DECODER_REG_AR115,
  572. EM_DECODER_REG_AR116,
  573. EM_DECODER_REG_AR117,
  574. EM_DECODER_REG_AR118,
  575. EM_DECODER_REG_AR119,
  576. EM_DECODER_REG_AR120,
  577. EM_DECODER_REG_AR121,
  578. EM_DECODER_REG_AR122,
  579. EM_DECODER_REG_AR123,
  580. EM_DECODER_REG_AR124,
  581. EM_DECODER_REG_AR125,
  582. EM_DECODER_REG_AR126,
  583. EM_DECODER_REG_AR127,
  584. EM_DECODER_REG_P0,
  585. EM_DECODER_REG_P1,
  586. EM_DECODER_REG_P2,
  587. EM_DECODER_REG_P3,
  588. EM_DECODER_REG_P4,
  589. EM_DECODER_REG_P5,
  590. EM_DECODER_REG_P6,
  591. EM_DECODER_REG_P7,
  592. EM_DECODER_REG_P8,
  593. EM_DECODER_REG_P9,
  594. EM_DECODER_REG_P10,
  595. EM_DECODER_REG_P11,
  596. EM_DECODER_REG_P12,
  597. EM_DECODER_REG_P13,
  598. EM_DECODER_REG_P14,
  599. EM_DECODER_REG_P15,
  600. EM_DECODER_REG_P16,
  601. EM_DECODER_REG_P17,
  602. EM_DECODER_REG_P18,
  603. EM_DECODER_REG_P19,
  604. EM_DECODER_REG_P20,
  605. EM_DECODER_REG_P21,
  606. EM_DECODER_REG_P22,
  607. EM_DECODER_REG_P23,
  608. EM_DECODER_REG_P24,
  609. EM_DECODER_REG_P25,
  610. EM_DECODER_REG_P26,
  611. EM_DECODER_REG_P27,
  612. EM_DECODER_REG_P28,
  613. EM_DECODER_REG_P29,
  614. EM_DECODER_REG_P30,
  615. EM_DECODER_REG_P31,
  616. EM_DECODER_REG_P32,
  617. EM_DECODER_REG_P33,
  618. EM_DECODER_REG_P34,
  619. EM_DECODER_REG_P35,
  620. EM_DECODER_REG_P36,
  621. EM_DECODER_REG_P37,
  622. EM_DECODER_REG_P38,
  623. EM_DECODER_REG_P39,
  624. EM_DECODER_REG_P40,
  625. EM_DECODER_REG_P41,
  626. EM_DECODER_REG_P42,
  627. EM_DECODER_REG_P43,
  628. EM_DECODER_REG_P44,
  629. EM_DECODER_REG_P45,
  630. EM_DECODER_REG_P46,
  631. EM_DECODER_REG_P47,
  632. EM_DECODER_REG_P48,
  633. EM_DECODER_REG_P49,
  634. EM_DECODER_REG_P50,
  635. EM_DECODER_REG_P51,
  636. EM_DECODER_REG_P52,
  637. EM_DECODER_REG_P53,
  638. EM_DECODER_REG_P54,
  639. EM_DECODER_REG_P55,
  640. EM_DECODER_REG_P56,
  641. EM_DECODER_REG_P57,
  642. EM_DECODER_REG_P58,
  643. EM_DECODER_REG_P59,
  644. EM_DECODER_REG_P60,
  645. EM_DECODER_REG_P61,
  646. EM_DECODER_REG_P62,
  647. EM_DECODER_REG_P63,
  648. EM_DECODER_REG_BR0 ,
  649. EM_DECODER_REG_BR1,
  650. EM_DECODER_REG_BR2,
  651. EM_DECODER_REG_BR3,
  652. EM_DECODER_REG_BR4,
  653. EM_DECODER_REG_BR5,
  654. EM_DECODER_REG_BR6,
  655. EM_DECODER_REG_BR7,
  656. EM_DECODER_REG_PR,
  657. EM_DECODER_REG_PR_ROT,
  658. EM_DECODER_REG_CR0,
  659. EM_DECODER_REG_CR1,
  660. EM_DECODER_REG_CR2,
  661. EM_DECODER_REG_CR3,
  662. EM_DECODER_REG_CR4,
  663. EM_DECODER_REG_CR5,
  664. EM_DECODER_REG_CR6,
  665. EM_DECODER_REG_CR7,
  666. EM_DECODER_REG_CR8,
  667. EM_DECODER_REG_CR9,
  668. EM_DECODER_REG_CR10,
  669. EM_DECODER_REG_CR11,
  670. EM_DECODER_REG_CR12,
  671. EM_DECODER_REG_CR13,
  672. EM_DECODER_REG_CR14,
  673. EM_DECODER_REG_CR15,
  674. EM_DECODER_REG_CR16,
  675. EM_DECODER_REG_CR17,
  676. EM_DECODER_REG_CR18,
  677. EM_DECODER_REG_CR19,
  678. EM_DECODER_REG_CR20,
  679. EM_DECODER_REG_CR21,
  680. EM_DECODER_REG_CR22,
  681. EM_DECODER_REG_CR23,
  682. EM_DECODER_REG_CR24,
  683. EM_DECODER_REG_CR25,
  684. EM_DECODER_REG_CR26,
  685. EM_DECODER_REG_CR27,
  686. EM_DECODER_REG_CR28,
  687. EM_DECODER_REG_CR29,
  688. EM_DECODER_REG_CR30,
  689. EM_DECODER_REG_CR31,
  690. EM_DECODER_REG_CR32,
  691. EM_DECODER_REG_CR33,
  692. EM_DECODER_REG_CR34,
  693. EM_DECODER_REG_CR35,
  694. EM_DECODER_REG_CR36,
  695. EM_DECODER_REG_CR37,
  696. EM_DECODER_REG_CR38,
  697. EM_DECODER_REG_CR39,
  698. EM_DECODER_REG_CR40,
  699. EM_DECODER_REG_CR41,
  700. EM_DECODER_REG_CR42,
  701. EM_DECODER_REG_CR43,
  702. EM_DECODER_REG_CR44,
  703. EM_DECODER_REG_CR45,
  704. EM_DECODER_REG_CR46,
  705. EM_DECODER_REG_CR47,
  706. EM_DECODER_REG_CR48,
  707. EM_DECODER_REG_CR49,
  708. EM_DECODER_REG_CR50,
  709. EM_DECODER_REG_CR51,
  710. EM_DECODER_REG_CR52,
  711. EM_DECODER_REG_CR53,
  712. EM_DECODER_REG_CR54,
  713. EM_DECODER_REG_CR55,
  714. EM_DECODER_REG_CR56,
  715. EM_DECODER_REG_CR57,
  716. EM_DECODER_REG_CR58,
  717. EM_DECODER_REG_CR59,
  718. EM_DECODER_REG_CR60,
  719. EM_DECODER_REG_CR61,
  720. EM_DECODER_REG_CR62,
  721. EM_DECODER_REG_CR63,
  722. EM_DECODER_REG_CR64,
  723. EM_DECODER_REG_CR65,
  724. EM_DECODER_REG_CR66,
  725. EM_DECODER_REG_CR67,
  726. EM_DECODER_REG_CR68,
  727. EM_DECODER_REG_CR69,
  728. EM_DECODER_REG_CR70,
  729. EM_DECODER_REG_CR71,
  730. EM_DECODER_REG_CR72,
  731. EM_DECODER_REG_CR73,
  732. EM_DECODER_REG_CR74,
  733. EM_DECODER_REG_CR75,
  734. EM_DECODER_REG_CR76,
  735. EM_DECODER_REG_CR77,
  736. EM_DECODER_REG_CR78,
  737. EM_DECODER_REG_CR79,
  738. EM_DECODER_REG_CR80,
  739. EM_DECODER_REG_CR81,
  740. EM_DECODER_REG_CR82,
  741. EM_DECODER_REG_CR83,
  742. EM_DECODER_REG_CR84,
  743. EM_DECODER_REG_CR85,
  744. EM_DECODER_REG_CR86,
  745. EM_DECODER_REG_CR87,
  746. EM_DECODER_REG_CR88,
  747. EM_DECODER_REG_CR89,
  748. EM_DECODER_REG_CR90,
  749. EM_DECODER_REG_CR91,
  750. EM_DECODER_REG_CR92,
  751. EM_DECODER_REG_CR93,
  752. EM_DECODER_REG_CR94,
  753. EM_DECODER_REG_CR95,
  754. EM_DECODER_REG_CR96,
  755. EM_DECODER_REG_CR97,
  756. EM_DECODER_REG_CR98,
  757. EM_DECODER_REG_CR99,
  758. EM_DECODER_REG_CR100,
  759. EM_DECODER_REG_CR101,
  760. EM_DECODER_REG_CR102,
  761. EM_DECODER_REG_CR103,
  762. EM_DECODER_REG_CR104,
  763. EM_DECODER_REG_CR105,
  764. EM_DECODER_REG_CR106,
  765. EM_DECODER_REG_CR107,
  766. EM_DECODER_REG_CR108,
  767. EM_DECODER_REG_CR109,
  768. EM_DECODER_REG_CR110,
  769. EM_DECODER_REG_CR111,
  770. EM_DECODER_REG_CR112,
  771. EM_DECODER_REG_CR113,
  772. EM_DECODER_REG_CR114,
  773. EM_DECODER_REG_CR115,
  774. EM_DECODER_REG_CR116,
  775. EM_DECODER_REG_CR117,
  776. EM_DECODER_REG_CR118,
  777. EM_DECODER_REG_CR119,
  778. EM_DECODER_REG_CR120,
  779. EM_DECODER_REG_CR121,
  780. EM_DECODER_REG_CR122,
  781. EM_DECODER_REG_CR123,
  782. EM_DECODER_REG_CR124,
  783. EM_DECODER_REG_CR125,
  784. EM_DECODER_REG_CR126,
  785. EM_DECODER_REG_CR127,
  786. EM_DECODER_REG_PSR,
  787. EM_DECODER_REG_PSR_L,
  788. EM_DECODER_REG_PSR_UM,
  789. EM_DECODER_REG_IP, /* register IP name */
  790. EM_DECODER_EM_REG_LAST,
  791. EM_DECODER_REG_AR_K0 = EM_DECODER_REG_AR0+EM_AR_KR0,
  792. EM_DECODER_REG_AR_K1 = EM_DECODER_REG_AR0+EM_AR_KR1,
  793. EM_DECODER_REG_AR_K2 = EM_DECODER_REG_AR0+EM_AR_KR2,
  794. EM_DECODER_REG_AR_K3 = EM_DECODER_REG_AR0+EM_AR_KR3,
  795. EM_DECODER_REG_AR_K4 = EM_DECODER_REG_AR0+EM_AR_KR4, /* added AR_K4-7 */
  796. EM_DECODER_REG_AR_K5 = EM_DECODER_REG_AR0+EM_AR_KR5,
  797. EM_DECODER_REG_AR_K6 = EM_DECODER_REG_AR0+EM_AR_KR6,
  798. EM_DECODER_REG_AR_K7 = EM_DECODER_REG_AR0+EM_AR_KR7,
  799. EM_DECODER_REG_AR_RSC = EM_DECODER_REG_AR0+EM_AR_RSC,
  800. EM_DECODER_REG_AR_BSP = EM_DECODER_REG_AR0+EM_AR_BSP,
  801. EM_DECODER_REG_AR_BSPSTORE = EM_DECODER_REG_AR0+EM_AR_BSPSTORE,
  802. EM_DECODER_REG_AR_RNAT = EM_DECODER_REG_AR0+EM_AR_RNAT,
  803. EM_DECODER_REG_AR_EFLAG= EM_DECODER_REG_AR0+EM_AR_EFLAG,
  804. EM_DECODER_REG_AR_CSD = EM_DECODER_REG_AR0+EM_AR_CSD,
  805. EM_DECODER_REG_AR_SSD = EM_DECODER_REG_AR0+EM_AR_SSD,
  806. EM_DECODER_REG_AR_CFLG = EM_DECODER_REG_AR0+EM_AR_CFLG,
  807. EM_DECODER_REG_AR_FSR = EM_DECODER_REG_AR0+EM_AR_FSR,
  808. EM_DECODER_REG_AR_FIR = EM_DECODER_REG_AR0+EM_AR_FIR,
  809. EM_DECODER_REG_AR_FDR = EM_DECODER_REG_AR0+EM_AR_FDR,
  810. EM_DECODER_REG_AR_CCV = EM_DECODER_REG_AR0+EM_AR_CCV,
  811. EM_DECODER_REG_AR_UNAT = EM_DECODER_REG_AR0+EM_AR_UNAT,
  812. EM_DECODER_REG_AR_FPSR = EM_DECODER_REG_AR0+EM_AR_FPSR,
  813. EM_DECODER_REG_AR_ITC = EM_DECODER_REG_AR0+EM_AR_ITC,
  814. EM_DECODER_REG_AR_PFS = EM_DECODER_REG_AR0+EM_AR_PFS,
  815. EM_DECODER_REG_AR_LC = EM_DECODER_REG_AR0+EM_AR_LC,
  816. EM_DECODER_REG_AR_EC = EM_DECODER_REG_AR0+EM_AR_EC,
  817. EM_DECODER_REG_CR_DCR = EM_DECODER_REG_CR0+EM_CR_DCR,
  818. EM_DECODER_REG_CR_ITM = EM_DECODER_REG_CR0+EM_CR_ITM,
  819. EM_DECODER_REG_CR_IVA = EM_DECODER_REG_CR0+EM_CR_IVA,
  820. EM_DECODER_REG_CR_PTA = EM_DECODER_REG_CR0+EM_CR_PTA,
  821. EM_DECODER_REG_CR_GPTA = EM_DECODER_REG_CR0+EM_CR_GPTA,
  822. EM_DECODER_REG_CR_IPSR = EM_DECODER_REG_CR0+EM_CR_IPSR,
  823. EM_DECODER_REG_CR_ISR = EM_DECODER_REG_CR0+EM_CR_ISR,
  824. EM_DECODER_REG_CR_IIP = EM_DECODER_REG_CR0+EM_CR_IIP,
  825. EM_DECODER_REG_CR_IFA = EM_DECODER_REG_CR0+EM_CR_IFA,
  826. EM_DECODER_REG_CR_ITIR = EM_DECODER_REG_CR0+EM_CR_ITIR,
  827. EM_DECODER_REG_CR_IIPA = EM_DECODER_REG_CR0+EM_CR_IIPA,
  828. EM_DECODER_REG_CR_IFS = EM_DECODER_REG_CR0+EM_CR_IFS,
  829. EM_DECODER_REG_CR_IIM = EM_DECODER_REG_CR0+EM_CR_IIM,
  830. EM_DECODER_REG_CR_IHA = EM_DECODER_REG_CR0+EM_CR_IHA,
  831. EM_DECODER_REG_CR_LID = EM_DECODER_REG_CR0+EM_CR_LID,
  832. EM_DECODER_REG_CR_IVR = EM_DECODER_REG_CR0+EM_CR_IVR,
  833. EM_DECODER_REG_CR_TPR = EM_DECODER_REG_CR0+EM_CR_TPR,
  834. EM_DECODER_REG_CR_EOI = EM_DECODER_REG_CR0+EM_CR_EOI,
  835. EM_DECODER_REG_CR_IRR0 = EM_DECODER_REG_CR0+EM_CR_IRR0,
  836. EM_DECODER_REG_CR_IRR1 = EM_DECODER_REG_CR0+EM_CR_IRR1,
  837. EM_DECODER_REG_CR_IRR2 = EM_DECODER_REG_CR0+EM_CR_IRR2,
  838. EM_DECODER_REG_CR_IRR3 = EM_DECODER_REG_CR0+EM_CR_IRR3,
  839. EM_DECODER_REG_CR_ITV = EM_DECODER_REG_CR0+EM_CR_ITV,
  840. EM_DECODER_REG_CR_PMV = EM_DECODER_REG_CR0+EM_CR_PMV,
  841. EM_DECODER_REG_CR_LRR0 = EM_DECODER_REG_CR0+EM_CR_LRR0,
  842. EM_DECODER_REG_CR_LRR1 = EM_DECODER_REG_CR0+EM_CR_LRR1,
  843. EM_DECODER_REG_CR_CMCV = EM_DECODER_REG_CR0+EM_CR_CMCV,
  844. /************************************************************/
  845. EM_DECODER_REG_LAST
  846. } EM_Decoder_Reg_Name;
  847. typedef struct EM_decoder_reg_info
  848. {
  849. int valid;
  850. EM_Decoder_Reg_Type type;
  851. EM_Decoder_Reg_Name name;
  852. long value;
  853. } EM_Decoder_Reg_Info;
  854. typedef enum EM_DECODER_regfile_name
  855. {
  856. EM_DECODER_NO_REGFILE = 0,
  857. EM_DECODER_REGFILE_PMC,
  858. EM_DECODER_REGFILE_PMD,
  859. EM_DECODER_REGFILE_PKR,
  860. EM_DECODER_REGFILE_RR,
  861. EM_DECODER_REGFILE_IBR,
  862. EM_DECODER_REGFILE_DBR,
  863. EM_DECODER_REGFILE_ITR,
  864. EM_DECODER_REGFILE_DTR,
  865. EM_DECODER_REGFILE_MSR,
  866. EM_DECODER_REGFILE_CPUID,
  867. EM_DECODER_REGFILE_LAST
  868. } EM_Decoder_Regfile_Name;
  869. typedef enum EM_decoder_operand_2nd_role
  870. {
  871. EM_DECODER_OPER_2ND_ROLE_NONE = 0,
  872. EM_DECODER_OPER_2ND_ROLE_SRC,
  873. EM_DECODER_OPER_2ND_ROLE_DST
  874. } EM_Decoder_Operand_2nd_Role;
  875. typedef enum EM_decoder_oper_size
  876. {
  877. EM_DECODER_OPER_NO_SIZE = 0,
  878. EM_DECODER_OPER_SIZE_1 = 1,
  879. EM_DECODER_OPER_SIZE_2 = 2,
  880. EM_DECODER_OPER_SIZE_4 = 4,
  881. EM_DECODER_OPER_SIZE_8 = 8,
  882. EM_DECODER_OPER_SIZE_10 = 10,
  883. EM_DECODER_OPER_SIZE_16 = 16,
  884. EM_DECODER_OPER_SIZE_20 = 20,
  885. EM_DECODER_OPER_SIZE_22 = 22,
  886. EM_DECODER_OPER_SIZE_24 = 24,
  887. EM_DECODER_OPER_SIZE_32 = 32,
  888. EM_DECODER_OPER_SIZE_64 = 64
  889. } EM_Decoder_Oper_Size;
  890. typedef enum EM_decoder_imm_type
  891. {
  892. EM_DECODER_IMM_NONE,
  893. EM_DECODER_IMM_SIGNED,
  894. EM_DECODER_IMM_UNSIGNED,
  895. EM_DECODER_IMM_FCLASS,
  896. EM_DECODER_IMM_MUX1,
  897. EM_DECODER_IMM_LAST
  898. } EM_Decoder_Imm_Type;
  899. typedef enum EM_decoder_slot
  900. {
  901. EM_DECODER_SLOT_0 = 0,
  902. EM_DECODER_SLOT_1 = 1,
  903. EM_DECODER_SLOT_2 = 2,
  904. EM_DECODER_SLOT_LAST = 2
  905. } EM_Decoder_Slot;
  906. /***** EM_decoder Structure Defenition ****/
  907. typedef struct EM_decoder_modifiers_s
  908. {
  909. EM_cmp_type_t cmp_type;
  910. EM_cmp_rel_t cmp_rel;
  911. EM_branch_type_t branch_type;
  912. EM_branch_hint_t branch_hint;
  913. EM_fp_precision_t fp_precision;
  914. EM_fp_status_t fp_status;
  915. EM_memory_access_hint_t mem_access_hint;
  916. } EM_Decoder_modifiers_t;
  917. typedef struct EM_decoder_oper_static_s
  918. {
  919. Operand_role_t role;
  920. Operand_type_t type;
  921. unsigned long flags;
  922. } EM_Decoder_oper_static_t;
  923. #define EM_DECODER_MAX_EXP_DST (2)
  924. #define EM_DECODER_MAX_EXP_SRC (5)
  925. #define EM_DECODER_MAX_IMP_DST (8)
  926. #define EM_DECODER_MAX_IMP_SRC (8)
  927. typedef struct EM_decoder_static_info_s
  928. {
  929. Mnemonic_t mnemonic;
  930. Template_role_t template_role;
  931. EM_Decoder_oper_static_t explicit_dst[EM_DECODER_MAX_EXP_DST];
  932. EM_Decoder_oper_static_t explicit_src[EM_DECODER_MAX_EXP_SRC];
  933. EM_Decoder_imp_oper_t implicit_dst[EM_DECODER_MAX_IMP_DST];
  934. EM_Decoder_imp_oper_t implicit_src[EM_DECODER_MAX_IMP_SRC];
  935. EM_Decoder_modifiers_t modifiers;
  936. Flags_t flags;
  937. } EM_Decoder_static_info_t;
  938. extern const EM_Decoder_static_info_t em_decoder_static_info[];
  939. typedef struct EM_decoder_regfile_info
  940. {
  941. EM_Decoder_Regfile_Name name;
  942. EM_Decoder_Reg_Info index;
  943. } EM_Decoder_Regfile_Info;
  944. typedef struct EM_decoder_imm_info
  945. {
  946. EM_Decoder_Imm_Type imm_type;
  947. unsigned int size;
  948. U64 val64;
  949. } EM_Decoder_Imm_Info;
  950. typedef struct EM_decoder_mem_info
  951. {
  952. EM_Decoder_Reg_Info mem_base;
  953. EM_Decoder_Oper_Size size;
  954. } EM_Decoder_Mem_Info;
  955. typedef struct em_decoder_em_bundle_info
  956. {
  957. EM_template_t b_template;
  958. unsigned long flags;
  959. } EM_Decoder_EM_Bundle_Info;
  960. typedef struct em_decoder_em_info
  961. {
  962. EM_Decoder_EM_Bundle_Info em_bundle_info;
  963. EM_Decoder_Slot slot_no;
  964. Template_role_t eut;
  965. unsigned long em_flags;
  966. } EM_Decoder_EM_Info;
  967. typedef struct EM_decoder_inst_static_info
  968. {
  969. void * client_info;
  970. const EM_Decoder_static_info_t *static_info;
  971. unsigned long flags;
  972. } EM_Decoder_Inst_Static_Info;
  973. typedef struct EM_decoder_operand_info
  974. {
  975. EM_Decoder_Operand_Type type;
  976. EM_Decoder_Regfile_Info regfile_info;
  977. EM_Decoder_Reg_Info reg_info;
  978. EM_Decoder_Mem_Info mem_info;
  979. EM_Decoder_Imm_Info imm_info;
  980. long ip_relative_offset;
  981. unsigned long oper_flags;
  982. } EM_Decoder_Operand_Info;
  983. typedef struct em_decoder_info
  984. {
  985. EM_Decoder_Inst_Id inst;
  986. EM_Decoder_Reg_Info pred;
  987. EM_Decoder_Operand_Info src1;
  988. EM_Decoder_Operand_Info src2;
  989. EM_Decoder_Operand_Info src3;
  990. EM_Decoder_Operand_Info src4;
  991. EM_Decoder_Operand_Info src5;
  992. EM_Decoder_Operand_Info dst1;
  993. EM_Decoder_Operand_Info dst2;
  994. EM_Decoder_EM_Info EM_info;
  995. void * client_info;
  996. unsigned long flags;
  997. unsigned char size;
  998. const EM_Decoder_static_info_t *static_info;
  999. } EM_Decoder_Info;
  1000. typedef struct em_decoder_bundle_info
  1001. {
  1002. unsigned int inst_num;
  1003. EM_Decoder_EM_Bundle_Info em_bundle_info;
  1004. EM_Decoder_Err error[3];
  1005. EM_Decoder_Info inst_info[3];
  1006. } EM_Decoder_Bundle_Info;
  1007. typedef int EM_Decoder_Id;
  1008. /***********************************************/
  1009. /*** Setup flags ***/
  1010. /***********************************************/
  1011. #define EM_DECODER_FLAG_NO_MEMSET 0X00000001
  1012. extern const U32 em_decoder_bundle_size;
  1013. EM_Decoder_Id em_decoder_open(void);
  1014. EM_Decoder_Err em_decoder_associate_one(const EM_Decoder_Id id,
  1015. const EM_Decoder_Inst_Id inst,
  1016. const void * client_info);
  1017. EM_Decoder_Err em_decoder_associate_check(const EM_Decoder_Id id,
  1018. EM_Decoder_Inst_Id * inst);
  1019. EM_Decoder_Err em_decoder_setenv(const EM_Decoder_Id,
  1020. const EM_Decoder_Machine_Type,
  1021. const EM_Decoder_Machine_Mode);
  1022. EM_Decoder_Err em_decoder_setup(const EM_Decoder_Id,
  1023. const EM_Decoder_Machine_Type,
  1024. const EM_Decoder_Machine_Mode,
  1025. unsigned long flags);
  1026. EM_Decoder_Err em_decoder_close(const EM_Decoder_Id);
  1027. EM_Decoder_Err em_decoder_decode(const EM_Decoder_Id id,
  1028. const unsigned char * code,
  1029. const int max_code_size,
  1030. const EM_IL location,
  1031. EM_Decoder_Info * decoder_info);
  1032. EM_Decoder_Err em_decoder_inst_static_info(const EM_Decoder_Id,
  1033. const EM_Decoder_Inst_Id,
  1034. EM_Decoder_Inst_Static_Info *);
  1035. const char* em_decoder_ver_str(void);
  1036. void em_decoder_get_version(EM_library_version_t * dec_version);
  1037. const char* em_decoder_err_msg(EM_Decoder_Err error);
  1038. EM_Decoder_Err em_decoder_decode_bundle(const EM_Decoder_Id id,
  1039. const unsigned char * code,
  1040. const int max_size,
  1041. EM_Decoder_Bundle_Info * bundle_info);
  1042. /********************** GET next IL *************************/
  1043. #define EM_DECODER_NEXT(IL, decoder_info) \
  1044. { \
  1045. U32 rem_size; \
  1046. int slot_no = EM_IL_GET_SLOT_NO(IL), \
  1047. size = (decoder_info)->size; \
  1048. switch (slot_no) \
  1049. { \
  1050. case 0: \
  1051. break; \
  1052. case 1: \
  1053. if (size < 2) \
  1054. break; /*** else fall-through ***/ \
  1055. case 2: \
  1056. size = EM_BUNDLE_SIZE - slot_no; \
  1057. } \
  1058. IEL_CONVERT1(rem_size, size); \
  1059. IEL_ADDU(IL, IL, rem_size); \
  1060. }
  1061. #define EM_DECODER_BUNDLE_NEXT(addr) \
  1062. { \
  1063. IEL_ADDU(addr, addr, em_decoder_bundle_size); \
  1064. }
  1065. #define EM_DECODER_ERROR_IS_FATAL(_Err) \
  1066. ((_Err) >= EM_DECODER_FIRST_FATAL_ERROR)
  1067. #define EM_DECODER_ERROR_IS_INST_FATAL(_Err) \
  1068. (((_Err) >= EM_DECODER_FIRST_FATAL_INST_ERROR) && ((_Err) < EM_DECODER_FIRST_FATAL_ERROR))
  1069. /************* EM Instruction Flags Related Macros ***************/
  1070. /*** EM_decoder and static infos flags ***/
  1071. /* Flags that copied directly from EMDB */
  1072. #define EM_DECODER_BIT_PREDICATE EM_FLAG_PRED /* The instruction can get pred */
  1073. #define EM_DECODER_BIT_PRIVILEGED EM_FLAG_PRIVILEGED /* The instruction is privileged */
  1074. #define EM_DECODER_BIT_LMEM EM_FLAG_LMEM /* The instuction is a load inst */
  1075. #define EM_DECODER_BIT_SMEM EM_FLAG_SMEM /* The instruction is a store */
  1076. #define EM_DECODER_BIT_CHECK_BASE_EQ_DST EM_FLAG_CHECK_BASE_EQ_DST /* Base value must differ from destination's */
  1077. #define EM_DECODER_BIT_GROUP_FIRST EM_FLAG_FIRST_IN_INSTRUCTION_GROUP /* Instruction must be the first in instruction group */
  1078. #define EM_DECODER_BIT_GROUP_LAST EM_FLAG_LAST_IN_INSTRUCTION_GROUP /* Instruction must be the last in instruction group */
  1079. #define EM_DECODER_BIT_CHECK_SAME_DSTS EM_FLAG_CHECK_SAME_DSTS /* Two destinations should have different values */
  1080. #define EM_DECODER_BIT_SLOT2_ONLY EM_FLAG_SLOT2_ONLY /* The instruction is allowed in the last slot of bundle */
  1081. #define EM_DECODER_BIT_TWO_SLOT EM_FLAG_TWO_SLOT /* The instruction is long (2 slots length) */
  1082. #define EM_DECODER_BIT_OK_IN_MLX EM_FLAG_OK_IN_MLX
  1083. #define EM_DECODER_BIT_CHECK_EVEN_ODD_FREGS EM_FLAG_CHECK_EVEN_ODD_FREGS
  1084. #define EM_DECODER_BIT_CTYPE_UNC EM_FLAG_CTYPE_UNC /* If two destinations are equal the instruction
  1085. allways causes illegal operation fault */
  1086. #define EM_DECODER_BIT_UNUSED_HINT_ALIAS EM_FLAG_UNUSED_HINT_ALIAS
  1087. #define EM_DECODER_BIT_ILLEGAL_OP EM_FLAG_ILLEGAL_OP
  1088. #define EM_DECODER_BIT_IGNORED_OP EM_FLAG_IGNORED_OP
  1089. #define EM_DECODER_BIT_ENDS_GROUP EM_FLAG_ENDS_INSTRUCTION_GROUP
  1090. /* Others */
  1091. #define EM_DECODER_BIT_SPECULATION (EMDB_LAST_FLAG << 1) /* Speculative form of instruction */
  1092. #define EM_DECODER_BIT_POSTINCREMENT (EMDB_LAST_FLAG << 2) /* Post increment form of instruction */
  1093. #define EM_DECODER_BIT_FALSE_PRED_EXEC (EMDB_LAST_FLAG << 3) /* Instruction executed when predicate is false */
  1094. #define EM_DECODER_BIT_BR_HINT (EMDB_LAST_FLAG << 4) /* Branch-hint form of instruction */
  1095. #define EM_DECODER_BIT_BR (EMDB_LAST_FLAG << 5) /* Branch instruction */
  1096. #define EM_DECODER_BIT_ADV_LOAD (EMDB_LAST_FLAG << 6) /* Instruction is an advanced or speculative advanced load */
  1097. #define EM_DECODER_BIT_CONTROL_TRANSFER (EMDB_LAST_FLAG << 7) /* Instruction violates sequential control flow */
  1098. #define EM_DECODER_BIT_UNC_ILLEGAL_FAULT (EMDB_LAST_FLAG << 8) /* Illegal opcode causes illegal operation fault
  1099. undependent on predicate value */
  1100. /* Flags that depend on the current bundle encoding */
  1101. /* in em_flags: */
  1102. #define EM_DECODER_BIT_CYCLE_BREAK 0x10000 /*Inst is last in its group */
  1103. #define EM_DECODER_BIT_LAST_INST 0x20000 /*Last instruction in bundle */
  1104. /* Static flags (depend only on inst id) */
  1105. #define EM_DECODER_BIT_LONG_INST 0x40000 /* 2 slots Inst */
  1106. /* in em_bundle_info flags */
  1107. #define EM_DECODER_BIT_BUNDLE_STOP 0x80000 /*Stop bit is set in bundle*/
  1108. #define EM_DECODER_PREDICATE(di) (EM_DECODER_BIT_PREDICATE & ((di)->flags))
  1109. #define EM_DECODER_PRIVILEGED(di) (EM_DECODER_BIT_PRIVILEGED & ((di)->flags))
  1110. #define EM_DECODER_LMEM(di) (EM_DECODER_BIT_LMEM & ((di)->flags))
  1111. #define EM_DECODER_SMEM(di) (EM_DECODER_BIT_SMEM & ((di)->flags))
  1112. #define EM_DECODER_CHECK_BASE_EQ_DST(di) (EM_DECODER_BIT_CHECK_BASE_EQ_DST & ((di)->flags))
  1113. #define EM_DECODER_CHECK_SPECULATION(di) (EM_DECODER_BIT_SPECULATION & ((di)->flags))
  1114. #define EM_DECODER_CHECK_POSTINCREMENT(di) (EM_DECODER_BIT_POSTINCREMENT & ((di)->flags))
  1115. #define EM_DECODER_CHECK_FALSE_PRED_EXEC(di) (EM_DECODER_BIT_FALSE_PRED_EXEC & ((di)->flags))
  1116. #define EM_DECODER_CHECK_BR_HINT(di) (EM_DECODER_BIT_BR_HINT & ((di)->flags))
  1117. #define EM_DECODER_CHECK_BR(di) (EM_DECODER_BIT_BR & ((di)->flags))
  1118. #define EM_DECODER_CHECK_GROUP_FIRST(di) (EM_DECODER_BIT_GROUP_FIRST & ((di)->flags))
  1119. #define EM_DECODER_CHECK_GROUP_LAST(di) (EM_DECODER_BIT_GROUP_LAST & ((di)->flags))
  1120. #define EM_DECODER_CHECK_SAME_DSTS(di) (EM_DECODER_BIT_CHECK_SAME_DSTS & ((di)->flags))
  1121. #define EM_DECODER_CHECK_SLOT2_ONLY(di) (EM_DECODER_BIT_SLOT2_ONLY & ((di)->flags))
  1122. #define EM_DECODER_CHECK_TWO_SLOT(di) (EM_DECODER_BIT_TWO_SLOT & ((di)->flags))
  1123. #define EM_DECODER_CHECK_ADV_LOAD(di) (EM_DECODER_BIT_ADV_LOAD & ((di)->flags))
  1124. #define EM_DECODER_CHECK_CONTROL_TRANSFER(di) (EM_DECODER_BIT_CONTROL_TRANSFER & ((di)->flags))
  1125. #define EM_DECODER_CHECK_UNC_ILLEGAL_FAULT(di) (EM_DECODER_BIT_CTYPE_UNC & ((di)->flags))
  1126. #define EM_DECODER_CHECK_OK_IN_MLX(di) (EM_DECODER_BIT_OK_IN_MLX & ((di)->flags))
  1127. #define EM_DECODER_CHECK_UNUSED_HINT_ALIAS(di) (EM_DECODER_BIT_UNUSED_HINT_ALIAS & ((di)->flags))
  1128. #define EM_DECODER_CHECK_ILLEGAL_OP(di) (EM_DECODER_BIT_ILLEGAL_OP & ((di)->flags))
  1129. #define EM_DECODER_CHECK_IGNORED_OP(di) (EM_DECODER_BIT_IGNORED_OP & ((di)->flags))
  1130. #define EM_DECODER_CHECK_ENDS_GROUP(di) (EM_DECODER_BIT_ENDS_GROUP & ((di)->flags))
  1131. #define EM_DECODER_LONG_INST(di) \
  1132. (EM_DECODER_BIT_LONG_INST & (((di)->EM_info).em_flags))
  1133. #define EM_DECODER_LAST_INST(di) \
  1134. (EM_DECODER_BIT_LAST_INST & (((di)->EM_info).em_flags))
  1135. #define EM_DECODER_CYCLE_BREAK(di) \
  1136. (EM_DECODER_BIT_CYCLE_BREAK & (((di)->EM_info).em_flags))
  1137. #define EM_DECODER_BUNDLE_STOP(di) \
  1138. (EM_DECODER_BIT_BUNDLE_STOP & \
  1139. (((di)->EM_info).em_bundle_info.flags))
  1140. /************** Operand Related macros ****************/
  1141. #define EM_DECODER_OPER_2ND_ROLE_SRC_BIT 0x00000001 /* Oper second role: src */
  1142. #define EM_DECODER_OPER_2ND_ROLE_DST_BIT 0x00000002 /* Oper second role: dest */
  1143. #define EM_DECODER_OPER_IMM_IREG_BIT 0x00000040 /* Operand type is IREG_NUM */
  1144. #define EM_DECODER_OPER_IMM_FREG_BIT 0x00000080 /* Operand type is FREG_NUM */
  1145. #define EM_DECODER_OPER_2ND_ROLE_SRC(oi) \
  1146. (((oi)->oper_flags) & EM_DECODER_OPER_2ND_ROLE_SRC_BIT)
  1147. #define EM_DECODER_OPER_2ND_ROLE_DST(oi) \
  1148. (((oi)->oper_flags) & EM_DECODER_OPER_2ND_ROLE_DST_BIT)
  1149. #define EM_DECODER_OPER_NOT_TRUE_SRC(oi) \
  1150. (((oi)->oper_flags) & EM_DECODER_OPER_NOT_TRUE_SRC_BIT)
  1151. #define EM_DECODER_OPER_IMP_ENCODED(oi) \
  1152. (((oi)->oper_flags) & EM_DECODER_OPER_IMP_ENCODED_BIT)
  1153. #define EM_DECODER_OPER_IMM_REG(oi) \
  1154. (((oi)->oper_flags) & (EM_DECODER_OPER_IMM_IREG_BIT | \
  1155. EM_DECODER_OPER_IMM_FREG_BIT))
  1156. #define EM_DECODER_OPER_IMM_IREG(oi) \
  1157. (((oi)->oper_flags) & EM_DECODER_OPER_IMM_IREG_BIT)
  1158. #define EM_DECODER_OPER_IMM_FREG(oi) \
  1159. (((oi)->oper_flags) & EM_DECODER_OPER_IMM_FREG_BIT)
  1160. /************* EM_decoder Static Info Related macros ************/
  1161. /****** Macros receive pointer to modifiers ******/
  1162. #define EM_DECODER_MODIFIERS_CMP_TYPE(Mo) \
  1163. ((Mo)->cmp_type)
  1164. #define EM_DECODER_MODIFIERS_CMP_REL(Mo) \
  1165. ((Mo)->cmp_rel)
  1166. #define EM_DECODER_MODIFIERS_BRANCH_TYPE(Mo) \
  1167. ((Mo)->branch_type)
  1168. #define EM_DECODER_MODIFIERS_BRANCH_HINT(Mo) \
  1169. ((Mo)->branch_hint)
  1170. #define EM_DECODER_MODIFIERS_FP_PRECISION(Mo) \
  1171. ((Mo)->fp_precision)
  1172. #define EM_DECODER_MODIFIERS_FP_STATUS(Mo) \
  1173. ((Mo)->fp_status)
  1174. #define EM_DECODER_MODIFIERS_MEMORY_ACCESS_HINT(Mo) \
  1175. ((Mo)->mem_access_hint)
  1176. /****** Macros receive operand flags value ******/
  1177. #define EM_DECODER_OPER_FLAGS_2ND_ROLE_SRC(of) \
  1178. ((of) & EM_DECODER_OPER_2ND_ROLE_SRC_BIT)
  1179. #define EM_DECODER_OPER_FLAGS_2ND_ROLE_DST(of) \
  1180. ((of) & EM_DECODER_OPER_2ND_ROLE_DST_BIT)
  1181. #define EM_DECODER_OPER_FLAGS_IMM_REG(of) \
  1182. ((of) & (EM_DECODER_OPER_IMM_IREG_BIT | \
  1183. EM_DECODER_OPER_IMM_FREG_BIT))
  1184. #define EM_DECODER_OPER_FLAGS_IMM_IREG(of) \
  1185. ((of) & EM_DECODER_OPER_IMM_IREG_BIT)
  1186. #define EM_DECODER_OPER_FLAGS_IMM_FREG(of) \
  1187. ((of) & EM_DECODER_OPER_IMM_FREG_BIT)
  1188. /****** Macros receive pointer to operand ******/
  1189. #define EM_DECODER_OPER_STAT_2ND_ROLE_SRC(oi) \
  1190. EM_DECODER_OPER_FLAGS_2ND_ROLE_SRC((oi)->flags)
  1191. #define EM_DECODER_OPER_STAT_2ND_ROLE_DST(oi) \
  1192. EM_DECODER_OPER_FLAGS_2ND_ROLE_DST((oi)->flags)
  1193. #define EM_DECODER_OPER_STAT_IMM_REG(oi) \
  1194. EM_DECODER_OPER_FLAGS_IMM_REG((oi)->flags)
  1195. #define EM_DECODER_OPER_STAT_IMM_BREG(oi) \
  1196. EM_DECODER_OPER_FLAGS_IMM_BREG((oi)->flags)
  1197. #define EM_DECODER_OPER_STAT_IMM_IREG(oi) \
  1198. EM_DECODER_OPER_FLAGS_IMM_IREG((oi)->flags)
  1199. #define EM_DECODER_OPER_STAT_IMM_FREG(oi) \
  1200. EM_DECODER_OPER_FLAGS_IMM_FREG((oi)->flags)
  1201. #define EM_DECODER_OPER_ROLE(oi) \
  1202. ((oi)->role)
  1203. #define EM_DECODER_OPER_TYPE(oi) \
  1204. ((oi)->type)
  1205. #define EM_DECODER_OPER_FLAGS(oi) \
  1206. ((oi)->flags)
  1207. /****** Macros receive instruction flags value ******/
  1208. #define EM_DECODER_FLAGS_FLAG_PRED(if) \
  1209. ((if) & EM_DECODER_BIT_PREDICATE)
  1210. #define EM_DECODER_FLAGS_FLAG_PRIVILEGED(if) \
  1211. ((if) & EM_DECODER_BIT_PRIVILEGED)
  1212. #define EM_DECODER_FLAGS_FLAG_LMEM(if) \
  1213. ((if) & EM_DECODER_BIT_LMEM)
  1214. #define EM_DECODER_FLAGS_FLAG_SMEM(if) \
  1215. ((if) & EM_DECODER_BIT_SMEM)
  1216. #define EM_DECODER_FLAGS_FLAG_CHECK_BASE_EQ_DST(if) \
  1217. ((if) & EM_DECODER_BIT_CHECK_BASE_EQ_DST)
  1218. #define EM_DECODER_FLAGS_FLAG_SPECULATION(if) \
  1219. ((if) & EM_DECODER_BIT_SPECULATION)
  1220. #define EM_DECODER_FLAGS_FLAG_POSTINCREMENT(if) \
  1221. ((if) & EM_DECODER_BIT_POSTINCREMENT)
  1222. #define EM_DECODER_FLAGS_FLAG_FALSE_PRED_EXEC(if) \
  1223. ((if) & EM_DECODER_BIT_FALSE_PRED_EXEC)
  1224. #define EM_DECODER_FLAGS_FLAG_BR_HINT(if) \
  1225. ((if) & EM_DECODER_BIT_BR_HINT)
  1226. #define EM_DECODER_FLAGS_FLAG_BR(if) \
  1227. ((if) & EM_DECODER_BIT_BR)
  1228. #define EM_DECODER_FLAGS_FLAG_ADV_LOAD(if) \
  1229. ((if) & EM_DECODER_CHECK_ADV_LOAD)
  1230. #define EM_DECODER_FLAGS_FLAG_GROUP_FIRST(if) \
  1231. ((if) & EM_DECODER_BIT_GROUP_FIRST)
  1232. #define EM_DECODER_FLAGS_FLAG_GROUP_LAST(if) \
  1233. ((if) & EM_DECODER_BIT_GROUP_LAST)
  1234. #define EM_DECODER_FLAGS_FLAG_CHECK_SAME_DSTS(if) \
  1235. ((if) & EM_DECODER_BIT_CHECK_SAME_DSTS)
  1236. #define EM_DECODER_FLAGS_FLAG_CONTROL_TRANSFER(if) \
  1237. ((if) & EM_DECODER_BIT_CONTROL_TRANSFER)
  1238. #define EM_DECODER_FLAGS_FLAG_UNUSED_HINT_ALIAS(if) \
  1239. ((if) & EM_DECODER_BIT_UNUSED_HINT_ALIAS)
  1240. #define EM_DECODER_FLAGS_FLAG_ILLEGAL_OP(if) \
  1241. ((if) & EM_DECODER_BIT_ILLEGAL_OP)
  1242. #define EM_DECODER_FLAGS_FLAG_IGNORED_OP(if) \
  1243. ((if) & EM_DECODER_BIT_IGNORED_OP)
  1244. #define EM_DECODER_FLAGS_FLAG_ENDS_GROUP(if) \
  1245. ((if) & EM_DECODER_BIT_ENDS_GROUP)
  1246. /****** Macros receive pointer to EM_decoder static info ******/
  1247. #define EM_DECODER_STATIC_MNEMONIC(si) \
  1248. ((si)->mnemonic)
  1249. #define EM_DECODER_STATIC_TEMPLATE_ROLE(si) \
  1250. ((si)->template_role)
  1251. #define EM_DECODER_STATIC_EXP_DST_ROLE(si, n) \
  1252. EM_DECODER_OPER_ROLE(((si)->explicit_dst) + (n))
  1253. #define EM_DECODER_STATIC_EXP_DST_TYPE(si, n) \
  1254. EM_DECODER_OPER_TYPE(((si)->explicit_dst) + (n))
  1255. #define EM_DECODER_STATIC_EXP_DST_FLAGS(si, n) \
  1256. EM_DECODER_OPER_FLAGS(((si)->explicit_dst) + (n))
  1257. #define EM_DECODER_STATIC_EXP_SRC_ROLE(si, n) \
  1258. EM_DECODER_OPER_ROLE(((si)->explicit_src) + (n))
  1259. #define EM_DECODER_STATIC_EXP_SRC_TYPE(si, n) \
  1260. EM_DECODER_OPER_TYPE(((si)->explicit_src) + (n))
  1261. #define EM_DECODER_STATIC_EXP_SRC_FLAGS(si, n) \
  1262. EM_DECODER_OPER_FLAGS(((si)->explicit_src) + (n))
  1263. #define EM_DECODER_STATIC_IMP_DST(si, n) \
  1264. ((si)->implicit_dst[(n)])
  1265. #define EM_DECODER_STATIC_IMP_SRC(si, n) \
  1266. ((si)->implicit_src[(n)])
  1267. #define EM_DECODER_STATIC_CMP_TYPE(si) \
  1268. EM_DECODER_MODIFIERS_CMP_TYPE(&((si)->modifiers))
  1269. #define EM_DECODER_STATIC_CMP_REL(si) \
  1270. EM_DECODER_MODIFIERS_CMP_REL(&((si)->modifiers))
  1271. #define EM_DECODER_STATIC_BRANCH_TYPE(si) \
  1272. EM_DECODER_MODIFIERS_BRANCH_TYPE(&((si)->modifiers))
  1273. #define EM_DECODER_STATIC_BRANCH_HINT(si) \
  1274. EM_DECODER_MODIFIERS_BRANCH_HINT(&((si)->modifiers))
  1275. #define EM_DECODER_STATIC_FP_PRECISION(si) \
  1276. EM_DECODER_MODIFIERS_FP_PRECISION(&((si)->modifiers))
  1277. #define EM_DECODER_STATIC_FP_STATUS(si) \
  1278. EM_DECODER_MODIFIERS_FP_STATUS(&((si)->modifiers))
  1279. #define EM_DECODER_STATIC_MEMORY_ACCESS_HINT(si) \
  1280. EM_DECODER_MODIFIERS_MEMORY_ACCESS_HINT(&((si)->modifiers))
  1281. #define EM_DECODER_STATIC_FLAGS(si) \
  1282. ((si)->flags)
  1283. #define EM_DECODER_STATIC_FLAG_PRED(si) \
  1284. EM_DECODER_FLAGS_FLAG_PRED((si)->flags)
  1285. #define EM_DECODER_STATIC_FLAG_PRIVILEGED(si) \
  1286. EM_DECODER_FLAGS_FLAG_PRIVILEGED((si)->flags)
  1287. #define EM_DECODER_STATIC_FLAG_LMEM(si) \
  1288. EM_DECODER_FLAGS_FLAG_LMEM((si)->flags)
  1289. #define EM_DECODER_STATIC_FLAG_SMEM(si) \
  1290. EM_DECODER_FLAGS_FLAG_SMEM((si)->flags)
  1291. #define EM_DECODER_STATIC_FLAG_CHECK_BASE_EQ_DST(si) \
  1292. EM_DECODER_FLAGS_FLAG_CHECK_BASE_EQ_DST((si)->flags)
  1293. #define EM_DECODER_STATIC_FLAG_SPECULATION(si) \
  1294. EM_DECODER_FLAGS_FLAG_SPECULATION((si)->flags)
  1295. #define EM_DECODER_STATIC_FLAG_POSTINCREMENT(si) \
  1296. EM_DECODER_FLAGS_FLAG_POSTINCREMENT((si)->flags)
  1297. #define EM_DECODER_STATIC_FLAG_FALSE_PRED_EXEC(si) \
  1298. EM_DECODER_FLAGS_FLAG_FALSE_PRED_EXEC((si)->flags)
  1299. #define EM_DECODER_STATIC_FLAG_BR_HINT(si) \
  1300. EM_DECODER_FLAGS_FLAG_BR_HINT((si)->flags)
  1301. #define EM_DECODER_STATIC_FLAG_BR(si) \
  1302. EM_DECODER_FLAGS_FLAG_BR((si)->flags)
  1303. #define EM_DECODER_STATIC_FLAG_GROUP_FIRST(si) \
  1304. EM_DECODER_FLAGS_FLAG_GROUP_FIRST((si)->flags)
  1305. #define EM_DECODER_STATIC_FLAG_GROUP_LAST(si) \
  1306. EM_DECODER_FLAGS_FLAG_GROUP_LAST((si)->flags)
  1307. #define EM_DECODER_STATIC_FLAG_CHECK_SAME_DSTS(si) \
  1308. EM_DECODER_FLAGS_FLAG_CHECK_SAME_DSTS((si)->flags)
  1309. #define EM_DECODER_STATIC_FLAG_CONTROL_TRANSFER(si) \
  1310. EM_DECODER_FLAGS_FLAG_CONTROL_TRANSFER((si)->flags)
  1311. #ifdef __cplusplus
  1312. }
  1313. #endif
  1314. #endif /*** EM_DECODER_H ***/