Jerome Vouillon wrote:
CGP -O3 MOps: 65 !!!1
This generates some pretty good code (for instance, for sub_i_i_i) :
Yep. I'd have a look at it, really compact.
Why not also predereference the operation address? This would save a memory read. The goto would become: goto **(cur_opcode += 4);
This is left as an exercise to the reader :) Improvements welcome - and I'm a really bad C programmer, I won't do it.
It seems hard to improve upon this. One possibility is to have some new instructions that uses an accumulator: accu = accu - (*(INTVAL *)cur_opcode[1]);
This looks very similar to my proposal WRT micro ops. I had 3 "accu" globals - pretty fast. But the problem is, they must be somewhere in the interpreter because of re-entrancy, threads and that. So this seems impossible.
-- Jérôme
leo