Commit Graph
9533 Commits
Author SHA1 Message Date
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
Ryan Houdek 45bf39ca0f Removes XOP frontend handling
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
2020-05-25 00:53:14 -07:00
Ryan Houdek 6cdbab9846 Fixes RCLSE CPUState classification
We were missing the newly added GDT classifications.
Wouldn't have caused any issues in any 64bit applications, but threw an
assert in debug builds
2020-05-25 00:34:19 -07:00
Ryan Houdek 136a2e4291 Implements get_rusage syscall 2020-05-24 00:22:40 -07:00
Ryan Houdek a95d43fa37 Changes getcwd to use the syscall directly.
The glibc implementation and syscall implementation differ quite
significantly.
Just use the kernel interface one for now.
2020-05-24 00:21:51 -07:00
Ryan Houdek 7c98f5a3ac Fixes LLVM on AArch64
LLVM-9 doesn have the include, while LLVM-10 does
2020-05-24 00:19:54 -07:00
Ryan Houdek 61c0fde8fe Fixes ASHR on AArch64
Smaller than 8byte wasn't sexting to the full register so it was causing issues
2020-05-24 00:18:51 -07:00
Ryan Houdek 63a90461e8 Adds 128bit division unit tests where we care about the upper bits 2020-05-24 00:03:17 -07:00
Ryan Houdek 600ad7f597 Fixes 128bit divisions on AArch64
These were only doing 64bit divisions.
Function calls are a bit ugly but once the new RA lands we can clean them up
2020-05-23 23:45:52 -07:00
Stefanos Kornilios Mitsis Poiitidis b906edae7a posixtests: Update submodule 2020-05-23 22:19:18 +03:00
Stefanos Kornilios Mitsis Poiitidis 5ae047e031 posix_test_runner.py: More debug output 2020-05-23 19:25:29 +03:00
Stefanos Kornilios Mitsis Poiitidis 223c51d4e5 Verbose test output 2020-05-22 17:15:08 +03:00
Stefanos Kornilios Mitsis Poiitidis 430ff3e2a6 Move posixtest to ctest, add known failures 2020-05-22 16:23:07 +03:00
Stefanos Kornilios Mitsis Poiitidis e737a34891 Update fex-posixtest-bins 2020-05-20 19:50:24 +03:00
Stefanos Kornilios Mitsis Poiitidis 1c314298b8 Merge pull request #178 from FEX-Emu/HdkR/Github_workflow
Ensure local pushes to a branch don't run through CI
2020-05-18 16:51:43 +03:00
Stefanos Kornilios Mitsis Poiitidis d33e4ad250 Merge pull request #185 from Sonicadvance1/32bit_syscalls
Implements initial 32bit syscall support
2020-05-18 15:40:34 +03:00
Stefanos Kornilios Mitsis Poiitidis 8d8463c869 Update CI scripts 2020-05-18 14:29:32 +03:00
Stefanos Kornilios Mitsis Poiitidis 2498de1f00 Add fex-posixtest-bins as submodule 2020-05-18 13:11:04 +03:00
Stefanos Kornilios Mitsis Poiitidis cb955c0d0c CI: Add posixtests 2020-05-18 13:10:22 +03:00
Ryan Houdek 10087f7757 Implements initial 32bit syscall support
This adds the initial 32bit syscalls for testing. No where near complete
2020-05-15 03:23:15 -07:00
Ryan Houdek 667e514262 Adds 32bit GDT state to CoreState
32bit x86 memory accesses require going through the GDT and has syscalls
that support setting these.
The GDT isn't a flat address space like in x86-64, so we actually need
to support this.
2020-05-15 03:01:17 -07:00
Ryan Houdek 446245204e Merge pull request #172 from Sonicadvance1/initial_32bit
Initial 32bit support
2020-05-14 19:27:48 -07:00
Ryan Houdek 64556e3eac Ensures passmanager gets the syscall handler during core init 2020-05-14 01:04:04 -07:00
Ryan Houdek ba3cb444ee Ensures test harness runner runs in 64bit mode 2020-05-14 01:03:42 -07:00
Ryan Houdek d2cf07a4fd Passes the running mode through from FEX to FEXCore 2020-05-14 00:56:31 -07:00
Ryan Houdek 7128f1fa46 Initial 32bit SonicUtils ELFLoader support 2020-05-14 00:55:52 -07:00
Ryan Houdek c171fbb71e Add 64bit config option
Not currently wired up to anything
2020-05-14 00:55:52 -07:00
Stefanos Kornilios Mitsis Poiitidis c555577d07 Merge pull request #184 from Sonicadvance1/RA_Fix
Works around a spill bug in the RA
2020-05-12 23:44:48 +03:00
Stefanos Kornilios Mitsis Poiitidis a65bb87fa8 Merge pull request #183 from Sonicadvance1/fix_frontend_imm
Fixes a bug in the frontend regarding constants
2020-05-12 19:52:43 +03:00
Stefanos Kornilios Mitsis Poiitidis 4e19bea7ae Merge pull request #182 from Sonicadvance1/IRLoader
IR Loader unit tests and surrounding support!
2020-05-12 19:51:17 +03:00
Ryan Houdek 0a1a52860d Works around a spill bug in the RA
Spilling is a mess in this version of the RA and there was a significant
bug that effectively made spilling either infinite loop or crash.

