This is the mail archive of the gcc@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]

Re: Aligned Strings


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


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