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: anton@mips.complang.tuwien.ac.at (Anton Ertl) Subject: Re: 21264 performance anomalies Date: 1999/04/22 Message-ID: <7fnq55$n2p$1@news.tuwien.ac.at>#1/1 X-Deja-AN: 470049805 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> <371A0B6C.4E678E8@gmx.de> Organization: Institut fuer Computersprachen, Technische Universitaet Wien Newsgroups: comp.os.linux.alpha,comp.arch In article <371A0B6C.4E678E8@gmx.de>, Bernd Paysan writes: > 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. Could be. I have done some more measurements: this time I aligned the jump target, and had the load (+add) and the jump in various 16-byte groups, and filled the rest of the instructions with nops and unops. I.e. $L2: {nop;unop;nop;unop} ldq $1,0($2) addq $2,8,$2 [nop;nop] {nop;unop;nop;unop} jmp $31,($1),0 This resulted in: jump load group group 0 1 2 3 0 1.12s 1 0.72s 2.64s 2 1.16s 2.68s 2.84s 3 1.12s 2.64s 2.82s 3.00s 4 1.28s 1.52s 2.82s 3.01s 5 1.44s 1.70s 1.70s 3.01s 6 1.62s 1.90s 1.89s 1.89s If the load is not in group 0, the pattern seems to be: if the jump happens before the loaded value is available (the load latency is 3 cycles), it mispredicts and does not update the next-line predictor of the jump. For some reason it works a lot better with the load in group 0. I am a bit worried, because many of these patterns occur in a real interpreter. However, I don't know how the presence of instructions other than nops and unops affects these results (but my experiences until now indicate that they do), so I probably should stop worrying and wait until the optimization guide arrives. - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html