rpcsx/rpcs3/Emu/Cell
Jeff Guo cefc37a553
PPU LLVM arm64+macOS port (#12115)
* BufferUtils: use naive function pointer on Apple arm64

Use naive function pointer on Apple arm64 because ASLR breaks asmjit.
See BufferUtils.cpp comment for explanation on why this happens and how
to fix if you want to use asmjit.

* build-macos: fix source maps for Mac

Tell Qt not to strip debug symbols when we're in debug or relwithdebinfo
modes.

* LLVM PPU: fix aarch64 on macOS

Force MachO on macOS to fix LLVM being unable to patch relocations
during codegen. Adds Aarch64 NEON intrinsics for x86 intrinsics used by
PPUTranslator/Recompiler.

* virtual memory: use 16k pages on aarch64 macOS

Temporary hack to get things working by using 16k pages instead of 4k
pages in VM emulation.

* PPU/SPU: fix NEON intrinsics and compilation for arm64 macOS

Fixes some intrinsics usage and patches usages of asmjit to properly
emit absolute jmps so ASLR doesn't cause out of bounds rel jumps. Also
patches the SPU recompiler to properly work on arm64 by telling LLVM to
target arm64.

* virtual memory: fix W^X toggles on macOS aarch64

Fixes W^X on macOS aarch64 by setting all JIT mmap'd regions to default
to RW mode. For both SPU and PPU execution threads, when initialization
finishes we toggle to RX mode. This exploits Apple's per-thread setting
for RW/RX to let us be technically compliant with the OS's W^X
    enforcement while not needing to actually separate the memory
    allocated for code/data.

* PPU: implement aarch64 specific functions

Implements ppu_gateway for arm64 and patches LLVM initialization to use
the correct triple. Adds some fixes for macOS W^X JIT restrictions when
entering/exiting JITed code.

* PPU: Mark rpcs3 calls as non-tail

Strictly speaking, rpcs3 JIT -> C++ calls are not tail calls. If you
call a function inside e.g. an L2 syscall, it will clobber LR on arm64
and subtly break returns in emulated code. Only JIT -> JIT "calls"
should be tail.

* macOS/arm64: compatibility fixes

* vm: patch virtual memory for arm64 macOS

Tag mmap calls with MAP_JIT to allow W^X on macOS. Fix mmap calls to
existing mmap'd addresses that were tagged with MAP_JIT on macOS. Fix
memory unmapping on 16K page machines with a hack to mark "unmapped"
pages as RW.

* PPU: remove wrong comment

* PPU: fix a merge regression

* vm: remove 16k page hacks

* PPU: formatting fixes

* PPU: fix arm64 null function assembly

* ppu: clean up arch-specific instructions
2022-06-14 15:28:38 +03:00
..
lv2 PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
Modules cellAudioOut: properly implement downMixer 2022-06-09 18:59:13 +02:00
Common.h PPU: implement accurate FRES 2022-05-11 10:46:08 +03:00
ErrorCodes.h Improve error_code (new formatting constructor) 2021-05-19 22:41:16 +03:00
MFC.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
MFC.h SPU debugger: Implement MFC journal 2021-03-02 21:57:51 +03:00
PPCDisAsm.h GUI Utilities: Implement instruction search, PPU/SPU disasm improvements (#10968) 2021-10-12 23:12:30 +03:00
PPUAnalyser.cpp PPU LLVM: allow to drop setting SAT flag (optimization, module-wide) 2021-12-03 00:14:06 +03:00
PPUAnalyser.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUCallback.h Fix HLE callbacks within context of HLE PPU stack variables 2021-06-28 14:31:28 +03:00
PPUDisAsm.cpp SPU DisAsm: Force decimal point insertion for constant floats 2021-10-30 21:33:06 +02:00
PPUDisAsm.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUFunction.cpp Remove built_function 2022-01-24 22:21:41 +03:00
PPUFunction.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUInterpreter.cpp Enable ppu_feed_data in PPU Interpreter 2022-06-07 15:24:50 +03:00
PPUInterpreter.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUModule.cpp Implements sys_fs_fcntl 0xC0000008 & 0xC000001A (#11957) 2022-06-11 13:12:42 +01:00
PPUModule.h Add stubs. 2022-04-10 18:28:57 +02:00
PPUOpcodes.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUThread.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
PPUThread.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
PPUTranslator.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
PPUTranslator.h PPU: implement accurate FRES 2022-05-11 10:46:08 +03:00
RawSPUThread.cpp SPU/PPU Loader: Implement linker/PS3 compiler executable files loading 2022-05-03 20:47:36 +03:00
RawSPUThread.h Migration to named_thread<> 2018-10-19 22:22:35 +03:00
SPUAnalyser.cpp Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPUAnalyser.h Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
SPUASMJITRecompiler.cpp SPU: Implement timer freezing ability 2022-05-14 22:03:47 +03:00
SPUASMJITRecompiler.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPUDisAsm.cpp Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPUDisAsm.h SPU DisAsm: Print SPU floats 2021-10-29 19:15:21 +02:00
SPUInterpreter.cpp Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPUInterpreter.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPUOpcodes.h Initial Linux Aarch64 support 2022-01-15 06:48:04 +03:00
SPURecompiler.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
SPURecompiler.h Remove built_function 2022-01-24 22:21:41 +03:00
SPUThread.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
SPUThread.h RawSPU: Reinvoke pending interrupts if missed 2022-05-25 11:46:51 +03:00
timers.hpp sys_rsxaudio: Initial implementation (#11907) 2022-05-05 15:47:44 +02:00