PlayAgain 0101: the dcbx-loop invalidation rule is the same with the wasm JIT on and off (design R5). SPDX-License-Identifier: GPL-2.0-or-later Tree: vendor/dolphin (Dolphin e22551ea + the fork's 150 locked patches, Remenby31/wasm-dolphin 50f0c362). What: FastDcbxLoop skipped every dcbx-loop icache invalidation when the wasm JIT is off, on the grounds that there are no compiled blocks; but the cached interpreter's own blocks are cached and invalidated too, so JIT off was another emulation, not a clean reference for JIT-on digests. Now only loops over 64 lines are skipped, in every mode. With the JIT on nothing changes. Switch: ?dcbxskip=legacy (bit 0 of the cached-interpreter mask, ENABLE polarity, set by 0101-fork in src/core-host.js) restores the old JIT-off skip. --- a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp +++ b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp @@ -401,7 +401,10 @@ // (and wherever relaxed SIMD is missing or unfused): the plain-f64 path. std::atomic s_fused_madd{false}; -// Bits 0, 1 and 2 are unused (patch 0196 removed the helpers they gated). +// Bits 1 and 2 are unused (patch 0196 removed the helpers they gated). +// PlayAgain 0101: ENABLE polarity (default-off; ?dcbxskip=legacy). Set: with the wasm JIT off, +// every dcbx-loop invalidation is skipped again, as before 0101 (the fork's behaviour at 50f0c362). +constexpr u32 DOLPHIN_WEB_ENABLE_LEGACY_DCBX_SKIP = 1u << 0; constexpr u32 DOLPHIN_WEB_DISABLE_DCBXLOOP = 1u << 3; // DcbxLoop constexpr u32 DOLPHIN_WEB_DISABLE_FASTBRANCH = 1u << 4; // FastBranch + FastBranchBdnz constexpr u32 DOLPHIN_WEB_DISABLE_FASTFP = 1u << 5; // FastFloat emit path @@ -12789,11 +12792,14 @@ #ifdef __EMSCRIPTEN__ // Large dcb* sweeps are overwhelmingly data-buffer flushes in the browser path. Keeping small // invalidations preserves the self-modifying-code heuristic while avoiding multi-megabyte - // block-cache scans in hot post-boot loops. Additionally, when the experimental WASM JIT is - // not active (interpreter-only mode), there are no compiled blocks to invalidate, so every - // invalidation is wasted work - skip them all. + // block-cache scans in hot post-boot loops. + // PlayAgain 0101: the same rule with the wasm JIT on and off. The cached interpreter's own + // blocks are cached and invalidated too, so skipping every invalidation with the JIT off made + // JIT off a different emulation from JIT on (design R5), not a clean reference. Only loops + // over 64 lines are skipped, in every mode; ?dcbxskip=legacy restores the old rule. skipped_large_data_flush = - !s_wasm_jit_enabled || line_count > LARGE_DCBX_DATA_FLUSH_SKIP_LINES; + line_count > LARGE_DCBX_DATA_FLUSH_SKIP_LINES || + (!s_wasm_jit_enabled && DolphinWebHelperDisabled(DOLPHIN_WEB_ENABLE_LEGACY_DCBX_SKIP)); #endif if (skipped_large_data_flush) {