Commit Graph
9533 Commits
Author SHA1 Message Date
Ryan Houdek b79083e510 Implements CVTSD2SI 2020-04-12 17:46:42 -07:00
Ryan Houdek f74bca4fdb Fixes a race condition in WaitForIdle
This is something that TSAN caught was happening.
Grabs the thread creation mutex when checking for idle and extends the
sleep time for WaitForIdle to something that is still below unit test
run time
2020-04-12 17:31:11 -07:00
Ryan Houdek 9233589ccc Fixes clone syscall when VFORK flag is used
The VFORK flag lets clone behaviour similarly to a fork.
The parent will be suspended until the resulting thread is exited
The mutex is removed because everything that touches state is already
wrapped by mutexes. So we don't need this one
2020-04-12 17:29:46 -07:00
Ryan Houdek 94b0ea4be3 Fixes the getaffinity syscall
This was implemented with the glibc API originally which was incorrect.
The syscall API is just a simple bitmask of for the affinity of the
number of CPU cores and a size check that the resulting structure is
large enough to store the number of bits.
2020-04-12 12:44:37 -07:00
Ryan Houdek 6f7573d726 Implements the mlock syscalls
Saw this when running Dolphin
2020-04-12 12:38:37 -07:00
Ryan Houdek 2ec41070da Ensure that anything opened with openat is tracked in our FD map
Missing this was an accident, this was how it was supposed to be.
It's very helpful to map FDs to filenames when tracking mmap mappings
2020-04-12 12:36:20 -07:00
Ryan Houdek 8d7a512b16 Move vector op RegisterSize and ElementSize values in to the header struct
Sadly this is a fairly substantial change that can't be broken in to
something smaller.
The gist of the problem is that most of the vector ops declared their
own uint8_t RegisterSize and ElementSize variables in their structs.
This was initially done because there were assumptions elsewhere in the
source that sometimes mixed up the IROp member `Size` and `Elements` as
sometimes meaning `Size` elements and `Elements` number of elements.
Other times there was an assumption that `Size` was the full register
size and `Elements` was the number of elements inside that size.
ex: `Size`: 16, `Elements` 8 would sometimes be interpreted as i8v16 OR i128v8

These assumptions are now removed and we also save on average 16bits per
vector operation. This is a necessary evil first step for upcoming IR
considerations.
This should have zero change on runtime behaviour and unit tests confirm
that.
2020-04-11 22:17:48 -07:00
Ryan Houdek 2267bc0949 Minor IR cleanup
Changes the IR register class definition to exist in the JSON file.
Removes a couple of IR ops that were unused and weren't necessary.

Changes the CPUID IR op to the new paired op which improves perf ever so
slightly.
Changes RA class handling in the RA pass to pull directly from the new
generated helper routine until it hits a complex op

Still need RA constraints to remove extraneous moves that would crop up
2020-04-10 19:16:47 -07:00
Stefanos Kornilios Mitsis Poiitidis fec93ea573 Merge pull request #95 from FEX-Emu/skmp/block-cache-hotfix
BlockCache: Remove MemoryBase logic, check full address for match
2020-04-10 13:58:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 0ae451afa9 Merge pull request #98 from Sonicadvance1/major_fixes
Float comparison bug fixes
2020-04-10 13:57:44 +03:00
Stefanos Kornilios Mitsis Poiitidis 937dbd811c BlockCache: Remove MemoryBase logic, check full address on aliased lookup 2020-04-10 13:50:09 +03:00
Ryan Houdek bfa727ac12 COMISD unit tests 2020-04-10 01:02:35 -07:00
Ryan Houdek 30bce2468d Remove magic numbers for invalid register class definition
Consolidates usage of register class to the one that is defined in the
IR Json file.
Every magic number is replaced with InvalidClass and instead uses the
enums directly

Another bug fix is that the GetHostFlags IR ops was being declared as
using the flags register class, which isn't a real thing yet.
This would most likely have ended up with host flag usage being
scheduled to a GPR that was already scheduled and overwrite it.

