Commit Graph
437 Commits
Author SHA1 Message Date
Ryan Houdek cb74beadb4 Fixes Zext on FPR->GPR conversion for AArch64
The 32bit and lower sizes were making vixl asserts fire.
Wouldn't actually change emitted code
2020-07-11 06:20:50 +01:00
Ryan Houdek d281e9f7ff Fixes LDIV bug in aarch64 JIT
vixl asserts were firing for the 16bit variant, and we needed to sext
the divisor for the 32bit variant
2020-07-11 06:20:40 +01:00
Stefanos Kornilios Mitsis Poiitidis 630d66942c uname: Should return x86_64, not x64_64
Run into this in CS:GO.
With this fix it progresses much further, but still doesn't get to the menu.
2020-07-08 20:58:57 +03:00
Stefanos Kornilios Mitsis Poiitidis 951ff40904 Frontend: Fix 15-byte long opcode assert 2020-07-08 14:00:14 +03:00
Ryan Houdek 15d6f48ca2 Merge pull request #258 from FEX-Emu/skmp/more-syscalls
syscalls: fork, vfork, eventfd2
2020-07-06 09:51:41 -07:00
Stefanos Kornilios Mitsis Poiitidis 560d467058 VURAvg: Fix arm64 jit 2020-07-04 21:52:15 +03:00
Stefanos Kornilios Mitsis Poiitidis 8eaa11f4f2 VURAvg: Fix llvm implementation 2020-07-04 20:51:13 +03:00
Stefanos Kornilios Mitsis Poiitidis c19e8b3d2f Implement PAVGB/PAVGW 2020-07-04 19:30:53 +03:00
Stefanos Kornilios Mitsis Poiitidis fc2d7656e0 syscalls: Warn on clone + ptrace instead of assert 2020-07-04 19:04:08 +03:00
Stefanos Kornilios Mitsis Poiitidis cb8f250078 syscalls: fork, vfork, eventfd2 2020-07-03 11:17:51 +03:00
Ryan Houdek 9c99dbfbdc Fixes AtomicSwap IR op on x86
lock prefix needed to go before the xchg, not before the move that was
there
2020-07-02 22:18:44 -07:00
Ryan Houdek 95f1775df5 Merge pull request #255 from FEX-Emu/skmp/implement-execve
syscalls: implement execve
2020-07-02 14:41:13 -07:00
Ryan Houdek 59cc3b576e Merge pull request #256 from FEX-Emu/skmp/implement-some-syscalls
syscalls: Implement a few easy ones
2020-07-02 14:40:25 -07:00
Ryan Houdek 03e084c7f0 Merge pull request #248 from FEX-Emu/fork_syscall
clone: Some support for fork, Flag validation
2020-07-02 14:39:23 -07:00
Stefanos Kornilios Mitsis Poiitidis 370397198b syscalls: (*)get/setxattr 2020-07-02 19:46:41 +03:00
Stefanos Kornilios Mitsis Poiitidis 9c48c7f487 syscalls: truncate,creat,chown,fchown,lchown,setpgid,getpgid,setfsuid,setfsgid,getsid,sync,syncfs 2020-07-02 19:34:21 +03:00
Stefanos Kornilios Mitsis Poiitidis 8234ffce3d syscalls: implement execve 2020-07-02 18:14:28 +03:00
Stefanos Kornilios Mitsis Poiitidis 0a66654161 Merge pull request #252 from Sonicadvance1/remove_strace_compile_time
Removes syscall strace parsing if not enabled
2020-07-02 12:48:23 +03:00
Ryan Houdek 4612fb5a67 Implements support for cache clearing in the ARM64 JIT
Previously the ARM64 JIT didn't support cache clearing at all.
This adds support for clearing the JIT cache while keeping dispatcher
helpers around and the ASM dispatcher alive.
2020-07-01 23:07:09 -07:00
Ryan Houdek bb60044e12 Splits JitArm64 IR handlers to a jump table
Improves compilation time by multiple minutes
Clang was taking multiple minutes to compile JIT.cpp for ARM.
This drops it down to a handful of seconds instead.

No functional behaviour change, only movement.
JIT compile times might deviate slightly moving from a switch to a jump
table, but will be negligible in either direction.
2020-07-02 02:46:14 +01:00
Ryan Houdek 62f9917b79 Removes syscall strace parsing if not enabled
This was spending ~60seconds of time compiling on my c630.
Something about fmt string formatting causing heavy compile times on
ARM.
Better to just compile it out anyway.
2020-07-01 06:11:35 +01:00
Ryan Houdek ce15a1bdcd Corrects MM register alignment in CoreState
This was misaligned by 8 bytes, which worked fine on x86, but crashed
when loaded on ARM.

Now it is correctly aligned to 128bit
2020-07-01 06:08:39 +01:00
Stefanos Kornilios Mitsis Poiitidis 2ccaea7d66 clone: Validate flags, cleanup 2020-06-30 16:23:43 +03:00
Ryan Houdek 8a5813e4d0 [WIP] Fork syscall support
Bit buggy
2020-06-30 16:22:47 +03:00
Ryan Houdek bd26d15879 Fixes LLVM multiblock
The break ir op is actually a block ender and it happened that in
regular code paths they were already ending the blocks correctly.

This enforces block ending in the Unimplemented op so multiblock still
generates the invalid code path correctly and it compiles.
We hit these a few times in multiblock for times in the code where it is
checking for CPU features and choosing a code path depending on CPUID
results.

