Commit Graph
1308 Commits
Author SHA1 Message Date
Ryan Houdek a4f92b8564 Removes some undefined behaviour in f2xm1 unit test
If the input range is outside of -1.0 to +1.0 then the result is
undefined.
To avoid precision problems just check for zero, aka 2^0-1 which also
returns zero
2020-09-23 09:45:08 -07:00
Ryan Houdek f5d15df6be Flips incorrect argument order in fyl2x unit test 2020-09-23 09:44:32 -07:00
Ryan Houdek 9ed9497f06 Removes some undefined behaviour in x87 inc/dec stp tests 2020-09-23 09:42:45 -07:00
Ryan Houdek 6cd4896db3 Fixes bugged x87 fcmov tests 2020-09-23 09:42:10 -07:00
Ryan Houdek 57021e5e11 Fixes x87 FCMOV
One flag type was having inverted results
2020-09-23 09:41:32 -07:00
Ryan Houdek 12dc4ad0c4 Fixes x87 FYL2X 2020-09-23 09:41:00 -07:00
Ryan Houdek 422dc9c104 Merge pull request #417 from Sonicadvance1/convert_with_host_flags
Implements OpDispatcher ops for host flag conversion ops
2020-09-23 09:32:08 -07:00
Ryan Houdek 6d8406b613 Fixes failing unit tests that were just fixed 2020-09-23 09:27:02 -07:00
Ryan Houdek 2983e4c421 Implements OpDispatcher ops for host flag conversion ops
These rely on the host flag being correct. Which will match what is set
through the regular host flag setting routines
2020-09-23 09:04:44 -07:00
Stefanos Kornilios Mitsis Poiitidis 57a835f475 Merge pull request #415 from Sonicadvance1/fix_unaligned_unittest
Fixes unit test that relies on unaligned XMM load
2020-09-23 14:22:40 +03:00
Stefanos Kornilios Mitsis Poiitidis d8b5ae3fdf Merge pull request #414 from Sonicadvance1/fix_eflag_state
Ensures eflags matches real state
2020-09-23 14:21:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 437d6e984d Merge pull request #418 from Sonicadvance1/hsub
Fixes the HSUB ops
2020-09-23 14:17:48 +03:00
Stefanos Kornilios Mitsis Poiitidis 6e4507ea2b Merge pull request #416 from Sonicadvance1/loadstore_roundingmode
Support setting emulator host rounding mode with ldmxcsr/stmxcsr
2020-09-23 14:17:00 +03:00
Ryan Houdek bef4e2ff01 Fixes HSUB unit tests
I had the values reversed from what was expected.
Changed to reflect what changed in the previous commit.

Confirmed by host unit test runner
2020-09-23 00:32:28 -07:00
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
Ryan Houdek a69b700afb Support setting emulator host rounding mode with ldmxcsr/stmxcsr 2020-09-23 00:21:52 -07:00
Ryan Houdek 72567f6f3a Fixes unit test that relies on unaligned XMM load 2020-09-23 00:17:49 -07:00
Ryan Houdek aef0f81a23 Ensures eflags matches real state
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.
2020-09-23 00:09:35 -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
Stefanos Kornilios Mitsis Poiitidis 75109050c0 Merge pull request #409 from Sonicadvance1/maskmov
Implements MASKMOVQ and MASKMOVDQU
2020-09-23 09:49:20 +03:00
Ryan Houdek 4b35cf3c3e Merge pull request #405 from Sonicadvance1/HostRunner
Implements x86 host runner
2020-09-22 23:36:33 -07:00
Ryan Houdek f01f3053f5 Merge pull request #407 from Sonicadvance1/remove_undefined_behaviour
Removes undefined behaviour in our unit tests
2020-09-22 23:32:17 -07:00
Ryan Houdek 8a62065917 Implements new unit tests for these instructions 2020-09-22 23:23:51 -07: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 3ad8ea49e4 Implements PMOVMSKB unit test 2020-09-22 23:23:06 -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 faa7a16655 Merge pull request #411 from Sonicadvance1/problematic_unittests
Disables problematic posix tests
2020-09-22 23:22:46 -07:00
Ryan Houdek cb525e4a59 Implements x86 host runner
Will be used for unit tests
2020-09-22 23:19:48 -07:00
Ryan Houdek 820d83f158 Disables problematic posix tests 2020-09-22 23:15:19 -07:00
Stefanos Kornilios Mitsis Poiitidis f0431a8ff4 Merge pull request #406 from Sonicadvance1/fix_ir_printer_crash
Fixes crash when SSA value has size of zero
2020-09-23 09:06:33 +03: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 0c7c7ba670 Removes undefined behaviour in our unit tests
Most of these were relying on the upper 16bits of the 80bit MM registers
to be zero.
This isn't necessarily true as one will find out when running this under
the host runner.
2020-09-22 18:32:19 -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
Ryan Houdek bad3b7da0c Merge pull request #403 from FEX-Emu/skmp/libsdl2-loadfns
libSDL2: SDL_LoadObject/Function/UnloadObject should be implemented in guest context
2020-09-22 16:24:25 -07:00
Stefanos Kornilios Mitsis Poiitidis ca563c42d4 libSDL2: SDL_LoadObject/Function/UnloadObject should be implemented in guest context 2020-09-23 02:19:15 +03: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
Stefanos Kornilios Mitsis Poiitidis 9e91310a62 Merge pull request #400 from Sonicadvance1/test_exec
Ensures the unit test code is marked executable
2020-09-23 01:43:28 +03:00
Stefanos Kornilios Mitsis Poiitidis f6a8f96fbd Merge pull request #399 from Sonicadvance1/unittest_reg_size
Allows unit tests registers to have partial register views
2020-09-23 01:42:33 +03:00
Stefanos Kornilios Mitsis Poiitidis b015a58704 Merge pull request #398 from Sonicadvance1/compile_arg
Ensures architeecture define is defined in the root cmake
2020-09-23 01:35:59 +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 5c32bac737 Ensures the unit test code is marked executable
This will become important in the future when we are actually executing
this code directly on host.
FEX itself doesn't yet care about memory permissions
2020-09-22 13:14:04 -07:00