Handle prefixes before fwait
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 1 May 2014 16:39:51 +0000 (09:39 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 1 May 2014 16:45:06 +0000 (09:45 -0700)
0x9b (fwait) is both an instruction and an opcode prefix.  When 0x9b is
treated as an instruction, we need to handle any prefixes before it.
This patch handles it properly.

gas/testsuite/

PR binutils/16891
* gas/i386/opcode.s: Add test for fwait with prefix.
* gas/i386/opcode-intel.d: Updated.
* gas/i386/opcode-suffix.d: Likewise.
* gas/i386/opcode.d: Likewise.

opcodes/

PR binutils/16891
* i386-dis.c (print_insn): Handle prefixes before fwait.

gas/testsuite/ChangeLog
gas/testsuite/gas/i386/opcode-intel.d
gas/testsuite/gas/i386/opcode-suffix.d
gas/testsuite/gas/i386/opcode.d
gas/testsuite/gas/i386/opcode.s
opcodes/ChangeLog
opcodes/i386-dis.c

index fac6a8b09a1d0474701d01e697f348fd3ad220ec..d59d640e1149c33604d8a29c0b8ad9bec8620fd2 100644 (file)
@@ -1,3 +1,11 @@
+2014-05-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/16891
+       * gas/i386/opcode.s: Add test for fwait with prefix.
+       * gas/i386/opcode-intel.d: Updated.
+       * gas/i386/opcode-suffix.d: Likewise.
+       * gas/i386/opcode.d: Likewise.
+
 2014-04-23  Will Newton  <will.newton@linaro.org>
 
        * gas/arm/backslash-at.d: Fix dump output regexps for
index 23b7afad6df85de17eeed0bc371ff73af6675c18..a1ebe4554331a2ad876860f87431f8ca09217f89 100644 (file)
@@ -592,4 +592,6 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    0f 4b 90 90 90 90 90    cmovnp edx,DWORD PTR \[eax-0x6f6f6f70\]
 [      ]*[a-f0-9]+:    66 0f 4a 90 90 90 90 90         cmovp  dx,WORD PTR \[eax-0x6f6f6f70\]
 [      ]*[a-f0-9]+:    66 0f 4b 90 90 90 90 90         cmovnp dx,WORD PTR \[eax-0x6f6f6f70\]
+[      ]*[a-f0-9]+:    26 9b [         ]*es fwait
+[      ]*[a-f0-9]+:    9b [    ]*fwait
 #pass
index 74e0adbbb194e6d8a22b3257dc4f8179335fa701..21ad22bcb94489a65825540d2a585104455a331a 100644 (file)
@@ -592,4 +592,6 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    0f 4b 90 90 90 90 90    cmovnpl -0x6f6f6f70\(%eax\),%edx
 [      ]*[a-f0-9]+:    66 0f 4a 90 90 90 90 90         cmovpw -0x6f6f6f70\(%eax\),%dx
 [      ]*[a-f0-9]+:    66 0f 4b 90 90 90 90 90         cmovnpw -0x6f6f6f70\(%eax\),%dx
+[      ]*[a-f0-9]+:    26 9b [         ]*es fwait
+[      ]*[a-f0-9]+:    9b [    ]*fwait
 #pass
index 1a94fc81f14d3e5887b8043bb2191f86eeca834a..371e40ac09120d6c7b78904f8b258304f9b55887 100644 (file)
@@ -591,4 +591,6 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    0f 4b 90 90 90 90 90    cmovnp -0x6f6f6f70\(%eax\),%edx
 [      ]*[a-f0-9]+:    66 0f 4a 90 90 90 90 90         cmovp  -0x6f6f6f70\(%eax\),%dx
 [      ]*[a-f0-9]+:    66 0f 4b 90 90 90 90 90         cmovnp -0x6f6f6f70\(%eax\),%dx
+[      ]*[a-f0-9]+:    26 9b [         ]*es fwait
+[      ]*[a-f0-9]+:    9b [    ]*fwait
 #pass
index a07e42372df38652e5a192c18531fab7853a050e..72333a557b537d4414a14e59b1574d3d3f38ef10 100644 (file)
@@ -589,3 +589,6 @@ foo:
  cmovpo 0x90909090(%eax),%edx
  cmovpe  0x90909090(%eax),%dx
  cmovpo 0x90909090(%eax),%dx
+
+ es fwait
+ fwait
index 05ad78a4ccca94c4717bc7668f77f95aa54944d4..747aa238b64eb50cd709e8a84fa23ab1574b9922 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/16891
+       * i386-dis.c (print_insn): Handle prefixes before fwait.
+
 2014-04-26  Alan Modra  <amodra@gmail.com>
 
        * po/POTFILES.in: Regenerate.
index 0e076060e0ed643696f5557b16ef0d8f7b5e94fe..c36c63231984e0bec0aeecdba272890618cfad72 100644 (file)
@@ -12548,8 +12548,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
   if (((prefixes & PREFIX_FWAIT)
        && ((*codep < 0xd8) || (*codep > 0xdf))))
     {
+      /* Handle prefixes before fwait.  */
+      for (i = 0;
+          i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
+          i++)
+       (*info->fprintf_func) (info->stream, "%s ",
+                              prefix_name (all_prefixes[i], sizeflag));
       (*info->fprintf_func) (info->stream, "fwait");
-      return 1;
+      return i + 1;
     }
 
   if (*codep == 0x0f)
This page took 0.028969 seconds and 4 git commands to generate.