Sender: chris AT mindspring DOT com Message-ID: <38936999.1C044730@ix.netcom.com> Date: Sat, 29 Jan 2000 14:28:41 -0800 From: Chris Sears X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.13-7mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: pgcc AT delorie DOT com Subject: Re: pgcc and egcs alignment -- function, basic block and string References: <38921CD6 DOT 2A725779 AT ix DOT netcom DOT com> <20000129032101 DOT A25630 AT atrey DOT karlin DOT mff DOT cuni DOT cz> <38927310 DOT 2033EED4 AT ix DOT netcom DOT com> <20000129143544 DOT G1024 AT cerebro DOT laendle> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: pgcc AT delorie DOT com Marc, thanks. > While intel recommends relatively large alignments, "common knowledge" > (linus for example ;) recommends no alignments at all. > In _my_ tests large alignment is a very very slight win, but in the real > world, the increased code size might not be worth it (cache effect, long > nops, AGI because of lea-nops). > It's a must on 486, though, and a bit better on ppro and later. This is about loop body alignment, right, not function entry alignment? I didn't get a clear idea of what you thought about function alignment. > Yes, -malign-loops=xxx, -malign-functions=xxx etc.. Just read the > manual(tm). Oops. I read the man page, really I did. -malign-xxx isn't there, but it is in the manual (2.8). Thanks, I'll experiment with it. But there isn't an alignment switch for strings. > > Admittedly, a cache line is word aligned as well, > > but wouldn't .align 4 suffice to align to a word boundary? > > It depends. The only way data alginment hurts is by wasting space, which > is rarely a problem (despite cache problems). aligning to a cache line > helps in practise, although one would think that natural alignment would > suffice. It isn't a huge issue, true. But in the kernel, there is no paging. String pages are pinned in memory. A similar situation arises in embedded applications. > Maybe a aligning on longwords is a good trade-off, but that needs > extensive benchmark data. Or a switch. But the .align 4 for egcs seems like a real gaffer to me. Any idea who I should it to? I've seen mention of it on a newsgroup when I was researching the problem, so it may be known. Chris Sears cbsears AT ix DOT netcom DOT com