@@ -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
@@ -12770,17 +12773,15 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1277012773 case VALUE_TYPE_F64:
1277112774#if WASM_ENABLE_FAST_INTERP == 0
1277212775 *(p - 1) = WASM_OP_SELECT_64;
12773- #endif
12774- #if WASM_ENABLE_FAST_INTERP != 0
12776+ #else
1277512777 if (loader_ctx->p_code_compiled) {
1277612778 uint8 opcode_tmp = WASM_OP_SELECT_64;
1277712779#if WASM_ENABLE_LABELS_AS_VALUES != 0
1277812780#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
1277912781 *(void **)(p_code_compiled_tmp
1278012782 - sizeof(void *)) =
1278112783 handle_table[opcode_tmp];
12782- #else
12783- #if UINTPTR_MAX == UINT64_MAX
12784+ #elif UINTPTR_MAX == UINT64_MAX
1278412785 /* emit int32 relative offset in 64-bit target
1278512786 */
1278612787 int32 offset =
@@ -12793,7 +12794,6 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1279312794 *(uint32 *)(p_code_compiled_tmp
1279412795 - sizeof(uint32)) =
1279512796 (uint32)(uintptr_t)handle_table[opcode_tmp];
12796- #endif
1279712797#endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
1279812798#else /* else of WASM_ENABLE_LABELS_AS_VALUES */
1279912799#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
@@ -12809,6 +12809,39 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1280912809#if (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) \
1281012810 || (WASM_ENABLE_FAST_INTERP != 0)
1281112811 case VALUE_TYPE_V128:
12812+ #if WASM_ENABLE_FAST_INTERP == 0
12813+ *(p - 1) = WASM_OP_SELECT_128;
12814+ #else
12815+ if (loader_ctx->p_code_compiled) {
12816+ uint8 opcode_tmp = WASM_OP_SELECT_128;
12817+ #if WASM_ENABLE_LABELS_AS_VALUES != 0
12818+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12819+ *(void **)(p_code_compiled_tmp
12820+ - sizeof(void *)) =
12821+ handle_table[opcode_tmp];
12822+ #elif UINTPTR_MAX == UINT64_MAX
12823+ /* emit int32 relative offset in 64-bit target
12824+ */
12825+ int32 offset =
12826+ (int32)((uint8 *)handle_table[opcode_tmp]
12827+ - (uint8 *)handle_table[0]);
12828+ *(int32 *)(p_code_compiled_tmp
12829+ - sizeof(int32)) = offset;
12830+ #else
12831+ /* emit uint32 label address in 32-bit target */
12832+ *(uint32 *)(p_code_compiled_tmp
12833+ - sizeof(uint32)) =
12834+ (uint32)(uintptr_t)handle_table[opcode_tmp];
12835+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12836+ #else /* else of WASM_ENABLE_LABELS_AS_VALUES */
12837+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12838+ *(p_code_compiled_tmp - 1) = opcode_tmp;
12839+ #else
12840+ *(p_code_compiled_tmp - 2) = opcode_tmp;
12841+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12842+ #endif /* end of WASM_ENABLE_LABELS_AS_VALUES */
12843+ }
12844+ #endif /* end of WASM_ENABLE_FAST_INTERP */
1281212845 break;
1281312846#endif /* (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) || \
1281412847 (WASM_ENABLE_FAST_INTERP != 0) */
@@ -12906,12 +12939,9 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1290612939 uint8 opcode_tmp = WASM_OP_SELECT;
1290712940
1290812941 if (type == VALUE_TYPE_V128) {
12909- #if (WASM_ENABLE_SIMD == 0) \
12910- || ((WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \
12911- && (WASM_ENABLE_FAST_INTERP == 0))
12912- set_error_buf(error_buf, error_buf_size,
12913- "SIMD v128 type isn't supported");
12914- goto fail;
12942+ #if WASM_ENABLE_JIT != 0 \
12943+ || WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
12944+ opcode_tmp = WASM_OP_SELECT_128;
1291512945#endif
1291612946 }
1291712947 else {
0 commit comments