Add names_mm, names_xmm and names_ymm.
2010-01-14 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (names_mm): New. (intel_names_mm): Likewise. (att_names_mm): Likewise. (names_xmm): Likewise. (intel_names_xmm): Likewise. (att_names_xmm): Likewise. (names_ymm): Likewise. (intel_names_ymm): Likewise. (att_names_ymm): Likewise. (print_insn): Set names_mm, names_xmm and names_ymm. (OP_MMX): Use names_mm, names_xmm and names_ymm. (OP_XMM): Likewise. (OP_EM): Likewise. (OP_EMC): Likewise. (OP_MXC): Likewise. (OP_EX): Likewise. (XMM_Fixup): Likewise. (OP_VEX): Likewise. (OP_EX_VexReg): Likewise. (OP_Vex_2src): Likewise. (OP_Vex_2src_1): Likewise. (OP_Vex_2src_2): Likewise. (OP_REG_VexI4): Likewise.
This commit is contained in:
parent
1319d143a7
commit
b9733481ab
2 changed files with 130 additions and 58 deletions
|
@ -1,3 +1,29 @@
|
||||||
|
2010-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* i386-dis.c (names_mm): New.
|
||||||
|
(intel_names_mm): Likewise.
|
||||||
|
(att_names_mm): Likewise.
|
||||||
|
(names_xmm): Likewise.
|
||||||
|
(intel_names_xmm): Likewise.
|
||||||
|
(att_names_xmm): Likewise.
|
||||||
|
(names_ymm): Likewise.
|
||||||
|
(intel_names_ymm): Likewise.
|
||||||
|
(att_names_ymm): Likewise.
|
||||||
|
(print_insn): Set names_mm, names_xmm and names_ymm.
|
||||||
|
(OP_MMX): Use names_mm, names_xmm and names_ymm.
|
||||||
|
(OP_XMM): Likewise.
|
||||||
|
(OP_EM): Likewise.
|
||||||
|
(OP_EMC): Likewise.
|
||||||
|
(OP_MXC): Likewise.
|
||||||
|
(OP_EX): Likewise.
|
||||||
|
(XMM_Fixup): Likewise.
|
||||||
|
(OP_VEX): Likewise.
|
||||||
|
(OP_EX_VexReg): Likewise.
|
||||||
|
(OP_Vex_2src): Likewise.
|
||||||
|
(OP_Vex_2src_1): Likewise.
|
||||||
|
(OP_Vex_2src_2): Likewise.
|
||||||
|
(OP_REG_VexI4): Likewise.
|
||||||
|
|
||||||
2010-01-13 H.J. Lu <hongjiu.lu@intel.com>
|
2010-01-13 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* i386-dis.c (print_insn): Update comments.
|
* i386-dis.c (print_insn): Update comments.
|
||||||
|
|
|
@ -2362,6 +2362,44 @@ static const char *att_index16[] = {
|
||||||
"%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
|
"%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char **names_mm;
|
||||||
|
static const char *intel_names_mm[] = {
|
||||||
|
"mm0", "mm1", "mm2", "mm3",
|
||||||
|
"mm4", "mm5", "mm6", "mm7"
|
||||||
|
};
|
||||||
|
static const char *att_names_mm[] = {
|
||||||
|
"%mm0", "%mm1", "%mm2", "%mm3",
|
||||||
|
"%mm4", "%mm5", "%mm6", "%mm7"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char **names_xmm;
|
||||||
|
static const char *intel_names_xmm[] = {
|
||||||
|
"xmm0", "xmm1", "xmm2", "xmm3",
|
||||||
|
"xmm4", "xmm5", "xmm6", "xmm7",
|
||||||
|
"xmm8", "xmm9", "xmm10", "xmm11",
|
||||||
|
"xmm12", "xmm13", "xmm14", "xmm15"
|
||||||
|
};
|
||||||
|
static const char *att_names_xmm[] = {
|
||||||
|
"%xmm0", "%xmm1", "%xmm2", "%xmm3",
|
||||||
|
"%xmm4", "%xmm5", "%xmm6", "%xmm7",
|
||||||
|
"%xmm8", "%xmm9", "%xmm10", "%xmm11",
|
||||||
|
"%xmm12", "%xmm13", "%xmm14", "%xmm15"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char **names_ymm;
|
||||||
|
static const char *intel_names_ymm[] = {
|
||||||
|
"ymm0", "ymm1", "ymm2", "ymm3",
|
||||||
|
"ymm4", "ymm5", "ymm6", "ymm7",
|
||||||
|
"ymm8", "ymm9", "ymm10", "ymm11",
|
||||||
|
"ymm12", "ymm13", "ymm14", "ymm15"
|
||||||
|
};
|
||||||
|
static const char *att_names_ymm[] = {
|
||||||
|
"%ymm0", "%ymm1", "%ymm2", "%ymm3",
|
||||||
|
"%ymm4", "%ymm5", "%ymm6", "%ymm7",
|
||||||
|
"%ymm8", "%ymm9", "%ymm10", "%ymm11",
|
||||||
|
"%ymm12", "%ymm13", "%ymm14", "%ymm15"
|
||||||
|
};
|
||||||
|
|
||||||
static const struct dis386 reg_table[][8] = {
|
static const struct dis386 reg_table[][8] = {
|
||||||
/* REG_80 */
|
/* REG_80 */
|
||||||
{
|
{
|
||||||
|
@ -12126,6 +12164,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||||
names8 = intel_names8;
|
names8 = intel_names8;
|
||||||
names8rex = intel_names8rex;
|
names8rex = intel_names8rex;
|
||||||
names_seg = intel_names_seg;
|
names_seg = intel_names_seg;
|
||||||
|
names_mm = intel_names_mm;
|
||||||
|
names_xmm = intel_names_xmm;
|
||||||
|
names_ymm = intel_names_ymm;
|
||||||
index64 = intel_index64;
|
index64 = intel_index64;
|
||||||
index32 = intel_index32;
|
index32 = intel_index32;
|
||||||
index16 = intel_index16;
|
index16 = intel_index16;
|
||||||
|
@ -12142,6 +12183,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||||
names8 = att_names8;
|
names8 = att_names8;
|
||||||
names8rex = att_names8rex;
|
names8rex = att_names8rex;
|
||||||
names_seg = att_names_seg;
|
names_seg = att_names_seg;
|
||||||
|
names_mm = att_names_mm;
|
||||||
|
names_xmm = att_names_xmm;
|
||||||
|
names_ymm = att_names_ymm;
|
||||||
index64 = att_index64;
|
index64 = att_index64;
|
||||||
index32 = att_index32;
|
index32 = att_index32;
|
||||||
index16 = att_index16;
|
index16 = att_index16;
|
||||||
|
@ -14625,53 +14669,56 @@ OP_R (int bytemode, int sizeflag)
|
||||||
static void
|
static void
|
||||||
OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
int reg = modrm.reg;
|
||||||
|
const char **names;
|
||||||
|
|
||||||
used_prefixes |= (prefixes & PREFIX_DATA);
|
used_prefixes |= (prefixes & PREFIX_DATA);
|
||||||
if (prefixes & PREFIX_DATA)
|
if (prefixes & PREFIX_DATA)
|
||||||
{
|
{
|
||||||
int add;
|
names = names_xmm;
|
||||||
USED_REX (REX_R);
|
USED_REX (REX_R);
|
||||||
if (rex & REX_R)
|
if (rex & REX_R)
|
||||||
add = 8;
|
reg += 8;
|
||||||
else
|
|
||||||
add = 0;
|
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf (scratchbuf, "%%mm%d", modrm.reg);
|
names = names_mm;
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int add;
|
int reg = modrm.reg;
|
||||||
|
const char **names;
|
||||||
|
|
||||||
USED_REX (REX_R);
|
USED_REX (REX_R);
|
||||||
if (rex & REX_R)
|
if (rex & REX_R)
|
||||||
add = 8;
|
reg += 8;
|
||||||
else
|
|
||||||
add = 0;
|
|
||||||
if (need_vex && bytemode != xmm_mode)
|
if (need_vex && bytemode != xmm_mode)
|
||||||
{
|
{
|
||||||
switch (vex.length)
|
switch (vex.length)
|
||||||
{
|
{
|
||||||
case 128:
|
case 128:
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
sprintf (scratchbuf, "%%ymm%d", modrm.reg + add);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
|
names = names_xmm;
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
OP_EM (int bytemode, int sizeflag)
|
OP_EM (int bytemode, int sizeflag)
|
||||||
{
|
{
|
||||||
|
int reg;
|
||||||
|
const char **names;
|
||||||
|
|
||||||
if (modrm.mod != 3)
|
if (modrm.mod != 3)
|
||||||
{
|
{
|
||||||
if (intel_syntax
|
if (intel_syntax
|
||||||
|
@ -14691,20 +14738,17 @@ OP_EM (int bytemode, int sizeflag)
|
||||||
MODRM_CHECK;
|
MODRM_CHECK;
|
||||||
codep++;
|
codep++;
|
||||||
used_prefixes |= (prefixes & PREFIX_DATA);
|
used_prefixes |= (prefixes & PREFIX_DATA);
|
||||||
|
reg = modrm.rm;
|
||||||
if (prefixes & PREFIX_DATA)
|
if (prefixes & PREFIX_DATA)
|
||||||
{
|
{
|
||||||
int add;
|
names = names_xmm;
|
||||||
|
|
||||||
USED_REX (REX_B);
|
USED_REX (REX_B);
|
||||||
if (rex & REX_B)
|
if (rex & REX_B)
|
||||||
add = 8;
|
reg += 8;
|
||||||
else
|
|
||||||
add = 0;
|
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf (scratchbuf, "%%mm%d", modrm.rm);
|
names = names_mm;
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cvt* are the only instructions in sse2 which have
|
/* cvt* are the only instructions in sse2 which have
|
||||||
|
@ -14730,22 +14774,21 @@ OP_EMC (int bytemode, int sizeflag)
|
||||||
MODRM_CHECK;
|
MODRM_CHECK;
|
||||||
codep++;
|
codep++;
|
||||||
used_prefixes |= (prefixes & PREFIX_DATA);
|
used_prefixes |= (prefixes & PREFIX_DATA);
|
||||||
sprintf (scratchbuf, "%%mm%d", modrm.rm);
|
oappend (names_mm[modrm.rm]);
|
||||||
oappend (scratchbuf + intel_syntax);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
used_prefixes |= (prefixes & PREFIX_DATA);
|
used_prefixes |= (prefixes & PREFIX_DATA);
|
||||||
sprintf (scratchbuf, "%%mm%d", modrm.reg);
|
oappend (names_mm[modrm.reg]);
|
||||||
oappend (scratchbuf + intel_syntax);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
OP_EX (int bytemode, int sizeflag)
|
OP_EX (int bytemode, int sizeflag)
|
||||||
{
|
{
|
||||||
int add;
|
int reg;
|
||||||
|
const char **names;
|
||||||
|
|
||||||
/* Skip mod/rm byte. */
|
/* Skip mod/rm byte. */
|
||||||
MODRM_CHECK;
|
MODRM_CHECK;
|
||||||
|
@ -14757,11 +14800,10 @@ OP_EX (int bytemode, int sizeflag)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reg = modrm.rm;
|
||||||
USED_REX (REX_B);
|
USED_REX (REX_B);
|
||||||
if (rex & REX_B)
|
if (rex & REX_B)
|
||||||
add = 8;
|
reg += 8;
|
||||||
else
|
|
||||||
add = 0;
|
|
||||||
|
|
||||||
if ((sizeflag & SUFFIX_ALWAYS)
|
if ((sizeflag & SUFFIX_ALWAYS)
|
||||||
&& (bytemode == x_swap_mode
|
&& (bytemode == x_swap_mode
|
||||||
|
@ -14776,18 +14818,18 @@ OP_EX (int bytemode, int sizeflag)
|
||||||
switch (vex.length)
|
switch (vex.length)
|
||||||
{
|
{
|
||||||
case 128:
|
case 128:
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
sprintf (scratchbuf, "%%ymm%d", modrm.rm + add);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
|
names = names_xmm;
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -15086,23 +15128,25 @@ CMPXCHG8B_Fixup (int bytemode, int sizeflag)
|
||||||
static void
|
static void
|
||||||
XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
|
XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
const char **names;
|
||||||
|
|
||||||
if (need_vex)
|
if (need_vex)
|
||||||
{
|
{
|
||||||
switch (vex.length)
|
switch (vex.length)
|
||||||
{
|
{
|
||||||
case 128:
|
case 128:
|
||||||
sprintf (scratchbuf, "%%xmm%d", reg);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
sprintf (scratchbuf, "%%ymm%d", reg);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf (scratchbuf, "%%xmm%d", reg);
|
names = names_xmm;
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -15198,6 +15242,8 @@ FXSAVE_Fixup (int bytemode, int sizeflag)
|
||||||
static void
|
static void
|
||||||
OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
const char **names;
|
||||||
|
|
||||||
if (!need_vex)
|
if (!need_vex)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
@ -15217,7 +15263,7 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
switch (bytemode)
|
switch (bytemode)
|
||||||
|
@ -15230,13 +15276,13 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf (scratchbuf, "%%ymm%d", vex.register_specifier);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[vex.register_specifier]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the VEX immediate byte without moving codep. */
|
/* Get the VEX immediate byte without moving codep. */
|
||||||
|
@ -15331,6 +15377,8 @@ get_vex_imm8 (int sizeflag, int opnum)
|
||||||
static void
|
static void
|
||||||
OP_EX_VexReg (int bytemode, int sizeflag, int reg)
|
OP_EX_VexReg (int bytemode, int sizeflag, int reg)
|
||||||
{
|
{
|
||||||
|
const char **names;
|
||||||
|
|
||||||
if (reg == -1 && modrm.mod != 3)
|
if (reg == -1 && modrm.mod != 3)
|
||||||
{
|
{
|
||||||
OP_E_memory (bytemode, sizeflag);
|
OP_E_memory (bytemode, sizeflag);
|
||||||
|
@ -15352,15 +15400,15 @@ OP_EX_VexReg (int bytemode, int sizeflag, int reg)
|
||||||
switch (vex.length)
|
switch (vex.length)
|
||||||
{
|
{
|
||||||
case 128:
|
case 128:
|
||||||
sprintf (scratchbuf, "%%xmm%d", reg);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
sprintf (scratchbuf, "%%ymm%d", reg);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -15368,9 +15416,11 @@ OP_Vex_2src (int bytemode, int sizeflag)
|
||||||
{
|
{
|
||||||
if (modrm.mod == 3)
|
if (modrm.mod == 3)
|
||||||
{
|
{
|
||||||
|
int reg = modrm.rm;
|
||||||
USED_REX (REX_B);
|
USED_REX (REX_B);
|
||||||
sprintf (scratchbuf, "%%xmm%d", rex & REX_B ? modrm.rm + 8 : modrm.rm);
|
if (rex & REX_B)
|
||||||
oappend (scratchbuf + intel_syntax);
|
reg += 8;
|
||||||
|
oappend (names_xmm[reg]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -15395,10 +15445,7 @@ OP_Vex_2src_1 (int bytemode, int sizeflag)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vex.w)
|
if (vex.w)
|
||||||
{
|
oappend (names_xmm[vex.register_specifier]);
|
||||||
sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
|
|
||||||
oappend (scratchbuf + intel_syntax);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
OP_Vex_2src (bytemode, sizeflag);
|
OP_Vex_2src (bytemode, sizeflag);
|
||||||
}
|
}
|
||||||
|
@ -15409,10 +15456,7 @@ OP_Vex_2src_2 (int bytemode, int sizeflag)
|
||||||
if (vex.w)
|
if (vex.w)
|
||||||
OP_Vex_2src (bytemode, sizeflag);
|
OP_Vex_2src (bytemode, sizeflag);
|
||||||
else
|
else
|
||||||
{
|
oappend (names_xmm[vex.register_specifier]);
|
||||||
sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
|
|
||||||
oappend (scratchbuf + intel_syntax);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -15454,6 +15498,8 @@ static void
|
||||||
OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
int reg;
|
int reg;
|
||||||
|
const char **names;
|
||||||
|
|
||||||
FETCH_DATA (the_info, codep + 1);
|
FETCH_DATA (the_info, codep + 1);
|
||||||
reg = *codep++;
|
reg = *codep++;
|
||||||
|
|
||||||
|
@ -15470,15 +15516,15 @@ OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
|
||||||
switch (vex.length)
|
switch (vex.length)
|
||||||
{
|
{
|
||||||
case 128:
|
case 128:
|
||||||
sprintf (scratchbuf, "%%xmm%d", reg);
|
names = names_xmm;
|
||||||
break;
|
break;
|
||||||
case 256:
|
case 256:
|
||||||
sprintf (scratchbuf, "%%ymm%d", reg);
|
names = names_ymm;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
oappend (scratchbuf + intel_syntax);
|
oappend (names[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue