OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [opcodes/] [i386-dis.c] - Diff between revs 163 and 166

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 163 Rev 166
Line 106... Line 106...
static void NOP_Fixup2 (int, int);
static void NOP_Fixup2 (int, int);
static void OP_3DNowSuffix (int, int);
static void OP_3DNowSuffix (int, int);
static void CMP_Fixup (int, int);
static void CMP_Fixup (int, int);
static void BadOp (void);
static void BadOp (void);
static void REP_Fixup (int, int);
static void REP_Fixup (int, int);
 
static void HLE_Fixup1 (int, int);
 
static void HLE_Fixup2 (int, int);
 
static void HLE_Fixup3 (int, int);
static void CMPXCHG8B_Fixup (int, int);
static void CMPXCHG8B_Fixup (int, int);
static void XMM_Fixup (int, int);
static void XMM_Fixup (int, int);
static void CRC32_Fixup (int, int);
static void CRC32_Fixup (int, int);
static void FXSAVE_Fixup (int, int);
static void FXSAVE_Fixup (int, int);
static void OP_LWPCB_E (int, int);
static void OP_LWPCB_E (int, int);
Line 410... Line 413...
#define Yzr { REP_Fixup, eDI_reg }
#define Yzr { REP_Fixup, eDI_reg }
#define indirDXr { REP_Fixup, indir_dx_reg }
#define indirDXr { REP_Fixup, indir_dx_reg }
#define ALr { REP_Fixup, al_reg }
#define ALr { REP_Fixup, al_reg }
#define eAXr { REP_Fixup, eAX_reg }
#define eAXr { REP_Fixup, eAX_reg }
 
 
 
/* Used handle HLE prefix for lockable instructions.  */
 
#define Ebh1 { HLE_Fixup1, b_mode }
 
#define Evh1 { HLE_Fixup1, v_mode }
 
#define Ebh2 { HLE_Fixup2, b_mode }
 
#define Evh2 { HLE_Fixup2, v_mode }
 
#define Ebh3 { HLE_Fixup3, b_mode }
 
