I'm interested in how software emulators of old game consoles work. These must consist of an interpreter for the machine language of the emulated processor.
If I have understood correctly an interpreter, for each instruction: reads the instruction and scrolls a huge switch-case (or sequence of
if-elseif-...) like structure comparing the instruction with each possible instruction in the architecture of the emulated processor, and then executes the related branch.
Is it possible to distribute the switch-case into severial thread, and give them to a parallel processor (GPGPU, FPGA, ...) ?
In my opinion, this problem is inherently parallel, because if 1 core = 1 opcode, and each core can read the next opcode, then just the right core will execute the instruction.
After finishing the execution of the current instruction, then it does the same thing for the next one.
Is it a good idea to create an interpreter (slowest type of emulation, but also the easiest type of emulator and free of problems like self-modifying code) and make it faster using distribute computing?
Each instruction means a different process for a different core
No problem with concurrency, because just one instruction branch is executed.
Is this a good idea or there is any problem?