Ryan Houdek
2cac41ee1c
Adds a bunch more syscalls
...
Some of these are just there to get us farther in some cases. They can
result in behaviour the app isn't expecting like when signals are setup
but not handled correctly.
Is fine for the cases that the app doesn't actually use them.
2020-04-17 15:19:09 -07:00
Ryan Houdek
46692d72c0
Adds new syscalls to the jump tables
2020-04-15 11:18:37 -07:00
Ryan Houdek
6471b6e833
Adds two new thread syscall functions
...
Adds getppid and kill
kill signals sent to emulator local threads may or may not behave as
expected until signals are implemented here
2020-04-15 11:16:14 -07:00
Ryan Houdek
565b8a6b54
Adds new FD syscall functions
...
flock, fsync, fdatasync, and fchmod
2020-04-15 11:14:23 -07:00
Ryan Houdek
12e8e63be7
Adds epoll_create syscall function
2020-04-15 11:13:36 -07:00
Stefanos Kornilios Mitsis Poiitidis
15d008d389
Merge pull request #115 from Sonicadvance1/fix_memory_allocation
...
Fixes memory allocation
2020-04-13 09:58:29 +03:00
Stefanos Kornilios Mitsis Poiitidis
bf130e28a5
Merge pull request #114 from Sonicadvance1/cvtsd2si
...
Implements CVTSD2SI
2020-04-13 09:57:13 +03:00
Stefanos Kornilios Mitsis Poiitidis
7abd7f358d
Merge pull request #111 from Sonicadvance1/waitforidle_race
...
Fixes a race condition in WaitForIdle
2020-04-13 09:53:13 +03:00
Stefanos Kornilios Mitsis Poiitidis
25d30597b5
Merge pull request #110 from Sonicadvance1/fix_clone_fork
...
Fixes clone syscall when VFORK flag is used
2020-04-13 09:51:48 +03:00
Stefanos Kornilios Mitsis Poiitidis
40c7da0b53
Merge pull request #109 from Sonicadvance1/fix_affinity_syscall
...
Fixes the getaffinity syscall
2020-04-13 09:50:46 +03:00
Stefanos Kornilios Mitsis Poiitidis
374e6f397c
Merge pull request #108 from Sonicadvance1/mlock_syscall
...
Implements the mlock syscalls
2020-04-13 09:49:54 +03:00
Ryan Houdek
780278a7f6
Fixes memory allocation
...
4GB virtual memory is too small and causes things to fault.
Previously we were at `1 << 36` but it caused oom issues on devices with
smaller amounts of memory.
This time ensure the the SHM memory is allocated with MEM_NORESERVE so
devices can actually allocate the virtual memory region.
2020-04-12 18:39:00 -07:00
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
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
937dbd811c
BlockCache: Remove MemoryBase logic, check full address on aliased lookup
2020-04-10 13:50:09 +03: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
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
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
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
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
75ab768a8f
Let the AArch64 JIT support unified memory address space
2020-04-05 14:00:22 -07:00