rpcsx/rpcs3/Emu/RSX/Common
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
..
bitfield.hpp rsx: Separate loop interrupts from graphics state 2022-05-20 16:29:27 +03:00
buffer_stream.hpp Minor AArch64 support changes 2022-05-04 16:12:32 +03:00
BufferUtils.cpp PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
BufferUtils.h rsx: Relocatable transform constants 2022-03-26 16:10:18 +03:00
profiling_timer.hpp rsx: Reduce the performance impact of enabling the profiling timer 2022-03-08 22:06:26 +03:00
ranged_map.hpp Fix ambiguous comparison operator warning 2022-03-23 11:26:06 +03:00
ring_buffer_helper.h RSX: fix 'Working buffer not big enough' 2021-07-27 23:59:12 +02:00
simple_array.hpp rsx: Allocate scratch memory using simple array with no default initialize 2022-05-31 23:34:14 +03:00
surface_store.cpp Move align helpers to util/asm.hpp 2020-12-18 18:07:42 +03:00
surface_store.h Update libusb to v1.0.26 2022-04-29 02:04:52 +02:00
surface_utils.h rsx: Unconditionally set MSAA flags if MSAA is active 2022-03-11 01:15:13 +03:00
TextGlyphs.h More random changes 2021-04-11 14:01:51 +03:00
texture_cache.cpp rsx: Avoid unnecessary memprotect syscalls 2022-03-29 12:35:32 +03:00
texture_cache.h Update libusb to v1.0.26 2022-04-29 02:04:52 +02:00
texture_cache_checker.h types.hpp: implement min_v<>, max_v<>, SignedInt, UnsignedInt, FPInt concepts 2021-05-23 19:43:51 +03:00
texture_cache_helpers.h rsx: Reduce log spam a bit 2022-03-28 19:55:34 +03:00
texture_cache_predictor.h Put std::hash specialization out of std 2021-12-07 13:04:10 +03:00
texture_cache_types.h rsx: Minor refactoring (#10358) 2021-05-27 23:44:07 +01:00
texture_cache_utils.h rsx: Disable ref count on exit 2022-03-28 19:55:34 +03:00
TextureUtils.cpp rsx: Allocate scratch memory using simple array with no default initialize 2022-05-31 23:34:14 +03:00
TextureUtils.h rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +03:00
time.hpp rsx: Lower performance hit due to frequency fetch 2022-05-20 16:29:27 +03:00