]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: don't open-code PREFIX_NONE
authorJan Beulich <jbeulich@suse.com>
Tue, 23 Mar 2021 07:44:35 +0000 (08:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 23 Mar 2021 07:44:35 +0000 (08:44 +0100)
Use the constant rather than literal zero. While at it fold two
conditionals (using the same base opcode and prefix) in load_insn_p().

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

index e8a501a4b963de21b577d85edd9599ec1955616a..2ba5111f3b850f26a0c56162bfc47296b55c7637 100644 (file)
@@ -1,3 +1,9 @@
+2021-03-23  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386.c (load_insn_p): Use PREFIX_NONE. Fold two
+       if()-s.
+       (match_template, output_insn): Use PREFIX_NONE.
+
 2021-03-23  Jan Beulich  <jbeulich@suse.com>
 
        * config/tc-i386.c (i386_index_check): New local variable t.
index ee4d2bc1c8eadc7c855ecc933e72f1c3844a340c..b1c7b5046290c1285683c24c608f85766dfa5565 100644 (file)
@@ -4446,10 +4446,11 @@ load_insn_p (void)
          && i.tm.extension_opcode != 6)
        return 1;
 
-      /* cmpxchg8b, cmpxchg16b, xrstors.  */
+      /* cmpxchg8b, cmpxchg16b, xrstors, vmptrld.  */
       if (i.tm.base_opcode == 0xfc7
-         && i.tm.opcode_modifier.opcodeprefix == 0
-         && (i.tm.extension_opcode == 1 || i.tm.extension_opcode == 3))
+         && i.tm.opcode_modifier.opcodeprefix == PREFIX_NONE
+         && (i.tm.extension_opcode == 1 || i.tm.extension_opcode == 3
+             || i.tm.extension_opcode == 6))
        return 1;
 
       /* fxrstor, ldmxcsr, xrstor.  */
@@ -4466,12 +4467,6 @@ load_insn_p (void)
              || i.tm.extension_opcode == 6))
        return 1;
 
-      /* vmptrld */
-      if (i.tm.base_opcode == 0xfc7
-         && i.tm.opcode_modifier.opcodeprefix == 0
-         && i.tm.extension_opcode == 6)
-       return 1;
-
       /* Check for x87 instructions.  */
       if (i.tm.base_opcode >= 0xd8 && i.tm.base_opcode <= 0xdf)
        {
@@ -6337,7 +6332,7 @@ match_template (char mnem_suffix)
       if (((i.suffix == QWORD_MNEM_SUFFIX
            && flag_code != CODE_64BIT
            && !(t->base_opcode == 0xfc7
-                && i.tm.opcode_modifier.opcodeprefix == 0
+                && i.tm.opcode_modifier.opcodeprefix == PREFIX_NONE
                 && t->extension_opcode == 1) /* cmpxchg8b */)
           || (i.suffix == LONG_MNEM_SUFFIX
               && !cpu_arch_flags.bitfield.cpui386))
@@ -9259,7 +9254,7 @@ output_insn (void)
          || i.tm.cpu_flags.bitfield.cpucmov
          || i.tm.cpu_flags.bitfield.cpusyscall
          || (i.tm.base_opcode == 0xfc7
-             && i.tm.opcode_modifier.opcodeprefix == 0
+             && i.tm.opcode_modifier.opcodeprefix == PREFIX_NONE
              && i.tm.extension_opcode == 1) /* cmpxchg8b */)
        x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_BASELINE;
       if (i.tm.cpu_flags.bitfield.cpusse3