From mboxrd@z Thu Jan 1 00:00:00 1970 From: michael@infortrend.com.tw To: help-gcc@gnu.org Subject: Forcing functions to be aligned on CPU cache line boundaries with GCC Date: Thu, 06 Jan 2000 07:10:00 -0000 Message-id: X-SW-Source: 2000-01/msg00068.html 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: michael@infortrend.com.tw To: help-gcc@gnu.org Subject: Forcing functions to be aligned on CPU cache line boundaries with GCC Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: X-SW-Source: 2000-q1/msg00068.html Message-ID: <20000401000000.IwiD45MeuEF3XS2M3njGN4FnyoL8mqnAAu4e6QLvZhg@z> 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