Aligned Strings

Jan Hubicka jh@suse.cz
Sun Aug 26 08:40:00 GMT 2001


Hi,
I've run across your testcase - it exhibits the worst case, where string
is 33 bytes long and aligned to 32bytes.
One way to track this down is to use the MAX_SKIP even for data alignment.
We can use the knowledge of size to fit string always in 2 cache lines
by aligning it to 32bit boundary when it is less than 2 bytes away.

I am not 100% sure this worths the extra machinery needed in target
macros, but it may make sense. The drawback is that programs often
uses just first few bytes of string, so alignment to cache line boundary
makes sense.

Other posibility is to increase the threshold from 32bits to 64bits.

I've run simple test with disabling this alignment and got less than 1%
change on gcc data section size.

Honza



More information about the Gcc mailing list