[06/12] x86: fold duplicate code in MOVSXD_Fixup()

Message ID c81fdcaa-907e-d6e1-04dd-aa95b1437b2e@suse.com
State New
Headers show
Series
  • x86: disassembler fixes and some consolidation
Related show

Commit Message

Luis Machado via Binutils July 21, 2021, 10:20 a.m.
There's no need to have two paths printing the "xd" mnemonic suffix.

Patch

--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -13601,31 +13601,25 @@  MOVSXD_Fixup (int bytemode, int sizeflag
   switch (bytemode)
     {
     case movsxd_mode:
-      if (intel_syntax)
+      if (!intel_syntax)
 	{
-	  *p++ = 'x';
-	  *p++ = 'd';
-	  goto skip;
+	  USED_REX (REX_W);
+	  if (rex & REX_W)
+	    {
+	      *p++ = 'l';
+	      *p++ = 'q';
+	      break;
+	    }
 	}
 
-      USED_REX (REX_W);
-      if (rex & REX_W)
-	{
-	  *p++ = 'l';
-	  *p++ = 'q';
-	}
-      else
-	{
-	  *p++ = 'x';
-	  *p++ = 'd';
-	}
+      *p++ = 'x';
+      *p++ = 'd';
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
       break;
     }
 
- skip:
   mnemonicendp = p;
   *p = '\0';
   OP_E (bytemode, sizeflag);