From 1bcf829da26ab439b21bfb043b76611c8344d51d Mon Sep 17 00:00:00 2001 From: Student Main Date: Sun, 17 May 2026 17:28:09 +0800 Subject: [PATCH] fallback to pure C emulation when LSX is not supported by processor --- src/emu/sigill_hook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emu/sigill_hook.c b/src/emu/sigill_hook.c index 2985358..cad5edc 100644 --- a/src/emu/sigill_hook.c +++ b/src/emu/sigill_hook.c @@ -31,6 +31,7 @@ #include #include #include "lasx_interpret.h" +#include int use_lsx_intrinsics; #ifdef LASX_PROFILE @@ -121,6 +122,10 @@ __attribute__((constructor)) void register_sigill_handler(void) { if (env && atoi(env) != 0) { use_lsx_intrinsics = 0; } + const bool has_lsx = __cpucfg(2) & 0b01000000; + if (!has_lsx) { + use_lsx_intrinsics = 0; + } // 初始化性能统计 perf_stats_init();