Once this IR op ends up in host flags this will be changed as well
2020-04-10 01:02:29 -07:00
Ryan Houdek 2340e35c5b Fixes unordered flag FCMP result on AArch64 JIT
Was using the wrong enum
2020-04-10 01:02:20 -07:00
Ryan Houdek 17ebe1b77a Removes ShouldDump from CMPXCHG 2020-04-10 01:02:16 -07:00
Ryan Houdek 74f61a00bc Adds invalid class definition through the IR definitions file 2020-04-10 01:02:11 -07:00
Ryan Houdek 4ed0f61ccc Makes sure FCMP IR op destination size is set to 4
Adds a description about its operation
2020-04-10 01:02:07 -07:00
Ryan Houdek 1ee5e87275 Fixes COMIS instruction table definitions
These instructions are always in xmm1, xmm2/mem format.
Incoming size needs to be 32bit or 64bit to be correct
2020-04-10 01:02:02 -07:00
Ryan Houdek 0766de70dd Merge pull request #89 from Sonicadvance1/wip_pair
CMPXCHG8B and CMPXCHG16B support
2020-04-10 00:56:26 -07:00
Ryan Houdek 70a3557925 Make sure the DCE pass doesn't remove pair context store ops 2020-04-10 00:50:35 -07:00
Ryan Houdek 24eb25bc89 Make sure the RCLSE pass can't optimize through paired context loadstore ops 2020-04-10 00:50:35 -07:00
Ryan Houdek 39b11cfc2e CMPXCHG8B/16B unit tests 2020-04-10 00:50:35 -07:00
Ryan Houdek eed4ff8b69 Implements support for CMPXCHG8B and CMPXCHG16B
There are still some extraneous moves generated around the instruction,
but we need RA instruction constraints in order to safely (and cleanly)
remove them
2020-04-10 00:50:35 -07:00
Ryan Houdek 79255c2c12 Adds LLVM support for the new pair IR ops 2020-04-10 00:50:35 -07:00
Ryan Houdek f73d82353c Adds AArch64 support for the new pair IR ops 2020-04-10 00:50:35 -07:00
Stefanos Kornilios Mitsis Poiitidis f166fd0b9b Merge pull request #99 from Sonicadvance1/remove_accurate_stdout
Removes accurate-std command line argument
2020-04-10 09:34:36 +03:00
Stefanos Kornilios Mitsis Poiitidis 6975042739 Merge pull request #97 from Sonicadvance1/implement_personality
Implements personality syscall
2020-04-10 09:21:01 +03:00
Stefanos Kornilios Mitsis Poiitidis 43ffdbdc2a Merge pull request #96 from Sonicadvance1/remove_aes
Remove CPUID flag saying that we support AES
2020-04-10 08:27:54 +03:00
Ryan Houdek 7d8c50389e Merge pull request #80 from Sonicadvance1/fix_optimization_passes
Fix optimization passes
2020-04-09 18:18:55 -07:00
Ryan Houdek 3424326987 Removes accurate-std command line argument
This is an option that has been removed
2020-04-09 18:01:29 -07:00
Ryan Houdek 044d7289b1 Implements personality syscall
Was seen in Reicast doing it for legacy reasons. Might as well as
support it.
2020-04-09 13:54:32 -07:00
Ryan Houdek fdf521ff46 Remove CPUID flag saying that we support AES
Node was found using it and we don't yet support it

All of the instructions directly map to AArch64 instructions aside from
AESKEYGENASSIST
2020-04-09 13:40:36 -07:00
Stefanos Kornilios Mitsis Poiitidis c092d2d21b Merge pull request #92 from Sonicadvance1/ensure_no32bit_mapping
Ensure the ELFLoader doesn't end up in the lower 32bit address space
2020-04-09 00:09:10 +03:00
Stefanos Kornilios Mitsis Poiitidis 281605e979 Merge pull request #91 from Sonicadvance1/enable_pie
Actually unconditionally enable PIE through cmake
2020-04-09 00:03:09 +03:00
Ryan Houdek 5298379fb9 Ensure the ELFLoader doesn't end up in the lower 32bit address space
We need to reserve that space for EXEC apps and 32bit apps. Hard throw a
warning if any of our mapping space ends up in the lower 32bits.

PIE and potentially a custom dynamic linker can enforce this.
2020-04-08 13:35:29 -07:00
Ryan Houdek 0ce0c4e895 Actually unconditionally enable PIE through cmake
behaviour around enabling PIC it was only working on one platform.

This follows through with the NEW cmake behaviour required to enable
PIE.
Very specifically you have to set the cmake variable, you have to set
the new policy, AND you have to have an explicit check for pie support.
With any of those three things missing then PIE won't be enabled
2020-04-08 13:06:35 -07:00
Ryan Houdek 436d988168 Adds x86-64 support for the new pair IR ops 2020-04-08 00:18:36 -07:00
Ryan Houdek 980448bcf9 Adds interpreter support for the new pair IR ops 2020-04-08 00:17:54 -07:00
Ryan Houdek 3bb0d06a36 Adds new paired reg IR ops 2020-04-08 00:17:12 -07:00
Ryan Houdek 27df596218 Adds support for register class conflicts to the RA
On average adds <1% performance overhead to RA
2020-04-08 00:14:52 -07:00
Ryan Houdek 8cb9e6200f Update vixl externals to get new simulator fixes
Fixes bugs in CASP and FCVTN
2020-04-08 00:10:03 -07:00
Ryan Houdek 88576f187c Fixes VBitCast IR op in the x86 JIT 2020-04-06 12:25:58 -07:00
Ryan Houdek f46870a2fb Fix a bug in the const prop pass
When a Zext is going 64bit->128bit this involves a register class change.
This is special cased in the CPU cores and the const prop class doesn't
really have a way to handle this case in the IR level
2020-04-06 12:25:58 -07:00
Ryan Houdek 211b9b625b Makes the RCLSE pass more strict about what it optimizes 2020-04-06 12:25:58 -07:00
Ryan Houdek 4ebfd7b9dc Removes the, buggy and redundant, redundant flag calculation elimination pass
The RCLSE pass already handles this
2020-04-06 12:25:58 -07:00
Stefanos Kornilios Mitsis Poiitidis ba3ed680a8 Merge pull request #81 from Sonicadvance1/cvttps2dq
Implements CVTTPS2DQ x86 instruction
2020-04-06 18:12:15 +03:00
Stefanos Kornilios Mitsis Poiitidis e356c6d9b4 Merge pull request #84 from Sonicadvance1/fix_x86_abi
Fixes stack alignment in x86_64 JIT
2020-04-06 18:11:28 +03:00
Stefanos Kornilios Mitsis Poiitidis 4049b30e57 Merge pull request #76 from Sonicadvance1/syscall_cleanup
Syscall cleanup
2020-04-06 18:10:05 +03:00
Ryan Houdek 812c8a9b4d Unit test for the cvttps2dq instruction 2020-04-05 14:26:17 -07:00
Ryan Houdek 75ab768a8f Let the AArch64 JIT support unified memory address space 2020-04-05 14:00:22 -07:00