Commit Graph

56 Commits

Author SHA1 Message Date
02d76ba2a0 Jit: Fix fastmem initialization order
When evaluating whether jo.fastmem should be set to true, we check the
value of jo.fastmem_arena. However, due to a change made in 28e8117b90,
jo.fastmem_arena wasn't set until after the first time we set
jo.fastmem, so jo.fastmem would end up always being false until the next
time RefreshConfig was called.

Fixes https://bugs.dolphin-emu.org/issues/13364.
2023-09-30 16:16:54 +02:00
28e8117b90 Jit: Automatically clear cache when JIT settings are updated
This fixes a problem where changing the JIT debug settings on
Android while a game was running wouldn't cause the changed settings
to apply to code blocks that already had been compiled.
2023-08-26 17:04:56 +02:00
1813f0fdb5 Jit: Remove checkedEntry
It's now always identical to normalEntry.
2023-07-30 14:28:02 +02:00
2561028b91 PPCTables: Remove unnecessary includes
Gets rid of a lingering dependency on the interpreter in common code and
a bunch of indirect inclusions.
2023-05-03 21:47:10 -04:00
23843583bf PowerPC: Refactor to class, move to System. 2023-04-09 21:48:37 +02:00
dfc14db313 CachedInterpreter: Avoid System::GetInstance() and ppcState. 2023-03-25 02:37:10 +01:00
9c0226b7e3 JitBase: Avoid System::GetInstance() and ppcState. 2023-03-25 02:37:00 +01:00
3d67c11b91 Interpreter: Move global state into class, move instance to System. 2023-03-19 03:05:20 +01:00
919182eda2 Interpreter: Pass Interpreter to CPU instruction functions. 2023-03-19 03:05:11 +01:00
164ea57790 Split PPCTables from Interpreter_Tables
This also allows use of constexpr in both places. Some additional work was needed in PPCTables due to mutable data associated with each opcode.
2023-03-16 18:36:25 -07:00
3b364c5c16 HW/CPU: Refactor to class, move to System. 2023-03-08 12:23:37 +01:00
8802f96b7e Fix uninitialized variable warnings (C26495) 2023-02-15 19:18:39 -08:00
485bba238e PowerPC: Add PowerPCState parameter to UpdatePerformanceMonitor(). 2023-01-27 15:22:44 +01:00
ba1b624e1b PowerPC: Remove MSR macro. 2023-01-27 15:22:42 +01:00
2f3187eba9 PowerPC: Remove NPC macro. 2023-01-27 15:22:41 +01:00
be8d0b76ca PowerPC: Remove PC macro. 2023-01-27 15:22:41 +01:00
c9558ecb4c CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00
1a92699455 Cast to int for enums that are not formattable 2022-01-13 11:11:08 -08:00
d6331c1e71 Config: Port remaining Interface settings to new config system. 2021-12-31 17:40:04 +01:00
9f525d69c8 Jit: Raise program exception on floating point exceptions
This is done entirely through interpreter fallbacks. It would
probably be possible to implement this using host exception
handlers instead, but I think it would be a lot of complexity
for a rarely used feature, so let's not do it for now.

For performance reasons, there are two settings for this feature:
One setting which does enables just what True Crime: New York City
needs and one setting which enables it all. The latter makes
almost all float instructions fall back to the interpreter.
2021-10-13 17:42:56 +02:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
2dcd0b248f CachedInterpreter: Call UpdatePerformanceMonitor 2020-12-23 17:34:32 +01:00
ef75e9acd8 Core: Convert logging over to fmt pt.5
Converts the remaining PowerPC code over to fmt-capable logging.

Now, all that's left to convert over are the lingering remnants within
the frontend code.
2020-11-25 13:23:48 -05:00
4c75b96254 HLE: Improve naming
Replace 'function' with 'hook' when appropriate
2020-08-28 20:29:05 +04:00
6ec4ade3b6 Interpreter: Drop idle skipping in interpreter.
And reimplement it in the cached interpreter based on the idle loop detection.
2019-04-20 20:52:39 +02:00
77e9aa48bc Jit64: Remove Jitx86Base class 2018-12-28 09:15:26 +00:00
e81408588f JitCommon/JitCache: Make JitBlock's checkedEntry and normalEntry members non-const pointers
In both cases of the x64 and AArch64 JITs, these would have const casted
away from them, followed by them being placed within an emitter and
having breakpoint instructions written in them.

