From c5d2adb303cdc9cc11d43fd30ea224137218fce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 20 Oct 2026 19:01:53 +0200 Subject: [PATCH] IR: Compile data cache ops to nothing The interpreter does nothing for any cache op but icache invalidation, but the IR only knew four of them and sent the rest to the interpreter one at a time. Media Engine code flushes its data cache with a loop of 0x14s, often every pass of its main loop: with the ME emulated (on a branch), mcidclan's me-simple-count went from 15.9 to 1.0 seconds for 3 emulated ones. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/MIPS/IR/IRCompLoadStore.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Core/MIPS/IR/IRCompLoadStore.cpp b/Core/MIPS/IR/IRCompLoadStore.cpp index e379385fcf..0e8354d239 100644 --- a/Core/MIPS/IR/IRCompLoadStore.cpp +++ b/Core/MIPS/IR/IRCompLoadStore.cpp @@ -158,13 +158,9 @@ namespace MIPSComp { int func = (op >> 16) & 0x1F; - // See Int_Cache for the definitions. - switch (func) { - case 24: break; - case 25: break; - case 27: break; - case 30: break; - default: + // See Int_Cache: only icache invalidation does anything, so the data cache ops (which ME + // code loops over to flush its cache) compile to nothing. + if (func == 8) { // Fall back to the interpreter. DISABLE; }