Doom mov

Basically, the processor tries to "look ahead" into the code of the currently running program, and execute things that might not even end up getting executed – for example, if between the line of code in the prediction and the line currently being executed, an error (such as attempting to read memory you're not allowed to access) happens. In such a scenario, the changes by the processor are supposed to be "rolled back", and the code is supposed to continue running as if this prediction never happened.

However, as discovered by researchers, observable side effects from code that was not supposed to be executed remain, which is what vulnerabilities like Meltdown and Spectre rely on.

The most common scenario where speculative execution comes into play is branching – moments where code can diverge into multiple scenarios, with things like if statements.

With that taken into account, @xoreaxeaxeax's solution was obvious. Just get rid of branching altogether!

And so, enter branchless Doom. Because hey, no branches would mean no problem, right? Well, yes, but not quite. It's a bit slow. As in, 1 frame per seven hours slow.

Of course, this is not a serious project. As described by @xoreaxeaxeax, "this project is entirely tongue-in-cheek, and only serves as a correctness test for the M/o/Vfuscator compiler" – M/o/Vfuscator being their experimental C compiler, which compiles C programs only using the x86 instruction set's mov instruction, which is supposed to just move data to and from memory.

Inspired by Stephen Dolan's paper titled "mov is Turing-complete", which proves that it is, in theory, possible to execute any possible program only using that single instruction, the compiler sets out to do exactly that.

You may find out about the compiler, along with the instructions on how to build Doom with it, at the project's GitHub repository:

via Motherboard