PATCH: i386 disassembler: Check PREFIX_REPNZ before PREFIX_DATA for prefix table

H. J. Lu hjl@lucon.org
Fri Nov 10 02:25:00 GMT 2006


When prefix user table is used, we check PREFIX_REPZ, PREFIX_DATA
and PREFIX_REPNZ, in that order. This patch changes it to
PREFIX_REPZ, PREFIX_REPNZ and PREFIX_DATA. There is no regression.


H.J.
---
2006-11-09  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis.c (print_insn): Check PREFIX_REPNZ before
	PREFIX_DATA when prefix user table is used.

--- opcodes/i386-dis.c.prefix	2006-11-09 18:13:40.000000000 -0800
+++ opcodes/i386-dis.c	2006-11-09 18:21:09.000000000 -0800
@@ -3139,14 +3139,16 @@ print_insn (bfd_vma pc, disassemble_info
 		index = 1;
 	      else
 		{
-		  used_prefixes |= (prefixes & PREFIX_DATA);
-		  if (prefixes & PREFIX_DATA)
-		    index = 2;
+		  /* We should check PREFIX_REPNZ and PREFIX_REPZ
+		     before PREFIX_DATA.  */
+		  used_prefixes |= (prefixes & PREFIX_REPNZ);
+		  if (prefixes & PREFIX_REPNZ)
+		    index = 3;
 		  else
 		    {
-		      used_prefixes |= (prefixes & PREFIX_REPNZ);
-		      if (prefixes & PREFIX_REPNZ)
-			index = 3;
+		      used_prefixes |= (prefixes & PREFIX_DATA);
+		      if (prefixes & PREFIX_DATA)
+			index = 2;
 		    }
 		}
 	      dp = &prefix_user_table[dp->bytemode2][index];



More information about the Binutils mailing list