IA-64 patch to avoid nop.f on Itanium2

James E Wilson wilson@specifixinc.com
Sat Apr 2 00:47:00 GMT 2005
David Mosberger sent me this in private mail.  I have tested it and
checked it in.

This just converts the default MFI nop bundles into MMI bundles for
anything other than Itanium1.  nop.f is undesirable on Itanium2 because
it can cause pipeline stalls.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

-------------- next part --------------
2005-04-01 David Mosberger  <davidm@hpl.hp.com>

        * config/tc-ia64.c (ia64_handle_align): Move le_nop and
        le_nop_stop arrays and initializers to file scope.
        (md_begin): When generating code for anything other than
        Itanium 1, use MMI instead of MFI NOP bundles as a filler.

Index: tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.150
diff -p -p -r1.150 tc-ia64.c
*** tc-ia64.c	28 Mar 2005 22:34:16 -0000	1.150
--- tc-ia64.c	2 Apr 2005 00:37:06 -0000
*************** static struct
*** 328,333 ****
--- 328,348 ----
    }
  md;
  
+ /* These are not const, because they are modified to MMI for non-itanium1
+    targets below.  */
+ /* MFI bundle of nops.  */
+ static unsigned char le_nop[16] =
+ {
+   0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00
+ };
+ /* MFI bundle of nops with stop-bit.  */
+ static unsigned char le_nop_stop[16] =
+ {
+   0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+   0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00
+ };
+ 
  /* application registers:  */
  
  #define AR_K0		0
*************** md_begin ()
*** 7259,7264 ****
--- 7274,7286 ----
      symbol_new (".<iplt>", undefined_section, FUNC_IPLT_RELOC,
  		&zero_address_frag);
  
+  if (md.tune != itanium1)
+    {
+      /* Convert MFI NOPs bundles into MMI NOPs bundles.  */
+      le_nop[0] = 0x8;
+      le_nop_stop[0] = 0x9;
+    }
+ 
    /* Compute the table of best templates.  We compute goodness as a
       base 4 value, in which each match counts for 3.  Match-failures
       result in NOPs and we use extra_goodness() to pick the execution
*************** void
*** 11516,11529 ****
  ia64_handle_align (fragp)
       fragS *fragp;
  {
-   /* Use mfi bundle of nops with no stop bits.  */
-   static const unsigned char le_nop[]
-     = { 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 	0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00};
-   static const unsigned char le_nop_stop[]
-     = { 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 	0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00};
- 
    int bytes;
    char *p;
    const unsigned char *nop;
--- 11538,11543 ----


More information about the Binutils mailing list