This adds a bunch of new comments about the logic of the spilling and
ipmroves it so it shouldn't break as easily.

There are still some edge cases that can be hit that break spilling but
a lot of this code is going to be scrapped for the new RA coming up
anyway.
This is temporary until the new RA merges in.
2020-05-11 16:19:08 -07:00
Ryan Houdek 0b88984005 Fixes a bug in the frontend regarding constants
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.
2020-05-11 16:10:50 -07:00
Ryan Houdek e6e4634651 Ensures LLVM JIT doesn't crash if DebugInfo isn't provided
IR doesn't have DebugInfo, all the other backends already handle this
2020-05-09 12:21:54 -07:00
Ryan Houdek c6616a0866 Switches over the unit test running in the github yml file to target
specific unit test categories

Allows us to split out the ASM unit tests and the IR unit tests to their
own independent steps in the yml file
2020-05-09 12:19:36 -07:00
Ryan Houdek 6cdd3916c0 Adds IR based unit test support.
Now that everything is punched through that is necessary, we can now
have IR based unit tests that will be used to ensure the IR is working
correctly.
Specifically this is necessary for quick iterating on RA testing.
2020-05-09 12:19:36 -07:00
Ryan Houdek 31afb62a2a Split python unit test ASM config parser code out to an independent file
This will be needed once we have multiple file type configs getting
parsed
2020-05-09 12:14:59 -07:00
Ryan Houdek 9664e24961 Adds a cmake target for running ASM tests 2020-05-09 12:14:59 -07:00
Ryan Houdek b70176c99a Fixes bug in TypeDefinition elements
Elements of 0 isn't a real thing. Would cause problems in the CPU
backends.
Ensure we have at least 1 element (Which technically means a vector 1
element wide, but that just defines as a scalar)
2020-05-09 12:14:59 -07:00
Ryan Houdek cda734cea2 Adds support for comment lines in the IR parser
Comments start with ';' on the line.
You can also technically have comments after IR ops but that isn't
explicitly supported, just an artifact of how things are parsed.
2020-05-09 12:14:59 -07:00
Ryan Houdek 718b3e6b4c Refactors PassManager to ingest IREmitter class instead of OpDispatcher
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
2020-05-09 12:14:59 -07:00
Ryan Houdek dff0a8fb69 Switch the IRLoader over to using the IREmitter class
Reduces some code duplication
2020-05-08 19:11:31 -07:00
Ryan Houdek dc87134af3 Switches the OpcodeDispatcher over to using the new IREmitter class 2020-05-08 19:08:14 -07:00
Ryan Houdek 1b720479c4 Adds a self contained IREmitter class
This class does IR emitting and some basic handling of IR specific
tasks.

This is going to be used to split the x86 OpDispatcher from the IR
emission so the IR emitter can be passed around without caring about x86
dependencies.
2020-05-08 19:03:22 -07:00