Admiral H. Curtiss
ed4403537f
Merge pull request #11916 from JosJuice/ppcanalyst-reorder-loop
...
PPCAnalyst: Reduce number of iterations in ReorderInstructionsCore
2023-07-01 01:06:53 +02:00
Admiral H. Curtiss
b71304230c
Jit64: Fix trampolines after #11834 .
2023-06-18 01:31:44 +02:00
get
07ad75f34f
EnumUtils: Add Common::ToUnderlying
...
Mirrors the C++23 <utility> function, std::to_underlying
2023-06-17 07:15:33 -05:00
Admiral H. Curtiss
089d433996
Merge pull request #11956 from JosJuice/jitarm64-12-bit-asm
...
JitArm64: Micro-optimizations in fres routine
2023-06-17 04:00:22 +02:00
Admiral H. Curtiss
f5eea4a957
Merge pull request #11834 from Dentomologist/xemitter_use_pseudonamed_parameter_force5bytes
...
XEmitter: Add enum class Force5Bytes
2023-06-16 15:46:36 +02:00
JosJuice
9c13436e2b
JitArm64: Improve instruction scheduling in fres routine
...
We want to have a low number of instructions between the LDP and the
MADD so that the MADD can start immediately after the LDP finishes
even if we're on a lower-end in-order CPU.
2023-06-15 22:02:39 +02:00
JMC47
f0f8225ff8
Merge pull request #11424 from Pokechu22/jit-imm-loadstore-update
...
Jit64: Attempt to fix updating stores with an immediate value
2023-06-15 11:32:30 -04:00
JosJuice
5b5124d9ff
JitArm64: Use immediates more in fres routine
...
Not sure why I didn't do this to begin with. Maybe I was under the
impression that the most significant bit of a 12-bit immediate was a
sign bit.
2023-06-14 23:27:58 +02:00
Lioncash
708c986693
PPCCache: Remove redundant reinterpret_casts
...
The pointer is being passed to functions that take arguments as void*,
so we don't need to cast here.
2023-06-13 08:25:26 -04:00
Dentomologist
4c2759f541
XEmitter: Add enum class Jump
...
Replace the bool parameter force5bytes in J, JMP, and J_CC with an enum
class Jump::Short/Near. Many callers set that parameter to the literal
'true', which was unclear if you didn't already know what it did.
2023-06-12 13:04:18 -07:00
Lioncash
41df38cb7c
Common: Move DebugInterface.h into Core
...
The base DebugInterface now depends on the Core's CPUThreadGuard, and
utilities in Common shouldn't be depending on Core facilities. So, we
can move this into the core library instead.
2023-06-12 10:35:31 -04:00
JosJuice
061ec365a8
PPCAnalyst: Reduce number of iterations in ReorderInstructionsCore
...
We can utilize the fact that if swapping two instructions causes another
swap to become possible, that swap involves one of the two instructions
we just swapped. There's need to search for new swap opportunities as
far back as the beginning of the block; we can just go one step back.
2023-06-09 19:45:51 +02:00
Lioncash
09271f365a
PowerPC/ConditionRegister: Mark PPCToInternal() as constexpr
...
This allows the compiler to eliminate a static constructor that
initializes the table, and instead precompute all of the data ahead of
time.
e.g. We get something like so on GCC without constexpr:
_GLOBAL__sub_I_PowerPC::ConditionRegister::s_crTable:
movdqa xmm0, XMMWORD PTR .LC0[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip], xmm0
movdqa xmm0, XMMWORD PTR .LC1[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+16], xmm0
movdqa xmm0, XMMWORD PTR .LC2[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+32], xmm0
movdqa xmm0, XMMWORD PTR .LC3[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+48], xmm0
movdqa xmm0, XMMWORD PTR .LC4[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+64], xmm0
movdqa xmm0, XMMWORD PTR .LC5[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+80], xmm0
movdqa xmm0, XMMWORD PTR .LC6[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+96], xmm0
movdqa xmm0, XMMWORD PTR .LC7[rip]
movaps XMMWORD PTR PowerPC::ConditionRegister::s_crTable[rip+112], xmm0
ret
PowerPC::ConditionRegister::s_crTable:
.zero 128
.LC0:
.quad -9223372032559808511
.quad -8646911280256385023
.LC1:
.quad -9223372032559808512
.quad -8646911280256385024
.LC2:
.quad 4294967297
.quad 576460756598390785
.LC3:
.quad 4294967296
.quad 576460756598390784
.LC4:
.quad -4611686014132420607
.quad -4035225261828997119
.LC5:
.quad -4611686014132420608
.quad -4035225261828997120
.LC6:
.quad 4611686022722355201
.quad 5188146775025778689
.LC7:
.quad 4611686022722355200
.quad 5188146775025778688
and with constexpr, this all get collapsed into:
PowerPC::ConditionRegister::s_crTable:
.quad -9223372032559808511
.quad -8646911280256385023
.quad -9223372032559808512
.quad -8646911280256385024
.quad 4294967297
.quad 576460756598390785
.quad 4294967296
.quad 576460756598390784
.quad -4611686014132420607
.quad -4035225261828997119
.quad -4611686014132420608
.quad -4035225261828997120
.quad 4611686022722355201
.quad 5188146775025778689
.quad 4611686022722355200
.quad 5188146775025778688
completely eliminating the static constructor. MSVC also exhibits this,
whereas clang is a little better and does this anyway, even without
constexpr.
2023-06-08 14:33:13 -04:00
Shawn Hoffman
c1580ebf30
msvc: workaround optimizer bug
2023-06-04 10:57:22 -07:00
Franz-Josef Haider
8943a9a369
Jit: Add missing call to InitBLROptimization for extra performance
2023-05-23 23:49:29 +03:00
Franz-Josef Haider
68aab70c75
Jit: Fix block map fallback in Arm64 case.
2023-05-23 23:20:08 +03:00
Franz-Josef Haider
859da32a6c
Jit: Improve block lookup performance through a shm memory segment.
...
By using a shm memory segment for the fast_block_map that is sparsely
allocated (i.e. on write by the OS) instead of a statically allocated
array we can make the block lookup faster by:
* Having a bigger space available for lookup that doesn't take up
too much memory, because the OS will only allocate the needed
pages when written to.
* Decrease the time spent to lookup a block in the assembly dispatcher
due to less comparisions and shorter code (for example the pc check
has been entirely dropped since only the msrBits need to be validated).
When the JIT block cache is full the shm segment will also be released
and reallocated to avoid allocating too much memory. It will also be
reset when the instruction cache is flushed by the PPC code to avoid
having stale entries.
Also fallback to the original method in case the memory segment couldn't
be allocated.
2023-05-20 16:26:55 +03:00
Admiral H. Curtiss
8c67083c87
Merge pull request #11813 from lioncash/insert
...
PPCSymbolDB: Use emplace() where applicable
2023-05-09 18:48:06 +02:00
Lioncash
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
JosJuice
2319210d85
Merge pull request #11810 from lioncash/jitreg
...
Common/JitRegister: Move interface into Common namespace
2023-05-03 17:43:01 +02:00
Lioncash
15d1ae3a8a
SymbolDB: Add constructors to Symbol
...
Allows for much more convenient in-place construction.
2023-05-02 16:04:47 -04:00
Lioncash
a14d8003f4
PPCSymbolDB: Use emplace() where applicable
...
Avoids default constructing an entry in the map that just gets
immediately overwritten. Also gets rid of some redundant map lookups.
2023-05-02 15:51:52 -04:00
Lioncash
56775e4901
JitInterface: Remove global system accessor
...
We can use JitInterface's system member variable to avoid needing this
2023-05-02 15:21:58 -04:00
Lioncash
4db186f9ff
Common/JitRegister: Move interface into Common namespace
...
Makes the namespace consistent with other common utilities.
2023-05-02 12:00:05 -04:00
get
0948f0ef69
Fix PPCCache savestate behavior
...
PR #11183 regressed the lookup table reconstruction and, for some reason, added an else clause that clobbered the dCache whenever dCache emulation is turned on.
2023-04-23 00:53:01 -05:00
Pokechu22
8fbfee03ab
Merge pull request #11764 from Minty-Meeo/ppc-cache-extendo-ram
...
Do not use magic numbers for RAM sizes/masks in PPCCache
2023-04-22 12:44:34 -07:00
get
9ba26670b8
Do not use magic numbers for RAM sizes/masks in PPCCache
...
Memory Override + Write-Back Cache emulation = game crash
2023-04-20 19:32:35 -05:00
Admiral H. Curtiss
2e7f0d002e
Merge pull request #11760 from Minty-Meeo/embracing-nullptr
...
Embrace nullptr over NULL and 0
2023-04-18 22:14:11 +02:00
get
a5d06fde4b
Embrace nullptr over NULL and 0
2023-04-15 16:07:05 -05:00
Lioncash
784a216927
Common/MathUtil: Move IntLog2 into MathUtil namespace
...
Gets this out of the global namespace.
2023-04-15 03:35:05 -04:00
Admiral H. Curtiss
23843583bf
PowerPC: Refactor to class, move to System.
2023-04-09 21:48:37 +02:00
Admiral H. Curtiss
e5941428d1
PowerPC/PPCTables: Pass instruction address to GetOpInfo().
2023-04-05 20:09:32 +02:00
Admiral H. Curtiss
6018daa3fa
PowerPC/PPCCache: Access PowerPCState through System.
2023-04-05 20:09:32 +02:00
Admiral H. Curtiss
aec3a882d7
PowerPC/JitInterface: Access PowerPCState through System.
2023-04-05 20:09:31 +02:00
Admiral H. Curtiss
18f8ae37ab
PowerPC/Expression: Pass System to EvaluateCondition().
2023-04-05 20:09:31 +02:00
Admiral H. Curtiss
0a88c2329a
Merge pull request #11715 from JosJuice/dcbx-order
...
Jit: Change argument order for InvalidateICacheLine(s)FromJIT
2023-04-05 20:06:26 +02:00
Pokechu22
c55e08ff73
Jit64: Attempt to fix updating stores with an immediate value
...
See https://bugs.dolphin-emu.org/issues/13144
2023-04-04 23:30:40 -07:00
Pokechu22
497e938c8c
Jit_LoadStoreFloating: Minor tidying
...
The inst.SIMM_16 change is for readability (though it also fixes a warning about potentially unintended uses of `||`).
The fallback change is because `b` is only meaningful for indexed instructions; this could theoretically lead to unintended fallbacks (but it seems unlikely).
2023-04-04 23:04:41 -07:00
Admiral H. Curtiss
e24e52af3c
Jit64: Use utility function for function calls in dcbx.
...
We have these for a reason. I think this also fixes a theoretical
problem when `ABI_PARAM1 == loop_counter` where the first MOV destroys
the second's value; I'm not sure if this can actually happen in practice
though.
2023-04-01 15:30:03 +02:00
JosJuice
1bf593f65a
Jit: Change argument order for InvalidateICacheLine(s)FromJIT
2023-04-01 14:34:30 +02:00
Admiral H. Curtiss
8dabd1a025
PowerPC/MMU: Refactor to class, move to System.
2023-03-28 03:47:51 +02:00
Mai
98fad9004b
Merge pull request #11698 from AdmiralCurtiss/mmu-comments
...
PowerPC/MMU: Clean up old comments.
2023-03-27 10:32:19 -04:00
Admiral H. Curtiss
d7fabf37d6
PowerPC/MMU: Clean up old comments.
2023-03-26 15:19:48 +02:00
Admiral H. Curtiss
7f50c070b2
JitInterface: Convert m_jit to unique_ptr.
2023-03-26 14:38:07 +02:00
Admiral H. Curtiss
9217a9eba4
JitInterface: Refactor to class, move to System.
2023-03-26 14:38:07 +02:00
Admiral H. Curtiss
1885ddcde2
JitArm64: Avoid System::GetInstance() and ppcState.
2023-03-25 15:47:30 +01:00
Admiral H. Curtiss
6b44947488
Merge pull request #11677 from AdmiralCurtiss/deglobal-jit
...
Avoid System::GetInstance() and ppcState global in Jit64 and CachedInterpreter.
2023-03-25 14:52:46 +01:00
Admiral H. Curtiss
fc394bdbdb
Jit64: Avoid System::GetInstance() and ppcState.
2023-03-25 02:37:10 +01:00
Admiral H. Curtiss
dfc14db313
CachedInterpreter: Avoid System::GetInstance() and ppcState.
2023-03-25 02:37:10 +01:00
Admiral H. Curtiss
9c0226b7e3
JitBase: Avoid System::GetInstance() and ppcState.
2023-03-25 02:37:00 +01:00