aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-09-22 09:38:53 -0700
committerH.J. Lu <hjl.tools@gmail.com>2014-09-22 09:38:53 -0700
commit68f34464821105e0c74a0ce16c5d26d4c3e1d20c (patch)
treed2cde5142f9aee2b2bf582bb65e7bc6d4c6180af /opcodes
parent20b23ee6c89b3c412f78017d777ca2d3d2937431 (diff)
downloadbinutils-68f34464821105e0c74a0ce16c5d26d4c3e1d20c.zip
binutils-68f34464821105e0c74a0ce16c5d26d4c3e1d20c.tar.gz
binutils-68f34464821105e0c74a0ce16c5d26d4c3e1d20c.tar.bz2
Ignore MOD field for control/debug register move
This patch ignores the MOD field in control/debug register move instructions. gas/testsuite/ * gas/i386/cdr.d: New file. * gas/i386/cdr.s: Likewise. * gas/i386/x86-64-cdr.d: Likewise. * gas/i386/i386.exp: Run cdr and x86-64-cdr. opcodes/ * i386-dis.c (MOD_0F20): Removed. (MOD_0F21): Likewise. (MOD_0F22): Likewise. (MOD_0F23): Likewise. (dis386_twobyte): Replace MOD_0F20, MOD_0F21, MOD_0F22 and MOD_0F23 with "movZ". (mod_table): Remove MOD_0F20, MOD_0F21, MOD_0F22 and MOD_0F23. (OP_R): Check mod/rm byte and call OP_E_register.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog11
-rw-r--r--opcodes/i386-dis.c40
2 files changed, 19 insertions, 32 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 42e09dd..e5bcb13 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,14 @@
+2014-09-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-dis.c (MOD_0F20): Removed.
+ (MOD_0F21): Likewise.
+ (MOD_0F22): Likewise.
+ (MOD_0F23): Likewise.
+ (dis386_twobyte): Replace MOD_0F20, MOD_0F21, MOD_0F22 and
+ MOD_0F23 with "movZ".
+ (mod_table): Remove MOD_0F20, MOD_0F21, MOD_0F22 and MOD_0F23.
+ (OP_R): Check mod/rm byte and call OP_E_register.
+
2014-09-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* nds32-asm.c (nds32_opcodes, operand_fields, keyword_im5_i,
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 79abe09..c7cfb55 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -753,10 +753,6 @@ enum
MOD_0F1A_PREFIX_0,
MOD_0F1B_PREFIX_0,
MOD_0F1B_PREFIX_1,
- MOD_0F20,
- MOD_0F21,
- MOD_0F22,
- MOD_0F23,
MOD_0F24,
MOD_0F26,
MOD_0F2B_PREFIX_0,
@@ -2736,10 +2732,10 @@ static const struct dis386 dis386_twobyte[] = {
{ "nopQ", { Ev } },
{ "nopQ", { Ev } },
/* 20 */
- { MOD_TABLE (MOD_0F20) },
- { MOD_TABLE (MOD_0F21) },
- { MOD_TABLE (MOD_0F22) },
- { MOD_TABLE (MOD_0F23) },
+ { "movZ", { Rm, Cm } },
+ { "movZ", { Rm, Dm } },
+ { "movZ", { Cm, Rm } },
+ { "movZ", { Dm, Rm } },
{ MOD_TABLE (MOD_0F24) },
{ Bad_Opcode },
{ MOD_TABLE (MOD_0F26) },
@@ -11642,26 +11638,6 @@ static const struct dis386 mod_table[][2] = {
{ "nopQ", { Ev } },
},
{
- /* MOD_0F20 */
- { Bad_Opcode },
- { "movZ", { Rm, Cm } },
- },
- {
- /* MOD_0F21 */
- { Bad_Opcode },
- { "movZ", { Rm, Dm } },
- },
- {
- /* MOD_0F22 */
- { Bad_Opcode },
- { "movZ", { Cm, Rm } },
- },
- {
- /* MOD_0F23 */
- { Bad_Opcode },
- { "movZ", { Dm, Rm } },
- },
- {
/* MOD_0F24 */
{ Bad_Opcode },
{ "movL", { Rd, Td } },
@@ -15892,10 +15868,10 @@ OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
static void
OP_R (int bytemode, int sizeflag)
{
- if (modrm.mod == 3)
- OP_E (bytemode, sizeflag);
- else
- BadOp ();
+ /* Skip mod/rm byte. */
+ MODRM_CHECK;
+ codep++;
+ OP_E_register (bytemode, sizeflag);
}
static void