0x2 is the default state for hardware boot, but it isn't the state we
boot applications in.
When an application boots under Linux it is actually set to 0x202
because interrupts have been enabled.
Since we can't disable interrupts we will just always have at least
0x202 in the eflags.
This modifies the unit tests to first clear the full eflags state then
loads it so we hit "default". Once we hit the unit test runner we won't
have known the eflags state at that point, so we need to clear it
initially.
Without supporting phis this entire loop needs to be unrolled.
I just found out while reading the x86 documentation that this
instruction is explicitly a weakly ordered memory operation.
So this operation can be changed over to a couple vector conditional
loadstores soon after merging
In the case of an invalid SSA destination size, the IR validation pass
would catch it and then when printing the IR it would crash with a
divide by zero.
Fixes that.
66 prefix /does/ change behaviour because that is the operand size
prefix.
Additionally the immediate variant will also modulo the result.
So that needs to be checked for
Confirmed with manual on upcoming host-side unit test runner
Noticed by Stef on 09/09/2020 as a curious code block that was failing
Forgot about it until now since we couldn't see exactly where it was
wrong
Code block was mixing x87 (Which forces a fallback to Interpreter) and
cmpxchg8b, which caused that code block to fail.
Since this op was broken with Unified Memory + Interpreter it wasn't
picked up by unit tests since those don't run in unified memory
This should really be done later in a sperate PR.
1. We don't have proper unit test coverage
2. I still didn't get this right at time of removal
3. I haven't done the jit changes to go along with this.
We were handling this in a completely broken fashion and it only broke
more with the previous zexting changes.
This fixes the EXPLICIT address size override usage.
There are still a few instructions that rely on implicit address size
override support that this doesn't handle
Almost all of these end up being simple passthrough.
This covers most syscalls, the remaining ones are signal related, exec
related, or rseq required.
All of these syscalls exist prior to Linux 5.0. We are using these with
the expectation still that the host Linux implementation is 5.0 or
higher.
Once we implement newer syscalls we will need to start checking for host
Linux version. We don't really have a care about devices shipping older
4.x kernels atm.