Commit Graph

142 Commits (21abd248700d59f6dcaf18a41b728ff4e5a70b41)

Author SHA1 Message Date
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
Stenzek 8f415a44e6
CPU/NewRec: Fix register allocation crash on Linux 2 years ago
Stenzek fa104acdd1
Misc: Purge unused code and report startup error to host 2 years ago
Stenzek 71f50566f3
System: Consider pending ticks when using global ticks 3 years ago
Stenzek 4599109854
CPU/CodeCache: Clear backpatch info for blocks when recompiled 3 years ago
Stenzek 454cceab80
CPU/CodeCache: Move backpatch lookup after RAM check
Saves a map lookup if we're just invalidating code.
3 years ago
Stenzek 4a70164dac
CMake: Determine host page size at build time
Needed for running on Asahi Linux.
3 years ago
Stenzek c1381cfda6
System: Gracefully handle memory allocaion failure 3 years ago
Stenzek ff9dc11a38
CPU/CodeCache: Increase frame delta for manual protected blocks
Reduces stutter in Wild Arms 2.
3 years ago
Stenzek 14e3969736
Misc: Warning fixes 3 years ago
Stenzek 21bbe5c76c
CPU/CodeCache: Fix page error when rewinding 3 years ago
Stenzek 6a7dea6908
CPU/CodeCache: Fix rewinding on Apple Silicon 3 years ago
Stenzek a499e21453
CPU/CodeCache: Don't try to compile direct double branches
Invalidation nightmare.
3 years ago