From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,4820dfa6cb2bff3e X-Google-Attributes: gid102b75,public X-Google-Thread: 111c93,3626ccca6bb70e55 X-Google-Attributes: gid111c93,public From: Justin Carlson Subject: Re: 21264 performance anomalies Date: 1999/04/14 Message-ID: <7f2j7a$r2n@usenet.pa.dec.com>#1/1 X-Deja-AN: 466368256 References: <87d81hkqw0.fsf@pfaffben.user.msu.edu> <7ei0gg$1kg$1@news.tuwien.ac.at> <370CF898.BD85182@moene.indiv.nluug.nl> <7ej80q$o1a$1@news.tuwien.ac.at> <7eqq1b$3nr$1@localhost.best.com> <7etets$kel@usenet.pa.dec.com> <7f232u$fvc$1@news.tuwien.ac.at> Organization: Digital Equipment Corporation, Palo Alto, CA, USA User-Agent: tin/pre-1.4-980618 (UNIX) (OSF1/V4.0 (alpha)) Newsgroups: comp.os.linux.alpha,comp.arch >> At any rate, I'm guessing you'll see the penalty go away not if >> you align the jumps or the targets, but rather if you insure that >> multiple jumps don't exist in the same fetch block. >> > It would, if there was more than one jump in the 16-byte block. Ok, > maybe the chip does not fully decode the instructions for this, but > decoding a frequent instruction like ldah or addq (which is what I > used) as jump would probably seriously hurt branch prediction. > One theory I have is that the performance penalty exists as soon as > the destination register of the instruction before the unaligned > branch target is not $31 (the zero register). I made a few > experiments, and they seem to support this (but I also found a few > more unexpected variations). > I also made several experiments with the same code in the 16-byte > block, varying the branch target between the first and the second > instruction of the block, and always saw a huge slowdown when the jump > target was not the first instruction. Ah, I misread your original post. Sorry about that. There shouldn't be a performance penalty for writing a non-zero register immediately before the jump unless, of course, the write incurs a read-after-write dependency in the pipe. At any rate, I need more information to look at what's going on here. I'm not overly familiar with this aspect of EV6, but I can probably dig up the info. Can you post a larger sample of the code you are generating, complete with register targets? Ideally I'd like to look at 8 instructions or so on either side of the section you're interested in. /JDC carlson@pa.dec.com