42913 Commits

Author SHA1 Message Date
JosJuice
6929dff016 JitArm64: Don't store immediate values in register cache
Like the previous commit did for Jit64, JitArm64 can now handle the
combination of a value simultaneously being in a host register and being
a known immediate.

Unlike with Jit64, I've put the codegen-affecting changes in this commit
and the move away from the RegType enum in a follow-up commit. This is
in part because the design of JitArm64 made it easy to implement the
codegen-affecting changes without combining it with a big bang
refactorization, and in part because we need to keep RegType around for
keeping track of different float formats in Arm64FPRCache, complicating
the refactorization a bit.
2024-12-24 17:16:46 +01:00
JosJuice
4177fa262e Jit64: Don't store immediate values in register cache
They're now stored in ConstantPropagation instead.

I've also removed the LocationType enum. The location of each guest
register is now tracked using three booleans: Whether it is in ppcState,
whether it is in a host register, and whether it is a known immediate.
The first two of these booleans are stored in the register cache, and
the last one is stored in ConstantPropagation. This new model allows us
to handle the combination of a value simultaneously being in a host
register and being a known immediate. It also keeps track of which
registers are dirty, which was previously kept track of in X64CachedReg.

The old model maps to the new model as follows:

                                default    host_reg    immediate

Default                         true       false       false
Discarded                       false      false       false
Bound                           (!dirty)   true        false
Immediate                       false      false       true
SpeculativeImmediate            true       false       true
[previously unrepresentable]    (!dirty)   true        true
2024-12-24 17:16:46 +01:00
JosJuice
52dca54ea8 Jit: Update constant propagation during instruction
This commit makes the JIT set/clear the individual registers of
ConstantPropagation immediately instead of at the end of the
instruction. This is needed to prevent Jit64::ComputeRC, which reads
from a register written to earlier during the same instruction, from
reading back stale register values from ConstantPropagation in the next
commit.
2024-12-24 17:16:46 +01:00
JosJuice
236bd035eb JitArm64: Make FlushRegisters unlock condition more robust
To find out whether a host register needs to be unlocked, FlushRegisters
checks if the guest register is known to be a zero immediate. This works
right now, but it will stop working correctly once we gain the ability
to have a guest register be a known immediate and be in a host register
at the same time, because a register that's known to be a zero immediate
may have had a host register allocated prior to the call to
FlushRegisters. Instead, we should check whether the register is
RegType::Register after we're done calling BindForRead.
2024-12-24 17:16:46 +01:00
JosJuice
47894560af JitArm64: Pass index to more Arm64GPRCache functions
This refactorization is needed for upcoming commits.
2024-12-24 17:16:45 +01:00
JosJuice
81adcfadca Jit: Move rlwimix to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
7e4dce4d19 Jit: Move srawx to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
4985a01c16 Jit: Move srwx to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
38eb57420b Jit: Move slwx to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
dc1110e9b9 Jit: Move divwx to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
2a7b68cf81 Jit: Move divwux to ConstantPropagation 2024-12-24 17:16:45 +01:00
JosJuice
e425a3e6fd Jit: Move subfic to ConstantPropagation 2024-12-24 17:16:40 +01:00
JosJuice
7e33dd5459 Jit: Move subfx to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
c64b981ed8 Jit: Move multiplication by 0 optimization to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
ed83dd8773 Jit: Move mullwx, mulhwx, mulhwux to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
3f12145f50 Jit: Move mulli to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
4392ef174d Jit: Move addicx to ConstantPropagation
Note: Jit64 didn't support immediate handling for addic before.
2024-12-24 17:11:45 +01:00
JosJuice
42d74f83db Jit: Move srawix to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
0b6b494b8b Jit: Move rlwinmx and rlwnmx to ConstantPropagation 2024-12-24 17:11:45 +01:00
JosJuice
4898fa72ab Jit: Move negx to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
9949da4c58 Jit: Move cntlzwx to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
b14c799100 Jit: Move extsXx to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
b833ddc2b6 Jit: Move addx to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
8a5cbe696f Jit: Move boolX to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
0b81bd8412 Jit: Move addix to ConstantPropagation 2024-12-24 17:11:44 +01:00
JosJuice
90c89ce533 Jit: Move reg_imm to ConstantPropagation 2024-12-24 17:11:43 +01:00
JosJuice
96876044a6 Jit: Extract immediate handling to separate ConstantPropagation class
Restructuring things in this way brings two immediate benefits:

* Code is deduplicated between Jit64 and JitArm64.
* Materializing an immediate value in a register no longer results in us
  forgetting what the immediate value was.

