dolphin/Source/Core
JosJuice 0c024de591 Jit64: Flush carry flag in FallBackToInterpreter
We have an optimization where the guest carry flag is kept in the host
carry flag between certain back-to-back pairs of integer instructions.
If the second instruction falls back to the interpreter, then
FallBackToInterpreter should flush the carry flag to m_ppc_state,
otherwise the interpreter reads a stale carry flag and at some later
point Jit64 trips the "Attempt to modify flags while flags locked!"
assertion.

An alternative solution would be to not store the guest carry flag in
the host carry flag to begin with if we know the next instruction is
going to fall back to the interpreter, but knowing that in advance is
non-trivial. Since interpreter fallbacks aren't exactly intended to be
super optimized, I went for the flushing solution instead, which is how
JitArm64 already works. In most cases, the emitted code shouldn't even
differ between these two solutions.

Note that the problematic situation only happens if the first integer
instruction doesn't fall back to the interpreter but the second one
does. This used to be impossible because there's no "JIT disable"
setting that's granular enough to disable some integer instructions but
not all, but with the constant propagation PR, it's possible if constant
propagation is able to entirely evaluate the first instruction but not
the second.
2025-11-29 11:45:43 +01:00
..
AudioCommon CubebStream: Use WorkQueueThread::PushBlocking instead of sync_event 2025-11-07 13:19:18 -08:00
Common Merge pull request #14142 from JosJuice/directiofile-cant-create-saf 2025-11-23 09:50:44 +01:00
Core Jit64: Flush carry flag in FallBackToInterpreter 2025-11-29 11:45:43 +01:00
DiscIO Merge pull request #13539 from tygyh/DiscIO-Remove-redundant-casts 2025-11-19 17:40:42 -06:00
DolphinNoGUI Merge pull request #13689 from JosJuice/lock-core-any-thread 2025-11-16 18:35:17 +01:00
DolphinQt Merge pull request #14169 from JosJuice/i18n-2025-11-25 2025-11-25 16:47:48 -06:00
DolphinTool Core: Remove IsHostThread 2025-11-10 21:14:56 +01:00
InputCommon Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
MacUpdater
UICommon Merge pull request #13748 from Dentomologist/autoupdatechecker_delete_old_updater_log_file 2025-11-18 18:12:47 +01:00
UpdaterCommon
VideoBackends Merge pull request #14042 from iwubcode/bp_functions_global 2025-11-02 13:17:38 -05:00
VideoCommon Merge pull request #14149 from iwubcode/shader_asset_vector_properties 2025-11-23 06:34:45 -05:00
WinUpdater
CMakeLists.txt
DolphinLib.ARM64.props
DolphinLib.props Merge pull request #14066 from Biendeo/master 2025-11-25 23:12:39 +01:00
DolphinLib.vcxproj Core/HW: Add Broadband Adapter (IPC). 2025-10-28 18:50:59 +00:00
DolphinLib.vcxproj.user
DolphinLib.x64.props
VersionInfo.plist.in