diff --git a/build-scripts/config_common.cmake b/build-scripts/config_common.cmake index 7ded52fd9..82d59ba2a 100644 --- a/build-scripts/config_common.cmake +++ b/build-scripts/config_common.cmake @@ -377,10 +377,7 @@ else () message (" Wakeup of blocking operations enabled") endif () if (WAMR_BUILD_SIMD EQUAL 1) - if (WAMR_BUILD_FAST_INTERP EQUAL 1 AND WAMR_BUILD_SIMDE EQUAL 0) - set(SIMD_ENABLED 0) - message(" SIMD disabled for fast-interp as simde is not being built") - elseif (WAMR_BUILD_TARGET MATCHES "RISCV64.*") + if (WAMR_BUILD_TARGET MATCHES "RISCV64.*") set(SIMD_ENABLED 0) message (" SIMD disabled due to not supported on target RISCV64") else() diff --git a/build-scripts/runtime_lib.cmake b/build-scripts/runtime_lib.cmake index 994414ffa..d9459838e 100644 --- a/build-scripts/runtime_lib.cmake +++ b/build-scripts/runtime_lib.cmake @@ -155,16 +155,6 @@ if (WAMR_BUILD_LIB_RATS EQUAL 1) include (${IWASM_DIR}/libraries/lib-rats/lib_rats.cmake) endif () -if (WAMR_BUILD_SIMD EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1) - if (WAMR_BUILD_PLATFORM STREQUAL "windows") - message(STATUS "SIMDe doesnt support platform " ${WAMR_BUILD_PLATFORM}) - set(WAMR_BUILD_SIMDE 0) - else() - include (${IWASM_DIR}/libraries/simde/simde.cmake) - set (WAMR_BUILD_SIMDE 1) - endif() -endif () - if (WAMR_BUILD_WASM_CACHE EQUAL 1) include (${WAMR_ROOT_DIR}/build-scripts/involve_boringssl.cmake) endif () @@ -178,6 +168,18 @@ endif () # include the build config template file include (${CMAKE_CURRENT_LIST_DIR}/config_common.cmake) +if (WAMR_BUILD_SIMD EQUAL 1 AND WAMR_BUILD_FAST_INTERP EQUAL 1) + if (WAMR_BUILD_PLATFORM STREQUAL "windows") + message(STATUS "SIMDe doesnt support platform " ${WAMR_BUILD_PLATFORM}) + set(WAMR_BUILD_SIMDE 0) + else() + include (${IWASM_DIR}/libraries/simde/simde.cmake) + set (WAMR_BUILD_SIMDE 1) + endif() +else() + set(WAMR_BUILD_SIMDE 0) +endif () + include_directories (${IWASM_DIR}/include) file (GLOB header diff --git a/core/iwasm/common/wasm_loader_common.c b/core/iwasm/common/wasm_loader_common.c index 6018f90a6..dc8009205 100644 --- a/core/iwasm/common/wasm_loader_common.c +++ b/core/iwasm/common/wasm_loader_common.c @@ -152,11 +152,12 @@ bool is_valid_value_type_for_interpreter(uint8 value_type) { #if (WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \ - && (WASM_ENABLE_FAST_INTERP == 0) + && (WASM_ENABLE_SIMDE == 0) /* - * Note: regardless of WASM_ENABLE_SIMD, our interpreters don't have - * SIMD implemented. It's safer to reject v128, especially for the - * fast interpreter. + * Note: regardless of WASM_ENABLE_SIMD, our classic interpreters don't + * have SIMD implemented. + * + * WASM_ENABLE_SIMDE is used to control SIMD feaure in fast interpreter */ if (value_type == VALUE_TYPE_V128) return false; diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index f33ad60e3..78b2f609e 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -3565,7 +3565,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, HANDLE_OP_END(); } -#if WASM_ENABLE_SIMD != 0 +#if WASM_ENABLE_SIMDE != 0 HANDLE_OP(EXT_OP_SET_LOCAL_FAST_V128) HANDLE_OP(EXT_OP_TEE_LOCAL_FAST_V128) { @@ -3619,7 +3619,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, GET_I64_FROM_ADDR((uint32 *)global_addr)); HANDLE_OP_END(); } -#if WASM_ENABLE_SIMD != 0 +#if WASM_ENABLE_SIMDE != 0 HANDLE_OP(WASM_OP_GET_GLOBAL_V128) { global_idx = read_uint32(frame_ip); @@ -4956,7 +4956,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module, HANDLE_OP_END(); } -#if WASM_ENABLE_SIMD != 0 +#if WASM_ENABLE_SIMDE != 0 HANDLE_OP(EXT_OP_COPY_STACK_TOP_V128) { addr1 = GET_OFFSET();