#define Evh3 { HLE_Fixup3, v_mode }
 
 
#define cond_jump_flag { NULL, cond_jump_mode }
#define cond_jump_flag { NULL, cond_jump_mode }
#define loop_jcxz_flag { NULL, loop_jcxz_mode }
#define loop_jcxz_flag { NULL, loop_jcxz_mode }
 
 
/* bits in sizeflag */
/* bits in sizeflag */
#define SUFFIX_ALWAYS 4
#define SUFFIX_ALWAYS 4
Line 640... Line 651...
};
};
 
 
enum
enum
{
{
  MOD_8D = 0,
  MOD_8D = 0,
 
  MOD_C6_REG_7,
 
  MOD_C7_REG_7,
  MOD_0F01_REG_0,
  MOD_0F01_REG_0,
  MOD_0F01_REG_1,
  MOD_0F01_REG_1,
  MOD_0F01_REG_2,
  MOD_0F01_REG_2,
  MOD_0F01_REG_3,
  MOD_0F01_REG_3,
  MOD_0F01_REG_7,
  MOD_0F01_REG_7,
Line 728... Line 741...
  MOD_VEX_0F388E_PREFIX_2,
  MOD_VEX_0F388E_PREFIX_2,
};
};
 
 
enum
enum
{
{
  RM_0F01_REG_0 = 0,
  RM_C6_REG_7 = 0,
 
  RM_C7_REG_7,
 
  RM_0F01_REG_0,
  RM_0F01_REG_1,
  RM_0F01_REG_1,
  RM_0F01_REG_2,
  RM_0F01_REG_2,
  RM_0F01_REG_3,
  RM_0F01_REG_3,
  RM_0F01_REG_7,
  RM_0F01_REG_7,
  RM_0FAE_REG_5,
  RM_0FAE_REG_5,
Line 1644... Line 1659...
   Braces '{' and '}', and vertical bars '|', indicate alternative
   Braces '{' and '}', and vertical bars '|', indicate alternative
   mnemonic strings for AT&T and Intel.  */
   mnemonic strings for AT&T and Intel.  */
 
 
static const struct dis386 dis386[] = {
static const struct dis386 dis386[] = {
  /* 00 */
  /* 00 */
  { "addB",             { Eb, Gb } },
  { "addB",             { Ebh1, Gb } },
  { "addS",             { Ev, Gv } },
  { "addS",             { Evh1, Gv } },
  { "addB",             { Gb, EbS } },
  { "addB",             { Gb, EbS } },
  { "addS",             { Gv, EvS } },
  { "addS",             { Gv, EvS } },
  { "addB",             { AL, Ib } },
  { "addB",             { AL, Ib } },
  { "addS",             { eAX, Iv } },
  { "addS",             { eAX, Iv } },
  { X86_64_TABLE (X86_64_06) },
  { X86_64_TABLE (X86_64_06) },
  { X86_64_TABLE (X86_64_07) },
  { X86_64_TABLE (X86_64_07) },
  /* 08 */
  /* 08 */
  { "orB",              { Eb, Gb } },
  { "orB",              { Ebh1, Gb } },
  { "orS",              { Ev, Gv } },
  { "orS",              { Evh1, Gv } },
  { "orB",              { Gb, EbS } },
  { "orB",              { Gb, EbS } },
  { "orS",              { Gv, EvS } },
  { "orS",              { Gv, EvS } },
  { "orB",              { AL, Ib } },
  { "orB",              { AL, Ib } },
  { "orS",              { eAX, Iv } },
  { "orS",              { eAX, Iv } },
  { X86_64_TABLE (X86_64_0D) },
  { X86_64_TABLE (X86_64_0D) },
  { Bad_Opcode },       /* 0x0f extended opcode escape */
  { Bad_Opcode },       /* 0x0f extended opcode escape */
  /* 10 */
  /* 10 */
  { "adcB",             { Eb, Gb } },
  { "adcB",             { Ebh1, Gb } },
  { "adcS",             { Ev, Gv } },
  { "adcS",             { Evh1, Gv } },
  { "adcB",             { Gb, EbS } },
  { "adcB",             { Gb, EbS } },
  { "adcS",             { Gv, EvS } },
  { "adcS",             { Gv, EvS } },
  { "adcB",             { AL, Ib } },
  { "adcB",             { AL, Ib } },
  { "adcS",             { eAX, Iv } },
  { "adcS",             { eAX, Iv } },
  { X86_64_TABLE (X86_64_16) },
  { X86_64_TABLE (X86_64_16) },
  { X86_64_TABLE (X86_64_17) },
  { X86_64_TABLE (X86_64_17) },
  /* 18 */
  /* 18 */
  { "sbbB",             { Eb, Gb } },
  { "sbbB",             { Ebh1, Gb } },
  { "sbbS",             { Ev, Gv } },
  { "sbbS",             { Evh1, Gv } },
  { "sbbB",             { Gb, EbS } },
  { "sbbB",             { Gb, EbS } },
  { "sbbS",             { Gv, EvS } },
  { "sbbS",             { Gv, EvS } },
  { "sbbB",             { AL, Ib } },
  { "sbbB",             { AL, Ib } },
  { "sbbS",             { eAX, Iv } },
  { "sbbS",             { eAX, Iv } },
  { X86_64_TABLE (X86_64_1E) },
  { X86_64_TABLE (X86_64_1E) },
  { X86_64_TABLE (X86_64_1F) },
  { X86_64_TABLE (X86_64_1F) },
  /* 20 */
  /* 20 */
  { "andB",             { Eb, Gb } },
  { "andB",             { Ebh1, Gb } },
  { "andS",             { Ev, Gv } },
  { "andS",             { Evh1, Gv } },
  { "andB",             { Gb, EbS } },
  { "andB",             { Gb, EbS } },
  { "andS",             { Gv, EvS } },
  { "andS",             { Gv, EvS } },
  { "andB",             { AL, Ib } },
  { "andB",             { AL, Ib } },
  { "andS",             { eAX, Iv } },
  { "andS",             { eAX, Iv } },
  { Bad_Opcode },       /* SEG ES prefix */
  { Bad_Opcode },       /* SEG ES prefix */
  { X86_64_TABLE (X86_64_27) },
  { X86_64_TABLE (X86_64_27) },
  /* 28 */
  /* 28 */
  { "subB",             { Eb, Gb } },
  { "subB",             { Ebh1, Gb } },
  { "subS",             { Ev, Gv } },
  { "subS",             { Evh1, Gv } },
  { "subB",             { Gb, EbS } },
  { "subB",             { Gb, EbS } },
  { "subS",             { Gv, EvS } },
  { "subS",             { Gv, EvS } },
  { "subB",             { AL, Ib } },
  { "subB",             { AL, Ib } },
  { "subS",             { eAX, Iv } },
  { "subS",             { eAX, Iv } },
  { Bad_Opcode },       /* SEG CS prefix */
  { Bad_Opcode },       /* SEG CS prefix */
  { X86_64_TABLE (X86_64_2F) },
  { X86_64_TABLE (X86_64_2F) },
  /* 30 */
  /* 30 */
  { "xorB",             { Eb, Gb } },
  { "xorB",             { Ebh1, Gb } },
  { "xorS",             { Ev, Gv } },
  { "xorS",             { Evh1, Gv } },
  { "xorB",             { Gb, EbS } },
  { "xorB",             { Gb, EbS } },
  { "xorS",             { Gv, EvS } },
  { "xorS",             { Gv, EvS } },
  { "xorB",             { AL, Ib } },
  { "xorB",             { AL, Ib } },
  { "xorS",             { eAX, Iv } },
  { "xorS",             { eAX, Iv } },
  { Bad_Opcode },       /* SEG SS prefix */
  { Bad_Opcode },       /* SEG SS prefix */
Line 1794... Line 1809...
  { REG_TABLE (REG_81) },
  { REG_TABLE (REG_81) },
  { Bad_Opcode },
  { Bad_Opcode },
  { REG_TABLE (REG_82) },
  { REG_TABLE (REG_82) },
  { "testB",            { Eb, Gb } },
  { "testB",            { Eb, Gb } },
  { "testS",            { Ev, Gv } },
  { "testS",            { Ev, Gv } },
  { "xchgB",            { Eb, Gb } },
  { "xchgB",            { Ebh2, Gb } },
  { "xchgS",            { Ev, Gv } },
  { "xchgS",            { Evh2, Gv } },
  /* 88 */
  /* 88 */
  { "movB",             { Eb, Gb } },
  { "movB",             { Ebh3, Gb } },
  { "movS",             { Ev, Gv } },
  { "movS",             { Evh3, Gv } },
  { "movB",             { Gb, EbS } },
  { "movB",             { Gb, EbS } },
  { "movS",             { Gv, EvS } },
  { "movS",             { Gv, EvS } },
  { "movD",             { Sv, Sw } },
  { "movD",             { Sv, Sw } },
  { MOD_TABLE (MOD_8D) },
  { MOD_TABLE (MOD_8D) },
  { "movD",             { Sw, Sv } },
  { "movD",             { Sw, Sv } },
Line 2127... Line 2142...
  { REG_TABLE (REG_0FA7) },
  { REG_TABLE (REG_0FA7) },
  /* a8 */
  /* a8 */
  { "pushT",            { gs } },
  { "pushT",            { gs } },
  { "popT",             { gs } },
  { "popT",             { gs } },
  { "rsm",              { XX } },
  { "rsm",              { XX } },
  { "btsS",             { Ev, Gv } },
  { "btsS",             { Evh1, Gv } },
  { "shrdS",            { Ev, Gv, Ib } },
  { "shrdS",            { Ev, Gv, Ib } },
  { "shrdS",            { Ev, Gv, CL } },
  { "shrdS",            { Ev, Gv, CL } },
  { REG_TABLE (REG_0FAE) },
  { REG_TABLE (REG_0FAE) },
  { "imulS",            { Gv, Ev } },
  { "imulS",            { Gv, Ev } },
  /* b0 */
  /* b0 */
  { "cmpxchgB",         { Eb, Gb } },
  { "cmpxchgB",         { Ebh1, Gb } },
  { "cmpxchgS",         { Ev, Gv } },
  { "cmpxchgS",         { Evh1, Gv } },
  { MOD_TABLE (MOD_0FB2) },
  { MOD_TABLE (MOD_0FB2) },
  { "btrS",             { Ev, Gv } },
  { "btrS",             { Evh1, Gv } },
  { MOD_TABLE (MOD_0FB4) },
  { MOD_TABLE (MOD_0FB4) },
  { MOD_TABLE (MOD_0FB5) },
  { MOD_TABLE (MOD_0FB5) },
  { "movz{bR|x}",       { Gv, Eb } },
  { "movz{bR|x}",       { Gv, Eb } },
  { "movz{wR|x}",       { Gv, Ew } }, /* yes, there really is movzww ! */
  { "movz{wR|x}",       { Gv, Ew } }, /* yes, there really is movzww ! */
  /* b8 */
  /* b8 */
  { PREFIX_TABLE (PREFIX_0FB8) },
  { PREFIX_TABLE (PREFIX_0FB8) },
  { "ud1",              { XX } },
  { "ud1",              { XX } },
  { REG_TABLE (REG_0FBA) },
  { REG_TABLE (REG_0FBA) },
  { "btcS",             { Ev, Gv } },
  { "btcS",             { Evh1, Gv } },
  { PREFIX_TABLE (PREFIX_0FBC) },
  { PREFIX_TABLE (PREFIX_0FBC) },
  { PREFIX_TABLE (PREFIX_0FBD) },
  { PREFIX_TABLE (PREFIX_0FBD) },
  { "movs{bR|x}",       { Gv, Eb } },
  { "movs{bR|x}",       { Gv, Eb } },
  { "movs{wR|x}",       { Gv, Ew } }, /* yes, there really is movsww ! */
  { "movs{wR|x}",       { Gv, Ew } }, /* yes, there really is movsww ! */
  /* c0 */
  /* c0 */
  { "xaddB",            { Eb, Gb } },
  { "xaddB",            { Ebh1, Gb } },
  { "xaddS",            { Ev, Gv } },
  { "xaddS",            { Evh1, Gv } },
  { PREFIX_TABLE (PREFIX_0FC2) },
  { PREFIX_TABLE (PREFIX_0FC2) },
  { PREFIX_TABLE (PREFIX_0FC3) },
  { PREFIX_TABLE (PREFIX_0FC3) },
  { "pinsrw",           { MX, Edqw, Ib } },
  { "pinsrw",           { MX, Edqw, Ib } },
  { "pextrw",           { Gdq, MS, Ib } },
  { "pextrw",           { Gdq, MS, Ib } },
  { "shufpX",           { XM, EXx, Ib } },
  { "shufpX",           { XM, EXx, Ib } },
Line 2434... Line 2449...
};
};
 
 
static const struct dis386 reg_table[][8] = {
static const struct dis386 reg_table[][8] = {
  /* REG_80 */
  /* REG_80 */
  {
  {
    { "addA",   { Eb, Ib } },
    { "addA",   { Ebh1, Ib } },
    { "orA",    { Eb, Ib } },
    { "orA",    { Ebh1, Ib } },
    { "adcA",   { Eb, Ib } },
    { "adcA",   { Ebh1, Ib } },
    { "sbbA",   { Eb, Ib } },
    { "sbbA",   { Ebh1, Ib } },
    { "andA",   { Eb, Ib } },
    { "andA",   { Ebh1, Ib } },
    { "subA",   { Eb, Ib } },
    { "subA",   { Ebh1, Ib } },
    { "xorA",   { Eb, Ib } },
    { "xorA",   { Ebh1, Ib } },
    { "cmpA",   { Eb, Ib } },
    { "cmpA",   { Eb, Ib } },
  },
  },
  /* REG_81 */
  /* REG_81 */
  {
  {
    { "addQ",   { Ev, Iv } },
    { "addQ",   { Evh1, Iv } },
    { "orQ",    { Ev, Iv } },
    { "orQ",    { Evh1, Iv } },
    { "adcQ",   { Ev, Iv } },
    { "adcQ",   { Evh1, Iv } },
    { "sbbQ",   { Ev, Iv } },
    { "sbbQ",   { Evh1, Iv } },
    { "andQ",   { Ev, Iv } },
    { "andQ",   { Evh1, Iv } },
    { "subQ",   { Ev, Iv } },
    { "subQ",   { Evh1, Iv } },
    { "xorQ",   { Ev, Iv } },
    { "xorQ",   { Evh1, Iv } },
    { "cmpQ",   { Ev, Iv } },
    { "cmpQ",   { Ev, Iv } },
  },
  },
  /* REG_82 */
  /* REG_82 */
  {
  {
    { "addQ",   { Ev, sIb } },
    { "addQ",   { Evh1, sIb } },
    { "orQ",    { Ev, sIb } },
    { "orQ",    { Evh1, sIb } },
    { "adcQ",   { Ev, sIb } },
    { "adcQ",   { Evh1, sIb } },
    { "sbbQ",   { Ev, sIb } },
    { "sbbQ",   { Evh1, sIb } },
    { "andQ",   { Ev, sIb } },
    { "andQ",   { Evh1, sIb } },
    { "subQ",   { Ev, sIb } },
    { "subQ",   { Evh1, sIb } },
    { "xorQ",   { Ev, sIb } },
    { "xorQ",   { Evh1, sIb } },
    { "cmpQ",   { Ev, sIb } },
    { "cmpQ",   { Ev, sIb } },
  },
  },
  /* REG_8F */
  /* REG_8F */
  {
  {
    { "popU",   { stackEv } },
    { "popU",   { stackEv } },
Line 2498... Line 2513...
    { Bad_Opcode },
    { Bad_Opcode },
    { "sarQ",   { Ev, Ib } },
    { "sarQ",   { Ev, Ib } },
  },
  },
  /* REG_C6 */
  /* REG_C6 */
  {
  {
    { "movA",   { Eb, Ib } },
    { "movA",   { Ebh3, Ib } },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { MOD_TABLE (MOD_C6_REG_7) },
  },
  },
  /* REG_C7 */
  /* REG_C7 */
  {
  {
    { "movQ",   { Ev, Iv } },
    { "movQ",   { Evh3, Iv } },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { MOD_TABLE (MOD_C7_REG_7) },
  },
  },
  /* REG_D0 */
  /* REG_D0 */
  {
  {
    { "rolA",   { Eb, I1 } },
    { "rolA",   { Eb, I1 } },
    { "rorA",   { Eb, I1 } },
    { "rorA",   { Eb, I1 } },
Line 2552... Line 2581...
  },
  },
  /* REG_F6 */
  /* REG_F6 */
  {
  {
    { "testA",  { Eb, Ib } },
    { "testA",  { Eb, Ib } },
    { Bad_Opcode },
    { Bad_Opcode },
    { "notA",   { Eb } },
    { "notA",   { Ebh1 } },
    { "negA",   { Eb } },
    { "negA",   { Ebh1 } },
    { "mulA",   { Eb } },       /* Don't print the implicit %al register,  */
    { "mulA",   { Eb } },       /* Don't print the implicit %al register,  */
    { "imulA",  { Eb } },       /* to distinguish these opcodes from other */
    { "imulA",  { Eb } },       /* to distinguish these opcodes from other */
    { "divA",   { Eb } },       /* mul/imul opcodes.  Do the same for div  */
    { "divA",   { Eb } },       /* mul/imul opcodes.  Do the same for div  */
    { "idivA",  { Eb } },       /* and idiv for consistency.               */
    { "idivA",  { Eb } },       /* and idiv for consistency.               */
  },
  },
  /* REG_F7 */
  /* REG_F7 */
  {
  {
    { "testQ",  { Ev, Iv } },
    { "testQ",  { Ev, Iv } },
    { Bad_Opcode },
    { Bad_Opcode },
    { "notQ",   { Ev } },
    { "notQ",   { Evh1 } },
    { "negQ",   { Ev } },
    { "negQ",   { Evh1 } },
    { "mulQ",   { Ev } },       /* Don't print the implicit register.  */
    { "mulQ",   { Ev } },       /* Don't print the implicit register.  */
    { "imulQ",  { Ev } },
    { "imulQ",  { Ev } },
    { "divQ",   { Ev } },
    { "divQ",   { Ev } },
    { "idivQ",  { Ev } },
    { "idivQ",  { Ev } },
  },
  },
  /* REG_FE */
  /* REG_FE */
  {
  {
    { "incA",   { Eb } },
    { "incA",   { Ebh1 } },
    { "decA",   { Eb } },
    { "decA",   { Ebh1 } },
  },
  },
  /* REG_FF */
  /* REG_FF */
  {
  {
    { "incQ",   { Ev } },
    { "incQ",   { Evh1 } },
    { "decQ",   { Ev } },
    { "decQ",   { Evh1 } },
    { "call{T|}", { indirEv } },
    { "call{T|}", { indirEv } },
    { "Jcall{T|}", { indirEp } },
    { "Jcall{T|}", { indirEp } },
    { "jmp{T|}", { indirEv } },
    { "jmp{T|}", { indirEv } },
    { "Jjmp{T|}", { indirEp } },
    { "Jjmp{T|}", { indirEp } },
    { "pushU",  { stackEv } },
    { "pushU",  { stackEv } },
Line 2684... Line 2713...
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { Bad_Opcode },
    { "btQ",    { Ev, Ib } },
    { "btQ",    { Ev, Ib } },
    { "btsQ",   { Ev, Ib } },
    { "btsQ",   { Evh1, Ib } },
    { "btrQ",   { Ev, Ib } },
    { "btrQ",   { Evh1, Ib } },
    { "btcQ",   { Ev, Ib } },
    { "btcQ",   { Evh1, Ib } },
  },
  },
  /* REG_0FC7 */
  /* REG_0FC7 */
  {
  {
    { Bad_Opcode },
    { Bad_Opcode },
    { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } } },
    { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } } },
Line 10064... Line 10093...
  {
  {
    /* MOD_8D */
    /* MOD_8D */
    { "leaS",           { Gv, M } },
    { "leaS",           { Gv, M } },
  },
  },
  {
  {
 
    /* MOD_C6_REG_7 */
 
    { Bad_Opcode },
 
    { RM_TABLE (RM_C6_REG_7) },
 
  },
 
  {
 
    /* MOD_C7_REG_7 */
 
    { Bad_Opcode },
 
    { RM_TABLE (RM_C7_REG_7) },
 
  },
 
  {
    /* MOD_0F01_REG_0 */
    /* MOD_0F01_REG_0 */
    { X86_64_TABLE (X86_64_0F01_REG_0) },
    { X86_64_TABLE (X86_64_0F01_REG_0) },
    { RM_TABLE (RM_0F01_REG_0) },
    { RM_TABLE (RM_0F01_REG_0) },
  },
  },
  {
  {
Line 10452... Line 10491...
  },
  },
};
};
 
 
static const struct dis386 rm_table[][8] = {
static const struct dis386 rm_table[][8] = {
  {
  {
 
    /* RM_C6_REG_7 */
 
    { "xabort",         { Skip_MODRM, Ib } },
 
  },
 
  {
 
    /* RM_C7_REG_7 */
 
    { "xbeginT",        { Skip_MODRM, Jv } },
 
  },
 
  {
    /* RM_0F01_REG_0 */
    /* RM_0F01_REG_0 */
    { Bad_Opcode },
    { Bad_Opcode },
    { "vmcall",         { Skip_MODRM } },
    { "vmcall",         { Skip_MODRM } },
    { "vmlaunch",       { Skip_MODRM } },
    { "vmlaunch",       { Skip_MODRM } },
    { "vmresume",       { Skip_MODRM } },
    { "vmresume",       { Skip_MODRM } },
Line 10468... Line 10515...
  },
  },
  {
  {
    /* RM_0F01_REG_2 */
    /* RM_0F01_REG_2 */
    { "xgetbv",         { Skip_MODRM } },
    { "xgetbv",         { Skip_MODRM } },
    { "xsetbv",         { Skip_MODRM } },
    { "xsetbv",         { Skip_MODRM } },
 
    { Bad_Opcode },
 
    { Bad_Opcode },
 
    { "vmfunc",         { Skip_MODRM } },
 
    { "xend",           { Skip_MODRM } },
 
    { "xtest",          { Skip_MODRM } },
 
    { Bad_Opcode },
  },
  },
  {
  {
    /* RM_0F01_REG_3 */
    /* RM_0F01_REG_3 */
    { "vmrun",          { Skip_MODRM } },
    { "vmrun",          { Skip_MODRM } },
    { "vmmcall",        { Skip_MODRM } },
    { "vmmcall",        { Skip_MODRM } },
Line 10508... Line 10561...
#define ADDR16_PREFIX   (0x67 | 0x100)
#define ADDR16_PREFIX   (0x67 | 0x100)
#define ADDR32_PREFIX   (0x67 | 0x200)
#define ADDR32_PREFIX   (0x67 | 0x200)
#define DATA16_PREFIX   (0x66 | 0x100)
#define DATA16_PREFIX   (0x66 | 0x100)
#define DATA32_PREFIX   (0x66 | 0x200)
#define DATA32_PREFIX   (0x66 | 0x200)
#define REP_PREFIX      (0xf3 | 0x100)
#define REP_PREFIX      (0xf3 | 0x100)
 
#define XACQUIRE_PREFIX (0xf2 | 0x200)
 
#define XRELEASE_PREFIX (0xf3 | 0x400)
 
 
static int
static int
ckprefix (void)
ckprefix (void)
{
{
  int newrex, i, length;
  int newrex, i, length;
Line 10738... Line 10793...
      return "data16";
      return "data16";
    case DATA32_PREFIX:
    case DATA32_PREFIX:
      return "data32";
      return "data32";
    case REP_PREFIX:
    case REP_PREFIX:
      return "rep";
      return "rep";
 
    case XACQUIRE_PREFIX:
 
      return "xacquire";
 
    case XRELEASE_PREFIX:
 
      return "xrelease";
    default:
    default:
      return NULL;
      return NULL;
    }
    }
}
}
 
 
Line 14356... Line 14415...
      abort ();
      abort ();
      break;
      break;
    }
    }
}
}
 
 
 
