This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

[PATCH] Fix 64-bit unclean ppc-opc.c


Hi!

This causes things like:
rlwinm 28,28,28,0xf0000000
not to be assembled with 64-bit gas binary. Got lost during ISO C90
conversion.
Ok to commit?

2003-07-28  Jakub Jelinek  <jakub@redhat.com>

	* ppc-opc.c (insert_mbe, extract_mbe): Shift 1L instead of 1 up.

--- opcodes/ppc-opc.c	7 Jul 2003 01:34:04 -0000	1.53
+++ opcodes/ppc-opc.c	28 Jul 2003 21:53:58 -0000
@@ -1103,7 +1103,7 @@ insert_mbe (unsigned long insn,
   /* me: location of last 1->0 transition */
   /* count: # transitions */
 
-  for (mx = 0, mask = 1 << 31; mx < 32; ++mx, mask >>= 1)
+  for (mx = 0, mask = 1L << 31; mx < 32; ++mx, mask >>= 1)
     {
       if ((uval & mask) && !last)
 	{
@@ -1144,7 +1144,7 @@ extract_mbe (unsigned long insn,
     {
       ret = 0;
       for (i = mb; i <= me; i++)
-	ret |= 1 << (31 - i);
+	ret |= 1L << (31 - i);
     }
   else if (mb == me + 1)
     ret = ~0;
@@ -1152,7 +1152,7 @@ extract_mbe (unsigned long insn,
     {
       ret = ~0;
       for (i = me + 1; i < mb; i++)
-	ret &= ~(1 << (31 - i));
+	ret &= ~(1L << (31 - i));
     }
   return ret;
 }

	Jakub


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