@@ -7295,6 +7295,9 @@ wasm_loader_find_block_addr(WASMExecEnv *exec_env, BlockAddr *block_addr_cache,
72957295 case WASM_OP_SELECT:
72967296 case WASM_OP_DROP_64:
72977297 case WASM_OP_SELECT_64:
7298+ #if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
7299+ case WASM_OP_SELECT_128:
7300+ #endif
72987301 break;
72997302
73007303#if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0
@@ -12809,6 +12812,42 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1280912812#if (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) \
1281012813 || (WASM_ENABLE_FAST_INTERP != 0)
1281112814 case VALUE_TYPE_V128:
12815+ #if WASM_ENABLE_FAST_INTERP == 0
12816+ *(p - 1) = WASM_OP_SELECT_128;
12817+ #endif
12818+ #if WASM_ENABLE_FAST_INTERP != 0
12819+ if (loader_ctx->p_code_compiled) {
12820+ uint8 opcode_tmp = WASM_OP_SELECT_128;
12821+ #if WASM_ENABLE_LABELS_AS_VALUES != 0
12822+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12823+ *(void **)(p_code_compiled_tmp
12824+ - sizeof(void *)) =
12825+ handle_table[opcode_tmp];
12826+ #else
12827+ #if UINTPTR_MAX == UINT64_MAX
12828+ /* emit int32 relative offset in 64-bit target
12829+ */
12830+ int32 offset =
12831+ (int32)((uint8 *)handle_table[opcode_tmp]
12832+ - (uint8 *)handle_table[0]);
12833+ *(int32 *)(p_code_compiled_tmp
12834+ - sizeof(int32)) = offset;
12835+ #else
12836+ /* emit uint32 label address in 32-bit target */
12837+ *(uint32 *)(p_code_compiled_tmp
12838+ - sizeof(uint32)) =
12839+ (uint32)(uintptr_t)handle_table[opcode_tmp];
12840+ #endif
12841+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12842+ #else /* else of WASM_ENABLE_LABELS_AS_VALUES */
12843+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12844+ *(p_code_compiled_tmp - 1) = opcode_tmp;
12845+ #else
12846+ *(p_code_compiled_tmp - 2) = opcode_tmp;
12847+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12848+ #endif /* end of WASM_ENABLE_LABELS_AS_VALUES */
12849+ }
12850+ #endif /* end of WASM_ENABLE_FAST_INTERP */
1281212851 break;
1281312852#endif /* (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) || \
1281412853 (WASM_ENABLE_FAST_INTERP != 0) */
@@ -12909,9 +12948,7 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1290912948#if (WASM_ENABLE_SIMD == 0) \
1291012949 || ((WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \
1291112950 && (WASM_ENABLE_FAST_INTERP == 0))
12912- set_error_buf(error_buf, error_buf_size,
12913- "SIMD v128 type isn't supported");
12914- goto fail;
12951+ opcode_tmp = WASM_OP_SELECT_128;
1291512952#endif
1291612953 }
1291712954 else {
0 commit comments