3 ms·
Afaik this is a decompilation and recompilation, which means there should be non-trivial performance increases over running it in an emulator, which will be imp
by malux85 2y ago
Afaik this is a decompilation and recompilation, which means there should be non-trivial performance increases over running it in an emulator, which will be important for people with non-high-end machines (the majority of the population)
- XMPPwocky 2y agoNo, not really. It's less a decompilation and more a specialization of a dynamic recompiling (JIT) emulator w/ this specific ROM - the performance increase is dramatically less than a true emulation would be. For example, an "add" instruction gets compiled down to something like 4 x64 instructions - fetch the input registers from the CPU context (in memory), do the actual add, store the result. A real recompilation would be one x64 instruction and no memory accesses. In this specific implementation, from what I can see looking at the generated assembly, the C compiler's optimization options are further limited because they don't pass the CPU context around as a restrict *, so aliasing concerns often require the compiler to emit real memory reads/writes for every memory access, and prevent many other optimizations too. (Even something like QEMU TCG isn't much worse than this - TCG can and will, IIRC, quite happily yoink target (MIPS) registers into CPU registers for an entire TB (slightly broader than a basic block), it only needs to spill them back to the CPU context at the end of a TB.)