Commit graph

30 commits

Author SHA1 Message Date
Connor McLaughlin 1d4d1d06a7 CPU/Recompiler: Disable static code buffer on macOS/Haiku 2020-08-22 13:24:57 +10:00
kwyxz 31695c4ff7
Haiku port of duckstation libretro core (#716)
* Haiku build 1st attempt

* fix load on Haiku

* Removed debugging flags

* Added a couple ifndef
2020-08-22 13:20:37 +10:00
Connor McLaughlin 2e9f656546 CPU: Implement PGXP CPU Mode
This is *very* slow. You don't want to enable it if you don't need it.
It is also incompatible with the recompiler and will disable it if the
option is enabled.
2020-08-20 00:49:39 +10:00
Connor McLaughlin 5b9db71b87 CPU/Recompiler: Fix mid-block software interrupts not updating pc
Fixes Need for Speed: High Stakes hanging at boot.
2020-08-09 04:32:53 +10:00
Connor McLaughlin 1d5f810a4b CPU/Recompiler: Disable memory access exceptions by default
This means it'll no longer pass amidog's CPU test in the default config.
But no games rely on this. You can enable it in advanced options if you
want to pass the CPU test.
2020-08-08 23:44:13 +10:00
Connor McLaughlin b1377fe0d9 CPU/Recompiler: Add a fast block lookup array
Up to 15% perf improvement.
2020-08-08 23:06:28 +10:00
Connor McLaughlin f6e88353eb CPU/Recompiler: Make generated code invariant to virtual PC 2020-08-08 23:06:28 +10:00
Connor McLaughlin 2885d2e547 CPU/CodeCache: Hopefully fix 32-bit compile errors 2020-08-01 03:53:53 +10:00
Connor McLaughlin b6f871d2b9
JIT optimizations and refactoring (#675)
* CPU/Recompiler: Use rel32 call where possible for no-args

* JitCodeBuffer: Support using preallocated buffer

* CPU/Recompiler/AArch64: Use bl instead of blr for short branches

* CPU/CodeCache: Allocate recompiler buffer in program space

This means we don't need 64-bit moves for every call out of the
recompiler.

* GTE: Don't store as u16 and load as u32

* CPU/Recompiler: Add methods to emit global load/stores

* GTE: Convert class to namespace

* CPU/Recompiler: Call GTE functions directly

* Settings: Turn into a global variable

* GPU: Replace local pointers with global

* InterruptController: Turn into a global pointer

* System: Replace local pointers with global

* Timers: Turn into a global instance

* DMA: Turn into a global instance

* SPU: Turn into a global instance

* CDROM: Turn into a global instance

* MDEC: Turn into a global instance

* Pad: Turn into a global instance

* SIO: Turn into a global instance

* CDROM: Move audio FIFO to the heap

* CPU/Recompiler: Drop ASMFunctions

No longer needed since we have code in the same 4GB window.

* CPUCodeCache: Turn class into namespace

* Bus: Local pointer -> global pointers

* CPU: Turn class into namespace

* Bus: Turn into namespace

* GTE: Store registers in CPU state struct

Allows relative addressing on ARM.

* CPU/Recompiler: Align code storage to page size

* CPU/Recompiler: Fix relative branches on A64

* HostInterface: Local references to global

* System: Turn into a namespace, move events out

* Add guard pages

* Android: Fix build
2020-07-31 17:09:18 +10:00
Connor McLaughlin d5a5432a8b CPU/CodeCache: Fix crash when BIOS is missing 2020-04-19 16:03:35 +10:00
Connor McLaughlin a43a0a14cc CPU/CodeCache: Don't leak blocks on shutdown 2020-04-16 20:23:54 +10:00
Connor McLaughlin 7a87b9b5bb CPU/CodeCache: Don't leak blocks on flush 2020-04-16 19:40:52 +10:00
Connor McLaughlin 71c1e243fe Remove YBaseLib dependency 2020-01-10 13:40:53 +10:00
Connor McLaughlin 41298a74e1 CPU/Recompiler: Fetch instruction before dispatching interrupts
Fixes polygon glitches in Crash.
2019-12-12 23:55:42 +10:00
Connor McLaughlin aa52dbfeb8 CPU/Recompiler: Use register cache for managing pc
Reduces the number of loadstores after each instruction.
2019-12-12 23:55:23 +10:00
Connor McLaughlin 002d1cd4fd CPU/CoreCache: Use virtual (unmasked) address as PC 2019-12-12 20:23:53 +10:00
Connor McLaughlin eeea5125f7 CPU: Use pending ticks as downcount comparison
Saves a few cycles decrementing the downcount.
2019-12-05 16:28:46 +10:00
Connor McLaughlin e518cbfffb CPU/Recompiler: Fallback-all-instructions working in AArch64 2019-12-03 20:45:14 +10:00
Connor McLaughlin f11d357ab9 Compile fixes for Android 2019-11-28 01:55:33 +10:00
Connor McLaughlin 519dbc818d CPU/CodeCache: Fix DMA writes not invalidating code blocks
Fixes Crash Team Racing and Spyro in Cached Interpreter/Recompiler
modes.
2019-11-26 19:45:38 +10:00
Connor McLaughlin 8c5fcc8f48 CPU: Fix more load delay slot issues
Fixes Spyro again. b{ltz,gez}(al)? disabled in the recompiler until
issues are fixed.
2019-11-24 01:11:51 +10:00
Connor McLaughlin 889bd73ac8 CPU: Add settings for execution mode 2019-11-23 20:22:09 +10:00
Connor McLaughlin b8de55b9b8 CPU/Recompiler: Implement simple block linking 2019-11-23 19:56:19 +10:00
Connor McLaughlin 11966e4caf CPU/Recompiler: Write exception exits to far code buffer
Keeps the hot path nice and clean.
2019-11-22 18:01:28 +10:00
Connor McLaughlin f46160ac46 CPU/Recompiler: Implement mult/multu 2019-11-22 16:45:13 +10:00
Connor McLaughlin 9e82afac7b CPU/Recompiler: Support block revalidation instead of flushing 2019-11-22 00:32:40 +10:00
Connor McLaughlin 7aafaeacbc CPU/Recompiler: Implement lb/lbu/lh/lhu/lw/sb/sh/sw instructions
Currently not passing CPU tests when combined with lwl/lwr.
2019-11-21 23:34:04 +10:00
Connor McLaughlin 9e3bb62216 CPU/CodeCache: Fast path for self-linking blocks 2019-11-20 01:19:03 +10:00
Connor McLaughlin 5217088d82 CPU: Refactor load delay handling
Now works when mixing interpreter and recompiler code.
2019-11-20 00:15:15 +10:00
Connor McLaughlin 1d6c4a3af1 CPU: Basic recompiler implementation for x64 (lui, ori, addiu)
Disabled by default.
2019-11-19 20:38:05 +10:00