This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] m68k-dis: don't match FPU insns with non-default CPID


Nominally the fpu insns on the m68k can have a coprocessor id different
from 1.  But the the IDs 0 and 2 are used for encoding the MMU insns and
other new insns on the 68040/68060.  Their encoding overlaps with some of
the FPU insn encodings with the non-default CPID, causing them to be
misdecoded as FPU insn.  AFAIK the only defined ID for FPU coprocessors is
ID 1 for the 68881/2, so it doesn't make sense to try to support any other
ID.

Andreas.

2005-11-01  Andreas Schwab  <schwab@suse.de>

	* m68k-dis.c (print_insn_m68k): Only match FPU insns with
	coprocessor ID 1.

Index: opcodes/m68k-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/m68k-dis.c,v
retrieving revision 1.19
diff -u -a -p -u -p -a -r1.19 opcodes/m68k-dis.c
--- opcodes/m68k-dis.c	1 Jul 2005 11:16:32 -0000	1.19
+++ opcodes/m68k-dis.c	1 Nov 2005 13:46:07 -0000
@@ -1499,6 +1499,20 @@ print_insn_m68k (bfd_vma memaddr, disass
 		}
 	    }
 
+	  /* Don't match FPU insns with non-default coprocessor ID.  */
+	  if (*d == '\0')
+	    {
+	      for (d = opc->args; *d; d += 2)
+		{
+		  if (d[0] == 'I')
+		    {
+		      val = fetch_arg (buffer, 'd', 3, info);
+		      if (val != 1)
+			break;
+		    }
+		}
+	    }
+
 	  if (*d == '\0')
 	    if ((val = match_insn_m68k (memaddr, info, opc, & priv)))
 	      return val;

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]