*gas/config/tc-i386.c: Fix errors in displacement size when
authorAlan Modra <amodra@gmail.com>
Fri, 20 Aug 1999 11:59:19 +0000 (11:59 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 20 Aug 1999 11:59:19 +0000 (11:59 +0000)
automatically inferring an address prefex.

gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/general.l
gas/testsuite/gas/i386/general.s

index 12d2d4f..052d746 100644 (file)
@@ -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,
index 22b5d5d..a2c0bcc 100644 (file)
@@ -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;
        }
index 84663de..aa5b761 100644 (file)
@@ -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*-*-*.
index 68f6600..e07e766 100644 (file)
  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
index cbe0373..b96b68d 100644 (file)
        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