[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] Instruction census



On Tue, Jan 14, 2003 at 12:33:48AM +0000, nico wrote:
> On Mon, 13 Jan 2003 00:07:19 +0100
> Michael Riepe <michael@stud.uni-hannover.de> wrote:
> 
> > 
> > The vast majority of instructions are load/store, add/sub/loadaddr[i]
> 
> It's even worse ! There is much more load than store !

There are about 3.6% loadi and 3.6% storei instructions (probably most
of them come from register save/restore code from function prologues
and epilogues), 11.0% `real' loads and 3.5% `real' stores (caused by
the C code).  These are average numbers; actual values vary with the
kind of program.  The F-CPU emulator alone has a total of 7820 loads
and 7220 stores, for example, which is a rather different picture.
The F-CPU instruction decoder from libfcpu_opcodes even has less loads
than stores (149/173) - it writes to a character buffer most of the time.
Table-based state machine code - e.g. yacc/(f)lex output - usually has
more loads (I observed 1.7 ... 1.9 loads per store).  The most extreme
case, however, was combine.c from the gcc source tree: 5257 loads,
856 stores (that's a factor of 6.14!).

> Could you
> calculate the distribution of distance between the load and the
> effective use of the data ?

That's hard to do with nothing else but a text analysis...

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/