]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86/Intel: adjustment to restricted suffix derivation
authorJan Beulich <jbeulich@suse.com>
Wed, 30 Nov 2022 08:10:17 +0000 (09:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 30 Nov 2022 08:10:17 +0000 (09:10 +0100)
In "x86/Intel: restrict suffix derivation" I think I screwed up
slightly, bringing a piece of code out of sync with its comment, and
resulting in a suffix potentially being derived when one isn't needed.

gas/config/tc-i386-intel.c

index 152e8e8ce24fc4e85a4a0f32dd31f6ad9247775e..ce4be6ac7dd45d125a5a1ccedbc87269e0a3c0f1 100644 (file)
@@ -841,11 +841,16 @@ i386_intel_operand (char *operand_string, int got_a_float)
                  abort ();
                }
 
+             /* We can skip templates with swappable operands here, as one
+                operand will be a register, which operand size can be
+                determined from.  */
+             if (t->opcode_modifier.d)
+               continue;
+
              /* In a few cases suffixes are permitted, but we can nevertheless
                 derive that these aren't going to be needed.  This is only of
-                interest for insns using ModR/M, plus we can skip templates with
-                swappable operands here (simplifying subsequent logic).  */
-             if (!t->opcode_modifier.modrm || t->opcode_modifier.d)
+                interest for insns using ModR/M.  */
+             if (!t->opcode_modifier.modrm)
                break;
 
              if (!t->operand_types[op].bitfield.baseindex)