Tue Jun 9 12:20:05 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
authorIan Lance Taylor <ian@airs.com>
Tue, 9 Jun 1998 16:21:35 +0000 (16:21 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 9 Jun 1998 16:21:35 +0000 (16:21 +0000)
* config/tc-i386.h: Change Data16 to Size16, Data32 to Size32,
IgnoreDataSize to IgnoreSize as they are used for address size as
well as data size.
* config/tc-i386.c: Likewise.  Add code to reject addr32/data32 in
32-bit mode, similarly addr16/data16 and variants.

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

index 29bc25aab83f00e79635ae455526c45235e1e746..4acb72b47f4ca31545ae06ca1c6f8b3468274457 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jun  9 12:20:05 1998  Alan Modra  <alan@spri.levels.unisa.edu.au>
+
+       * config/tc-i386.h: Change Data16 to Size16, Data32 to Size32,
+       IgnoreDataSize to IgnoreSize as they are used for address size as
+       well as data size.
+       * config/tc-i386.c: Likewise.  Add code to reject addr32/data32 in
+       32-bit mode, similarly addr16/data16 and variants.
+
 Mon Jun  8 18:32:01 1998  Nick Clifton  <nickc@cygnus.com>
 
        * config/tc-d30v.c (md_assemble): Fix handling of reverse
index ea2a9847639fed99eb5838de573e891dff83c2f4..8a41231049365a703283b79d522e647fbff70e1d 100644 (file)
@@ -934,8 +934,18 @@ md_assemble (line)
 
        if (*l != END_OF_INSN
            && current_templates
-           && (current_templates->start->opcode_modifier & IsPrefix) != 0)
+           && (current_templates->start->opcode_modifier & IsPrefix))
          {
+           /* If we are in 16-bit mode, do not allow addr16 or data16.
+              Similarly, in 32-bit mode, do not allow addr32 or data32.  */
+           if ((current_templates->start->opcode_modifier & (Size16 | Size32))
+               && (((current_templates->start->opcode_modifier & Size32) != 0)
+                   ^ flag_16bit_code))
+             {
+               as_bad (_("redundant %s prefix"),
+                       current_templates->start->name);
+               return;
+             }
            /* Add prefix, checking for repeated prefixes.  */
            switch (add_prefix (current_templates->start->base_opcode))
              {
@@ -1246,9 +1256,9 @@ md_assemble (line)
 
     /* If matched instruction specifies an explicit opcode suffix, use
        it.  */
-    if (i.tm.opcode_modifier & (Data16|Data32))
+    if (i.tm.opcode_modifier & (Size16 | Size32))
       {
-       if (i.tm.opcode_modifier & Data16)
+       if (i.tm.opcode_modifier & Size16)
          i.suffix = WORD_OPCODE_SUFFIX;
        else
          i.suffix = DWORD_OPCODE_SUFFIX;
@@ -1453,7 +1463,7 @@ md_assemble (line)
           prefix anyway.  */
        if ((i.suffix == DWORD_OPCODE_SUFFIX
             || i.suffix == LONG_OPCODE_SUFFIX) == flag_16bit_code
-           && !(i.tm.opcode_modifier & IgnoreDataSize))
+           && !(i.tm.opcode_modifier & IgnoreSize))
          {
            unsigned int prefix = DATA_PREFIX_OPCODE;
            if (i.tm.opcode_modifier & JumpByte) /* jcxz, loop */
index 11a4d32efbe8b6b8ca99891a260ad85bb1a186af..39f8d14df0f3d7ea34eecc2a268f4596285ebbd4 100644 (file)
@@ -312,9 +312,9 @@ typedef struct
 #define FloatD          0x400  /* direction for float insns:  MUST BE 0x400 */
 #define Seg2ShortForm   0x800  /* encoding of load segment reg insns */
 #define Seg3ShortForm  0x1000  /* fs/gs segment register insns. */
-#define Data16         0x2000  /* needs data prefix if in 32-bit mode */
-#define Data32         0x4000  /* needs data prefix if in 16-bit mode */
-#define IgnoreDataSize 0x8000  /* instruction ignores operand size prefix */
+#define Size16         0x2000  /* needs size prefix if in 32-bit mode */
+#define Size32         0x4000  /* needs size prefix if in 16-bit mode */
+#define IgnoreSize     0x8000  /* instruction ignores operand size prefix */
 #define No_bSuf               0x10000  /* b suffix on instruction illegal */
 #define No_wSuf               0x20000  /* w suffix on instruction illegal */
 #define No_lSuf               0x40000  /* l suffix on instruction illegal */
This page took 0.038554 seconds and 4 git commands to generate.