Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix load/store #4054

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions core/iwasm/interpreter/wasm_interp_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -5766,10 +5766,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
case SIMD_v128_load:
{
uint32 offset, addr;
offset = read_uint32(
frame_ip); // TODO: Check with an offset!
addr = GET_OPERAND(uint32, I32, 0);
frame_ip += 2;
offset = read_uint32(frame_ip);
addr = POP_I32();
addr_ret = GET_OFFSET();
CHECK_MEMORY_OVERFLOW(16);
PUT_V128_TO_ADDR(frame_lp + addr_ret, LOAD_V128(maddr));
Expand Down Expand Up @@ -5879,8 +5877,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
{
uint32 offset, addr;
offset = read_uint32(frame_ip);
frame_ip += 2;
addr = GET_OPERAND(uint32, I32, 0);
V128 data = POP_V128();
addr = POP_I32();

V128 data;
data = POP_V128();
Expand Down Expand Up @@ -6393,7 +6391,6 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,

#define SIMD_LOAD_LANE_COMMON(vec, register, lane, width) \
do { \
addr = GET_OPERAND(uint32, I32, 0); \
addr_ret = GET_OFFSET(); \
CHECK_MEMORY_OVERFLOW(width / 8); \
if (width == 64) { \
Expand All @@ -6410,8 +6407,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
uint32 offset, addr; \
offset = read_uint32(frame_ip); \
V128 vec = POP_V128(); \
int32 base = POP_I32(); \
offset += base; \
addr = POP_I32(); \
int lane = *frame_ip++; \
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \
} while (0)
Expand Down Expand Up @@ -6441,11 +6437,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
uint32 offset, addr; \
offset = read_uint32(frame_ip); \
V128 vec = POP_V128(); \
int32 base = POP_I32(); \
offset += base; \
addr = POP_I32(); \
int lane = *frame_ip++; \
addr = GET_OPERAND(uint32, I32, 0); \
addr_ret = GET_OFFSET(); \
CHECK_MEMORY_OVERFLOW(width / 8); \
if (width == 64) { \
STORE_I64(maddr, vec.register[lane]); \
Expand Down Expand Up @@ -6482,8 +6475,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
do { \
uint32 offset, addr; \
offset = read_uint32(frame_ip); \
int32 base = POP_I32(); \
offset += base; \
addr = POP_I32(); \
int32 lane = 0; \
V128 vec = { 0 }; \
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \
Expand Down
4 changes: 0 additions & 4 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -15362,10 +15362,6 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,

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

#if WASM_ENABLE_FAST_INTERP != 0
emit_uint32(loader_ctx, mem_offset);
#endif

CHECK_BUF(p, p_end, 1);
lane = read_uint8(p);
if (!check_simd_access_lane(opcode1, lane, error_buf,
Expand Down
Loading