Commit graph

85 commits

Author SHA1 Message Date
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
Nekotekina 8a029159cd PPU Analyser: compile certain functions on per-instruction basis
PPU LLVM: optimize small blocks
2021-02-01 11:30:50 +03:00
Nekotekina 891ebd0cb1 PPU Analyser: use reloc info (disabled for now)
Add blocks from relocations.
2021-02-01 11:30:50 +03:00
Nekotekina f9ee8978ff PPU LLVM: improve analyser
Compile possibly executable holes between detected functions.
Add unused "PPU LLVM Greedy Mode" option (for future updates).
Add "nounwind" attribute to compiled functions (reduces size).
2021-02-01 11:30:50 +03:00
Nekotekina db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Eladash 7eb16e13bb PRX loader: Fix libfs_155.sprx loading
Fix relocations' segments referencing when there are "empty" (memsize=0) LOAD segments.
2020-12-15 11:16:45 +03:00
Nekotekina 65c04e4ddd Remove constexpr from ppu/spu decoders.
We don't need them at compile time (yet).
But can reduce compile time and complexity.
2020-12-10 15:06:01 +03:00
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +03:00
Nekotekina 1c99a2e7fb vm: add map_self() method to utils::shm
Add complementary unmap_self() method.
Move VirtualMemory to util/vm.hpp
Minor associated include cleanup.
Move asm.h to util/asm.hpp
2020-11-08 16:43:15 +03:00
Eladash 5960de2e20 PPUAnalyzer: Check if TOC from OPD is a valid address 2020-04-19 10:56:42 +01:00
Nekotekina b1b67a13c6 Revert "Replace rotate utils with std::rotl" (partial)
This reverts commit 4d8bfe328b.
2020-04-14 19:45:53 +03:00
Nekotekina 4d8bfe328b Replace rotate utils with std::rotl
More include cleanup.
2020-04-14 16:05:58 +03:00
Nekotekina d0c199d455 Replace utils::cnttz{32,64} with std::countr_{zero,one}
Make #include <bit> mandatory.
2020-04-14 16:05:58 +03:00
Nekotekina fa29c5aa94 ppu_iname: refactor to use actual strings 2020-03-26 15:28:41 +03:00
Nekotekina 1ceb779a38 Make ppu_decoder<> objects constexpr (partial) 2020-03-24 13:46:46 +03:00
Nekotekina 04dedb17eb Disable exception handling.
Use -fno-exceptions in cmake.
On MSVC, enable _HAS_EXCEPTION=0.
Cleanup throw/catch from the source.
Create yaml.cpp enclave because it needs exception to work.
Disable thread_local optimizations in logs.cpp (TODO).
Implement cpu_counter for cpu_threads (moved globals).
2020-03-12 16:03:08 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Nekotekina 771eff273b First part of fixing sign-compare warning (inside be_t). 2020-02-19 22:54:58 +03:00
Nekotekina 327bb2d8f0 Modernize PPU logging (ppu_log variable) 2020-02-01 11:52:24 +03:00
Nekotekina 3eca2d5d6c Remove legacy LOADER log channel 2020-02-01 07:49:38 +03:00
Nekotekina ad9c9f0183 C-style cast cleanup II 2019-11-30 18:17:45 +03:00