diff options
Diffstat (limited to 'src/interp/binary-reader-interp.cc')
-rw-r--r-- | src/interp/binary-reader-interp.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/interp/binary-reader-interp.cc b/src/interp/binary-reader-interp.cc index 0da318ae..cbec83cc 100644 --- a/src/interp/binary-reader-interp.cc +++ b/src/interp/binary-reader-interp.cc @@ -212,6 +212,10 @@ class BinaryReaderInterp : public BinaryReaderNop { Result OnUnreachableExpr() override; Result EndFunctionBody(Index index) override; Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override; + Result OnSimdLoadLaneExpr(Opcode opcode, + Address alignment_log2, + Address offset, + uint64_t value) override; Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override; Result OnLoadSplatExpr(Opcode opcode, Address alignment_log2, @@ -891,16 +895,25 @@ Result BinaryReaderInterp::OnSimdLaneOpExpr(Opcode opcode, uint64_t value) { return Result::Ok; } +uint32_t GetAlignment(Address alignment_log2) { + return alignment_log2 < 32 ? 1 << alignment_log2 : ~0u; +} + +Result BinaryReaderInterp::OnSimdLoadLaneExpr(Opcode opcode, + Address alignment_log2, + Address offset, + uint64_t value) { + CHECK_RESULT(validator_.OnSimdLoadLane(loc, opcode, GetAlignment(alignment_log2), value)); + istream_.Emit(opcode, kMemoryIndex0, offset, static_cast<u8>(value)); + return Result::Ok; +} + Result BinaryReaderInterp::OnSimdShuffleOpExpr(Opcode opcode, v128 value) { CHECK_RESULT(validator_.OnSimdShuffleOp(loc, opcode, value)); istream_.Emit(opcode, value); return Result::Ok; } -uint32_t GetAlignment(Address alignment_log2) { - return alignment_log2 < 32 ? 1 << alignment_log2 : ~0u; -} - Result BinaryReaderInterp::OnLoadSplatExpr(Opcode opcode, Address align_log2, Address offset) { |