Potentially these could be made in to no-ops since we'll never hit these
codepaths in practice, but it is nicer to break in case we actually do
hit one of these paths.
2020-06-26 12:31:15 -07:00
Ryan Houdek b73b585db3 Merge pull request #246 from FEX-Emu/skmp/fix-syscall-forward-macro
Syscalls/x64: Fix SYSCALL_FORWARD_ERRNO
2020-06-25 04:58:15 -07:00
Stefanos Kornilios Mitsis Poiitidis 7b7c4a9730 Syscalls/x64: Fix SYSCALL_FORWARD_ERRNO 2020-06-25 14:51:01 +03:00
Stefanos Kornilios Mitsis Poiitidis 4e515abb33 Syscalls: Add a wrapping class for better backtrace 2020-06-25 14:29:02 +03:00
Ryan Houdek 8e95d502f3 Merge pull request #226 from FEX-Emu/skmp/add-all-syscall
Dynamic Syscall Regsistration, Automatic Strace generation
2020-06-25 03:18:43 -07:00
Ryan Houdek 2bcc46c9e5 Implements FFREEP support in the OpDispatcher
There's some history for this instruction. It is not in the official
instruction documentations from AMD or Intel but it is supported on
almost every x87 supporting CPU (I think there was some Cyrix that
missed it?)

This was originally implemented by accident on the Intel 80287 CPU.
It was then periodically documented in random documentation.

The instruction behaves exactly like FFREE but then pops the stack after
the operation.
For our current implementation of FFREE, which is a NOP, we just need to
pop the stack.
2020-06-20 08:11:26 -07:00
Stefanos Kornilios Mitsis Poiitidis df1ed9442b Syscalls/x64: Add stubs for all syscalls, remove some syscall entries that are too new 2020-06-19 20:30:06 +03:00
Stefanos Kornilios Mitsis Poiitidis 7c2efe0155 Syscalls: Cleanup headers, add names, add NotImplemented 2020-06-19 13:07:07 +03:00
Stefanos Kornilios Mitsis Poiitidis eddd3dd4ed Syscalls/x64: Cleanup and document syscall registration/forwarding logic 2020-06-19 09:45:00 +03:00
Stefanos Kornilios Mitsis Poiitidis db213f94f3 Syscalls: Implement tkill, tgkill 2020-06-18 20:18:56 +03:00
Stefanos Kornilios Mitsis Poiitidis 0bf585bf76 Syscalls: Dynamic registration, auto strace generation 2020-06-18 19:57:58 +03:00
Scott Mansell 41635ee8be Implement fallocate syscall 2020-06-17 23:47:52 +12:00
Ryan Houdek 7a48d17d66 Implements two missing timerfd syscalls 2020-06-16 16:53:08 -07:00
Stefanos Kornilios Mitsis Poiitidis 0e19763045 Merge pull request #236 from Sonicadvance1/32bit_move_segments
Supports segment register moving
2020-06-16 10:47:17 +03:00
Stefanos Kornilios Mitsis Poiitidis 88d78e6664 Merge pull request #233 from Sonicadvance1/armv8_0_atomics
Implements atomic ops for ARMv8.0 devices
2020-06-16 10:46:12 +03:00
Stefanos Kornilios Mitsis Poiitidis cc2f994956 Merge pull request #237 from Sonicadvance1/32bit_opdispatcher
Supports 32bit operating mode in the OpDispatcher
2020-06-16 10:45:13 +03:00
Stefanos Kornilios Mitsis Poiitidis 06ece0402b Merge pull request #238 from Sonicadvance1/remove_debug_log
Remove a debug log from the AArch64 JIT
2020-06-16 10:43:08 +03:00
Ryan Houdek 2acf22f15b Fixes cvtps2dq instruction
This must of have been a copy and paste error, I didn't even have this
instruction on my list of implemented instructions.
It definitely isn't converting to a GPR
2020-06-15 20:25:13 -07:00
Ryan Houdek ea85c70daf Remove a debug log from the AArch64 JIT
These keep sneaking back in when I'm testing
2020-06-14 14:35:53 -07:00
Stefanos Kornilios Mitsis Poiitidis 77b63760be Merge pull request #235 from Sonicadvance1/32bit_remove_64bit_size
Removes 64bit size from frontend when in 32bit mode
2020-06-14 03:15:48 +03:00
Ryan Houdek fc777887f4 Supports 32bit operating mode in the OpDispatcher
Pretty basic for the most part, just changes default operating mode for
most everything from 64bit to 32bit.
2020-06-12 19:27:43 -07:00
Ryan Houdek c2bd346297 Supports segment register moving
32bit apps are setting GS register that I saw.
64Bit applications can also technically use these instructions but it
has some major limitation that causes applications to never use them
2020-06-12 18:49:29 -07:00
Ryan Houdek 5b9de1675f Removes 64bit size from frontend when in 32bit mode
64bit mode doesn't exist when we are operating in 32bit mode, so this
needs to be disabled.
This forces a fallback to a 32bit size for those ops
2020-06-12 15:19:40 -07:00
Ryan Houdek 7bfe127fcb Ensures the core saves the entry cache to the correct folder
We should store this in XDG_CACHE_HOME, not DATA_HOME.
Also fallback the HOME and PWD directories correctly
2020-06-12 15:08:16 -07:00
Ryan Houdek 53c46312ff Implements atomic ops for ARMv8.0 devices
These can only be implemented as acquire/release exclusive loops on
ARMv8.0 so they end up looking pretty disgusting.
This is more for compatibility for testing than anything. I'm not
expecting ANY ARMv8.0 device to get decent performance
2020-06-12 15:06:36 -07:00
Ryan Houdek b262b59916 Fixes up prefix handling for 32bit
Moves REX to a 64bit only table entry. This allows the missing INC/DEC
instructions to exist in 32bit space
2020-06-10 16:49:06 -07:00