From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,3626ccca6bb70e55 X-Google-Attributes: gid111c93,public X-Google-Thread: 102b75,4820dfa6cb2bff3e X-Google-Attributes: gid102b75,public From: Bernd Paysan Subject: Re: 21264 performance anomalies Date: 1999/04/18 Message-ID: <371A0B6C.4E678E8@gmx.de>#1/1 X-Deja-AN: 468065715 Content-Transfer-Encoding: 7bit References: <87d81hkqw0.fsf@pfaffben.user.msu.edu> <7eemp3$11ap@news1.newsguy.com> <370BA607.1F391244@moene.indiv.nluug.nl> <7ei0gg$1kg$1@news.tuwien.ac.at> <370CF898.BD85182@moene.indiv.nluug.nl> <7ej80q$o1a$1@news.tuwien.ac.at> <923660402.19654.0.nnrp-12.9e981e55@news.demon.co.uk> <7f2e17$ds2$1@news1.rmi.net> <3714DA77.6150C99A@bell-labs.com> <7f4m3f$mtff$2@xinwen.daimi.au.dk> <3715f75f.0@news.destek.net> Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@paysan.nom X-Trace: 18 Apr 1999 23:46:31 +0200, dial118.mucweb.de Organization: Bernd Paysan, 81477 Muenchen, Germany Mime-Version: 1.0 NNTP-Posting-Date: 18 Apr 1999 16:42:20 GMT Newsgroups: comp.os.linux.alpha,comp.arch Dave Cherkus wrote: > > Erik Corry (erik@arbat.com) wrote: > > > > Why 'unfortunately'? Has this feature limited gcc's portability? > > > > It surely makes it hard to compile code written using this construct > with compilers other than gcc. I've been told that the only compiler > that can compile the Linux kernel code is gcc/egcs. It'd be nice to > see if the upcoming Compaq Alpha compilers for Linux produce a faster > kernel, but I've been told the work involved in eliminating/recoding > gcc constructs is huge. But adding this GCC feature to any other C compiler should be pretty trivial, what? This is the "don't fix your app, fix your compiler" approach. GCC has so many valuable extensions that are needed to write efficient code, and labels as values is just one of them - Linux uses others. So maybe recoding Linux might lead to compilable code on DECpaq's compiler, but it doesn't necessarily mean that this code will run faster. Well, IMHO the whole thing is all the wrong approach. The Alpha compiler team should better improve GCC instead of trying to port Linux over to a non-GCC compiler. But back to the topic: The effect of the instructions in the 16 byte chunk before the label target is easy to explain: obviously the 21264 just executes all of them, and cancels those that shouldn't have been executed - that takes time. The other effect is also understandable: it's just like the Pentium doesn't like back-to-back branches, and when you move the jump into the next chunk, it's not a back-to-back branch. GCC has some simple hooks to define alignments of branch targets, the pgcc makes use of that, too; setting them to 16 bytes (and padding with nops) should be easy. I don't know if it also allows padding of jumps, but after all emiting a .align per jump should be not so difficult. With ELF, these alignments actually work. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://www.jwdt.com/~paysan/