As a more long-term benefit, this lets us also run constant propagation
as part of PPCAnalyst, which could let us do cool stuff in the future
like statically determining whether a conditional branch will be taken.
But I have nothing concrete planned for that right now.
2024-12-24 17:11:43 +01:00
JosJuice
ff965f1937 JitArm64: Add function for setting constant overflow 2024-12-24 17:11:43 +01:00
JosJuice
be8e3fc5ae Jit64: Extract handling of immediate Rc 2024-12-24 17:11:43 +01:00
JMC47
c528a70e64
Merge pull request #13211 from Sintendo/blendvpd
Jit_FloatingPoint: fselx - Prefer BLENDVPD over VBLENDVPD
2024-12-22 18:35:11 -05:00
JMC47
a1d6aa7d3e
Merge pull request #13212 from JosJuice/jitarm64-ps-sel-same-reg
JitArm64: Optimize ps_sel with d == b || d == c
2024-12-22 18:34:32 -05:00
JosJuice
5641b83d4e
Merge pull request #13063 from TryTwo/PR_GameSettings
Add ability to edit game-specific GFX settings from game properties tab.
2024-12-22 20:42:28 +01:00
Admiral H. Curtiss
bb8c0a795f
Merge pull request #13214 from JosJuice/sethardcoremode-private
AchievementManager: Make SetHardcoreMode private
2024-12-22 20:09:29 +01:00
JMC47
1ba8541da9
Merge pull request #13091 from mitaclaw/ranges-modernization-2-returns
Ranges Algorithms Modernization - Return
2024-12-20 12:50:19 -05:00
JMC47
ac0d6cbaaa
Merge pull request #13224 from Sintendo/jitarm64-subfic2
JitArm64_Integer: Optimize subfic for -1
2024-12-18 12:07:23 -05:00
OatmealDome
01f6810a9d
Merge pull request #13207 from OatmealDome/vulkan-hdr-color-space
VKSwapChain: Always use surface formats with a normal sRGB color space if not RGBA16F
2024-12-16 17:29:19 -05:00
Jordan Woyak
b4a1967310
Merge pull request #13226 from JosJuice/achievementmanager-forward-declarations
AchievementManager: Add required forward declarations
2024-12-15 14:02:56 -06:00
JosJuice
ad24ddb6bb VerifyTool: Add missing USE_RETRO_ACHIEVEMENTS ifdefs 2024-12-15 18:15:57 +01:00
JosJuice
84ab15e020 AchievementManager: Add required forward declarations
This was causing compilation errors when building without
USE_RETRO_ACHIEVEMENTS.
2024-12-15 18:00:14 +01:00
Sintendo
d81213c4a5 JitArm64_Integer: Optimize subfic for -1
Another one backported from x86. Not sure why I didn't do this in #12891
already.

- Without carry
Before:
0x2a3a03fb   mvn    w27, w26
0x6b1a037b   subs   w27, w27, w26

After:
0x1280001b   mov    w27, #-0x1                ; =-1

- With carry
Before:
0x2a3b03f7   mvn    w23, w27
0x6b1b02f7   subs   w23, w23, w27
0x1a9f37f6   cset   w22, hs
0x390bd3b6   strb   w22, [x29, #0x2f4]

After:
0x12800017   mov    w23, #-0x1                ; =-1
2024-12-15 02:24:30 +01:00
JosJuice
ada646a795
Merge pull request #12682 from JosJuice/jit-fallback-discard-assert
Jit: Skip discarded registers when flushing for interpreter fallback
2024-12-12 23:48:37 +01:00
TryTwo
9541bb6cf7 Add method to bold slider/spin labels when a user game ini setting is being used 2024-12-10 13:42:30 -07:00
TryTwo
ac129d318b EnhancementsWidget:: Move to using ConfigControls and add new control for ComboBoxes that set two settings at once. 2024-12-10 13:42:17 -07:00
TryTwo
84a937ae65 Add GFX property tabs to game properties window, allowing them to be set to the user game ini. Additionally, refactor ConfigWidgets to reduce duplication. Refactor GameConfigWidget to use config system.
Creates a layer outside the game config layer system and passes it to the created gfx widows, so as to not interfere with the global config system.

Supports multiple game properties being open at once.
Supports editing while a game is playing, but the options only save and update the active game when the window is closed.
Right-clicking will remove a property from the game ini.
2024-12-10 13:40:30 -07:00
JMC47
6ea8edd531
Merge pull request #13209 from jordan-woyak/sdl-touchpad
InputCommon/SDL: Add touchpad inputs.
2024-12-10 12:52:43 -05:00
JMC47
394db8b798
Merge pull request #13215 from Tilka/efb_access
GameSettings: set EFBAccessEnable=True for Neighbours from Hell
2024-12-09 14:23:45 -05:00
Tillmann Karras
445fe2248c GameSettings: set EFBAccessEnable=True for Neighbours from Hell
This fixes the loading screens that show a walking animation.
2024-12-08 11:29:15 +00:00
JosJuice
687fe65709
Merge pull request #13166 from Sintendo/stX-opt
JitArm64_LoadStore: Optimize zero stores in stX
2024-12-08 11:06:33 +01:00
OatmealDome
57b1234feb
Merge pull request #13113 from CelestialAmber/mwld-map
Core: Store object name separately for symbols
2024-12-07 17:13:13 -05:00
JosJuice
7a31c8f10b AchievementManager: Make SetHardcoreMode private
This is an implementation detail that doesn't need to be exposed.
2024-12-07 19:29:53 +01:00