dolphin/Source
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
..
Android Merge pull request #14159 from JosJuice/android-retroachievements-login-gone 2025-11-25 20:52:29 +01:00
Core Jit64: Flush carry flag in FallBackToInterpreter 2025-11-29 11:45:43 +01:00
DSPSpy DSPSpy: Make RealDSP final and make overide explicit 2025-05-10 13:02:55 +02:00
DSPTool Host: Remove unnecessary functions 2025-08-03 13:19:30 -07:00
PCH
UnitTests Merge pull request #13689 from JosJuice/lock-core-any-thread 2025-11-16 18:35:17 +01:00
VSProps Merge pull request #13694 from jordan-woyak/sdl3 2025-06-24 18:59:48 -04:00
.clang-format Clang-format: Fix invalid settings 2025-05-01 22:05:07 +02:00
CMakeLists.txt CMakeLists: Disable -Wtrigraphs. 2025-11-08 22:38:03 +00:00
dolphin-emu.sln Core/HW: Add Visual Studio project files for cpp-ipc library. 2025-10-28 18:50:58 +00:00