implement POP_V128()

This is to simplify the simd implementation for fast interpreter
This commit is contained in:
Marcin Kolny 2024-10-01 11:10:22 +01:00
parent 326aea298c
commit 860379bc58
2 changed files with 5 additions and 3 deletions

View File

@ -89,7 +89,8 @@ is_valid_value_type(uint8 type)
bool bool
is_valid_value_type_for_interpreter(uint8 value_type) is_valid_value_type_for_interpreter(uint8 value_type)
{ {
#if (WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) #if (WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \
&& (WASM_ENABLE_FAST_INTERP == 0)
/* /*
* Note: regardless of WASM_ENABLE_SIMD, our interpreters don't have * Note: regardless of WASM_ENABLE_SIMD, our interpreters don't have
* SIMD implemented. It's safer to reject v128, especially for the * SIMD implemented. It's safer to reject v128, especially for the

View File

@ -485,6 +485,8 @@ wasm_interp_get_frame_ref(WASMInterpFrame *frame)
#define POP_I64() (GET_I64_FROM_ADDR(frame_lp + GET_OFFSET())) #define POP_I64() (GET_I64_FROM_ADDR(frame_lp + GET_OFFSET()))
#define POP_V128() (GET_V128_FROM_ADDR(frame_lp + GET_OFFSET()))
#define POP_F64() (GET_F64_FROM_ADDR(frame_lp + GET_OFFSET())) #define POP_F64() (GET_F64_FROM_ADDR(frame_lp + GET_OFFSET()))
#define POP_REF() \ #define POP_REF() \
@ -5662,8 +5664,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
} }
case SIMD_v128_any_true: case SIMD_v128_any_true:
{ {
V128 value = GET_OPERAND_V128(0); V128 value = POP_V128();
frame_ip += 2;
addr_ret = GET_OFFSET(); addr_ret = GET_OFFSET();
frame_lp[addr_ret] = frame_lp[addr_ret] =
value.i64x2[0] != 0 || value.i64x2[1] != 0; value.i64x2[0] != 0 || value.i64x2[1] != 0;