/* Similar to OP_E.  But the 0xf2/0xf3 prefixes should be displayed as
 
   "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
 
 */
 
 
 
static void
 
HLE_Fixup1 (int bytemode, int sizeflag)
 
{
 
  if (modrm.mod != 3
 
      && (prefixes & PREFIX_LOCK) != 0)
 
    {
 
      if (prefixes & PREFIX_REPZ)
 
        all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
 
      if (prefixes & PREFIX_REPNZ)
 
        all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
 
    }
 
 
 
  OP_E (bytemode, sizeflag);
 
}
 
 
 
/* Similar to OP_E.  But the 0xf2/0xf3 prefixes should be displayed as
 
   "xacquire"/"xrelease" for memory operand.  No check for LOCK prefix.
 
 */
 
 
 
static void
 
HLE_Fixup2 (int bytemode, int sizeflag)
 
{
 
  if (modrm.mod != 3)
 
    {
 
      if (prefixes & PREFIX_REPZ)
 
        all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
 
      if (prefixes & PREFIX_REPNZ)
 
        all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
 
    }
 
 
 
  OP_E (bytemode, sizeflag);
 
}
 
 
 
/* Similar to OP_E.  But the 0xf3 prefixes should be displayed as
 
   "xrelease" for memory operand.  No check for LOCK prefix.   */
 
 
 
