Compare commits

...

5 Commits

Author SHA1 Message Date
Maks Litskevich
af3eb96b9b
Merge beb079563a into 0e8b57d8a8 2025-05-07 13:40:34 +09:00
Chris Woods
0e8b57d8a8
More detail to python setup, and fixed small typo (#4247)
Some checks are pending
compilation on SGX / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, ubuntu-22.04, linux-sgx) (push) Waiting to run
compilation on SGX / build_iwasm (-DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_JIT_BUILD_OPTIONS, ubuntu-22.04, linux-sgx) (push) Waiting to run
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / build (-DWAMR_BUILD_AOT=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_CUSTOM_NAME_SECTION=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_DEBUG_INTERP=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_PTHREAD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_LIB_WASI_THREADS=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_REF_TYPES=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_SIMD=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_BUILD_TAIL_CALL=1) (push) Waiting to run
compilation on windows-latest / build (-DWAMR_DISABLE_HW_BOUND_CHECK=1) (push) Waiting to run
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Blocked by required conditions
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Blocked by required conditions
2025-05-07 11:32:43 +08:00
YAMAMOTO Takashi
88b5f6a535
samples/wasm-c-api: remove unused valgrind detection (#4249)
- it's unused
- valgrind is basically a linux-only software.
  it isn't a good idea to make it a hard requirement.
  if we want to use valgrind, it's better to introduce
  a separate option to control it.
2025-05-07 11:32:29 +08:00
YAMAMOTO Takashi
ac2fe552d5
aot_resolve_object_relocation_group: adapt to LLVM 16 (#4250)
cf. https://reviews.llvm.org/D123264
2025-05-07 11:32:14 +08:00
Maks Litskevich
beb079563a Add select 128 2025-05-03 01:28:47 +03:00
7 changed files with 87 additions and 28 deletions

View File

@ -1316,6 +1316,13 @@ aot_compile_func(AOTCompContext *comp_ctx, uint32 func_index)
return false; return false;
break; break;
#if WASM_ENABLE_SIMD != 0
case WASM_OP_SELECT_128:
if (!aot_compile_op_select(comp_ctx, func_ctx, true))
return false;
break;
#endif
#if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0 #if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0
case WASM_OP_SELECT_T: case WASM_OP_SELECT_T:
{ {

View File

@ -4007,8 +4007,12 @@ aot_resolve_object_relocation_group(AOTObjectData *obj_data,
&& (str_starts_with(relocation->symbol_name, ".LCPI") && (str_starts_with(relocation->symbol_name, ".LCPI")
|| str_starts_with(relocation->symbol_name, ".LJTI") || str_starts_with(relocation->symbol_name, ".LJTI")
|| str_starts_with(relocation->symbol_name, ".LBB") || str_starts_with(relocation->symbol_name, ".LBB")
|| str_starts_with(relocation->symbol_name, || str_starts_with(relocation->symbol_name, ".Lswitch.table.")
".Lswitch.table."))) { #if LLVM_VERSION_MAJOR >= 16
/* cf. https://reviews.llvm.org/D123264 */
|| str_starts_with(relocation->symbol_name, ".Lpcrel_hi")
#endif
)) {
/* change relocation->relocation_addend and /* change relocation->relocation_addend and
relocation->symbol_name */ relocation->symbol_name */
LLVMSectionIteratorRef contain_section; LLVMSectionIteratorRef contain_section;

View File

@ -1888,6 +1888,28 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
} }
HANDLE_OP_END(); HANDLE_OP_END();
} }
#if WASM_ENABLE_JIT != 0 \
|| WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
HANDLE_OP(WASM_OP_SELECT_128)
{
cond = frame_lp[GET_OFFSET()];
addr1 = GET_OFFSET();
addr2 = GET_OFFSET();
addr_ret = GET_OFFSET();
if (!cond) {
if (addr_ret != addr1)
PUT_V128_TO_ADDR(frame_lp + addr_ret,
GET_V128_FROM_ADDR(frame_lp + addr1));
}
else {
if (addr_ret != addr2)
PUT_V128_TO_ADDR(frame_lp + addr_ret,
GET_V128_FROM_ADDR(frame_lp + addr2));
}
HANDLE_OP_END();
}
#endif
#if WASM_ENABLE_GC != 0 #if WASM_ENABLE_GC != 0
HANDLE_OP(WASM_OP_SELECT_T) HANDLE_OP(WASM_OP_SELECT_T)

View File

@ -7295,6 +7295,9 @@ wasm_loader_find_block_addr(WASMExecEnv *exec_env, BlockAddr *block_addr_cache,
case WASM_OP_SELECT: case WASM_OP_SELECT:
case WASM_OP_DROP_64: case WASM_OP_DROP_64:
case WASM_OP_SELECT_64: case WASM_OP_SELECT_64:
#if WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
case WASM_OP_SELECT_128:
#endif
break; break;
#if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0 #if WASM_ENABLE_REF_TYPES != 0 || WASM_ENABLE_GC != 0
@ -12779,8 +12782,7 @@ re_scan:
case VALUE_TYPE_F64: case VALUE_TYPE_F64:
#if WASM_ENABLE_FAST_INTERP == 0 #if WASM_ENABLE_FAST_INTERP == 0
*(p - 1) = WASM_OP_SELECT_64; *(p - 1) = WASM_OP_SELECT_64;
#endif #else
#if WASM_ENABLE_FAST_INTERP != 0
if (loader_ctx->p_code_compiled) { if (loader_ctx->p_code_compiled) {
uint8 opcode_tmp = WASM_OP_SELECT_64; uint8 opcode_tmp = WASM_OP_SELECT_64;
#if WASM_ENABLE_LABELS_AS_VALUES != 0 #if WASM_ENABLE_LABELS_AS_VALUES != 0
@ -12788,8 +12790,7 @@ re_scan:
*(void **)(p_code_compiled_tmp *(void **)(p_code_compiled_tmp
- sizeof(void *)) = - sizeof(void *)) =
handle_table[opcode_tmp]; handle_table[opcode_tmp];
#else #elif UINTPTR_MAX == UINT64_MAX
#if UINTPTR_MAX == UINT64_MAX
/* emit int32 relative offset in 64-bit target /* emit int32 relative offset in 64-bit target
*/ */
int32 offset = int32 offset =
@ -12802,7 +12803,6 @@ re_scan:
*(uint32 *)(p_code_compiled_tmp *(uint32 *)(p_code_compiled_tmp
- sizeof(uint32)) = - sizeof(uint32)) =
(uint32)(uintptr_t)handle_table[opcode_tmp]; (uint32)(uintptr_t)handle_table[opcode_tmp];
#endif
#endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */ #endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
#else /* else of WASM_ENABLE_LABELS_AS_VALUES */ #else /* else of WASM_ENABLE_LABELS_AS_VALUES */
#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0 #if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
@ -12818,6 +12818,39 @@ re_scan:
#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) || (WASM_ENABLE_FAST_INTERP != 0)
case VALUE_TYPE_V128: case VALUE_TYPE_V128:
#if WASM_ENABLE_FAST_INTERP == 0
*(p - 1) = WASM_OP_SELECT_128;
#else
if (loader_ctx->p_code_compiled) {
uint8 opcode_tmp = WASM_OP_SELECT_128;
#if WASM_ENABLE_LABELS_AS_VALUES != 0
#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
*(void **)(p_code_compiled_tmp
- sizeof(void *)) =
handle_table[opcode_tmp];
#elif UINTPTR_MAX == UINT64_MAX
/* emit int32 relative offset in 64-bit target
*/
int32 offset =
(int32)((uint8 *)handle_table[opcode_tmp]
- (uint8 *)handle_table[0]);
*(int32 *)(p_code_compiled_tmp
- sizeof(int32)) = offset;
#else
/* emit uint32 label address in 32-bit target */
*(uint32 *)(p_code_compiled_tmp
- sizeof(uint32)) =
(uint32)(uintptr_t)handle_table[opcode_tmp];
#endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
#else /* else of WASM_ENABLE_LABELS_AS_VALUES */
#if WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS != 0
*(p_code_compiled_tmp - 1) = opcode_tmp;
#else
*(p_code_compiled_tmp - 2) = opcode_tmp;
#endif /* end of WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS */
#endif /* end of WASM_ENABLE_LABELS_AS_VALUES */
}
#endif /* end of WASM_ENABLE_FAST_INTERP */
break; break;
#endif /* (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) || \ #endif /* (WASM_ENABLE_WAMR_COMPILER != 0) || (WASM_ENABLE_JIT != 0) || \
(WASM_ENABLE_FAST_INTERP != 0) */ (WASM_ENABLE_FAST_INTERP != 0) */
@ -12915,12 +12948,9 @@ re_scan:
uint8 opcode_tmp = WASM_OP_SELECT; uint8 opcode_tmp = WASM_OP_SELECT;
if (type == VALUE_TYPE_V128) { if (type == VALUE_TYPE_V128) {
#if (WASM_ENABLE_SIMD == 0) \ #if WASM_ENABLE_JIT != 0 \
|| ((WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0) \ || WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0
&& (WASM_ENABLE_FAST_INTERP == 0)) opcode_tmp = WASM_OP_SELECT_128;
set_error_buf(error_buf, error_buf_size,
"SIMD v128 type isn't supported");
goto fail;
#endif #endif
} }
else { else {

View File

@ -278,13 +278,14 @@ typedef enum WASMOpcode {
DEBUG_OP_BREAK = 0xdc, /* debug break point */ DEBUG_OP_BREAK = 0xdc, /* debug break point */
#endif #endif
#if WASM_ENABLE_JIT != 0 \ #if WASM_ENABLE_JIT != 0 || WASM_ENABLE_FAST_INTERP != 0 \
|| WASM_ENABLE_FAST_INTERP != 0 && WASM_ENABLE_SIMD != 0 || WASM_ENABLE_WAMR_COMPILER != 0 && WASM_ENABLE_SIMD != 0
EXT_OP_SET_LOCAL_FAST_V128 = 0xdd, EXT_OP_SET_LOCAL_FAST_V128 = 0xdd,
EXT_OP_TEE_LOCAL_FAST_V128 = 0xde, EXT_OP_TEE_LOCAL_FAST_V128 = 0xde,
EXT_OP_COPY_STACK_TOP_V128 = 0xdf, EXT_OP_COPY_STACK_TOP_V128 = 0xdf,
WASM_OP_GET_GLOBAL_V128 = 0xe0, WASM_OP_GET_GLOBAL_V128 = 0xe0,
WASM_OP_SET_GLOBAL_V128 = 0xe1, WASM_OP_SET_GLOBAL_V128 = 0xe1,
WASM_OP_SELECT_128 = 0xe2,
#endif #endif
/* Post-MVP extend op prefix */ /* Post-MVP extend op prefix */
@ -804,7 +805,8 @@ typedef enum WASMAtomicEXTOpcode {
SET_GOTO_TABLE_ELEM(EXT_OP_TEE_LOCAL_FAST_V128), /* 0xde */ \ SET_GOTO_TABLE_ELEM(EXT_OP_TEE_LOCAL_FAST_V128), /* 0xde */ \
SET_GOTO_TABLE_ELEM(EXT_OP_COPY_STACK_TOP_V128), /* 0xdf */ \ SET_GOTO_TABLE_ELEM(EXT_OP_COPY_STACK_TOP_V128), /* 0xdf */ \
SET_GOTO_TABLE_ELEM(WASM_OP_GET_GLOBAL_V128), /* 0xe0 */ \ SET_GOTO_TABLE_ELEM(WASM_OP_GET_GLOBAL_V128), /* 0xe0 */ \
SET_GOTO_TABLE_ELEM(WASM_OP_SET_GLOBAL_V128), /* 0xe1 */ SET_GOTO_TABLE_ELEM(WASM_OP_SET_GLOBAL_V128), /* 0xe1 */ \
SET_GOTO_TABLE_ELEM(WASM_OP_SELECT_128), /* 0xe2 */
#else #else
#define DEF_EXT_V128_HANDLE() #define DEF_EXT_V128_HANDLE()

View File

@ -1,14 +1,17 @@
# WARM API # WAMR API
* **Notice**: The python package `wamr.wamrapi.wamr` need python >= `3.10`. * **Notice**: The python package `wamr.wamrapi.wamr` requires a python version >= `3.10`.
## Setup ## Setup
### Pre-requisites ### Pre-requisites
#### Install requirements
Before proceeding it is necessary to make sure your Python environment is correctly configured. To do ths open a terminal session in this directory and perfom the following:
Install requirements,
```shell ```shell
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```

View File

@ -205,12 +205,3 @@ foreach(EX ${EXAMPLES})
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
) )
endforeach() endforeach()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
find_program(VALGRIND
valgrind
REQUIRED
)
# run `ctest -T memcheck -V --test-dir build`
endif()