11825 Commits

Author SHA1 Message Date
Ryan Houdek
633e3ddb33 x87 based unit tests! 2020-05-28 14:47:43 -07:00
Ryan Houdek
5efab1eff9 Updates list of known failures for unit tests
x87 implementation has changed these
2020-05-28 14:47:43 -07:00
Ryan Houdek
3759cbdb65 Interpreter based x87 support!
This implements support for 130 of the 132 x87 ops as interpreter
fallbacks.

The two missing ops are the BCD load and BCD store instructions and can
be implemented another time.

This allows us to no longer have to rely on a libstdc++ modification to
handle their usage of long double. This instead works entirely through
using `long double` directly in the interpreter. Which will either use
real x87 on an x86 host. Or in the case of ARM devices, fall down
glibc's long double soft float path.

This doesn't necessarily need to be quick right now. It's more important
to have the compatibility improvement from this.
2020-05-28 14:47:43 -07:00
Ryan Houdek
f5273e1505
Merge pull request #215 from FEX-Emu/skmp/unimplemented-syscalls-always-fail
Add ERROR_AND_DIE, use it on unhandled syscalls
2020-05-28 14:20:58 -07:00
Stefanos Kornilios Mitsis Poiitidis
8206aa0413 Add ERROR_AND_DIE, use it on unhandled syscalls 2020-05-28 18:47:24 +03:00
Stefanos Kornilios Mitsis Poiitidis
88c87eb214
Merge pull request #213 from Sonicadvance1/more_syscalls
Implements three more syscalls
2020-05-28 10:11:54 +03:00
Stefanos Kornilios Mitsis Poiitidis
eed60e775a
Merge pull request #212 from Sonicadvance1/fix_multiprocess_crash
Fixes crashes in unit tests
2020-05-28 10:10:47 +03:00
Ryan Houdek
1d6aac1a5d Implements two handle_at syscalls 2020-05-27 18:32:17 -07:00
Ryan Houdek
c78520c526 Implements symlink syscall 2020-05-27 18:32:17 -07:00
Ryan Houdek
5e4a75e8a6 Fixes crashes in unit tests
In the case of multiple dozens of tests running, they will end up
loading and saving the config files dozens of times.
This was causing the configuration system to load in half saved files
that were causing common crashes in the posix unit tests.

Theoretically this could have happened at any time but it looks like
with the posix unit tests added, it is just more likely to happen.

