Commit Graph
647 Commits
Author SHA1 Message Date
Ryan Houdek d425aa4f49 Fixes the HSUB ops
These were swizzling in the wrong direction.
Confirmed by host runner
2020-09-23 00:31:39 -07:00
Stefanos Kornilios Mitsis Poiitidis e168e5053a Merge pull request #410 from Sonicadvance1/pmovmskb
Implements MMX PMOVMSKB
2020-09-23 09:51:48 +03:00
Stefanos Kornilios Mitsis Poiitidis 91bea781f4 Merge pull request #408 from Sonicadvance1/rounding_mode_host
Adds new IR ops for supporting host rounding mode conversion
2020-09-23 09:50:37 +03:00
Ryan Houdek 74e2f189f1 Implements MASKMOVQ and MASKMOVDQU
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
2020-09-22 23:23:51 -07:00
Ryan Houdek 88a545cea5 Implements MMX PMOVMSKB
Only pulls out 8 bits of data then zero extends the result to 32bits for
the GPR
2020-09-22 23:23:06 -07:00
Ryan Houdek 394f20d2c8 Implements the new IR ops in the x86 JIT 2020-09-22 18:46:04 -07:00
Ryan Houdek 6da5071433 Implements the new IR ops in the Arm64 JIT 2020-09-22 18:45:16 -07:00
Ryan Houdek e84e65d246 Implements new IR ops in the interpreter 2020-09-22 18:43:40 -07:00
Ryan Houdek e4182108f6 Adds new IR ops for supporting host rounding mode conversion 2020-09-22 18:42:23 -07:00
Ryan Houdek adb9b111ca Fixes crash when SSA value has size of zero
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.
2020-09-22 18:20:32 -07:00
Stefanos Kornilios Mitsis Poiitidis 98909af0f7 Merge pull request #402 from Sonicadvance1/fix_bt_tests
Fixes incorrect assuming BT tests
2020-09-23 01:56:30 +03:00
Stefanos Kornilios Mitsis Poiitidis 43dfb6c363 Merge pull request #401 from Sonicadvance1/frontend_signal_handler
Adds ability for the frontend to register a signal handler
2020-09-23 01:45:15 +03:00
Ryan Houdek c39781275f Merge pull request #396 from FEX-Emu/skmp/execve-only-existing-files
syscalls: execve should fail on missing files
2020-09-22 15:25:08 -07:00
Stefanos Kornilios Mitsis Poiitidis a8a0a270f6 Syscalls: Execve should fail for not existing files 2020-09-23 01:22:14 +03:00
Ryan Houdek fe3028d5b5 Merge pull request #323 from FEX-Emu/skmp/callbacks
Thunks: Initial Callback support
2020-09-22 14:18:12 -07:00
Ryan Houdek 78ad2e4781 Fixes incorrect assuming BT tests
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
2020-09-22 14:05:26 -07:00
Ryan Houdek de2a165a7d Adds ability for the frontend to register a signal handler
This will come to be useful for our host code execution and wine in the
future
2020-09-22 13:19:41 -07:00
Ryan Houdek 15b5eae875 Merge pull request #397 from FEX-Emu/skmp/add-iret
x86-64: Implement IRET for wine
2020-09-22 13:00:54 -07:00
Stefanos Kornilios Mitsis Poiitidis 2425ab994b Thunks: Generation script refactor, generic callbacks 2020-09-22 14:35:38 +03:00
Stefanos Kornilios Mitsis Poiitidis 23a4e83ba2 x86-64: Implement IRET for wine 2020-09-21 13:42:07 +03:00
Ryan Houdek 5bd02fb003 Fixes CASP IR op on interpreter when unified memory is enabled
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
2020-09-17 15:35:56 -07:00
Stefanos Kornilios Mitsis Poiitidis 2cb8db0abb Merge pull request #394 from Sonicadvance1/fix_addr_size_override
Fixes address size override prefix
2020-09-17 10:00:36 +03:00
Ryan Houdek e194aa28e4 Removes a couple of unnecessary variables to improve reentrancy chances
We still aren't 100% reentrant safe in the case that the cores are
interrupted while running, but this is a step in the right direction
2020-09-16 22:34:21 -07:00
Ryan Houdek 00f0047cff Merge pull request #391 from phire/Remove_BFE
Remove unneeded BFEs around flag generation code.
2020-09-16 22:27:59 -07:00
Scott Mansell 5048753e37 Undo limitation of ASHR to 32/64bit
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.
2020-09-17 16:26:41 +12:00
Scott Mansell 7db3063a04 Fix broken flags on INC/DEC 2020-09-17 16:09:55 +12:00
Scott Mansell 4f666a2cbd OpcodeDispacher: Remove useless case statement
Looks like a copy/paste error
2020-09-17 14:59:51 +12:00
Scott Mansell 168148220c OpcodeDispatcher: Remove BFEs from flag-gen code 2020-09-17 14:59:50 +12:00
Scott Mansell 96603495ec OpcodeDispatcher: Remove BFEs from flag-gen calls 2020-09-17 14:59:50 +12:00
Ryan Houdek 806753fa43 Fixes address size override prefix
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
2020-09-16 19:16:08 -07:00
Scott Mansell d4844703d9 ReplaceAllUses: Early exit optimization 2020-09-17 11:29:57 +12:00
Scott Mansell b0cfc19267 Fast replacement path for constants 2020-09-17 11:29:57 +12:00
Ryan Houdek 40a40b8636 Merge pull request #385 from FEX-Emu/skmp/fix-rol-ror-flags
x86disp: Fix ROL/ROR CF and OF calculation
2020-09-16 12:47:09 -07:00
Stefanos Kornilios Mitsis Poiitidis 38be0f05a3 ROL/ROR: Fix flag calculations 2020-09-16 22:43:05 +03:00
Ryan Houdek bfde44a288 Merge pull request #386 from FEX-Emu/skmp/fix-shld-shrd
x86disp: Fix shld/shrd flags
2020-09-16 12:36:51 -07:00
Stefanos Kornilios Mitsis Poiitidis 79fa103a04 SH*D: Fix shifts by zero, OF calculation 2020-09-16 22:23:53 +03:00
Ryan Houdek d0de92f97a Removes error and die in multithreaded forks
This can result in some terrible behaviour if something doesn't
immediately execve once it forks. Allow it instead of crashing out
though.
2020-09-16 11:29:57 -07:00
Ryan Houdek d424cf0eee Merge pull request #365 from phire/IR_iterators
Refactor the IR Interface to prevent "foot-shooting"
2020-09-16 11:24:44 -07:00
Ryan Houdek ddecec12ec Spam out a wackload more syscalls
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.
2020-09-16 10:48:56 -07:00
Ryan Houdek addcb824e2 Merge pull request #390 from FEX-Emu/skmp/add-pendatic-smc
SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test
2020-09-16 09:26:35 -07:00
Stefanos Kornilios Mitsis Poiitidis df3bdf361f SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test 2020-09-16 01:15:21 +03:00
Ryan Houdek 703c6833fc Merge pull request #389 from FEX-Emu/skmp/asr32-should-zext
OP_ASR: Fix zext semantics
2020-09-15 10:12:18 -07:00
Ryan Houdek aa3b42da10 Merge pull request #388 from FEX-Emu/skmp/fix-cmpxchg8b-zext
x86disp: cmpxchg8b should only zext on register write
2020-09-15 10:08:06 -07:00
Ryan Houdek 605a774bc4 Merge pull request #387 from FEX-Emu/skmp/fix-dividiv-zext
x86disp: Fix div32/idiv32 zext behavior
2020-09-15 10:07:31 -07:00
Ryan Houdek 4e2c4f71f9 Merge pull request #384 from FEX-Emu/skmp/fix-shrasr-cf
x86disp: Fix LSR/ASR CF calculation
2020-09-15 10:06:38 -07:00
Ryan Houdek ded48258d6 Merge pull request #378 from FEX-Emu/skmp/fix-BT-offsets
x86disp: BT/BTR/BTS/BTC make bit index signed
2020-09-15 10:05:47 -07:00
Ryan Houdek 5a31cc9aa1 Merge pull request #383 from FEX-Emu/skmp/fix-fld-sti
x86disp: Fix FLD st(i)
2020-09-15 10:04:40 -07:00
Ryan Houdek b5e354d341 Merge pull request #380 from FEX-Emu/skmp/fix-movhlps
x86disp: Add movhlps special case
2020-09-15 10:04:17 -07:00
Ryan Houdek e11d3ed83a Merge pull request #382 from FEX-Emu/skmp/fix-xadd-regreg
x86disp: fix xadd reg,reg
2020-09-15 10:02:04 -07:00
Ryan Houdek 29cb5d1821 Merge pull request #381 from FEX-Emu/skmp/fix-8bit-idiv
x86disp: Fix 8 bit IDIV
2020-09-15 10:01:29 -07:00