2005-05-17 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 17 May 2005 17:26:27 +0000 (17:26 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 17 May 2005 17:26:27 +0000 (17:26 +0000)
* elfxx-ia64.c (elfNN_ia64_relax_brl): Undo the change made on
2005-02-16.

bfd/ChangeLog
bfd/elfxx-ia64.c

index 8fb261fa913698ca15f19001fe83ddfea88f21f0..f3f87f807bd434d23ab0e280ed62dac2000f0d80 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfxx-ia64.c (elfNN_ia64_relax_brl): Undo the change made on
+       2005-02-16.
+
 2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elfxx-ia64.c (elfNN_ia64_relax_br): Keep the original
index 0a906ec5f558db940a6e733ae096469c15acc6ae..bbf629634b63cb1167a17f6a03e00e8d5fbd3734 100644 (file)
@@ -822,39 +822,33 @@ elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
 static void
 elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
 {
-  unsigned int template, t0, t1, t2, t3;
+  int template;
   bfd_byte *hit_addr;
+  bfd_vma t0, t1, i0, i1, i2;
 
   hit_addr = (bfd_byte *) (contents + off);
   hit_addr -= (long) hit_addr & 0x3;
-  t0 = bfd_getl32 (hit_addr + 0);
-  t1 = bfd_getl32 (hit_addr + 4);
-  t2 = bfd_getl32 (hit_addr + 8);
-  t3 = bfd_getl32 (hit_addr + 12);
-
-  /* Turn a MLX bundle into a MBB bundle with the same stop-bit
-     variety.  */
-  template = 0x12;
-  if ((t0 & 0x1f) == 5)
-    template += 1;
+  t0 = bfd_getl64 (hit_addr);
+  t1 = bfd_getl64 (hit_addr + 8);
 
   /* Keep the instruction in slot 0. */
-  t0 &= 0xffffffe0;
-  t1 &= 0x3fff;
-
-  t0 |= template;
-
+  i0 = (t0 >> 5) & 0x1ffffffffffLL;
+  /* Use nop.b for slot 1. */
+  i1 = 0x4000000000LL;
   /* For slot 2, turn brl into br by masking out bit 40.  */
-  t2 &= 0xff800000;
-  t3 &= 0x7fffffff;
+  i2 = (t1 >> 23) & 0x0ffffffffffLL;
 
-  /* Use nop.b for slot 1. */
-  t2 |= 0x100000;
+  /* Turn a MLX bundle into a MBB bundle with the same stop-bit
+     variety.  */
+  if (t0 & 0x1)
+    template = 0x13;
+  else
+    template = 0x12;
+  t0 = (i1 << 46) | (i0 << 5) | template;
+  t1 = (i2 << 23) | (i1 >> 18);
 
-  bfd_putl32 (t0, hit_addr);
-  bfd_putl32 (t1, hit_addr + 4);
-  bfd_putl32 (t2, hit_addr + 8);
-  bfd_putl32 (t3, hit_addr + 12);
+  bfd_putl64 (t0, hit_addr);
+  bfd_putl64 (t1, hit_addr + 8);
 }
 \f
 /* These functions do relaxation for IA-64 ELF.  */
This page took 0.032843 seconds and 4 git commands to generate.