public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Forcing functions to be aligned on CPU cache line boundaries with GCC
@ 2000-01-06  7:10 michael
  2000-04-01  0:00 ` michael
  0 siblings, 1 reply; 2+ messages in thread
From: michael @ 2000-01-06  7:10 UTC (permalink / raw)
  To: help-gcc

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Forcing functions to be aligned on CPU cache line boundaries with GCC
  2000-01-06  7:10 Forcing functions to be aligned on CPU cache line boundaries with GCC michael
@ 2000-04-01  0:00 ` michael
  0 siblings, 0 replies; 2+ messages in thread
From: michael @ 2000-04-01  0:00 UTC (permalink / raw)
  To: help-gcc

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-06  7:10 Forcing functions to be aligned on CPU cache line boundaries with GCC michael
2000-04-01  0:00 ` michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).