]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86/APX: drop %SW disassembler macro again
authorJan Beulich <jbeulich@suse.com>
Fri, 30 Aug 2024 09:23:51 +0000 (11:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 30 Aug 2024 09:23:51 +0000 (11:23 +0200)
Not the least due to its extremely rare use I didn't really like that
macro's introduction. Adjust swap_operand() accordingly instead.

opcodes/i386-dis-evex.h
opcodes/i386-dis.c

index 434133e7621e401715a3c57be529cbc317101787..559f0fbebde7a5f06de539c73da67f6278825310 100644 (file)
@@ -938,10 +938,10 @@ static const struct dis386 evex_table[][256] = {
     { Bad_Opcode },
     { Bad_Opcode },
     /* 38 */
-    { "%NEccmp%SCB%DF",                { Eb, Gb }, 0 },
-    { "%NEccmp%SCS%DF",                { Ev, Gv }, PREFIX_NP_OR_DATA },
-    { "%NEccmp%SCB%SW%DF",     { Gb, Eb }, 0 },
-    { "%NEccmp%SCS%SW%DF",     { Gv, Ev }, PREFIX_NP_OR_DATA },
+    { "%NEccmp%SCB%DF",        { Eb, Gb }, 0 },
+    { "%NEccmp%SCS%DF",        { Ev, Gv }, PREFIX_NP_OR_DATA },
+    { "%NEccmp%SCB%DF",        { Gb, EbS }, 0 },
+    { "%NEccmp%SCS%DF",        { Gv, EvS }, PREFIX_NP_OR_DATA },
     { Bad_Opcode },
     { Bad_Opcode },
     { Bad_Opcode },
index 59ec771369ab68de93f4cc622b6488824037f7c1..05b72a42207c4ace99c0f3f90ddcf1c8bd5d62c7 100644 (file)
@@ -1809,8 +1809,6 @@ struct dis386 {
           in MAP4.
    "ZU" => print 'zu' if EVEX.ZU=1.
    "SC" => print suffix SCC for SCC insns
-   "SW" => print '.s' to indicate operands were swapped when suffix_always is
-          true.
    "YK" keep unused, to avoid ambiguity with the combined use of Y and K.
    "YX" keep unused, to avoid ambiguity with the combined use of Y and X.
    "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
@@ -10251,9 +10249,21 @@ static const char *const scc_suffix[16] = {
 static void
 swap_operand (instr_info *ins)
 {
-  ins->mnemonicendp[0] = '.';
-  ins->mnemonicendp[1] = 's';
-  ins->mnemonicendp[2] = '\0';
+  char *p = ins->mnemonicendp;
+
+  if (p[-1] == '}')
+    {
+      while (*--p != '{')
+       {
+         if (p <= ins->obuf + 2)
+           abort ();
+       }
+      if (p[-1] == ' ')
+       --p;
+    }
+  memmove (p + 2, p, ins->mnemonicendp - p + 1);
+  p[0] = '.';
+  p[1] = 's';
   ins->mnemonicendp += 2;
 }
 
@@ -10929,14 +10939,6 @@ putop (instr_info *ins, const char *in_template, int sizeflag)
                *ins->obufp++ = ins->vex.w ? 'd': 's';
              else if (last[0] == 'B')
                *ins->obufp++ = ins->vex.w ? 'w': 'b';
-             else if (last[0] == 'S')
-               {
-                 if (ins->modrm.mod == 3 && (sizeflag & SUFFIX_ALWAYS))
-                   {
-                     *ins->obufp++ = '.';
-                     *ins->obufp++ = 's';
-                   }
-               }
              else
                abort ();
            }