This is the mail archive of the binutils@sourceware.cygnus.com 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]

64-bit clean-up in mn10300 disassembler


Ok to install?

Index: opcodes/ChangeLog
from  Alexandre Oliva  <aoliva@cygnus.com>

	* m10300-dis.c (disassemble): Don't assume 32-bit longs when
	sign-extending operands.

Index: opcodes/m10300-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/m10300-dis.c,v
retrieving revision 1.4
diff -u -r1.4 m10300-dis.c
--- opcodes/m10300-dis.c	2000/04/20 22:15:32	1.4
+++ opcodes/m10300-dis.c	2000/05/24 13:20:42
@@ -508,11 +508,10 @@
 		}
 
 	      if ((operand->flags & MN10300_OPERAND_SIGNED) != 0
-		   /* These are properly extended by the code above.  */
-		   && ((operand->flags & MN10300_OPERAND_24BIT) == 0)
-		  )
-		value = ((long)(value << (32 - operand->bits))
-			  >> (32 - operand->bits));
+		  /* These are properly extended by the code above.  */
+		  && ((operand->flags & MN10300_OPERAND_24BIT) == 0)
+		  && (value & (1 << (operand->bits - 1))))
+		value |= (((unsigned long)0) - 1) << (operand->bits - 1);
 
 	      if (!nocomma
 		  && (!paren

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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