Skip to content

Commit 362946f

Browse files
committed
Merge remote-tracking branch 'origin/makslit/v128_fixes' into makslit/local_global
2 parents 6d3cf0b + 84d627d commit 362946f

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

core/iwasm/interpreter/wasm_interp_fast.c

+6-16
Original file line numberDiff line numberDiff line change
@@ -5836,10 +5836,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
58365836
case SIMD_v128_load:
58375837
{
58385838
uint32 offset, addr;
5839-
offset = read_uint32(
5840-
frame_ip); // TODO: Check with an offset!
5841-
addr = GET_OPERAND(uint32, I32, 0);
5842-
frame_ip += 2;
5839+
offset = read_uint32(frame_ip);
5840+
addr = POP_I32();
58435841
addr_ret = GET_OFFSET();
58445842
CHECK_MEMORY_OVERFLOW(16);
58455843
PUT_V128_TO_ADDR(frame_lp + addr_ret, LOAD_V128(maddr));
@@ -5934,9 +5932,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
59345932
uint32 offset, addr;
59355933
offset = read_uint32(frame_ip);
59365934
V128 data = POP_V128();
5937-
int32 base = POP_I32();
5938-
offset += base;
5939-
addr = GET_OPERAND(uint32, I32, 0);
5935+
addr = POP_I32();
59405936

59415937
CHECK_MEMORY_OVERFLOW(4);
59425938
STORE_V128(maddr, data);
@@ -6466,7 +6462,6 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
64666462

64676463
#define SIMD_LOAD_LANE_COMMON(vec, register, lane, width) \
64686464
do { \
6469-
addr = GET_OPERAND(uint32, I32, 0); \
64706465
addr_ret = GET_OFFSET(); \
64716466
CHECK_MEMORY_OVERFLOW(width / 8); \
64726467
if (width == 64) { \
@@ -6483,8 +6478,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
64836478
uint32 offset, addr; \
64846479
offset = read_uint32(frame_ip); \
64856480
V128 vec = POP_V128(); \
6486-
int32 base = POP_I32(); \
6487-
offset += base; \
6481+
addr = POP_I32(); \
64886482
int lane = *frame_ip++; \
64896483
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \
64906484
} while (0)
@@ -6514,11 +6508,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
65146508
uint32 offset, addr; \
65156509
offset = read_uint32(frame_ip); \
65166510
V128 vec = POP_V128(); \
6517-
int32 base = POP_I32(); \
6518-
offset += base; \
6511+
addr = POP_I32(); \
65196512
int lane = *frame_ip++; \
6520-
addr = GET_OPERAND(uint32, I32, 0); \
6521-
addr_ret = GET_OFFSET(); \
65226513
CHECK_MEMORY_OVERFLOW(width / 8); \
65236514
if (width == 64) { \
65246515
STORE_I64(maddr, vec.register[lane]); \
@@ -6555,8 +6546,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
65556546
do { \
65566547
uint32 offset, addr; \
65576548
offset = read_uint32(frame_ip); \
6558-
int32 base = POP_I32(); \
6559-
offset += base; \
6549+
addr = POP_I32(); \
65606550
int32 lane = 0; \
65616551
V128 vec = { 0 }; \
65626552
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \

core/iwasm/interpreter/wasm_loader.c

-4
Original file line numberDiff line numberDiff line change
@@ -15483,10 +15483,6 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1548315483

1548415484
read_leb_mem_offset(p, p_end, mem_offset); /* offset */
1548515485

15486-
#if WASM_ENABLE_FAST_INTERP != 0
15487-
emit_uint32(loader_ctx, mem_offset);
15488-
#endif
15489-
1549015486
CHECK_BUF(p, p_end, 1);
1549115487
lane = read_uint8(p);
1549215488
if (!check_simd_access_lane(opcode1, lane, error_buf,

core/iwasm/libraries/simde/simde.cmake

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
set (LIB_SIMDE_DIR ${CMAKE_CURRENT_LIST_DIR})
66

7-
if (WAMR_BUILD_TARGET MATCHES "AARCH64.*" OR "ARM.*")
7+
if (WAMR_BUILD_TARGET MATCHES "AARCH64.*" OR WAMR_BUILD_TARGET MATCHES "ARM.*")
88
add_definitions (-DWASM_ENABLE_SIMDE=1)
9-
endif ()
9+
else()
10+
message(WARNING "Disabling SIMD for fast interpreter as the target is not supported")
11+
set(WAMR_BUILD_SIMD 0)
12+
endif()
1013

1114
include_directories(${LIB_SIMDE_DIR} ${LIB_SIMDE_DIR}/simde)
1215

0 commit comments

Comments
 (0)