From 72535e4e4523a01d92487e338fa46f145ab0a7a8 Mon Sep 17 00:00:00 2001 From: Maks Litskevich Date: Mon, 27 Jan 2025 16:03:59 +0000 Subject: [PATCH] correct endif wasm loader --- core/iwasm/interpreter/wasm_interp_fast.c | 1 - core/iwasm/interpreter/wasm_loader.c | 2 +- core/iwasm/interpreter/wasm_opcode.h | 9 +++------ core/iwasm/libraries/simde/simde.cmake | 7 +++++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index c8f00aed9..ee1ba73c6 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -7019,7 +7019,6 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, } case SIMD_i32x4_add: { - SIMD_DOUBLE_OP(simde_wasm_i32x4_add); break; } diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index efd95f426..4e2d6f337 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -13228,10 +13228,10 @@ re_scan: skip_label(); emit_label(WASM_OP_GET_GLOBAL_128); } -#endif #endif /* end of WASM_ENABLE_SIMDE */ emit_uint32(loader_ctx, global_idx); PUSH_OFFSET_TYPE(global_type); +#endif /* end of WASM_ENABLE_FAST_INTERP */ break; } diff --git a/core/iwasm/interpreter/wasm_opcode.h b/core/iwasm/interpreter/wasm_opcode.h index 0ddf8153a..a8118ead0 100644 --- a/core/iwasm/interpreter/wasm_opcode.h +++ b/core/iwasm/interpreter/wasm_opcode.h @@ -278,8 +278,7 @@ typedef enum WASMOpcode { DEBUG_OP_BREAK = 0xdc, /* debug break point */ #endif -#if (WASM_ENABLE_JIT != 0 \ - || (WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMDE != 0)) \ +#if (WASM_ENABLE_JIT != 0 || (WASM_ENABLE_FAST_INTERP != 0)) \ && WASM_ENABLE_SIMD != 0 EXT_OP_SET_LOCAL_FAST_V128 = 0xdd, EXT_OP_TEE_LOCAL_FAST_V128 = 0xde, @@ -791,8 +790,7 @@ typedef enum WASMAtomicEXTOpcode { #endif #define SET_GOTO_TABLE_ELEM(opcode) [opcode] = HANDLE_OPCODE(opcode) -#if (WASM_ENABLE_JIT != 0 \ - || (WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMDE != 0)) \ +#if (WASM_ENABLE_JIT != 0 || (WASM_ENABLE_FAST_INTERP != 0)) \ && WASM_ENABLE_SIMD != 0 #define SET_GOTO_TABLE_SIMD_PREFIX_ELEM() \ SET_GOTO_TABLE_ELEM(WASM_OP_SIMD_PREFIX), @@ -800,8 +798,7 @@ typedef enum WASMAtomicEXTOpcode { #define SET_GOTO_TABLE_SIMD_PREFIX_ELEM() #endif -#if (WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMDE != 0) \ - && WASM_ENABLE_SIMD != 0 +#if (WASM_ENABLE_FAST_INTERP != 0) && WASM_ENABLE_SIMD != 0 #define DEF_EXT_V128_HANDLE() \ SET_GOTO_TABLE_ELEM(EXT_OP_SET_LOCAL_FAST_V128), \ SET_GOTO_TABLE_ELEM(EXT_OP_TEE_LOCAL_FAST_V128), \ diff --git a/core/iwasm/libraries/simde/simde.cmake b/core/iwasm/libraries/simde/simde.cmake index b36e35694..1219c8e5b 100644 --- a/core/iwasm/libraries/simde/simde.cmake +++ b/core/iwasm/libraries/simde/simde.cmake @@ -4,9 +4,12 @@ set (LIB_SIMDE_DIR ${CMAKE_CURRENT_LIST_DIR}) -if (WAMR_BUILD_TARGET MATCHES "AARCH64.*" OR "ARM.*") +if (WAMR_BUILD_TARGET MATCHES "AARCH64.*" OR WAMR_BUILD_TARGET MATCHES "ARM.*") add_definitions (-DWASM_ENABLE_SIMDE=1) -endif () +else() + message(WARNING "Disabling SIMD for fast interpreter as the target is not supported") + set(WAMR_BUILD_SIMD 0) +endif() include_directories(${LIB_SIMDE_DIR} ${LIB_SIMDE_DIR}/simde)