Skip to content

Commit f32aeb8

Browse files
committed
Fix load/store
Fix v128 load/store style
1 parent 07fd987 commit f32aeb8

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

core/iwasm/interpreter/wasm_interp_fast.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5767,9 +5767,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
57675767
{
57685768
uint32 offset, addr;
57695769
offset = read_uint32(
5770-
frame_ip); // TODO: Check with an offset!
5771-
addr = GET_OPERAND(uint32, I32, 0);
5772-
frame_ip += 2;
5770+
frame_ip);
5771+
addr = POP_I32();
57735772
addr_ret = GET_OFFSET();
57745773
CHECK_MEMORY_OVERFLOW(16);
57755774
PUT_V128_TO_ADDR(frame_lp + addr_ret, LOAD_V128(maddr));
@@ -5879,8 +5878,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
58795878
{
58805879
uint32 offset, addr;
58815880
offset = read_uint32(frame_ip);
5882-
frame_ip += 2;
5883-
addr = GET_OPERAND(uint32, I32, 0);
5881+
V128 data = POP_V128();
5882+
addr = POP_I32();
58845883

58855884
V128 data;
58865885
data = POP_V128();
@@ -6393,7 +6392,6 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
63936392

63946393
#define SIMD_LOAD_LANE_COMMON(vec, register, lane, width) \
63956394
do { \
6396-
addr = GET_OPERAND(uint32, I32, 0); \
63976395
addr_ret = GET_OFFSET(); \
63986396
CHECK_MEMORY_OVERFLOW(width / 8); \
63996397
if (width == 64) { \
@@ -6410,8 +6408,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
64106408
uint32 offset, addr; \
64116409
offset = read_uint32(frame_ip); \
64126410
V128 vec = POP_V128(); \
6413-
int32 base = POP_I32(); \
6414-
offset += base; \
6411+
addr = POP_I32(); \
64156412
int lane = *frame_ip++; \
64166413
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \
64176414
} while (0)
@@ -6441,11 +6438,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
64416438
uint32 offset, addr; \
64426439
offset = read_uint32(frame_ip); \
64436440
V128 vec = POP_V128(); \
6444-
int32 base = POP_I32(); \
6445-
offset += base; \
6441+
addr = POP_I32(); \
64466442
int lane = *frame_ip++; \
6447-
addr = GET_OPERAND(uint32, I32, 0); \
6448-
addr_ret = GET_OFFSET(); \
64496443
CHECK_MEMORY_OVERFLOW(width / 8); \
64506444
if (width == 64) { \
64516445
STORE_I64(maddr, vec.register[lane]); \
@@ -6482,8 +6476,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
64826476
do { \
64836477
uint32 offset, addr; \
64846478
offset = read_uint32(frame_ip); \
6485-
int32 base = POP_I32(); \
6486-
offset += base; \
6479+
addr = POP_I32(); \
64876480
int32 lane = 0; \
64886481
V128 vec = { 0 }; \
64896482
SIMD_LOAD_LANE_COMMON(vec, register, lane, width); \

core/iwasm/interpreter/wasm_loader.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15362,10 +15362,6 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1536215362

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

15365-
#if WASM_ENABLE_FAST_INTERP != 0
15366-
emit_uint32(loader_ctx, mem_offset);
15367-
#endif
15368-
1536915365
CHECK_BUF(p, p_end, 1);
1537015366
lane = read_uint8(p);
1537115367
if (!check_simd_access_lane(opcode1, lane, error_buf,

0 commit comments

Comments
 (0)