Forcing functions to be aligned on CPU cache line boundaries with GCC
michael@infortrend.com.tw
michael@infortrend.com.tw
Thu Jan 6 07:10:00 GMT 2000
Hi!
We are using GCC as our primary development environment for a PPC HW
environment. We've noted that shifting code one way or the other can cause
5-10% difference in performance. We suspect that this has to do with
alignment of functions. If it happens that most of the functions that
are called are based near the head of cache lines, then the cache hit rate
will probably increase and performance go up. I'm speculating that this
may be the cause of such a difference in performance, for I can not think
of any other reason why a shift in memory location of code of a few dwords
would cause such a substantial performance impact.
So here's the questing. Is there any way to force alignment of functions
on, say, a 32-byte boundary? If so, what command line option or pragma or
whatever should we use?
Thanks much for any help you can provide!
Regards,
Michael Schnapp
Infortrend Technology, Inc.
Taiwan
email: michael@infortrend.com.tw
More information about the Gcc-help
mailing list