In this case, we shouldn't be using const period if we're writing to the
emitted data.
2018-08-27 10:23:22 -04:00
03c88c83ac CachedInterpreter: Implement breakpoints.
There were missed on the initial implementation of the cached interpreter.
2018-06-13 08:33:57 +02:00
a3f2941173 JitBase: Centralize location of code buffer
Given the code buffer is something truly common to all JIT
implementations, we can centralize it in the base class and avoid
duplicating it all over the place, while still allowing for differently
sized buffers.
2018-06-09 08:16:53 -04:00
3a8a67025e PPCAnalyst: Make CodeBuffer an alias for std::vector<CodeOp>
This class effectively acted as a "discount vector", that would simply
allocate memory and then delete it in the destructor when it goes out of
scope.

We can just use a std::vector directly to reduce this boilerplate.
2018-05-18 17:19:45 -04:00
4b25538f2f CachedInterpreter: Factor function hooking code out of Jit()
Extracts the self-contained code into its own function to clean up the
flow of Jit() a little more.

This also introduces a helper function to HLE.h that will be used to
reduce the boilerplate here and in the interpreter and Jit64 in the
following commits.

This function performs all of the preliminary checks required prior to
attempting to hook/replace a function at a given address. The function then
calls a provided object that satisfies the FunctionObject concept in the
C++ standard library. This can be a lambda, a regular function pointer,
an object with an overloaded function call operator, etc. The only
requirement is that the function return a bool, indicating whether or
not the function was replaced, and that it can take parameters in the
form: fn(u32 function, HLE::HookType type)
2018-05-16 18:55:49 -04:00
f4affa3d1d CachedInterpreter: Clean up code buffer accesses in Jit()
Done similarly for the reasons Jit64 was done. Localizes indexing to one
place instead of repeatedly indexing the same place.
2018-05-13 22:11:01 -04:00
ffcf107dd2 PowerPC: Make the PowerPCState's msr member variable a UReg_MSR instance
Gets rid of the need to construct UReg_MSR values around the the actual
member in order to query information from it (without using shifts and
masks). This makes it more concise in some areas, while helping with
readability in some other places (such as copying the ILE bit to the LE
bit in the exception checking functions).
2018-05-05 17:59:30 -04:00
4cfd900c67 Fix some warnings 2018-04-17 14:10:05 +01:00
40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
48e2e9a41d CachedInterpreter: Use using aliases instead of typedef 2018-03-25 02:57:25 -04:00
9829083241 CachedInterpreter: Use an enum class for instruction type 2018-03-25 02:57:16 -04:00
328ac424c0 Merge pull request #6517 from lioncash/ppctables
PPCTables: Namespace all exposed functions
2018-03-24 22:17:36 +01:00
2381aeecc3 PPCTables: Namespace all exposed functions
It's somewhat inconsistent to have two straggler functions outside the
namespace.
2018-03-24 16:46:12 -04:00
397b3fb976 CPUCoreBase: Make the GetName() member function const qualified
This function should have no need to modify internal class state.
2018-03-24 16:17:39 -04:00
3deb8ce074 HLE: Use enum classes for HookType and HookFlag 2018-02-04 14:50:55 +01:00
958b75b707 JitCommon: Restructure the profiler calls. 2017-09-02 13:05:58 +02:00
dd4203bec8 Core: Remove unnecessary includes
Also moves a cpp file's related header file to the top of the inclusions if it isn't already there.
2017-06-15 18:52:22 -04:00
51def492c7 [HLE] CachedInterpreter: Fixes invalid logs 2017-04-29 19:38:41 +01:00
1bd87f5a79 CachedInterpreter: fix HLEFunction argument 2017-04-07 17:54:59 -07:00
8d98ac6509 CPU: Convert state enum to an enum class
Gets enum constants out of the immediate namespace. Also makes it
strongly typed like the other state enums.
2017-03-28 11:48:28 -04:00
a9c570a9f8 CachedInterpreter: Get rid of an unnecessary cast
This is only ever used to read a value and not modify data, so this can
just be constructed by value.
2017-03-06 13:18:46 -05:00
0783476464 CachedInterpreter: Forward declare instruction struct
Allows changes to be made to the instruction struct without recompiling
other source files.
2017-02-23 18:08:20 -05:00
d3aee2de08 JitCache: Split off JIT call from dispatcher.
This avoid flushing the BLR optimization stack on fast_block_cache misses.
2017-01-25 01:51:19 +01:00
70caf447b9 JitCache: Get physical addresses from PPCAnalyst.
So we support all kind of degenerated blocks now, not just range+length based ones.
2017-01-23 20:33:44 +01:00