Khan said:
BTW, Dark forces looks gorgeously smooth (maybe we can expect 486DX/33 perfomance figures after all
)
Great job, Pickle!
with a very good dynamic recompiler running 32 bit x86 code you could easily get up to 486DX-120Mhz performance depending on the software being run
with interpreted emulation running 16bits x86 code, not much more than a 386DX-16
the 486 had only 8KB to 16KB of cache (code+data)
ARM and 486 have roughly equivalent cycles-per-operation speeds (1 cycle/op)
where it hurts:
* emulating has an overhead for emulating I/O and virtual memory
* the ARM ALU is 32bits only (8bits and 16bits ops needs to be shifted back and forth to emulate the x86 flags)
* ARM instructions are 4 bytes long and recompiled code is much larger so a lot less fits in the cache VS x86 code
* Thumb instructions are 2 bytes long but are much less efficient for emulation because you need a lot of bit-shift operations and address calculations which the 4byte ARM code does better, so you end up with much more Thumb code than ARM code for emulating the same x86 opcodes.
x86:
ADD [EBX], EAX ; 2 bytes, 3 cycles (on 486)
ARM:
ldr r12, [r1] ; 4 bytes, 1 cycle
adds r12, r12, r0 ; 4 bytes, 1 cycle
str r12, [r1] ; 4 bytes, 1 cycle
both take the same time, but ARM takes 12 bytes VS 2 bytes, less fits in the instruction cache = more memory delays
that's not even counting the overhead of emulating virtual memory.
emulating a MIPS processor with flat memory (N64, PS, PSP) is a lot easier for an ARM than emulating an x86 in protected mode (dos4gw, windows, etc)