At 12:09 PM +0100 2/20/03, Leopold Toetsch wrote:
Starting from the unbearable fact, that optimized compiled C is still faster then parrot -j (in primes.pasm), I did this experiment:
- do register allocation for JIT in imcc
- use the first N registers as MAPped processor registers
This sounds pretty interesting, and I bet it could make things faster.
I have now checked in a first version for testing: - the define JIT_IMCC_OJ in jit.c is disabled - so no impact - jit2h.pl defines now a MAP macro, which makes jit_cpu.c more readable Restrictions: - no vtable ops - no saving of non preserved registers (%edx on I386) So not much will run, when experimenting with it.
But I think, the numbers are promising, so it's worth a further try.
To enable the whole fun, recompile with JIT_IMCC_OJ enabled, build imcc and use the -Oj switch (primes.pasm is from examples/benchmarks):
$ time imcc -j -Oj primes.pasm N primes up to 50000 is: 5133 last is: 49999 Elapsed time: 3.523477
real 0m3.548s
$ ./primes # primes.c -O3 gcc 2.95.2 N primes up to 50000 is: 5133 last is: 49999 Elapsed time: 3.647063
$ time imcc -j -O1 primes.pasm # normal JIT N primes up to 50000 is: 5133 last is: 49999 Elapsed time: 4.039121
real 0m4.065s
imcc/parrot was built without optimization, but this doesn't matter, no external code is called for jit/i386 in the primes.pasm.
The timings for imcc obviously include compiling too.
leo