static void
 
HLE_Fixup3 (int bytemode, int sizeflag)
 
{
 
  if (modrm.mod != 3
 
      && last_repz_prefix > last_repnz_prefix
 
      && (prefixes & PREFIX_REPZ) != 0)
 
    all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
 
 
 
  OP_E (bytemode, sizeflag);
 
}
 
 
static void
static void
CMPXCHG8B_Fixup (int bytemode, int sizeflag)
CMPXCHG8B_Fixup (int bytemode, int sizeflag)
{
{
  USED_REX (REX_W);
  USED_REX (REX_W);
  if (rex & REX_W)
  if (rex & REX_W)
Line 14367... Line 14477...
      /* Change cmpxchg8b to cmpxchg16b.  */
      /* Change cmpxchg8b to cmpxchg16b.  */
      char *p = mnemonicendp - 2;
      char *p = mnemonicendp - 2;
      mnemonicendp = stpcpy (p, "16b");
      mnemonicendp = stpcpy (p, "16b");
      bytemode = o_mode;
      bytemode = o_mode;
    }
    }
 
  else if ((prefixes & PREFIX_LOCK) != 0)
 
    {
 
      if (prefixes & PREFIX_REPZ)
 
        all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
 
      if (prefixes & PREFIX_REPNZ)
 
        all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
 
    }
 
 
  OP_M (bytemode, sizeflag);
  OP_M (bytemode, sizeflag);
}
}
 
 
static void
static void
XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.