As we run more threaded applications it is becoming apparent that this
needs to be fixed now.
This duplicates the FrontendDecoder and Passmanager per thread so they
no longer block each other while compiling.
Increases a bit of memory usage but completely worth it.
Adds a couple of assets in the other repeat instructions.
Jump targets were accidently inverted.
SCAS and LODS are the two repeat instructions we don't have unit tests
for.
Unit tests are forthcoming for this
The IRHeader itself contains a flag for if a block should fallback to
the interpreter.
This is necessary for the case that an IR is loaded and the Frontend
object no longer has the data necessary to know if it should do an
interpreter fallback.
This is super useful for bisecting JIT versus Intepreter failures, and
also cases where falling back to intepreter for compatibility is a lot
more simple than wiring things through the JIT (ala x87)
This isn't currently utilized, but will be once x87 work lands
This is a bit of a peculiar one, we want to ensure a single threaded
application is running on the emulator's primary thread.
This mitigates the problem that an application can do a getpid versus
gettid comparison and notice a problem.
Some games rely on getpid being the actual process ID and will spin
forever if it isn't the case.
This is also necessary for wine bringup since thread creation needs a
bit more finesse there.
Fixes#186
This keeps the XOP instruction tables around but removes the decoding
assert.
This lets us implement the POP instruction that overlapped the XOP
prefix without having to deal with XOP at all.
I don't believe we have any real need to support XOP, but if it is a
thing later then it'll be easy to add back
Optimization passes found a bug in the frontend regarding constants.
Specifically in the case of instructions that have a 32bit constant that
are sign extended to 64bit was being incorrectly set to have a size of
32bits (the size of the constant).
So an optimization pass would rematerialize constants of the expected
size, thus ~0ULL would turn in to ~0U and generate invalid code.
Now watch the destination size and set the constant to that size, which
matches what its size will be.
The Passmanager passes need very little or zero x86 knowledge to do
their work. They don't need the x86 OpDispatcher handling code at all.
Convert this entirely over to using the IREmitter class so it can
actually optimize IR code from the IRLoader frontend