aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2008-05-02 16:53:40 +0000
committerH.J. Lu <hjl.tools@gmail.com>2008-05-02 16:53:40 +0000
commitf1f8f695c0b509617985d96559c940664c01334b (patch)
tree71b024e8640775137ee73a9d6979dc70f4649c6b /opcodes/i386-dis.c
parent237fc4c9cdd1a1df1e53a8321dfd7b147da722fd (diff)
downloadgdb-f1f8f695c0b509617985d96559c940664c01334b.zip
gdb-f1f8f695c0b509617985d96559c940664c01334b.tar.gz
gdb-f1f8f695c0b509617985d96559c940664c01334b.tar.bz2
gas/
2008-05-02 H.J. Lu <hongjiu.lu@intel.com> * NEWS: Mention XSAVE, EPT and MOVBE. * config/tc-i386.c (cpu_arch): Add .movbe and .ept. (md_show_usage): Add .movbe and .ept. * doc/c-i386.texi: Add movbe and ept to -march=. Document .movbe and .ept. gas/testsuite/ 2008-05-02 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/i386.exp: Run movbe, movbe-intel, inval-movbe, ept, ept-intel, inval-ept, x86-64-movbe, x86-64-movbe-intel, x86-64-inval-movbe. x86-64-ept, x86-64-ept-intel and x86-64-inval-ept. * gas/i386/arch-10.s: Add movbe and invept. * gas/i386/x86-64-arch-2.s: Likewise. * gas/i386/ept.d: New file * gas/i386/ept-intel.d: Likewise. * gas/i386/ept.s: Likewise. * gas/i386/inval-ept.l: Likewise. * gas/i386/inval-ept.s: Likewise. * gas/i386/inval-movbe.l: Likewise. * gas/i386/inval-movbe.s: Likewise. * gas/i386/movbe.d: Likewise. * gas/i386/movbe-intel.d: Likewise. * gas/i386/movbe.s: Likewise. * gas/i386/x86-64-inval-ept.l: Likewise. * gas/i386/x86-64-inval-ept.s: Likewise. * gas/i386/x86-64-inval-movbe.l: Likewise. * gas/i386/x86-64-inval-movbe.s: Likewise. * gas/i386/x86-64-ept.d: Likewise. * gas/i386/x86-64-ept-intel.d: Likewise. * gas/i386/x86-64-ept.s: Likewise. * gas/i386/x86-64-movbe.d: Likewise. * gas/i386/x86-64-movbe-intel.d: Likewise. * gas/i386/x86-64-movbe.s: Likewise. * gas/i386/arch-10.d: Updated. * gas/i386/arch-10-1.l: Likewise. * gas/i386/arch-10-2.l: Likewise. * gas/i386/arch-10-3.l: Likewise. * gas/i386/arch-10-4.l: Likewise. * gas/i386/x86-64-arch-2.d: Likewise. opcodes/ 2008-05-02 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (MOVBE_Fixup): New. (Mo): Likewise. (PREFIX_0F3880): Likewise. (PREFIX_0F3881): Likewise. (PREFIX_0F38F0): Updated. (prefix_table): Add PREFIX_0F3880 and PREFIX_0F3881. Update PREFIX_0F38F0 and PREFIX_0F38F1 for movbe. (three_byte_table): Use PREFIX_0F3880 and PREFIX_0F3881. * i386-gen.c (cpu_flag_init): Add CPU_MOVBE_FLAGS and CPU_EPT_FLAGS. (cpu_flags): Add CpuMovbe and CpuEPT. * i386-opc.h (CpuMovbe): New. (CpuEPT): Likewise. (CpuLM): Updated. (i386_cpu_flags): Add cpumovbe and cpuept. * i386-opc.tbl: Add entries for movbe and EPT instructions. * i386-init.h: Regenerated. * i386-tbl.h: Likewise.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c67
1 files changed, 60 insertions, 7 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 087c449..4f3c9e0 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -121,6 +121,7 @@ static void OP_DREX4 (int, int);
static void OP_DREX3 (int, int);
static void OP_DREX_ICMP (int, int);
static void OP_DREX_FCMP (int, int);
+static void MOVBE_Fixup (int, int);
struct dis_private {
/* Points to first byte not fetched. */
@@ -254,6 +255,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
#define Ma { OP_M, a_mode }
#define Mb { OP_M, b_mode }
#define Md { OP_M, d_mode }
+#define Mo { OP_M, o_mode }
#define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
#define Mq { OP_M, q_mode }
#define Mx { OP_M, x_mode }
@@ -745,7 +747,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
#define PREFIX_0F383F (PREFIX_0F383E + 1)
#define PREFIX_0F3840 (PREFIX_0F383F + 1)
#define PREFIX_0F3841 (PREFIX_0F3840 + 1)
-#define PREFIX_0F38DB (PREFIX_0F3841 + 1)
+#define PREFIX_0F3880 (PREFIX_0F3841 + 1)
+#define PREFIX_0F3881 (PREFIX_0F3880 + 1)
+#define PREFIX_0F38DB (PREFIX_0F3881 + 1)
#define PREFIX_0F38DC (PREFIX_0F38DB + 1)
#define PREFIX_0F38DD (PREFIX_0F38DC + 1)
#define PREFIX_0F38DE (PREFIX_0F38DD + 1)
@@ -3003,6 +3007,22 @@ static const struct dis386 prefix_table[][4] = {
{ "(bad)", { XX } },
},
+ /* PREFIX_0F3880 */
+ {
+ { "(bad)", { XX } },
+ { "(bad)", { XX } },
+ { "invept", { Gm, Mo } },
+ { "(bad)", { XX } },
+ },
+
+ /* PREFIX_0F3881 */
+ {
+ { "(bad)", { XX } },
+ { "(bad)", { XX } },
+ { "invvpid", { Gm, Mo } },
+ { "(bad)", { XX } },
+ },
+
/* PREFIX_0F38DB */
{
{ "(bad)", { XX } },
@@ -3045,17 +3065,17 @@ static const struct dis386 prefix_table[][4] = {
/* PREFIX_0F38F0 */
{
+ { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
{ "(bad)", { XX } },
- { "(bad)", { XX } },
- { "(bad)", { XX } },
+ { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
{ "crc32", { Gdq, { CRC32_Fixup, b_mode } } },
},
/* PREFIX_0F38F1 */
{
+ { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
{ "(bad)", { XX } },
- { "(bad)", { XX } },
- { "(bad)", { XX } },
+ { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
{ "crc32", { Gdq, { CRC32_Fixup, v_mode } } },
},
@@ -5832,8 +5852,8 @@ static const struct dis386 three_byte_table[][256] = {
{ "(bad)", { XX } },
{ "(bad)", { XX } },
/* 80 */
- { "(bad)", { XX } },
- { "(bad)", { XX } },
+ { PREFIX_TABLE (PREFIX_0F3880) },
+ { PREFIX_TABLE (PREFIX_0F3881) },
{ "(bad)", { XX } },
{ "(bad)", { XX } },
{ "(bad)", { XX } },
@@ -13700,3 +13720,36 @@ VPERMIL2_Fixup (int bytemode ATTRIBUTE_UNUSED,
scratchbuf[0] = '\0';
}
}
+
+static void
+MOVBE_Fixup (int bytemode, int sizeflag)
+{
+ /* Add proper suffix to "movbe". */
+ char *p = obuf + strlen (obuf);
+
+ switch (bytemode)
+ {
+ case v_mode:
+ if (intel_syntax)
+ break;
+
+ USED_REX (REX_W);
+ if (sizeflag & SUFFIX_ALWAYS)
+ {
+ if (rex & REX_W)
+ *p++ = 'q';
+ else if (sizeflag & DFLAG)
+ *p++ = 'l';
+ else
+ *p++ = 'w';
+ }
+ used_prefixes |= (prefixes & PREFIX_DATA);
+ break;
+ default:
+ oappend (INTERNAL_DISASSEMBLER_ERROR);
+ break;
+ }
+ *p = '\0';
+
+ OP_M (bytemode, sizeflag);
+}