Makes it so loading the configuration file is much more robust and
verbose on failure.
Makes it so saving the config file first saves to a temporary and then
moves in to the correct location. This causes the config saving to be
atomic in a sense so the unit tests won't corrupt other processes of FEX
trying to load the config file.
2020-05-27 16:52:45 -07:00
Ryan Houdek
e84dbafd2a
Merge pull request #205 from Sonicadvance1/threaded_compilation_fix
Makes threaded compilation not rely on a global mutex
2020-05-27 10:27:56 -07:00
Ryan Houdek
fd857e4966 Makes threaded compilation not rely on a global mutex
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.
2020-05-27 10:18:02 -07:00
Stefanos Kornilios Mitsis Poiitidis
a773a4e627
Merge pull request #211 from Sonicadvance1/softfloat
Implements softfloat library for x87
2020-05-27 14:30:02 +03:00
Stefanos Kornilios Mitsis Poiitidis
6669bcfffd
Merge pull request #209 from Sonicadvance1/minor_opts
Minor memory allocation optimizations in the IR passes.
2020-05-27 14:27:08 +03:00
Stefanos Kornilios Mitsis Poiitidis
2fd8e617ff
Merge pull request #207 from Sonicadvance1/interpreter_fallback
Adds support for interpreter fallback
2020-05-27 14:20:58 +03:00
Stefanos Kornilios Mitsis Poiitidis
22a4c5185d
Merge pull request #208 from Sonicadvance1/fence_ops
Implements fence ops
2020-05-27 14:18:21 +03:00
Ryan Houdek
56087a029d Implements softfloat library for x87 2020-05-27 00:05:48 -07:00
Stefanos Kornilios Mitsis Poiitidis
670869ccd7
Merge pull request #210 from Sonicadvance1/fix_scas
Fixes SCAS
2020-05-27 09:14:45 +03:00
Ryan Houdek
77e444e8a5 Fixes SCAS
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
2020-05-26 22:51:11 -07:00
Ryan Houdek
b3b6727a8e Minor optimization in IRCompaction pass
Codeblock array was constantly being reallocated.
Changes the remap array over to a allocate in multiples of the alignment
size.
Was hitting a pedantic case where the compaction would hit slightly
increasing function sizes so large numbers of reallocations occured
quickly.
2020-05-26 22:25:15 -07:00
Ryan Houdek
f8579d5458 Minor optimization in the RCLSE pass
We already have an unmodified classification struct. Just memcpy it to
reset the state. Reduces a bunch of temporary allocations.
Also disables the CFG calculation since we aren't using it currently
2020-05-26 22:23:10 -07:00
Ryan Houdek
38ff936c81 Adds support for interpreter fallback
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
2020-05-26 19:08:18 -07:00
Ryan Houdek
19cecdbd2b Adds fence unit tests
Just execution tests
2020-05-26 19:06:21 -07:00
Ryan Houdek
5569894d81 Implements fence ops
These map directly to x86 fence instructions, which have equivalent ARM
versions as well.
2020-05-26 19:04:35 -07:00
Ryan Houdek
719094445b
Merge pull request #206 from FEX-Emu/skmp/posixtest-python-disable-list
posixtests: Move disabled list to file from filenames
2020-05-26 13:36:26 -07:00
Stefanos Kornilios Mitsis Poiitidis
41a6cccfe8 posxitests: disable conformance-interfaces-sched_rr_get_interval-1-1.test 2020-05-26 18:34:01 +03:00
Stefanos Kornilios Mitsis Poiitidis
f10891eb11 posixtests: Move disabled list to file from filenames 2020-05-26 17:39:22 +03:00
Stefanos Kornilios Mitsis Poiitidis
66a0293cdb
Merge pull request #201 from Sonicadvance1/fix_file_flags
Fixes FD flags mismatch between x86 and ARM64
2020-05-26 12:52:26 +03:00
Stefanos Kornilios Mitsis Poiitidis
6e9558c8fd
Merge pull request #204 from Sonicadvance1/warn_once
Adds a WARN_ONCE macro
2020-05-26 12:51:09 +03:00
Ryan Houdek
f23a0997e7
Merge pull request #200 from Sonicadvance1/finish_x87_table
Finishes x87 instruction table flags
2020-05-26 01:31:32 -07:00
Ryan Houdek
56128d98b0
Merge pull request #202 from Sonicadvance1/fix_pid_tid_problem
Forces the primary application thread to be host primary thread
2020-05-26 00:41:07 -07:00
Stefanos Kornilios Mitsis Poiitidis
25ddef17c1
Merge pull request #203 from Sonicadvance1/fix_includes
Fixes some missing includes
2020-05-26 10:04:08 +03:00
Stefanos Kornilios Mitsis Poiitidis
0bc4cc6663
Merge pull request #187 from FEX-Emu/skmp/posix-tests
CI: Add posix-tests
2020-05-26 09:42:54 +03:00
Stefanos Kornilios Mitsis Poiitidis
7799cd43a4
Merge pull request #199 from Sonicadvance1/ir_has_sideeffects
Implements HasSideEffects IR option
2020-05-26 09:36:02 +03:00
Stefanos Kornilios Mitsis Poiitidis
7a9a95583c
Merge pull request #190 from Sonicadvance1/fix_128bit_div
Fixes 128bit divisions on AArch64
2020-05-26 09:34:32 +03:00
Stefanos Kornilios Mitsis Poiitidis
6c2b66894b
Merge pull request #196 from Sonicadvance1/fix_32bit_gdt_classification_dse
Fixes RCLSE CPUState classification
2020-05-26 09:32:59 +03:00
Ryan Houdek
cff34909a8 Adds a WARN_ONCE macro
There are cases where a WARN_ONCE macro that warns about one thing is
very nice to have.
Add the macro so we can use it later
2020-05-25 21:42:39 -07:00
Ryan Houdek
7c8f7c732f Fixes some missing includes 2020-05-25 20:04:17 -07:00
Ryan Houdek
0130b41a10 Forces the primary application thread to be host primary thread
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
2020-05-25 19:56:05 -07:00
Ryan Houdek
160da69c21 Fixes FD flags mismatch between x86 and ARM64
AArch64 redefines these four flags so they don't match between
architectures.
This is what was actually causing ls to fail, the x86 side was passing
in O_DIRECTORY which the AArch64 side was interpreting at O_DIRECT.
This made it return EINVAL
2020-05-26 02:44:11 +01:00
Ryan Houdek
566d83e334 Finishes x87 instruction table flags 2020-05-25 18:02:27 -07:00
Ryan Houdek
f41700cd58 Lets DCE pass use the new HasSideEffects IR attribute
This will be less prone to breaking since you should have the sideeffect
described in the IR
2020-05-25 17:55:26 -07:00
Ryan Houdek
98d6feabae Marks IR ops that have side effects in the IR file 2020-05-25 17:53:57 -07:00
Ryan Houdek
277d0c6e22 Adds JSON IR option HasSideEffects
This will be useful for making sure our DCE pass isn't so fragile
2020-05-25 17:50:07 -07:00
Stefanos Kornilios Mitsis Poiitidis
9e2bc5b28e Disable tests that fail on ARM 2020-05-25 19:53:58 +03:00
Stefanos Kornilios Mitsis Poiitidis
f5d69722d7
Merge pull request #195 from Sonicadvance1/implement_get_rusage
Implements get_rusage syscall
2020-05-25 18:11:36 +03:00
Stefanos Kornilios Mitsis Poiitidis
ec8eac2836
Merge pull request #197 from Sonicadvance1/remove_xop
Removes XOP frontend handling
2020-05-25 17:16:44 +03:00
Stefanos Kornilios Mitsis Poiitidis
cd4e29f83f
Merge pull request #194 from Sonicadvance1/fix_getcwd
Changes getcwd to use the syscall directly.
2020-05-25 17:10:28 +03:00
Stefanos Kornilios Mitsis Poiitidis
a69a821773
Merge pull request #192 from Sonicadvance1/fix_aarch64_llvm9
Fixes LLVM on AArch64
2020-05-25 17:06:28 +03:00
Stefanos Kornilios Mitsis Poiitidis
881d22e9af
Merge pull request #191 from Sonicadvance1/fix_ashr
Fixes ASHR on AArch64
2020-05-25 17:06:08 +03:00