rpcsx/rpcs3/Emu/RSX
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
..
Capture Improve bitwise serialization trait 2021-06-11 16:54:17 +03:00
Common PPU LLVM arm64+macOS port (#12115) 2022-06-14 15:28:38 +03:00
GL gl: Disallow overlapping binding points 2022-06-05 10:13:41 +03:00
Null Remove BOM markers 2020-12-06 15:30:12 +03:00
Overlays Overlays: Add screenshot message to queue 2022-05-26 08:52:12 +02:00
Program glsl: Avoid implicit int->uint conversions (#12220) 2022-06-12 18:05:43 +01:00
VK vk: Fix image view search and destroy 2022-06-09 02:13:55 +03:00
display.h Remove BOM markers 2020-12-06 15:30:12 +03:00
GCM.h rsx: Resurgence of HLE GCM 2022-06-06 12:56:25 +02:00
gcm_enums.cpp Warning Fixes 2022-03-23 19:35:10 +01:00
gcm_enums.h rsx: Rework how depth/stencil initialization+clear works 2021-09-21 19:53:46 +03:00
gcm_printing.cpp Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
gcm_printing.h Introducing RSX debugger entry (main debugger) 2021-01-19 22:55:12 +03:00
GSFrameBase.h scale debug overlay based on current dpi settings 2021-05-26 20:31:29 +02:00
GSRender.cpp More random changes 2021-04-11 14:01:51 +03:00
GSRender.h More random changes 2021-04-11 14:01:51 +03:00
rsx_cache.h rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +03:00
rsx_decode.h More random changes 2021-04-11 14:01:51 +03:00
rsx_methods.cpp rsx: Improve Null Renderer 2022-06-12 20:54:42 +03:00
rsx_methods.h rsx: refactor rsx_utils a bit 2021-09-28 17:43:15 +03:00
rsx_utils.cpp rsx: Add some sensible fallbacks (#11219) 2021-12-02 16:02:08 +03:00
rsx_utils.h rsx: Surface format remapping enhancements 2022-01-17 10:28:23 +03:00
rsx_vertex_data.cpp rsx: Properly implement immediate mode rendering 2021-11-15 18:14:15 +03:00
rsx_vertex_data.h rsx: Properly implement immediate mode rendering 2021-11-15 18:14:15 +03:00
RSXDisAsm.cpp RSX-Debugger: Implement backwards scrolling 2022-04-15 22:34:51 +03:00
RSXDisAsm.h RSX-Debugger: Implement backwards scrolling 2022-04-15 22:34:51 +03:00
RSXFIFO.cpp rsx: Minor fixup (#12165) 2022-06-04 15:04:27 +01:00
RSXFIFO.h rsx: Implement atomic FIFO fetching (stability improvement) (non-default setting) (#12107) 2022-06-04 15:35:06 +03:00
RSXOffload.cpp rsx: Optimize thread self-tests 2021-09-28 17:43:15 +03:00
RSXOffload.h Implement fill_array() utility 2021-04-19 12:33:32 +03:00
RSXTexture.cpp rsx: Rework gamma override mask from RGBA to ARGB to match other per-channel mask registers 2021-08-30 11:41:19 +03:00
RSXTexture.h Implement fill_array() utility 2021-04-19 12:33:32 +03:00
RSXThread.cpp rsx: Improve Null Renderer 2022-06-12 20:54:42 +03:00
RSXThread.h rsx: Resurgence of HLE GCM 2022-06-06 12:56:25 +02:00
RSXZCULL.cpp rsx: Asynchronously flush the pipelines when handing ZCULL memory access violations 2022-05-21 10:06:32 +03:00
RSXZCULL.h rsx: Improve sync_hint callback interface 2022-05-20 16:29:27 +03:00