Commit graph

34 commits

Author SHA1 Message Date
Exzap
25794f70fa PPCRec: Added dump option for recompiled functions + more fixes 2025-04-26 00:24:42 +02:00
Exzap
aa946ae42d PPCRec: Add RA support for instructions with register constraints
Also make interval tracking more fine grained and differentiate between input and output edges of each instruction
2025-04-26 00:22:37 +02:00
Exzap
675c802cc1 PPCRec: Simplify RA code and clean it up a bit 2025-04-26 00:22:37 +02:00
Exzap
f55b842773 PPCRec: Dead code elimination + reintroduce pre-rework optimizations 2025-04-26 00:22:37 +02:00
Exzap
1cc458c543 PPCRec: Implement MFCR and MTCRF 2025-04-26 00:22:37 +02:00
Exzap
9dd4f9b9a3 PPCRec: FPRs now use the shared register allocator 2025-04-26 00:22:37 +02:00
Exzap
c891abcb74 PPCRec: Partial support for typed registers in RA 2025-04-26 00:22:37 +02:00
Exzap
e9c161c508 PPCRec: Initial support for typed registers 2025-04-26 00:22:37 +02:00
Exzap
acfc27f9fc PPCRec: Use IMLReg type in FPR RA 2025-04-26 00:22:36 +02:00
Exzap
ce9a48b987 PPCRec: Rework CR bit handling
CR bits are now resident in registers instead of being baked into the instruction definitions. Same for XER SO, and LWARX reservation EA and value.

Reworked LWARX/STWCX, CRxx ops, compare and branch instructions. As well as RC bit handling. Not all CR-related instructions are reimplemented yet.

Introduced atomic_cmp_store operation to allow implementing STWCX in architecture agnostic IML

Removed legacy CR-based compare and jump operations
2025-04-26 00:22:36 +02:00
Exzap
db1f9c162f PPCRec: Avoid complex optimizations in backend
It's better to do it in a lowering pass so that the backend code can be kept as simple as possible
2025-04-26 00:22:36 +02:00
Exzap
f305a2ba17 PPCRec: Rework carry bit and generalize carry IML instructions
Carry bit is now resident in a register-allocated GPR instead of being backed directly into IML instructions

All the PowerPC carry ADD* and SUB* instructions as well as SRAW/SRAWI have been reworked to use more generalized IML instructions for handling carry

IML instructions now support two named output registers instead of only one (easily extendable to arbitrary count)
2025-04-26 00:22:36 +02:00
Exzap
a51a8bb7d5 PPCRec: New compare and cond jump instrs, update RA
Storing the condition result in a register instead of imitating PPC CR lets us simplify the backend a lot. Only implemented as PoC for BDZ/BDNZ so far.
2025-04-26 00:22:36 +02:00
Exzap
53436f1c79 PPCRec: Rename register constants to avoid name collision 2025-04-26 00:22:36 +02:00
Exzap
d420622da7 PPCRec: Make register pool for RA configurable 2025-04-26 00:22:35 +02:00
Exzap
f2a07ade4c PPCRec: Fix merge conflicts 2025-04-26 00:22:35 +02:00
Exzap
e1e710e3f5 PPCRec: Reworked IML builder to work with basic-blocks
Intermediate commit while I'm still fixing things but I didn't want to pile on too many changes in a single commit.
New:
Reworked PPC->IML converter to first create a graph of basic blocks and then turn those into IML segment(s). This was mainly done to decouple IML design from having PPC specific knowledge like branch target addresses. The previous design also didn't allow to preserve cycle counting properly in all cases since it was based on IML instruction counting.
The new solution supports functions with non-continuous body. A pretty common example for this is when functions end with a trailing B instruction to some other place.

Current limitations:
- BL inlining not implemented
- MFTB not implemented
- BCCTR and BCLR are only partially implemented

Undo vcpkg change
2025-04-26 00:22:35 +02:00
Exzap
0622631868 PPCRec: Move X64 files into subdirectory and rename 2025-04-26 00:22:35 +02:00
Exzap
da08eda506 PPCRec: Emit x86 movd for non-AVX + more restructuring 2025-04-26 00:22:35 +02:00
Exzap
faf6c17438 PPCRec: Rename IML structs for better clarity 2025-04-26 00:22:34 +02:00
Exzap
d42ea6e5a8 PPCRec: Use vector for segment list + deduplicate RA file 2025-04-26 00:22:34 +02:00
goeiecool9999
eaa82817dd
Update thread names (#1120) 2024-03-15 23:06:48 +01:00
Exzap
f04c7575d7 coreinit: Handle non-existing modules in OSDynLoad_Acquire
Fixes Togabito crashing on boot

coreinit: Handle non-existing modules in OSDynLoad_Acquire
2023-09-14 20:52:40 +02:00
Exzap
2200cc0ddf
Initial support for title switching + better Wii U menu compatibility (#907) 2023-07-21 13:54:07 +02:00
Crementif
d903b2cf12
Remove deprecated logging system and expose developer logging window (#825) 2023-05-20 02:46:12 +02:00
why-keith
caa57a3cfd
Logging migration (forceLogDebug_printf) (#780)
* script changes - no arguments

* script changes with 2 arguments

* script changes with > 2 arguments

* script conversions with 1 argument - pt. 1

* script conversions with 1 argument - pt. 2

* script conversions with 1 argument - pt. 3

* script conversions with 1 argument - pt. 4

* script conversions with 1 argument - pt. 5

Pointer format hunting

* Fixed pointer format

* script conversions with 1 argument - final

* fixed conversion in non utf-8 file

* fixed conversion with capital letter

* actually fixed conversion with capital letter

* fixed another capital lettering issue

* Added conversions with LR removed

* removed LR from logs

* Converted logs that previously contained LR

* converted log that originally specified string length

* fixed log with commas in main text

* fixed multi-line log

* Fixed more logs with commas in main text

* Fixed unformatted pointer

* added conversion with float value

* converted lines with double parameters

* converted missed line

* corrected argument formatting

Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com>

* Fixed misspellings of "unhandled"

unhandeled -> unhandled

Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com>

---------

Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com>
2023-04-25 08:43:31 +02:00
why-keith
4be57f4896
Migrate force_log_printf to new logging (#714) 2023-04-12 16:31:34 +02:00
Exzap
2c81d240a5
Make codebase more CPU-agnostic + MacOS disclaimer (#559) 2022-12-07 01:48:24 +01:00
Exzap
028b3f7992
Make controller button code thread-safe (#405)
* Refactor spinlock to meet Lockable requirements
* Input: Refactor button code and make it thread-safe
2022-10-23 15:47:42 +02:00
Exzap
3bceb39966
Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)
Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
2022-09-24 08:43:27 +02:00
Tom Lally
d3a7b3b5a6
Misc. Linux improvements and bug fixes. (#121)
Co-authored-by: Tom Lally <tomlally@protonmail.com>
2022-09-01 20:46:20 +02:00
Crementif
ca78b92718
Remove cemuhook and fix exports (#73) 2022-08-26 19:41:42 +02:00
Marcin Chojnacki
974edaa649
Initial macOS port bringup (#52) 2022-08-26 04:03:26 +02:00
Exzap
d60742f52b Add all the files 2022-08-22 22:21:23 +02:00