disasm_int.h revision 159909
1251881Speter/*- 2251881Speter * Copyright (c) 2000-2003 Marcel Moolenaar 3251881Speter * All rights reserved. 4251881Speter * 5251881Speter * Redistribution and use in source and binary forms, with or without 6251881Speter * modification, are permitted provided that the following conditions 7251881Speter * are met: 8251881Speter * 9251881Speter * 1. Redistributions of source code must retain the above copyright 10251881Speter * notice, this list of conditions and the following disclaimer. 11251881Speter * 2. Redistributions in binary form must reproduce the above copyright 12251881Speter * notice, this list of conditions and the following disclaimer in the 13251881Speter * documentation and/or other materials provided with the distribution. 14251881Speter * 15251881Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16251881Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17251881Speter * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18251881Speter * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19251881Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20251881Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21251881Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22251881Speter * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23251881Speter * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24251881Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25362181Sdim * 26362181Sdim * $FreeBSD: head/sys/ia64/disasm/disasm_int.h 159909 2006-06-24 01:19:52Z marcel $ 27251881Speter */ 28251881Speter 29251881Speter#ifndef _DISASM_INT_H_ 30289180Speter#define _DISASM_INT_H_ 31289180Speter 32251881Speter#ifdef _DISASM_H_ 33251881Speter#error Include disasm_int.h before disasm.h 34251881Speter#endif 35251881Speter 36251881Speter/* 37251881Speter * Instruction bundle specifics. 38251881Speter */ 39251881Speter#define TMPL_BITS 5 40251881Speter#define SLOT_BITS 41 41251881Speter#define SLOT_COUNT 3 42251881Speter 43251881Speter#define BUNDLE_SIZE (SLOT_COUNT * SLOT_BITS + TMPL_BITS) 44251881Speter#define BUNDLE_BYTES ((BUNDLE_SIZE+7) >> 3) 45251881Speter#define TMPL_MASK ((1 << TMPL_BITS) - 1) 46251881Speter#define SLOT_MASK ((1ULL << SLOT_BITS) - 1ULL) 47251881Speter#define TMPL(p) (*(const uint8_t*)(p) & TMPL_MASK) 48251881Speter#define _U32(p,i) ((uint64_t)(((const uint32_t*)(p))[i])) 49251881Speter#define _SLOT(p,i) (_U32(p,i) | (_U32(p,(i)+1)<<32)) 50251881Speter#define SLOT(p,i) ((_SLOT(p,i) >> (TMPL_BITS+((i)<<3)+(i))) & SLOT_MASK) 51251881Speter 52251881Speter/* 53251881Speter * Instruction specifics 54251881Speter */ 55251881Speter#define _FLD64(i,o,l) ((i >> o) & ((1LL << l) - 1LL)) 56251881Speter#define FIELD(i,o,l) ((uint32_t)_FLD64(i,o,l)) 57251881Speter#define OPCODE(i) FIELD(i, 37, 4) 58251881Speter#define QP_BITS 6 59251881Speter#define QP(i) FIELD(i, 0, QP_BITS) 60251881Speter#define REG_BITS 7 61251881Speter#define REG(i,r) FIELD(i, ((r) - 1) * REG_BITS + QP_BITS, REG_BITS) 62251881Speter 63251881Speter/* 64251881Speter * Opcodes used internally as sentinels to denote either a lack of more 65251881Speter * specific information or to preserve the additional state/information 66251881Speter * we already have and need to pass around for later use. 67251881Speter */ 68251881Speter#define ASM_ADDITIONAL_OPCODES \ 69251881Speter ASM_OP_INTERNAL_OPCODES, \ 70251881Speter ASM_OP_BR_CALL, ASM_OP_BR_CEXIT, ASM_OP_BR_CLOOP, \ 71251881Speter ASM_OP_BR_COND, ASM_OP_BR_CTOP, ASM_OP_BR_IA, ASM_OP_BR_RET, \ 72251881Speter ASM_OP_BR_WEXIT, ASM_OP_BR_WTOP, \ 73251881Speter ASM_OP_BREAK_B, ASM_OP_BREAK_F, ASM_OP_BREAK_I, ASM_OP_BREAK_M, \ 74251881Speter ASM_OP_BREAK_X, \ 75251881Speter ASM_OP_BRL_COND, ASM_OP_BRL_CALL, \ 76251881Speter ASM_OP_BRP_, ASM_OP_BRP_RET, \ 77289180Speter ASM_OP_BSW_0, ASM_OP_BSW_1, \ 78289180Speter ASM_OP_CHK_A_CLR, ASM_OP_CHK_A_NC, ASM_OP_CHK_S, \ 79289180Speter ASM_OP_CHK_S_I, ASM_OP_CHK_S_M, \ 80289180Speter ASM_OP_CLRRRB_, ASM_OP_CLRRRB_PR, \ 81289180Speter ASM_OP_CMP_EQ, ASM_OP_CMP_EQ_AND, ASM_OP_CMP_EQ_OR, \ 82362181Sdim ASM_OP_CMP_EQ_OR_ANDCM, ASM_OP_CMP_EQ_UNC, ASM_OP_CMP_GE_AND, \ 83251881Speter ASM_OP_CMP_GE_OR, ASM_OP_CMP_GE_OR_ANDCM, ASM_OP_CMP_GT_AND, \ 84289180Speter ASM_OP_CMP_GT_OR, ASM_OP_CMP_GT_OR_ANDCM, ASM_OP_CMP_LE_AND, \ 85289180Speter ASM_OP_CMP_LE_OR, ASM_OP_CMP_LE_OR_ANDCM, ASM_OP_CMP_LT, \ 86362181Sdim ASM_OP_CMP_LT_AND, ASM_OP_CMP_LT_OR, ASM_OP_CMP_LT_OR_ANDCM, \ 87251881Speter ASM_OP_CMP_LT_UNC, ASM_OP_CMP_LTU, ASM_OP_CMP_LTU_UNC, \ 88251881Speter ASM_OP_CMP_NE_AND, ASM_OP_CMP_NE_OR, ASM_OP_CMP_NE_OR_ANDCM, \ 89251881Speter ASM_OP_CMP4_EQ, ASM_OP_CMP4_EQ_AND, ASM_OP_CMP4_EQ_OR, \ 90251881Speter ASM_OP_CMP4_EQ_OR_ANDCM, ASM_OP_CMP4_EQ_UNC, ASM_OP_CMP4_GE_AND,\ 91251881Speter ASM_OP_CMP4_GE_OR, ASM_OP_CMP4_GE_OR_ANDCM, ASM_OP_CMP4_GT_AND, \ 92289180Speter ASM_OP_CMP4_GT_OR, ASM_OP_CMP4_GT_OR_ANDCM, ASM_OP_CMP4_LE_AND, \ 93251881Speter ASM_OP_CMP4_LE_OR, ASM_OP_CMP4_LE_OR_ANDCM, ASM_OP_CMP4_LT, \ 94251881Speter ASM_OP_CMP4_LT_AND, ASM_OP_CMP4_LT_OR, ASM_OP_CMP4_LT_OR_ANDCM, \ 95289180Speter ASM_OP_CMP4_LT_UNC, ASM_OP_CMP4_LTU, ASM_OP_CMP4_LTU_UNC, \ 96289180Speter ASM_OP_CMP4_NE_AND, ASM_OP_CMP4_NE_OR, ASM_OP_CMP4_NE_OR_ANDCM, \ 97289180Speter ASM_OP_CMP8XCHG16_ACQ, ASM_OP_CMP8XCHG16_REL, \ 98289180Speter ASM_OP_CMPXCHG1_ACQ, ASM_OP_CMPXCHG1_REL, \ 99289180Speter ASM_OP_CMPXCHG2_ACQ, ASM_OP_CMPXCHG2_REL, \ 100289180Speter ASM_OP_CMPXCHG4_ACQ, ASM_OP_CMPXCHG4_REL, \ 101289180Speter ASM_OP_CMPXCHG8_ACQ, ASM_OP_CMPXCHG8_REL, \ 102289180Speter ASM_OP_CZX1_L, ASM_OP_CZX1_R, \ 103251881Speter ASM_OP_CZX2_L, ASM_OP_CZX2_R, \ 104251881Speter ASM_OP_DEP_, ASM_OP_DEP_Z, \ 105251881Speter ASM_OP_FC_, ASM_OP_FC_I, \ 106251881Speter ASM_OP_FCLASS_M, \ 107251881Speter ASM_OP_FCVT_FX, ASM_OP_FCVT_FX_TRUNC, ASM_OP_FCVT_FXU, \ 108251881Speter ASM_OP_FCVT_FXU_TRUNC, ASM_OP_FCVT_XF, \ 109251881Speter ASM_OP_FETCHADD4_ACQ, ASM_OP_FETCHADD4_REL, \ 110251881Speter ASM_OP_FETCHADD8_ACQ, ASM_OP_FETCHADD8_REL, \ 111289180Speter ASM_OP_FMA_, ASM_OP_FMA_D, ASM_OP_FMA_S, \ 112251881Speter ASM_OP_FMERGE_NS, ASM_OP_FMERGE_S, ASM_OP_FMERGE_SE, \ 113251881Speter ASM_OP_FMIX_L, ASM_OP_FMIX_LR, ASM_OP_FMIX_R, \ 114251881Speter ASM_OP_FMS_, ASM_OP_FMS_D, ASM_OP_FMS_S, \ 115289180Speter ASM_OP_FNMA_, ASM_OP_FNMA_D, ASM_OP_FNMA_S, \ 116289180Speter ASM_OP_FPCMP_EQ, ASM_OP_FPCMP_LE, ASM_OP_FPCMP_LT, \ 117289180Speter ASM_OP_FPCMP_NEQ, ASM_OP_FPCMP_NLE, ASM_OP_FPCMP_NLT, \ 118289180Speter ASM_OP_FPCMP_ORD, ASM_OP_FPCMP_UNORD, \ 119289180Speter ASM_OP_FPCVT_FX, ASM_OP_FPCVT_FX_TRUNC, ASM_OP_FPCVT_FXU, \ 120289180Speter ASM_OP_FPCVT_FXU_TRUNC, \ 121289180Speter ASM_OP_FPMERGE_NS, ASM_OP_FPMERGE_S, ASM_OP_FPMERGE_SE, \ 122289180Speter ASM_OP_FSWAP_, ASM_OP_FSWAP_NL, ASM_OP_FSWAP_NR, \ 123289180Speter ASM_OP_FSXT_L, ASM_OP_FSXT_R, \ 124289180Speter ASM_OP_GETF_D, ASM_OP_GETF_EXP, ASM_OP_GETF_S, ASM_OP_GETF_SIG, \ 125289180Speter ASM_OP_HINT_B, ASM_OP_HINT_F, ASM_OP_HINT_I, ASM_OP_HINT_M, \ 126289180Speter ASM_OP_HINT_X, \ 127289180Speter ASM_OP_INVALA_, ASM_OP_INVALA_E, \ 128251881Speter ASM_OP_ITC_D, ASM_OP_ITC_I, \ 129251881Speter ASM_OP_ITR_D, ASM_OP_ITR_I, \ 130251881Speter ASM_OP_LD1_, ASM_OP_LD1_A, ASM_OP_LD1_ACQ, ASM_OP_LD1_BIAS, \ 131251881Speter ASM_OP_LD1_C_CLR, ASM_OP_LD1_C_CLR_ACQ, ASM_OP_LD1_C_NC, \ 132251881Speter ASM_OP_LD1_S, ASM_OP_LD1_SA, \ 133251881Speter ASM_OP_LD16_, ASM_OP_LD16_ACQ, \ 134251881Speter ASM_OP_LD2_, ASM_OP_LD2_A, ASM_OP_LD2_ACQ, ASM_OP_LD2_BIAS, \ 135289180Speter ASM_OP_LD2_C_CLR, ASM_OP_LD2_C_CLR_ACQ, ASM_OP_LD2_C_NC, \ 136251881Speter ASM_OP_LD2_S, ASM_OP_LD2_SA, \ 137251881Speter ASM_OP_LD4_, ASM_OP_LD4_A, ASM_OP_LD4_ACQ, ASM_OP_LD4_BIAS, \ 138251881Speter ASM_OP_LD4_C_CLR, ASM_OP_LD4_C_CLR_ACQ, ASM_OP_LD4_C_NC, \ 139251881Speter ASM_OP_LD4_S, ASM_OP_LD4_SA, \ 140251881Speter ASM_OP_LD8_, ASM_OP_LD8_A, ASM_OP_LD8_ACQ, ASM_OP_LD8_BIAS, \ 141251881Speter ASM_OP_LD8_C_CLR, ASM_OP_LD8_C_CLR_ACQ, ASM_OP_LD8_C_NC, \ 142251881Speter ASM_OP_LD8_FILL, ASM_OP_LD8_S, ASM_OP_LD8_SA, \ 143251881Speter ASM_OP_LDF_FILL, \ 144251881Speter ASM_OP_LDF8_, ASM_OP_LDF8_A, ASM_OP_LDF8_C_CLR, \ 145251881Speter ASM_OP_LDF8_C_NC, ASM_OP_LDF8_S, ASM_OP_LDF8_SA, \ 146251881Speter ASM_OP_LDFD_, ASM_OP_LDFD_A, ASM_OP_LDFD_C_CLR, \ 147251881Speter ASM_OP_LDFD_C_NC, ASM_OP_LDFD_S, ASM_OP_LDFD_SA, \ 148251881Speter ASM_OP_LDFE_, ASM_OP_LDFE_A, ASM_OP_LDFE_C_CLR, \ 149251881Speter ASM_OP_LDFE_C_NC, ASM_OP_LDFE_S, ASM_OP_LDFE_SA, \ 150251881Speter ASM_OP_LDFP8_, ASM_OP_LDFP8_A, ASM_OP_LDFP8_C_CLR, \ 151251881Speter ASM_OP_LDFP8_C_NC, ASM_OP_LDFP8_S, ASM_OP_LDFP8_SA, \ 152251881Speter ASM_OP_LDFPD_, ASM_OP_LDFPD_A, ASM_OP_LDFPD_C_CLR, \ 153251881Speter ASM_OP_LDFPD_C_NC, ASM_OP_LDFPD_S, ASM_OP_LDFPD_SA, \ 154251881Speter ASM_OP_LDFPS_, ASM_OP_LDFPS_A, ASM_OP_LDFPS_C_CLR, \ 155251881Speter ASM_OP_LDFPS_C_NC, ASM_OP_LDFPS_S, ASM_OP_LDFPS_SA, \ 156251881Speter ASM_OP_LDFS_, ASM_OP_LDFS_A, ASM_OP_LDFS_C_CLR, \ 157289180Speter ASM_OP_LDFS_C_NC, ASM_OP_LDFS_S, ASM_OP_LDFS_SA, \ 158251881Speter ASM_OP_LFETCH_, ASM_OP_LFETCH_EXCL, ASM_OP_LFETCH_FAULT, \ 159289180Speter ASM_OP_LFETCH_FAULT_EXCL, \ 160289180Speter ASM_OP_MF_, ASM_OP_MF_A, \ 161289180Speter ASM_OP_MIX1_L, ASM_OP_MIX1_R, \ 162362181Sdim ASM_OP_MIX2_L, ASM_OP_MIX2_R, \ 163362181Sdim ASM_OP_MIX4_L, ASM_OP_MIX4_R, \ 164362181Sdim ASM_OP_MOV_, ASM_OP_MOV_CPUID, ASM_OP_MOV_DBR, ASM_OP_MOV_I, \ 165362181Sdim ASM_OP_MOV_IBR, ASM_OP_MOV_IP, ASM_OP_MOV_M, ASM_OP_MOV_MSR, \ 166362181Sdim ASM_OP_MOV_PKR, ASM_OP_MOV_PMC, ASM_OP_MOV_PMD, ASM_OP_MOV_PR, \ 167362181Sdim ASM_OP_MOV_PSR, ASM_OP_MOV_PSR_L, ASM_OP_MOV_PSR_UM, \ 168362181Sdim ASM_OP_MOV_RET, ASM_OP_MOV_RR, \ 169251881Speter ASM_OP_NOP_B, ASM_OP_NOP_F, ASM_OP_NOP_I, ASM_OP_NOP_M, \ 170251881Speter ASM_OP_NOP_X, \ 171251881Speter ASM_OP_PACK2_SSS, ASM_OP_PACK2_USS, \ 172251881Speter ASM_OP_PACK4_SSS, \ 173251881Speter ASM_OP_PADD1_, ASM_OP_PADD1_SSS, ASM_OP_PADD1_UUS, \ 174251881Speter ASM_OP_PADD1_UUU, \ 175251881Speter ASM_OP_PADD2_, ASM_OP_PADD2_SSS, ASM_OP_PADD2_UUS, \ 176251881Speter ASM_OP_PADD2_UUU, \ 177251881Speter ASM_OP_PAVG1_, ASM_OP_PAVG1_RAZ, \ 178251881Speter ASM_OP_PAVG2_, ASM_OP_PAVG2_RAZ, \ 179251881Speter ASM_OP_PCMP1_EQ, ASM_OP_PCMP1_GT, \ 180251881Speter ASM_OP_PCMP2_EQ, ASM_OP_PCMP2_GT, \ 181251881Speter ASM_OP_PCMP4_EQ, ASM_OP_PCMP4_GT, \ 182251881Speter ASM_OP_PMAX1_U, \ 183251881Speter ASM_OP_PMIN1_U, \ 184251881Speter ASM_OP_PMPY2_L, ASM_OP_PMPY2_R, \ 185251881Speter ASM_OP_PMPYSHR2_, ASM_OP_PMPYSHR2_U, \ 186251881Speter ASM_OP_PROBE_R, ASM_OP_PROBE_R_FAULT, ASM_OP_PROBE_RW_FAULT, \ 187251881Speter ASM_OP_PROBE_W, ASM_OP_PROBE_W_FAULT, \ 188251881Speter ASM_OP_PSHR2_, ASM_OP_PSHR2_U, \ 189251881Speter ASM_OP_PSHR4_, ASM_OP_PSHR4_U, \ 190251881Speter ASM_OP_PSUB1_, ASM_OP_PSUB1_SSS, ASM_OP_PSUB1_UUS, \ 191251881Speter ASM_OP_PSUB1_UUU, \ 192251881Speter ASM_OP_PSUB2_, ASM_OP_PSUB2_SSS, ASM_OP_PSUB2_UUS, \ 193251881Speter ASM_OP_PSUB2_UUU, \ 194362181Sdim ASM_OP_PTC_E, ASM_OP_PTC_G, ASM_OP_PTC_GA, ASM_OP_PTC_L, \ 195362181Sdim ASM_OP_PTR_D, ASM_OP_PTR_I, \ 196362181Sdim ASM_OP_SETF_EXP, ASM_OP_SETF_D, ASM_OP_SETF_S, ASM_OP_SETF_SIG, \ 197251881Speter ASM_OP_SHR_, ASM_OP_SHR_U, \ 198251881Speter ASM_OP_SRLZ_D, ASM_OP_SRLZ_I, \ 199251881Speter ASM_OP_ST1_, ASM_OP_ST1_REL, \ 200251881Speter ASM_OP_ST16_, ASM_OP_ST16_REL, \ 201251881Speter ASM_OP_ST2_, ASM_OP_ST2_REL, \ 202251881Speter ASM_OP_ST4_, ASM_OP_ST4_REL, \ 203251881Speter ASM_OP_ST8_, ASM_OP_ST8_REL, ASM_OP_ST8_SPILL, \ 204251881Speter ASM_OP_STF_SPILL, \ 205251881Speter ASM_OP_SYNC_I, \ 206362181Sdim ASM_OP_TBIT_NZ_AND, ASM_OP_TBIT_NZ_OR, ASM_OP_TBIT_NZ_OR_ANDCM, \ 207251881Speter ASM_OP_TBIT_Z, ASM_OP_TBIT_Z_AND, ASM_OP_TBIT_Z_OR, \ 208251881Speter ASM_OP_TBIT_Z_OR_ANDCM, ASM_OP_TBIT_Z_UNC, \ 209362181Sdim ASM_OP_TNAT_NZ_AND, ASM_OP_TNAT_NZ_OR, ASM_OP_TNAT_NZ_OR_ANDCM, \ 210362181Sdim ASM_OP_TNAT_Z, ASM_OP_TNAT_Z_AND, ASM_OP_TNAT_Z_OR, \ 211362181Sdim ASM_OP_TNAT_Z_OR_ANDCM, ASM_OP_TNAT_Z_UNC, \ 212251881Speter ASM_OP_UNPACK1_H, ASM_OP_UNPACK1_L, \ 213362181Sdim ASM_OP_UNPACK2_H, ASM_OP_UNPACK2_L, \ 214362181Sdim ASM_OP_UNPACK4_H, ASM_OP_UNPACK4_L, \ 215362181Sdim ASM_OP_XMA_H, ASM_OP_XMA_HU, ASM_OP_XMA_L, \ 216362181Sdim ASM_OP_NUMBER_OF_OPCODES 217251881Speter 218251881Speter#endif /* _DISASM_INT_H_ */ 219251881Speter