Commit d6e94b03 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Fix decoding memarg in interpreter

The location of the immediates depend on the opcode length if a
s128.load/store was encoded using multiple bytes.

Bug: v8:10258
Change-Id: I09de8a37d442c0711de96ba4bb1746ae6732d83e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182960Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67623}
parent edb121ea
......@@ -2519,11 +2519,11 @@ class ThreadImpl {
case kExprS128LoadMem:
return ExecuteLoad<Simd128, Simd128>(decoder, code, pc, len,
MachineRepresentation::kSimd128,
/*prefix_len=*/1);
/*prefix_len=*/opcode_length);
case kExprS128StoreMem:
return ExecuteStore<Simd128, Simd128>(decoder, code, pc, len,
MachineRepresentation::kSimd128,
/*prefix_len=*/1);
/*prefix_len=*/opcode_length);
#define SHIFT_CASE(op, name, stype, count, expr) \
case kExpr##op: { \
uint32_t shift = Pop().to<uint32_t>(); \
......@@ -2795,7 +2795,7 @@ class ThreadImpl {
static_assert(sizeof(wide_type) == sizeof(narrow_type) * 2,
"size mismatch for wide and narrow types");
if (!ExecuteLoad<uint64_t, uint64_t>(decoder, code, pc, len, rep,
/*prefix_len=*/1)) {
/*prefix_len=*/*len - 1)) {
return false;
}
constexpr int lanes = kSimd128Size / sizeof(wide_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment