[PATCH] ia64: fix regression from fix for PR/803
James E Wilson
wilson@specifixinc.com
Wed May 25 22:26:00 GMT 2005
On Wed, 2005-05-25 at 00:34, Jan Beulich wrote:
> The question thus only is whether preferring M-nops over I-nops is
> going to do any good meanwhile. H.J., do you have a particular
> preference here?
The original request came from David Mosberger, whose only interest was
discouraging use of B and F nops to avoid stalls associated with them.
Since gcc is choosing templates itself when optimizing, this presumably
only affects hand written assembly code, and hence there might not be
enough benefit here to worry about.
> is correct. We *do* care for them when at the end, we don't care for
> them only when followed by valid instructions. I had added similar code
> temporarily; I didn't offer it with the patch because there seems to be
> a policy of having no #if-0-framed code (there was some cleanup done
> recently to that respect; I personally don't agree to such a policy, in
> various occasions such code may prove useful).
Yes, you are right. I was trying to get rid of all of the ones that
started with invalid instructions, because they get printed first, but I
went too far.
I can avoid the possible #if 0 issue by using something like #ifdef
DEBUG_TEMPLATE instead.
Here is a revised patch.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
-------------- next part --------------
2005-05-25 James E Wilson <wilson@specifixinc.com>
* config/tc-ia64.c (extra_goodness): Update comment.
(md_begin): Add debugging code to print best_template table.
Index: tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.165
diff -p -p -r1.165 tc-ia64.c
*** tc-ia64.c 25 May 2005 07:17:08 -0000 1.165
--- tc-ia64.c 25 May 2005 20:13:51 -0000
*************** match (int templ, int type, int slot)
*** 7141,7148 ****
return result;
}
! /* Add a bit of extra goodness if a nop of type F or B would fit
! in TEMPL at SLOT. */
static inline int
extra_goodness (int templ, int slot)
--- 7141,7149 ----
return result;
}
! /* For Itanium 1, add a bit of extra goodness if a nop of type F or B would fit
! in TEMPL at SLOT. For Itanium 2, add a bit of extra goodness if a nop of
! type M or I would fit in TEMPL at SLOT. */
static inline int
extra_goodness (int templ, int slot)
*************** md_begin ()
*** 7320,7325 ****
--- 7321,7341 ----
}
}
+ #ifdef DEBUG_TEMPLATES
+ /* For debugging changes to the best_template calculations. We don't care
+ about combinations with invalid instructions, so start the loops at 1. */
+ for (i = 0; i < IA64_NUM_TYPES; ++i)
+ for (j = 0; j < IA64_NUM_TYPES; ++j)
+ for (k = 0; k < IA64_NUM_TYPES; ++k)
+ {
+ char type_letter[IA64_NUM_TYPES] = { 'n', 'a', 'i', 'm', 'b', 'f',
+ 'x', 'd' };
+ fprintf (stderr, "%c%c%c %s\n", type_letter[i], type_letter[j],
+ type_letter[k],
+ ia64_templ_desc[best_template[i][j][k]].name);
+ }
+ #endif
+
for (i = 0; i < NUM_SLOTS; ++i)
md.slot[i].user_template = -1;
More information about the Binutils
mailing list