M68k-JIT for ARM


TomB

Very Active Member
Joined
Oct 26, 2009
Messages
212
Hi.

Does anyone has experience with JIT for ARM CPUs? Maybe I can get some ideas how to improve my JIT implementation for UAE4ALL.

I have now a first special version of UAE4ALL with JIT (very experimental version, nothing to publish). It based on the aranym version of the m68k core.

Only in some programs which are not using blitter or copper so heavy like demos or games, you get a noteable improvement on my 1 GHz device. For example the benchmark tool SYSINFO gives you a 3.5 times faster result than the regular newcpu-implementation for m68k CPU.

In games or demos, the interleaving of the handling of cpu, blitter and copper is too much. JIT is only useful if you can run a large amount of cycles without interrupt by any custom chip.

For now, I stay on FAME core for UAE4ALL because on Pandoras with 600 MHz, the newcpu core is too slow. With or without JIT.

Regards,

TomB
 
Last edited by a moderator:

Exophase

Nothing good will ever come of Exophase.
Joined
Sep 21, 2006
Messages
10,308
Age
36
Location
Cleveland OH
Switching between the emulated CPU code and some other device emulation shouldn't be any slower for a recompiler (JIT) than it is for an interpreter so long as an interrupt wasn't raised. And even that can use cached block pointers if it happens very frequently. If you're doing a block lookup every time the switch happens that's sub-optimal. For a single CPU system I recommend structuring it so the emulation of other devices is a function call from the recompiled code.
 

TomB

Very Active Member
Joined
Oct 26, 2009
Messages
212
My explanations wasn't clear for this topic. The calls to the emulation of the custom chip is done with function calls from the recompiled code. What I can see is, that there are lot of small blocks of recompiled code (4 to 10 M68K instructions). I think I have to make a deeper analysis of the block usage, cache misses and recompilation of same blocks.

Maybe the emitted code isn't optimal. The code from aranym was for ARMv5, so there is a chance to find better sequences for ARMv7.
 

Exophase

Nothing good will ever come of Exophase.
Joined
Sep 21, 2006
Messages
10,308
Age
36
Location
Cleveland OH
You shouldn't be exiting the recompiler every block. There should be a cycle counter that you decrement, that tells you when to exit. And blocks should directly branch to each other if connected via direct branches.

I'd also recommend having basic blocks that are at the very least single entry, multiple exit (so end with an unconditional branch, not a conditional branch) if that's not already what you're doing.
 
Last edited by a moderator:

mcobit

Advanced Member
Joined
Jul 28, 2008
Messages
6,910
For Arm there was some code done by notaz for mame4all wasn't it?


Also Basilisk has a jit. But not for arm...
 

TomB

Very Active Member
Joined
Oct 26, 2009
Messages
212
The ARM JIT from aranym based on the JIT of Basilisk. WinUAE and Basilisk had also the same base. For aranym they started to implement the ARM version.

I'll have a look at the sources from mame4all...thanks for the hint.
 
Top