aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-11-12 02:21:46 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-11-12 02:21:46 +0000
commit1b9f0c97ada321f4722312fb97acdf5cbb8bfb47 (patch)
treefcc9d41cfdd45bafeec47d65ab07069a553f03a3 /gas
parentf310f33d50d9bfb1ded3dbf04a23aeb5eed5368b (diff)
downloadgdb-1b9f0c97ada321f4722312fb97acdf5cbb8bfb47.zip
gdb-1b9f0c97ada321f4722312fb97acdf5cbb8bfb47.tar.gz
gdb-1b9f0c97ada321f4722312fb97acdf5cbb8bfb47.tar.bz2
2009-11-11 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (build_modrm_byte): Don't set register operand twice.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c28
2 files changed, 21 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a372f9a..c239616 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/tc-i386.c (build_modrm_byte): Don't set register
+ operand twice.
+
2009-11-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* configure.in: Call ACX_LARGEFILE. Stop calling AC_SYS_LARGEFILE.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2996751..e787215 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5344,19 +5344,23 @@ build_modrm_byte (void)
i.vex.register_specifier = i.op[vex_reg].regs;
}
- /* If there is an extension opcode to put here, the
- register number must be put into the regmem field. */
- if (i.tm.extension_opcode != None)
+ /* Don't set OP operand twice. */
+ if (vex_reg != op)
{
- i.rm.regmem = i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- }
- else
- {
- i.rm.reg = i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
+ /* If there is an extension opcode to put here, the
+ register number must be put into the regmem field. */
+ if (i.tm.extension_opcode != None)
+ {
+ i.rm.regmem = i.op[op].regs->reg_num;
+ if ((i.op[op].regs->reg_flags & RegRex) != 0)
+ i.rex |= REX_B;
+ }
+ else
+ {
+ i.rm.reg = i.op[op].regs->reg_num;
+ if ((i.op[op].regs->reg_flags & RegRex) != 0)
+ i.rex |= REX_R;
+ }
}
/* Now, if no memory operand has set i.rm.mode = 0, 1, 2 we