3 ms·
Cycle-accurate transpiling, now that sounds like a fun project. I think it would "only" have to be cycle-accurate between specific events, e.g. access to specif
by anyfoo 5y ago
Cycle-accurate transpiling, now that sounds like a fun project. I think it would "only" have to be cycle-accurate between specific events, e.g. access to specific registers. (No idea how feasible this whole thing could be.)
- monocasa 5y agoI remain skeptical (but would love to be proven wrong!). Most of the point of recompiling (JIT or AOT) is to amortize instruction decode and dispatch costs versus an interpreter. If you have to do the cycle accurate bookkeeping anyway, you're most of the way to the overhead of an interpreter again. There'll be some savings around partial instruction streams that don't have effects outside the CPU core that can just be run as a burst, but I'm not sure it'll be a game changing amount.
- NobodyNada 5y ago> I think it would "only" have to be cycle-accurate between specific events, e.g. access to specific registers. That’s correct — but one of those events is external interrupts (from the graphics, audio, or cartridge hardware), which complicates things a bit since your “checkpoints” can be anywhere in the code rather than just at a specific set of register accesses. You could work around this by tracking cycles per-basic-block while running transpiled code, and falling back to cycle-accurate software emulation when you get close to a hardware interrupt.