summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2007-09-20 20:13:26 +0000
committerH.J. Lu <hjl@lucon.org>2007-09-20 20:13:26 +0000
commitec6f258137c48d22eb07bcea8f22afd6f99767ba (patch)
tree2e9f0d32b57efc648dfcacb701adcf0bdd64d499 /opcodes
parent73e9c0cb016e0ad9203092c3110c85f32256078f (diff)
downloadgdb-ec6f258137c48d22eb07bcea8f22afd6f99767ba.tar.gz
gas/testsuite/
2007-09-20 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/sib.s: Add more eiz tests. * gas/i386/x86-64-sib.s: Add more riz tests. * gas/i386/sib-intel.d: Updated. * gas/i386/sib.d: Likewise. * gas/i386/x86-64-sib-intel.d: Likewise. * gas/i386/x86-64-sib.d: Likewise. opcodes/ 2007-09-20 H.J. Lu <hongjiu.lu@intel.com> * i386-dis.c (OP_E_extended): Display eiz for [eiz*1 + offset].
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/i386-dis.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 88be05e9a91..584e24c3437 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
2007-09-20 H.J. Lu <hongjiu.lu@intel.com>
+ * i386-dis.c (OP_E_extended): Display eiz for [eiz*1 + offset].
+
+2007-09-20 H.J. Lu <hongjiu.lu@intel.com>
+
PR 658
* 386-dis.c (index64): New.
(index32): Likewise.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 9a45e9100d8..ecb428fd8fc 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -6314,6 +6314,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
int havesib;
int havebase;
int haveindex;
+ int needindex;
int base;
int index = 0;
int scale = 0;
@@ -6368,7 +6369,15 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
break;
}
- havedisp = havebase || (havesib && (haveindex || scale != 0));
+ /* In 32bit mode, we need index register to tell [offset] from
+ [eiz*1 + offset]. */
+ needindex = (havesib
+ && !havebase
+ && !haveindex
+ && address_mode == mode_32bit);
+ havedisp = (havebase
+ || needindex
+ || (havesib && (haveindex || scale != 0)));
if (!intel_syntax)
if (modrm.mod != 0 || (base & 7) == 5)
@@ -6402,6 +6411,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
/* ESP/RSP won't allow index. If base isn't ESP/RSP,
print index to tell base + index from base. */
if (scale != 0
+ || needindex
|| haveindex
|| (havebase && base != ESP_REG_NUM))
{