Commit graph

106 commits

Author SHA1 Message Date
Elad 63147fdede Remove ppu_acontext 2025-02-11 16:12:33 +02:00
Elad 9a7b8e41eb PPU Analyzer: Minor Fixup 2025-02-09 14:28:08 +02:00
Elad c7e853bf99 PPU Analyzer: GPR-assisted jump table analysis 2025-02-07 20:27:17 +02:00
Elad ac97b36b1c PPU Analyzer: Opt-out suspected floats from instruction stream 2025-02-07 20:27:17 +02:00
Elad 181c92a868 PPU Analyzer: Clean addr_heap fron non-valid code
Should speed up analysis in some cases.
2025-02-07 20:27:17 +02:00
Elad 2420aa7a21 Fixup PPU block unfolding 2025-02-04 20:33:24 +02:00
Megamouse 3187dc816e Fix some warnings 2025-02-02 17:06:39 +01:00
Elad 57b6ced957 PPU Analyzer: Fix per-instruction code submission 2025-01-31 13:01:53 +02:00
Elad ba79e092a0 Protect RPCS3 from built-in PS2 emulator 2025-01-25 12:47:44 +02:00
Elad b46408d554 PPU Analyzer: Report invalid functions 2025-01-25 12:47:44 +02:00
Elad 58701000cd PPU Analyzer: Clean addr_heap from non-relocations (PRX) 2025-01-25 12:47:44 +02:00
Elad 5a5e475c6e PPU Analyzer: Move ppu_function::callers to lower sizeof(ppu_function) 2025-01-25 12:47:44 +02:00
Elad ff89a08ee4 PPU Analyzer: Remove ppu_function::calls to lower sizeof(ppu_function)
Use blocks to get calls.
2025-01-25 12:47:44 +02:00
Elad f5487e9137 PPU Analyzer: Use std::map::extract to reduce peak memory consumption 2025-01-25 12:47:44 +02:00
Elad f0fa8e3bc3 Remove ppu_attr::known_addr 2025-01-25 12:47:44 +02: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
oltolm 2b0f786b2d
Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Elad Ashkenazi 6fff22391c PPU Analyzer: Utilize exported functions 2024-06-08 14:09:37 +03:00
Elad Ashkenazi 721e55458c PPU Analyzer: Fixes 2024-06-08 14:09:37 +03:00
Elad Ashkenazi 8fa23436f9 PPU Analyzer: Unuse per-instruction compilation on fallback 2024-05-30 11:41:24 +03:00
Eladash c7d93bd470 PPU Analyzer: Look for functions using callers (fallback) 2024-04-19 20:51:37 +03:00
Megamouse 59c58aa3cf fix some warnings 2023-12-30 19:07:35 +01:00
Eladash 1e1d6f6437 PPU Analyzer: Fixup 2023-09-22 10:03:51 +03:00
Eladash d399bd5b6a PPU Analyzer: Another fixup 2023-09-10 18:58:34 +03:00
Elad Ashkenazi 52495c17d6
PPU Analyzer: Fixup 2023-09-06 06:53:10 +03:00
Eladash a02c168a0d PPU Analyzer: Fixup greedy instruction search 2023-09-05 06:20:57 +03:00
Elad Ashkenazi ea57984912
SPU LLVM: Fill space between functions using targets (Precompilation)
* Revert "PPU Analyzer: Revert TRAP detection change"
2023-09-02 15:56:34 +03:00
Eladash deacf76ca4 PPU Analyzer: Revert TRAP detection change 2023-09-02 12:31:11 +03:00
Eladash be0a789e7d PPU Analyzer: Fix OPD section validation 2023-08-27 02:11:01 +03:00
Eladash 82c5c4d285 PPU Analyzer: Analyze whole segment 0 when patches are applied
Improve greedy instruction search.
2023-08-25 12:52:02 +03:00
Eladash 756ab1191e PPU Analyzer: Fix for unaligned sections 2023-08-23 10:14:29 +03:00
Eladash cdc0441405 PPU: Fixup interpreter and analyzer 2023-08-08 10:22:05 +03:00
Eladash 91b68f3b45 PPU Analyzer: Fixup verify_func 2023-08-07 06:48:44 +03:00
Eladash c96f3a877f PPU Analyzer: Add more function constraints 2023-08-06 21:37:10 +03:00
Eladash ee869a49f4 PPU Precompilation Fixup 2023-08-06 10:38:40 +03:00
Eladash 99671b754f Add ppu_module::get_ref() to ease debugging 2023-07-23 17:58:54 +03:00
Eladash 554b27a82a PPU LLVM: Implement SELF precompilation
Do not use PS3 memory for precompilation.
2023-06-28 18:34:33 +03:00
Megamouse d662a39a12 PPUAnalyser: fix std::move nonsense 2023-06-14 11:05:00 +03:00
Eladash 0e388639cc Loader: Make executable analyzation not halt UI when launching games 2023-04-12 15:18:50 +03:00
Eladash 1dd1062be1 PPU LLVM: Fix HLE function injection 2022-08-21 15:02:01 +03:00
Nekotekina c9d8e59dbf PPU LLVM: allow to drop setting SAT flag (optimization, module-wide)
Implement ppu_attr::has_mfvscr (partially, module-wide search).
If this instruction isn't found, allow to drop setting SAT flag.
It's based on presumption that only MFVSCR can retrieve SAT flag.
2021-12-03 00:14:06 +03:00
Eladash fafefb2cf5 Fixup No.3 after #10779 2021-09-10 11:46:39 +03:00
Eladash b40ed5bdb7
Patches/PPU: Extend and improve patching capabilities (code allocations, jumps to any address) (#10779)
* Patches/PPU: Implement dynamic code allocation + Any-Address jump patches

Also fix deallocation path of fixed allocation patches.
2021-09-01 13:38:17 +03:00
Nekotekina 160b131de3 types.hpp: implement smin, smax, amin, amax
Rewritten the following global utility constants:
`umax` returns max number, restricted to unsigned.
`smax` returns max signed number, restricted to integrals.
`smin` returns min signed number, restricted to signed.
`amin` returns smin or zero, less restricted.
`amax` returns smax or umax, less restricted.

Fix operators == and <=> for synthesized rel-ops.
2021-05-22 12:10:57 +03:00
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Nekotekina 0057c89eaa PPU Analyser: follow fallbacks in some cases
Fallback is an "invisible" branch to the next instruction.
This may be necessary for certain cases when patches are used.
2021-02-07 11:02:45 +03:00
Nekotekina 9e9a55df46 PPU LLVM: compile instructions from patches
For now, only as a single instruction at a time.
2021-02-07 11:02:31 +03:00
Nekotekina 9463238490 PPU Analyser: minor fixups for end pointer
Add more sanity checks for sections.
Remove some redundancy.
2021-02-07 11:02:31 +03:00
Nekotekina 58eef983e2 PPU Analyser: fix constraints for all elfs.
Added for main executable and OVLs.
Forgot to use it not just for SPRX.
2021-02-01 19:14:24 +03:00
Nekotekina d5f16ce272 PPU Analyser: better constraints for SPRX 2021-02-01 11:30:50 +03:00