i386 code label alignment patch
Jeffrey A Law
law@cygnus.com
Wed May 6 19:06:00 GMT 1998
In message < 199805041430.KAA22226@jwlab.FEITH.COM >you write:
> Hello,
>
> This change implements the alignment of code labels following
> the recommendations of the "Intel Architecture Optimization Manual".
> This change seem to be worth about 33% speed increase in the simple
> case of:
>
> main()
> {
> int a;
> int i;
>
> a = 0;
> for (i = 0; i < 1000000000; i++)
> a += i;
>
> return a;
> }
I like the idea. However...
I don't think you can use an autoconf test like that -- what happens
for a cross or canadian cross build? It doesn't look like you handle
those cases. Then again, I'm not an autoconf guru, so I could be
missing something simple.
Maybe the way to go is make worst case assumptions in those cases.
Thoughts?
I also don't see why we need new output routines for
ASM_OUTPUT_LABEL_ALIGN_AFTER_BARRIER. Isn't the desired alignment
for each label stored in LABEL_TO_ALIGNMENT? Can you say more about
the motivation behind this aspect of the change
I also worry about the correctness of shorten_branches in the case
where the label is far away from the jump site and thus the alignment
directive has no effect. This may cause problems since shorten_branches
no longer uses trivial algorithms that either only grow or only shrink.
jeff
More information about the Gcc-bugs
mailing list