Commit Graph

154 Commits (365f1aa9beaab1381b18cdd95e2a21bf5704fff8)

Author SHA1 Message Date
Stenzek 365f1aa9be
CPU: Implement breakpoints in the recompiler
Both cop0 execution and debug breakpoints.
1 day ago
Stenzek 24ecfdd94f
Misc: Use C++23 elifdef/elifndef
And drop macros for platforms not supported in the public repo.
3 days ago
Stenzek cbe7951be6
CPU/CodeCache: Remove thread_local recursive guard
I previously had this in PageFaultHandler::ExceptionHandler(),
but it was causing random strange crashes in XTAJIT (Windows
ARM64 x86 emulation layer). Seems like some threads were being
created and triggering exceptions before the TLS storage was
initialized. Very strange. Anyway, best to just avoid that
completely, since apparently you can't guarantee that the TLS
will be initialized at the point a VEH runs.
2 weeks ago
Stenzek 83a03fe955
CPU/CodeCache: Assert that handlers execute on core thread
And fastmem exceptions come from within the code buffer.
1 month ago
Stenzek e175c84227
Bus: Pack state in struct 2 months ago
Stenzek 53c4176a17
CPU/CodeCache: Don't skip filling backprop for first instruction 5 months ago
Stenzek abf3b8cc0f
CPU/CodeCache: Move JIT write protect out of MemMap
Gets rid of the TLS variable, and lazily enables it.

Fixes crash on Apple Silicon, regression from
5de2b77d04.
5 months ago
Stenzek f9254e23f0
CPU/CodeCache: Pack state in struct 5 months ago
Stenzek 0a816b6576
CPU/CodeCache: Fix blocks ending up perpetually in interpreter fallback
Only would have triggered with rewind/runahead.
5 months ago
Stenzek 2af1cd6409
CPU/CodeCache: lwc2/swc2 should not read rt in backprop 5 months ago
Stenzek 5de2b77d04
CPU/CodeCache: Fix redundant begin/end code write 5 months ago
Stenzek 739b0734bc
CodeCache: Don't try to handle page faults when shutting down 9 months ago
Stenzek 7de367fc2b
CPU/Recompiler: Remove unused function pointer 1 year ago
Stenzek 0479500357
CPU: Correctly mask upper 1.5GB of KUSEG
Stops fastmem going into a loop when trying to backpatch accesses
above 512MB.
1 year ago
Stenzek 3687697d0e
CPU/CodeCache: Only reset used portion of buffer
Saves writing 48MB every reset.
2 years ago
Stenzek ffef0c2e38
CPU/CodeCache: Don't compile invalid jumps via block links 2 years ago
Stenzek 242561debf
CPU/Recompiler: Align dispatchers and JIT blocks
A couple of percent difference if we're lucky. Practically probably <1%.
2 years ago
Stenzek 2a8cfc7922
CPU/CodeCache: Simplify code LUT addressing
One more instruction on x86/ARM32, no additional instructions on ARM64.

Worth it so that the application doesn't crash if the game jumps to an
invalid PC. Note that the lower 2 bits are truncated, so an unaligned
jump will round down to the closest instruction. Obviously not correct,
but if a game ends up doing this, it's a lost cause anyway.
2 years ago
Stenzek 4b34825afd
CPU/CodeCache: Remove InstructionInfo pc field
No longer needed since oldrecs are gone.
2 years ago
Stenzek ce71b168c3
CPU/CodeCache: Add static to a couple of missing functions 2 years ago
Stenzek 448009f4ef
CPU/CodeCache: Fastmem RAM faults are always writes 2 years ago
Stenzek 568667753d
CPU/CodeCache: Avoid log calls in faults outside of JIT code
Could be in other functions that are unsafe to call log functions from.
2 years ago
Stenzek 726aa67d1b
CPU/CodeCache: Only cache EXP1 blocks up to 0x1F060000
Neither cart type has code mapped above this address.

Saves ~91MB of memory.
2 years ago
Stenzek 99f133223c
CPU/Recompiler: Create block links for self-looping blocks
This way invalidation will rewrite the jump back to the compiler.
Otherwise a SMC block can end up looping itself indefinitely.

Might help with Spyro 2/3. I can't seem to make them crash anymore.
2 years ago
Stenzek 2e805d56dd
CPU/CodeCache: Always backpatch KSEG2 writes 2 years ago
Stenzek c3a2156c79
CPU/CodeCache: Fix event kicking for Cached Interpreter 2 years ago
Stenzek 5bf7227790
CPU/CodeCache: Use code buffer section on Android 2 years ago
Stenzek d3ceda0c5b
CPU/CodeCache: Improve block host size heuristics
Codegen is much better these days, especially with NewRec.
2 years ago
Stenzek 0faa9cf650
Build: Add Devel configuration
Gets you debug assertions and logging, while still producing an
optimized executable.
2 years ago
Stenzek 5261cfe8e4
CPU/Recompiler: Tidy up type names
And reduce global namespace pollution.
2 years ago
Stenzek f67eacc071
CPU: Default to new recompiler/remove old recompiler 2 years ago
Stenzek 8bd0e6c3f7
CPU/CodeCache: Clear blocks on system shutdown
Means we release all allocated memory on system shutdown, rather
than waiting until the next VM/system start.
2 years ago
Stenzek 6551358212
Log: Replace channel string search with bitset
Knocks off around ~20KB of code.
2 years ago
Stenzek 26b6c704f0
MemMap: Support dynamic page size selection
i.e. 4K to 16K on ARM64.
2 years ago
Stenzek b36e2ce6be
CPU/CodeCache: Don't create a branch block with no delay slot
Can't compile that.
2 years ago
Stenzek 3dca598063
Log: Switch to enum class
Need to change the channel to a bitset too.. the string lookups are
horribly slow, and conflict when one is a prefix of another.
2 years ago
Stenzek ab1c85790c
CPU: Refactor execution mode switching
Fixes single step breaking in branch delay slots with recompiler.
Simplifies initialization.
Removes multiple sources of truth for fastmem.
2 years ago
Stenzek 7f4e5d55db
Misc: Update copyright headers 2 years ago
Stenzek 86d4d92753
TimingEvents: Switch to 64-bit counters 2 years ago
Stenzek 2e2451998c
Misc: Fix ARM32 build (again) 2 years ago
Stenzek a2f98541b3
Misc: Slim down some header includes 2 years ago
Stenzek 2e96931c32
CPU/CodeCache: Dynamically compute BIOS memory access timing
The timings can change if the game does so. Instead of forcing the
blocks to recompile, we can just manually multiply size * word_time.

Improves stability of Nightmare Creatures booting, and fixes corrupted
text in Formula Circus when using the cached interpreter.
2 years ago
Stenzek 2ac2ad605e
CPU/Recompiler: Break blocks on invalid instructions 2 years ago
Stenzek 3b9c489787
CPU: Pass instruction query values by reference 2 years ago
Stenzek f3671d21f3
CPU/CodeCache: Reduce far code size when using NewRec 2 years ago
Stenzek 9b42ad3859
CPU/CodeCache: Purge JitCodeBuffer 2 years ago
Stenzek be8fbafd71
CPU/CodeCache: Always dynamically allocate code buffer
Reduces .bss size.
2 years ago
Stenzek 4e922a34a7
Log: Simplify macros 2 years ago
Stenzek 9f90f14c48
CPU/CodeCache: Only print code size stats on request 2 years ago
Stenzek b6d019db66
Misc: Replace log printf calls with fmt 2 years ago