Use address size prefix for loopw as for jcxz.
authorIan Lance Taylor <ian@airs.com>
Tue, 26 Aug 1997 16:33:34 +0000 (16:33 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 26 Aug 1997 16:33:34 +0000 (16:33 +0000)
gas/ChangeLog
gas/config/tc-i386.c

index 7c0c9de..6f62dc0 100644 (file)
@@ -2,7 +2,7 @@ Tue Aug 26 12:23:25 1997  Ian Lance Taylor  <ian@cygnus.com>
 
        * config/tc-i386.c (md_assemble): In JumpByte case, when looking
        for a WORD_PREFIX_OPCODE, change it to ADDR_PREFIX_OPCODE if this
-       is jcxz.
+       is jcxz or a loop instruction.
 
 start-sanitize-v850
 Mon Aug 25 16:04:14 1997  Nick Clifton  <nickc@cygnus.com>
index 20a4f4e..3bd5398 100644 (file)
@@ -1737,11 +1737,17 @@ md_assemble (line)
                   ADDR_PREFIX_OPCODE.  This is a hack, but, then, so
                   is the instruction itself.
 
+                  If an explicit suffix is used for the loop
+                  instruction, that actually controls whether we use
+                  cx vs. ecx.  This is also controlled by
+                  ADDR_PREFIX_OPCODE.
+
                   I don't know if there is any valid case in which we
                   want to emit WORD_PREFIX_OPCODE, but I am keeping
                   the old behaviour for safety.  */
 
-               if (IS_JUMP_ON_CX_ZERO (t->base_opcode))
+               if (IS_JUMP_ON_CX_ZERO (t->base_opcode)
+                   || IS_LOOP_ECX_TIMES (t->base_opcode))
                  FRAG_APPEND_1_CHAR (ADDR_PREFIX_OPCODE);
                else
                  FRAG_APPEND_1_CHAR (WORD_PREFIX_OPCODE);