Tue Jul 7 13:00:37 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
authorIan Lance Taylor <ian@airs.com>
Tue, 7 Jul 1998 17:20:59 +0000 (17:20 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 7 Jul 1998 17:20:59 +0000 (17:20 +0000)
* config/tc-i386.c (i386_operand): Don't set the size of an
  immediate address based solely on the suffix and the mode.

* config/tc-i386.c (md_assemble): Add assertion to make sure
overlap2 does not set Imm.

gas/ChangeLog
gas/config/tc-i386.c

index 4ebe6d3362621c24e3095c09ba9063a1caaec8ac..e73d120e3293cf27148d08da7c49540281c9e4c8 100644 (file)
@@ -1,5 +1,11 @@
 Tue Jul  7 13:00:37 1998  Alan Modra  <alan@spri.levels.unisa.edu.au>
 
+       * config/tc-i386.c (i386_operand): Don't set the size of an
+       immediate address based solely on the suffix and the mode.
+
+       * config/tc-i386.c (md_assemble): Add assertion to make sure
+       overlap2 does not set Imm.
+
        * config/tc-i386.c (space_chars): Remove. The scrubber converts
        sequences of whitespace to a single space.
        (is_space_chars): Just compare with space.
index fd93b4c954f5c89446cb3cb4373aaa113a3079a2..9077ba1d467df6d9de5eff8f71598b652998f63b 100644 (file)
@@ -1387,8 +1387,7 @@ md_assemble (line)
       }
 
     /* Make still unresolved immediate matches conform to size of immediate
-       given in i.suffix.  Note: overlap2 cannot be an immediate!
-       We assume this. */
+       given in i.suffix.  Note: overlap2 cannot be an immediate!  */
     if ((overlap0 & (Imm8 | Imm8S | Imm16 | Imm32))
        && overlap0 != Imm8 && overlap0 != Imm8S
        && overlap0 != Imm16 && overlap0 != Imm32)
@@ -1429,6 +1428,7 @@ md_assemble (line)
            return;
          }
       }
+    assert ((overlap2 & Imm) == 0);
 
     i.types[0] = overlap0;
     if (overlap0 & ImplicitRegister)
@@ -2374,23 +2374,12 @@ i386_operand (operand_string)
 #endif
       else
        {
-         /* This is an address.  */
-         i.types[this_operand] |=
-           (flag_16bit_code ^ (i.prefix[DATA_PREFIX] != 0)) ? Imm16 : Imm32;
-       }
-      /* shorten this type of this operand if the instruction wants
-       * fewer bits than are present in the immediate.  The bit field
-       * code can put out 'andb $0xffffff, %al', for example.   pace
-       * also 'movw $foo,(%eax)'
-       */
-      switch (i.suffix)
-       {
-       case WORD_OPCODE_SUFFIX:
-         i.types[this_operand] |= Imm16;
-         break;
-       case BYTE_OPCODE_SUFFIX:
-         i.types[this_operand] |= Imm16 | Imm8 | Imm8S;
-         break;
+         /* This is an address.  The size of the address will be
+            determined later, depending on destination register,
+            suffix, or the default for the section.  We exclude
+            Imm8S here so that `push $foo' and other instructions
+            with an Imm8S form will use Imm16 or Imm32.  */
+         i.types[this_operand] |= (Imm8 | Imm16 | Imm32);
        }
     }
   else if (is_digit_char (*op_string) || is_identifier_char (*op_string)
This page took 0.041497 seconds and 4 git commands to generate.