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: lindsay@best.com (Donald C. Lindsay) Subject: Re: 21264 performance anomalies Date: 1999/04/11 Message-ID: <7eqq1b$3nr$1@localhost.best.com>#1/1 X-Deja-AN: 465198295 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> X-Trace: nntp1.ba.best.com 923859523 211 209.24.164.230 Organization: none lately Reply-To: don.lindsay@acm.org Newsgroups: comp.os.linux.alpha,comp.arch In article <7ej80q$o1a$1@news.tuwien.ac.at>, Anton Ertl wrote: >2) In an unaligned block the kind of instruction *before* the jump >target does play a role. nops are cheap, while the other instructions >I tried apparently cost another ~5 cycles/NEXT. Why is that and why so >much? Since no one who really knows has seen fit to answer: The 21264 uses a next-line-and-set predictor. That is, the predictor doesn't emit a predicted PC value. It emits I-cache indexing information which allows you to cycle the I-cache. The advantage of this scheme is that -the predictor state has fewer bits/target, eg 12 instead of 43. -you don't have to map PC bits to an I-cache line-and-set, it's already done. The disadvantage (?) of this is: -if the I-cache misses, the I-refill doesn't have the speculated PC. >From your data, I'd guess that they're prefetching the branch target's cache line, and speculatively issuing the left hand of the cache line. If the target wasn't at the left hand of the cache line, their mis-speculation has some time cost. I'd guess that the issue logic squashes NOPs, although NOPs may be fast-pathed in some other way. I don't know why 5 cycles. The moral is that on the 21264, you will see speedup if you use binaries with cache-aligned branch targets. Compaq has tooling to re-schedule old binaries, but I guess the customer has to know to run them. -- Don Donald C. Lindsay, Ph.D. www.best.com/~dlindsay Just laid off.