x86: simplify legacy prefix emission
authorJan Beulich <jbeulich@novell.com>
Wed, 11 Jul 2018 08:28:16 +0000 (10:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Jul 2018 08:28:16 +0000 (10:28 +0200)
The check_prefix label was bogus from the beginning: The special
checking is supposed to happen for PadLock insns only; no
3-opcode-byte insn should go this path.

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

index ddb62358d356f9cc2416c5e1a44bd3c01d7e51ad..e6a6d096369f651a2639b91b0f5d96a3876b9d9b 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-11  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386.c (output_insn): Remove check_prefix label and
+       fold remaining expression.
+
 2018-07-11  Jan Beulich  <jbeulich@suse.com>
 
        * testsuite/gas/i386/cet.s, testsuite/gas/i386/x86-64-cet.s:
index a7b84000e05ab1971cee28fc468b340f777a036b..61c1518c2b512c240e8e4c1dea2362eb6caa74a5 100644 (file)
@@ -7676,22 +7676,16 @@ output_insn (void)
              if (i.tm.base_opcode & 0xff000000)
                {
                  prefix = (i.tm.base_opcode >> 24) & 0xff;
-                 goto check_prefix;
+                 add_prefix (prefix);
                }
              break;
            case 2:
              if ((i.tm.base_opcode & 0xff0000) != 0)
                {
                  prefix = (i.tm.base_opcode >> 16) & 0xff;
-                 if (i.tm.cpu_flags.bitfield.cpupadlock)
-                   {
-check_prefix:
-                     if (prefix != REPE_PREFIX_OPCODE
-                         || (i.prefix[REP_PREFIX]
-                             != REPE_PREFIX_OPCODE))
-                       add_prefix (prefix);
-                   }
-                 else
+                 if (!i.tm.cpu_flags.bitfield.cpupadlock
+                     || prefix != REPE_PREFIX_OPCODE
+                     || (i.prefix[REP_PREFIX] != REPE_PREFIX_OPCODE))
                    add_prefix (prefix);
                }
              break;