@@ -7304,6 +7304,9 @@ wasm_loader_find_block_addr(WASMExecEnv *exec_env, BlockAddr *block_addr_cache,
7304
7304
case WASM_OP_SELECT:
7305
7305
case WASM_OP_DROP_64:
7306
7306
case WASM_OP_SELECT_64:
7307
+ #if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
7308
+ case WASM_OP_SELECT_128:
7309
+ #endif
7307
7310
break;
7308
7311
7309
7312
#if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0
@@ -12788,17 +12791,15 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
12788
12791
case VALUE_TYPE_F64:
12789
12792
#if WASM_ENABLE_FAST_INTERP == 0
12790
12793
*(p - 1) = WASM_OP_SELECT_64;
12791
- #endif
12792
- #if WASM_ENABLE_FAST_INTERP != 0
12794
+ #else
12793
12795
if (loader_ctx->p_code_compiled) {
12794
12796
uint8 opcode_tmp = WASM_OP_SELECT_64;
12795
12797
#if WASM_ENABLE_LABELS_AS_VALUES != 0
12796
12798
#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12797
12799
*(void **)(p_code_compiled_tmp
12798
12800
- sizeof(void *)) =
12799
12801
handle_table[opcode_tmp];
12800
- #else
12801
- #if UINTPTR_MAX == UINT64_MAX
12802
+ #elif UINTPTR_MAX == UINT64_MAX
12802
12803
/* emit int32 relative offset in 64-bit target
12803
12804
*/
12804
12805
int32 offset =
@@ -12811,7 +12812,6 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
12811
12812
*(uint32 *)(p_code_compiled_tmp
12812
12813
- sizeof(uint32)) =
12813
12814
(uint32)(uintptr_t)handle_table[opcode_tmp];
12814
- #endif
12815
12815
#endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12816
12816
#else /* else of WASM_ENABLE_LABELS_AS_VALUES */
12817
12817
#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
@@ -12827,6 +12827,39 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
12827
12827
#if (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) \
12828
12828
|| (WASM_ENABLE_FAST_INTERP != 0)
12829
12829
case VALUE_TYPE_V128:
12830
+ #if WASM_ENABLE_FAST_INTERP == 0
12831
+ *(p - 1) = WASM_OP_SELECT_128;
12832
+ #else
12833
+ if (loader_ctx->p_code_compiled) {
12834
+ uint8 opcode_tmp = WASM_OP_SELECT_128;
12835
+ #if WASM_ENABLE_LABELS_AS_VALUES != 0
12836
+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12837
+ *(void **)(p_code_compiled_tmp
12838
+ - sizeof(void *)) =
12839
+ handle_table[opcode_tmp];
12840
+ #elif UINTPTR_MAX == UINT64_MAX
12841
+ /* emit int32 relative offset in 64-bit target
12842
+ */
12843
+ int32 offset =
12844
+ (int32)((uint8 *)handle_table[opcode_tmp]
12845
+ - (uint8 *)handle_table[0]);
12846
+ *(int32 *)(p_code_compiled_tmp
12847
+ - sizeof(int32)) = offset;
12848
+ #else
12849
+ /* emit uint32 label address in 32-bit target */
12850
+ *(uint32 *)(p_code_compiled_tmp
12851
+ - sizeof(uint32)) =
12852
+ (uint32)(uintptr_t)handle_table[opcode_tmp];
12853
+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12854
+ #else /* else of WASM_ENABLE_LABELS_AS_VALUES */
12855
+ #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
12856
+ *(p_code_compiled_tmp - 1) = opcode_tmp;
12857
+ #else
12858
+ *(p_code_compiled_tmp - 2) = opcode_tmp;
12859
+ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
12860
+ #endif /* end of WASM_ENABLE_LABELS_AS_VALUES */
12861
+ }
12862
+ #endif /* end of WASM_ENABLE_FAST_INTERP */
12830
12863
break;
12831
12864
#endif /* (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) || \
12832
12865
(WASM_ENABLE_FAST_INTERP != 0) */
@@ -12924,12 +12957,12 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
12924
12957
uint8 opcode_tmp = WASM_OP_SELECT;
12925
12958
12926
12959
if (type == VALUE_TYPE_V128) {
12927
- #if (WASM_ENABLE_SIMD == 0) \
12928
- || ((WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \
12929
- && (WASM_ENABLE_FAST_INTERP == 0))
12960
+ #if WASM_ENABLE_JIT != 0 \
12961
+ || WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
12962
+ opcode_tmp = WASM_OP_SELECT_128;
12963
+ #else
12930
12964
set_error_buf(error_buf, error_buf_size,
12931
- "SIMD v128 type isn't supported");
12932
- goto fail;
12965
+ "v128 value type requires simd feature");
12933
12966
#endif
12934
12967
}
12935
12968
else {
0 commit comments