This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

mips branch alignment patch



 > Wed Aug 11 20:52:26 1999  Geoffrey Keating  <geoffk@cygnus.com>
 > 
 > 	* config/mips/mips.h (LABEL_ALIGN): Align branches on
 > 	64-bit boundary on 64-bit MIPS.
 > 
 > 	* config/mips/mips.c (print_operand): New substitution, %~,
 > 	which aligns labels to LABEL_ALIGN.
 > 	* config/mips/mips.md (div_trap_normal): Use %~.
 > 	(div_trap_mips16): Likewise.
 > 	(abssi): Likewise.
 > 	(absdi2): Likewise.
 > 	(ffssi2): Likewise.
 > 	(ffsdi2): Likewise.
 > 	(ashldi3_internal): Likewise.
 > 	(ashrdi3_internal): Likewise.
 > 	(lshrdi3_internal): Likewise.
 > 	(casesi_internal): Likewise.

Geoff,

My comments here are based on intuition rather than actual knowledge.
I could very well be wrong here, and would welcome correction.
Most of what you've done here is fine, I just have a problem with how
you've chosen to enable label alignment.

I believe the primary reason for aligning labels is to improve cache
performance.  And that what alignment is correct for a particular cache
depends on the characteristics of the cache involved (cache line size
seems to be the important one here).  And there is no standard (or even
consistantly used convention) across mips processors for these
characteristics (right?).  So it doesn't make sense to unconditionaly
align all labels based on TARGET_64BIT.

Also, alignment of labels is a speed for space tradeoff (again right?),
so not every user is going to want this turned on.  

If I'm right about all this, it would be better if alignment of labels
was enabled by a compiler option, like Jeff Law's -malign-loops= option,
for example.

                                                 -gavin...


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