aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c8
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/i386/general.l15
-rw-r--r--gas/testsuite/gas/i386/general.s8
5 files changed, 37 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 12d2d4f..052d746 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+1999-08-20 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * config/tc-i386.c (i386_index_check): Fix the displacement size
+ when INFER_ADDR_PREFIX.
+
1999-08-18 Nick Clifton <nickc@cygnus.com>
* config/tc-arm.c (md_apply_fix3): If an offset is invalid,
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 22b5d5d..a2c0bcc 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3115,6 +3115,14 @@ i386_index_check (operand_string)
{
i.prefix[ADDR_PREFIX] = ADDR_PREFIX_OPCODE;
i.prefixes += 1;
+ /* Change the size of any displacement too. At most one of
+ Disp16 or Disp32 is set.
+ FIXME. There doesn't seem to be any real need for separate
+ Disp16 and Disp32 flags. The same goes for Imm16 and Imm32.
+ Removing them would probably clean up the code quite a lot.
+ */
+ if (i.types[this_operand] & (Disp16|Disp32))
+ i.types[this_operand] ^= (Disp16|Disp32);
fudged = 1;
goto tryprefix;
}
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 84663de..aa5b761 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+1999-08-20 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * gas/i386/general.s, gas/i386/general.l: Add .code16gcc
+ displacement checks with auto address prefix.
+
1999-08-17 H.J. Lu <hjl@gnu.org>
* gas/elf/elf.exp: Expected to fail on alpha*-*-*.
diff --git a/gas/testsuite/gas/i386/general.l b/gas/testsuite/gas/i386/general.l
index 68f6600..e07e766 100644
--- a/gas/testsuite/gas/i386/general.l
+++ b/gas/testsuite/gas/i386/general.l
@@ -200,7 +200,14 @@
147 0137 89341D00 000000 mov %esi,\(,%ebx,1\)
148 013e 80250000 00007F andb \$~0x80,foo
149
- 150 # Force a good alignment.
- 151 0145 00000000 00000000[ ]*.p2align 4,0
- 151 000000
-
+ 150 #check 16-bit code auto address prefix
+ 151 .code16gcc
+ 152 0145 67668D95 00FFFFFF leal -256\(%ebp\),%edx
+ 153 014d 6788857F FFFFFF mov %al,-129\(%ebp\)
+ 154 0154 67886580 mov %ah,-128\(%ebp\)
+ 155 0158 67668D9D 20F9FFFF leal -1760\(%ebp\),%ebx
+ 156 0160 67668984 248C0000 movl %eax,140\(%esp\)
+ 156 00
+ 157
+ 158 # Force a good alignment.
+ 159 0169 00000000 000000[ ]*.p2align 4,0
diff --git a/gas/testsuite/gas/i386/general.s b/gas/testsuite/gas/i386/general.s
index cbe0373..b96b68d 100644
--- a/gas/testsuite/gas/i386/general.s
+++ b/gas/testsuite/gas/i386/general.s
@@ -147,5 +147,13 @@
mov %esi,(,%ebx,1)
andb $~0x80,foo
+#check 16-bit code auto address prefix
+.code16gcc
+ leal -256(%ebp),%edx
+ mov %al,-129(%ebp)
+ mov %ah,-128(%ebp)
+ leal -1760(%ebp),%ebx
+ movl %eax,140(%esp)
+
# Force a good alignment.
.p2align 4,0