This is one thing I allways wanted to try ;-)

fast_core MOps: 11
Prederef: 17.5
CGoto MOps: 19.4
CGP MOps: 27.5
CGP -O3 MOps: 65 !!!1

This runloop combines the faster dispatch of opcodes via computed goto and the clever register addressing due to predereferencing registers and constants.
And it's compact due to the fact that all opcode variants with constants collapse to just one implementation of the functions body. It's so compact, that my ancient gcc 2.95.2 even can compile it -O3, which didn't succeed with core_ops_cg.c.

-rw-r--r-- 1 lt users 618496 Feb 6 12:33 core_ops.c
-rw-r--r-- 1 lt users 665012 Feb 6 13:10 core_ops.o
-rw-r--r-- 1 lt users 219169 Feb 6 12:33 core_ops_cg.c
-rw-r--r-- 1 lt users 339312 Feb 6 13:10 core_ops_cg.o
-rw-r--r-- 1 lt users 154457 Feb 6 13:05 core_ops_cgp.c
-rw-r--r-- 1 lt users 165520 Feb 6 13:27 core_ops_cgp.o
-rw-r--r-- 1 lt users 219446 Feb 6 12:33 core_ops_prederef.c
-rw-r--r-- 1 lt users 240592 Feb 6 13:10 core_ops_prederef.o

This runloop is now enabled with the -P switch. If you want to run the "normal" prederefed runloop then use '-P -g'.

Have fun,
leo

Reply via email to