Commit graph

531 commits

Author SHA1 Message Date
Megamouse 3c576da42f Move debugger functions to emu_utils.cpp 2025-02-25 19:45:43 +01:00
RipleyTom cd87a64621 Headers cleanup 2025-02-11 20:38:35 +01:00
Elad 575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
Elad 926de68a79 Debugger: Dump related thread information on crash 2024-11-28 13:32:52 +02:00
Elad b073d08a52 LLVM: Implement Recursive Intrinsics 2024-11-23 20:22:58 +02:00
Malcolm Jestadt 967adaf9db SPU LLVM: Compute frest exponent at runtime rather than using the lookup table
- Provides a small speedup and smaller codesize
2024-10-05 20:44:23 +03:00
Malcolm Jestadt 8ca60df1ab SPU LLVM: Add optimized path for spu_re_acc special cases
- Uses vfixupimmps (AVX-512), 5 instructions down to 1
2024-10-05 20:44:23 +03:00
Megamouse 4c3d243672 MacOs/Arm64: Fix warning 2024-09-23 23:00:58 +02:00
kd-11 7353696014 cpu: Format additions to sse2neon to match the rest of the file 2024-09-04 07:49:49 +03:00
kd-11 a60eab6e36 aarch64: Fix compilation for windows-on-arm 2024-09-04 07:49:49 +03:00
kd-11 c80342e8d4 aarch64: Support calloc patch blocks 2024-08-31 13:55:58 +03:00
kd-11 f367703574 Use sysctlbyname 2024-08-25 22:04:45 +03:00
kd-11 8c64192ac7 Implement basic system info detection on macos using sysctl 2024-08-25 22:04:45 +03:00
kd-11 470f8674df aarch64 - Support for apple exceptions 2024-08-24 14:13:14 +03:00
kd-11 4da30e9eca Add proper transform pass management 2024-08-24 14:13:14 +03:00
kd-11 09ea858dbf Minor fixes 2024-08-24 02:07:00 +03:00
kd-11 94b6e4598c Fix aarch64 compilation on macOS 2024-08-24 02:07:00 +03:00
kd-11 f5173ca9bf aarch64 - Decode CPU brand information 2024-08-24 02:07:00 +03:00
Elad Ashkenazi 1c16ada670 Debugger: Pointer comparison bugfix 2024-08-22 12:21:55 +03:00
kd-11 042a5481ca Formatting 2024-08-21 16:16:28 +03:00
kd-11 4bb79b6c31 Rework aarch64 signal handling 2024-08-21 16:16:28 +03:00
kd-11 d0dbdb1ab5 Fix hang when compiling leaf blocks 2024-08-20 05:18:53 +03:00
kd-11 fbcd8e32b8 Cleanup 2024-08-18 18:27:52 +03:00
kd-11 ca4fa1ac74 Use return-oriented trap approach 2024-08-18 18:27:52 +03:00
kd-11 fc415cf32a Move to a assembler wrapper for injected asm to better handle dependencies 2024-08-18 18:27:52 +03:00
kd-11 2faa61ac31 Refactor aarch64 JIT code 2024-08-18 18:27:52 +03:00
Elad Ashkenazi d0ebba6c5e CELL: New reservation notifications mechanism 2024-08-14 11:53:00 +03:00
kd-11 0b62385ddb aarch64/llvm: Handle processing of leaf nodes 2024-08-13 18:25:26 +03:00
kd-11 3ef8046f5c rsx: Fix fragment constants decoding for non-x86 platforms 2024-08-09 15:09:26 +03:00
kd-11 1200bbe7cc Address review comments 2024-08-08 13:40:07 +03:00
kd-11 294bebb4a7 Fix SPU compilation 2024-08-08 13:40:07 +03:00
kd-11 42d47b61a0 Fix dependency injection on terminators 2024-08-08 13:40:07 +03:00
kd-11 7979c5d9eb Finalize PPU migration to the frame pass system 2024-08-08 13:40:07 +03:00
kd-11 cba658baba Complete PPU support 2024-08-08 13:40:07 +03:00
kd-11 34549445a8 Migrate PPU to post-process execution model 2024-08-08 13:40:07 +03:00
kd-11 a976ac3353 jit: Add aarch64 JIT backend for pre-codegen transforms 2024-08-08 13:40:07 +03:00
kd-11 56cc5d9355 Initial PPU LLVM implementation for aarch64 2024-08-08 13:40:07 +03:00
kd-11 3e7c1e207d Add fallback CPU detection when llvm is not aware of the CPU model 2024-08-03 21:35:10 +03:00
Elad Ashkenazi faabb9e111 Add SPU usage for program dump 2024-07-28 12:36:42 +03:00
Elad Ashkenazi c71edc0719 Remove check_state() inside thread notifiatios
This was a flawed concept due to risk of deadlocks.
Worst case some we will focus o performanc regressins indvidually as we should and not accept this bug.
2024-06-29 14:02:12 +03:00
Megamouse 25ce3880c4 Replace get_thread_class with static cast for performance reasons 2024-05-18 16:16:08 +02:00
Megamouse 10d85d4f51 CPUThread: remove m_class member due to bad ppu cache design 2024-05-18 16:16:08 +02:00
Megamouse dfee5b9a6c threads: replace magic number id_type with thread_class 2024-05-18 16:16:08 +02:00
Elad Ashkenazi 6d8575d0d0 Savestates: Warn on invalid SPU save state 2024-05-14 19:36:48 +03:00
Eladash bef832f4e0 llvm_calli fix 2024-05-04 14:15:51 +03:00
Eladash 6b906b9a9c Fixup SPU Profiler 2024-05-04 14:15:51 +03:00
oltolm 9e9a3262eb simplify template code like std::is_same<T>::value 2024-04-21 18:15:17 +03:00
Eladash 7833862342 Add SPU Profiler to GUI 2024-04-13 13:48:00 +03:00
Eladash 78c1a6f326 CPUThread.cpp: Add reservation sampling 2024-04-13 13:48:00 +03:00
oltolm c567c92d4b fix GCC warnings 2024-03-28 08:45:20 +01:00