From d43cd0802b550003463143af8478476d4311028c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Sun, 17 Aug 2025 10:48:07 +0200 Subject: [PATCH 1/7] add support for `metadata.code.compilation_order`, `metadata.code.instr_freq` and `metadata.code.call_targets` annotations and sections --- include/wabt/binary-reader-logging.h | 5 +- include/wabt/binary-reader-nop.h | 9 +- include/wabt/binary-reader.h | 7 +- include/wabt/ir.h | 83 +- include/wabt/token.def | 7 + include/wabt/wast-parser.h | 9 + src/binary-reader-ir.cc | 15 +- src/binary-reader-logging.cc | 24 +- src/binary-reader-objdump.cc | 35 +- src/binary-reader.cc | 25 +- src/binary-writer.cc | 8 +- src/decompiler.cc | 2 +- src/ir.cc | 32 + src/leb128.cc | 9 +- src/lexer-keywords.txt | 7 + src/prebuilt/lexer-keywords.cc | 2070 +++++++++-------- src/wast-parser.cc | 162 +- src/wat-writer.cc | 3 +- test/parse/compilation-hint-call-targets.txt | 84 + .../compilation-hint-compilation-priority.txt | 124 + test/parse/compilation-hint-instr-freq.txt | 119 + 21 files changed, 1815 insertions(+), 1024 deletions(-) create mode 100644 test/parse/compilation-hint-call-targets.txt create mode 100644 test/parse/compilation-hint-compilation-priority.txt create mode 100644 test/parse/compilation-hint-instr-freq.txt diff --git a/include/wabt/binary-reader-logging.h b/include/wabt/binary-reader-logging.h index 4a031f74bb..97adf778f1 100644 --- a/include/wabt/binary-reader-logging.h +++ b/include/wabt/binary-reader-logging.h @@ -414,7 +414,10 @@ class BinaryReaderLogging : public BinaryReaderDelegate { Result BeginCodeMetadataSection(std::string_view name, Offset size) override; Result OnCodeMetadataFuncCount(Index count) override; Result OnCodeMetadataCount(Index function_index, Index count) override; - Result OnCodeMetadata(Offset offset, const void* data, Address size) override; + Result OnCodeMetadataCodeOffset(Offset offset) override; + Result OnCodeMetadata(const void* data, Address size) override; + Result OnCodeMetadataCallTarget(Index target_index, + uint32_t call_frequency) override; Result EndCodeMetadataSection() override; private: diff --git a/include/wabt/binary-reader-nop.h b/include/wabt/binary-reader-nop.h index fdb7d14a41..c3d7977341 100644 --- a/include/wabt/binary-reader-nop.h +++ b/include/wabt/binary-reader-nop.h @@ -489,9 +489,12 @@ class BinaryReaderNop : public BinaryReaderDelegate { Result OnCodeMetadataCount(Index function_index, Index count) override { return Result::Ok; } - Result OnCodeMetadata(Offset offset, - const void* data, - Address size) override { + Result OnCodeMetadata(const void* data, Address size) override { + return Result::Ok; + } + Result OnCodeMetadataCodeOffset(Offset offset) override { return Result::Ok; } + Result OnCodeMetadataCallTarget(Index target_index, + uint32_t call_frequency) override { return Result::Ok; } Result EndCodeMetadataSection() override { return Result::Ok; } diff --git a/include/wabt/binary-reader.h b/include/wabt/binary-reader.h index 94b19c1100..45d6f6e2bb 100644 --- a/include/wabt/binary-reader.h +++ b/include/wabt/binary-reader.h @@ -498,9 +498,10 @@ class BinaryReaderDelegate { Offset size) = 0; virtual Result OnCodeMetadataFuncCount(Index count) = 0; virtual Result OnCodeMetadataCount(Index function_index, Index count) = 0; - virtual Result OnCodeMetadata(Offset offset, - const void* data, - Address size) = 0; + virtual Result OnCodeMetadata(const void* data, Address size) = 0; + virtual Result OnCodeMetadataCodeOffset(Offset offset) = 0; + virtual Result OnCodeMetadataCallTarget(Index target_index, + uint32_t call_frequency) = 0; virtual Result EndCodeMetadataSection() = 0; const State* state = nullptr; diff --git a/include/wabt/ir.h b/include/wabt/ir.h index 5fa4439a0c..e812e2847a 100644 --- a/include/wabt/ir.h +++ b/include/wabt/ir.h @@ -32,6 +32,8 @@ #include "wabt/intrusive-list.h" #include "wabt/opcode.h" +#include + namespace wabt { struct Module; @@ -702,15 +704,90 @@ class CallIndirectExpr : public ExprMixin { class CodeMetadataExpr : public ExprMixin { public: + struct CallTarget { + Var func; + uint32_t frequency; + }; + struct CompilationPriority { + uint32_t compilation_priority; + std::optional optimization_priority; + }; + struct InstructionFrequency { + uint32_t frequency; + }; + enum class Type { + Binary, + CompilationHint, + InstructionFrequency, + CallTargets + }; + explicit CodeMetadataExpr(std::string_view name, std::vector data, const Location& loc = Location()) + : ExprMixin(loc), name(name), type(Type::Binary) { + new (&hint.data) std::vector(std::move(data)); + } + + explicit CodeMetadataExpr(std::string_view name, + CompilationPriority compilation_priority, + const Location& loc = Location()) + : ExprMixin(loc), + name(name), + type(Type::CompilationHint) { + new (&hint.compilation_priority) CompilationPriority(compilation_priority); + } + + explicit CodeMetadataExpr(std::string_view name, + InstructionFrequency instruction_frequency, + const Location& loc = Location()) : ExprMixin(loc), - name(std::move(name)), - data(std::move(data)) {} + name(name), + type(Type::InstructionFrequency) { + new (&hint.instruction_frequency) + InstructionFrequency(instruction_frequency); + } + + explicit CodeMetadataExpr(std::string_view name, + std::vector targets, + const Location& loc = Location()) + : ExprMixin(loc), + name(name), + type(Type::CallTargets) { + new (&hint.call_targets) std::vector(std::move(targets)); + } + + ~CodeMetadataExpr() override { + switch (type) { + case Type::Binary: + hint.data.~vector(); + break; + case Type::CallTargets: + hint.call_targets.~vector(); + break; + default: + // CompilationHint and InstructionFrequency do not allocate memory.; + break; + } + } + + bool is_function_annotation() const { return type == Type::CompilationHint; } + + // convert non-binary hints to binary + std::vector serialize(const Module&) const; std::string_view name; - std::vector data; + Type type; + + private: + union Hint { + std::vector data; + CompilationPriority compilation_priority; + InstructionFrequency instruction_frequency{}; + std::vector call_targets; + Hint() {} + ~Hint() {} + } hint; }; class ReturnCallIndirectExpr : public ExprMixin { diff --git a/include/wabt/token.def b/include/wabt/token.def index f2f05aec34..9a0f311b1a 100644 --- a/include/wabt/token.def +++ b/include/wabt/token.def @@ -20,6 +20,7 @@ /* Tokens with no additional data (i.e. bare). */ WABT_TOKEN(Invalid, "Invalid") +WABT_TOKEN(AlwaysOpt, "always_opt") WABT_TOKEN(After, "after") WABT_TOKEN(Array, "array") WABT_TOKEN(AssertException, "assert_exception") @@ -31,6 +32,7 @@ WABT_TOKEN(AssertTrap, "assert_trap") WABT_TOKEN(AssertUnlinkable, "assert_unlinkable") WABT_TOKEN(Before, "before") WABT_TOKEN(Bin, "bin") +WABT_TOKEN(Compilation, "compilation") WABT_TOKEN(Item, "item") WABT_TOKEN(Data, "data") WABT_TOKEN(Declare, "declare") @@ -40,9 +42,11 @@ WABT_TOKEN(Either, "either") WABT_TOKEN(Elem, "elem") WABT_TOKEN(Eof, "EOF") WABT_TOKEN(Tag, "tag") +WABT_TOKEN(Target, "target") WABT_TOKEN(Export, "export") WABT_TOKEN(Field, "field") WABT_TOKEN(Function, "function") +WABT_TOKEN(Freq, "freq") WABT_TOKEN(Get, "get") WABT_TOKEN(Global, "global") WABT_TOKEN(Import, "import") @@ -55,7 +59,9 @@ WABT_TOKEN(Module, "module") WABT_TOKEN(Mut, "mut") WABT_TOKEN(NanArithmetic, "nan:arithmetic") WABT_TOKEN(NanCanonical, "nan:canonical") +WABT_TOKEN(NeverOpt, "never_opt") WABT_TOKEN(Offset, "offset") +WABT_TOKEN(Optimization, "optimization") WABT_TOKEN(Output, "output") WABT_TOKEN(PageSize, "pagesize") WABT_TOKEN(Param, "param") @@ -64,6 +70,7 @@ WABT_TOKEN(Quote, "quote") WABT_TOKEN(Register, "register") WABT_TOKEN(Result, "result") WABT_TOKEN(Rpar, ")") +WABT_TOKEN(RunOnce, "run_once") WABT_TOKEN(Shared, "shared") WABT_TOKEN(Start, "start") WABT_TOKEN(Struct, "struct") diff --git a/include/wabt/wast-parser.h b/include/wabt/wast-parser.h index 7a60af23b5..ede89743d9 100644 --- a/include/wabt/wast-parser.h +++ b/include/wabt/wast-parser.h @@ -217,6 +217,15 @@ class WastParser { Result ParseTerminatingInstrList(ExprList*); Result ParseInstr(ExprList*); Result ParseCodeMetadataAnnotation(ExprList*); + Result ParseCodeMetaDataCompilationPriorityAnnotation(ExprList*, + std::string_view, + Location); + Result ParseCodeMetaDataInstrFreqAnnotation(ExprList*, + std::string_view, + Location); + Result ParseCodeMetaDataCallTargetsAnnotation(ExprList*, + std::string_view, + Location); Result ParsePlainInstr(std::unique_ptr*); Result ParseF32(Const*, ConstType type); Result ParseF64(Const*, ConstType type); diff --git a/src/binary-reader-ir.cc b/src/binary-reader-ir.cc index 11e88da549..715cb32e9d 100644 --- a/src/binary-reader-ir.cc +++ b/src/binary-reader-ir.cc @@ -350,7 +350,8 @@ class BinaryReaderIR : public BinaryReaderNop { Result BeginCodeMetadataSection(std::string_view name, Offset size) override; Result OnCodeMetadataFuncCount(Index count) override; Result OnCodeMetadataCount(Index function_index, Index count) override; - Result OnCodeMetadata(Offset offset, const void* data, Address size) override; + Result OnCodeMetadataCodeOffset(Offset offset) override; + Result OnCodeMetadata(const void* data, Address size) override; Result OnTagSymbol(Index index, uint32_t flags, @@ -398,6 +399,7 @@ class BinaryReaderIR : public BinaryReaderNop { CodeMetadataExprQueue code_metadata_queue_; std::string_view current_metadata_name_; + Offset current_metadata_offset_; }; BinaryReaderIR::BinaryReaderIR(Module* out_module, @@ -1710,18 +1712,21 @@ Result BinaryReaderIR::OnCodeMetadataCount(Index function_index, Index count) { return Result::Error; } -Result BinaryReaderIR::OnCodeMetadata(Offset offset, - const void* data, - Address size) { +Result BinaryReaderIR::OnCodeMetadata(const void* data, const Address size) { std::vector data_(static_cast(data), static_cast(data) + size); auto meta = std::make_unique(current_metadata_name_, std::move(data_)); - meta->loc.offset = offset; + meta->loc.offset = current_metadata_offset_; code_metadata_queue_.push_metadata(std::move(meta)); return Result::Ok; } +Result BinaryReaderIR::OnCodeMetadataCodeOffset(const Offset offset) { + current_metadata_offset_ = offset; + return Result::Ok; +} + Result BinaryReaderIR::OnLocalName(Index func_index, Index local_index, std::string_view name) { diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc index 0c13622576..9f33a6952c 100644 --- a/src/binary-reader-logging.cc +++ b/src/binary-reader-logging.cc @@ -681,13 +681,23 @@ Result BinaryReaderLogging::BeginCodeMetadataSection(std::string_view name, Indent(); return reader_->BeginCodeMetadataSection(name, size); } -Result BinaryReaderLogging::OnCodeMetadata(Offset code_offset, - const void* data, - Address size) { - std::string_view content(static_cast(data), size); - LOGF("OnCodeMetadata(offset: %" PRIzd ", data: \"" PRIstringview "\")\n", - code_offset, WABT_PRINTF_STRING_VIEW_ARG(content)); - return reader_->OnCodeMetadata(code_offset, data, size); +Result BinaryReaderLogging::OnCodeMetadataCodeOffset(const Offset code_offset) { + LOGF("OnCodeMetadataCodeOffset(offset: %" PRIzd ")\n", code_offset); + return reader_->OnCodeMetadataCodeOffset(code_offset); +} +Result BinaryReaderLogging::OnCodeMetadata(const void* data, + const Address size) { + const std::string_view content(static_cast(data), size); + LOGF("OnCodeMetadata(data: \"" PRIstringview "\")\n", + WABT_PRINTF_STRING_VIEW_ARG(content)); + return reader_->OnCodeMetadata(data, size); +} +Result BinaryReaderLogging::OnCodeMetadataCallTarget( + const Index target_index, + const uint32_t call_frequency) { + LOGF("OnCodeMetadataCallTarget(target_index: %u, call_frequency: %u)\n", + target_index, call_frequency); + return reader_->OnCodeMetadataCallTarget(target_index, call_frequency); } Result BinaryReaderLogging::OnGenericCustomSection(std::string_view name, diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index 34ba068708..9f474117b3 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -1286,9 +1286,10 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase { Result OnRefNullExpr(Type type) override; Result OnGlobalGetExpr(Index global_index) override; Result OnCodeMetadataCount(Index function_index, Index count) override; - Result OnCodeMetadata(Offset code_offset, - const void* data, - Address size) override; + Result OnCodeMetadataCodeOffset(Offset code_offset) override; + Result OnCodeMetadata(const void* data, Address size) override; + Result OnCodeMetadataCallTarget(Index target_index, + uint32_t call_frequency) override; private: Result EndInitExpr(); @@ -2446,25 +2447,43 @@ Result BinaryReaderObjdump::OnCodeMetadataCount(Index function_index, return Result::Ok; } printf(" - func[%" PRIindex "]", function_index); - auto name = GetFunctionName(function_index); + const auto name = GetFunctionName(function_index); if (!name.empty()) { printf(" <" PRIstringview ">", WABT_PRINTF_STRING_VIEW_ARG(name)); } printf(":\n"); return Result::Ok; } -Result BinaryReaderObjdump::OnCodeMetadata(Offset code_offset, - const void* data, - Address size) { +Result BinaryReaderObjdump::OnCodeMetadataCodeOffset(const Offset code_offset) { if (!ShouldPrintDetails()) { return Result::Ok; } printf(" - meta[%" PRIzx "]:\n", code_offset); - + return Result::Ok; +} +Result BinaryReaderObjdump::OnCodeMetadata(const void* data, + const Address size) { + if (!ShouldPrintDetails()) { + return Result::Ok; + } out_stream_->WriteMemoryDump(data, size, 0, PrintChars::Yes, " - "); return Result::Ok; } +Result BinaryReaderObjdump::OnCodeMetadataCallTarget( + const Index target_index, + const uint32_t call_frequency) { + if (!ShouldPrintDetails()) { + return Result::Ok; + } + printf(" - target [%" PRIindex "]", target_index); + const auto name = GetFunctionName(target_index); + if (!name.empty()) { + printf(" <" PRIstringview ">", WABT_PRINTF_STRING_VIEW_ARG(name)); + } + printf(": %" PRIu32 "%%\n", call_frequency); + return Result::Ok; +} } // end anonymous namespace std::string_view ObjdumpNames::Get(Index index) const { diff --git a/src/binary-reader.cc b/src/binary-reader.cc index cbdd3384f8..a75abc0252 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -2467,11 +2467,26 @@ Result BinaryReader::ReadCodeMetadataSection(std::string_view name, last_code_offset == kInvalidOffset || code_offset > last_code_offset, "code offset out of order: %" PRIzx, code_offset); last_code_offset = code_offset; - - Address data_size; - const void* data; - CHECK_RESULT(ReadBytes(&data, &data_size, "instance data")); - CALLBACK(OnCodeMetadata, code_offset, data, data_size); + CALLBACK(OnCodeMetadataCodeOffset, code_offset); + + if (name == "call_targets") { + uint32_t hint_size; + CHECK_RESULT(ReadU32Leb128(&hint_size, "call targets hint size")); + Offset end = state_.offset + hint_size; + while (state_.offset < end) { + Index target_index; + CHECK_RESULT(ReadIndex(&target_index, "call target index")); + uint32_t call_frequency; + CHECK_RESULT(ReadU32Leb128(&call_frequency, "call frequency")); + CALLBACK(OnCodeMetadataCallTarget, target_index, call_frequency); + } + assert(state_.offset == end); + } else { + Address data_size; + const void* data; + CHECK_RESULT(ReadBytes(&data, &data_size, "instance data")); + CALLBACK(OnCodeMetadata, data, data_size); + } } } diff --git a/src/binary-writer.cc b/src/binary-writer.cc index 600154b941..208468bd5b 100644 --- a/src/binary-writer.cc +++ b/src/binary-writer.cc @@ -1146,8 +1146,12 @@ void BinaryWriter::WriteExpr(const Func* func, const Expr* expr) { s.entries.emplace_back(cur_func_index_); } auto& a = s.entries.back(); - Offset code_offset = stream_->offset() - cur_func_start_offset_; - a.entries.emplace_back(code_offset, meta_expr->data); + Offset code_offset; + if (meta_expr->is_function_annotation()) + code_offset = 0; + else + code_offset = stream_->offset() - cur_func_start_offset_; + a.entries.emplace_back(code_offset, meta_expr->serialize(*module_)); break; } } diff --git a/src/decompiler.cc b/src/decompiler.cc index 7881ce8838..b025912f4a 100644 --- a/src/decompiler.cc +++ b/src/decompiler.cc @@ -610,7 +610,7 @@ struct Decompiler { case ExprType::CodeMetadata: { auto cme = cast(n.e); std::string c = "// @metadata.code." + cme->name + " "; - c += BinaryToString(cme->data); + c += BinaryToString(cme->serialize(this->mc.module)); return Value{{std::move(c)}, Precedence::None}; } default: { diff --git a/src/ir.cc b/src/ir.cc index a2f9c48e0c..f1861e5032 100644 --- a/src/ir.cc +++ b/src/ir.cc @@ -15,6 +15,7 @@ */ #include "wabt/ir.h" +#include "wabt/stream.h" #include #include @@ -172,6 +173,37 @@ bool Module::IsImport(ExternalKind kind, const Var& var) const { } } +std::vector CodeMetadataExpr::serialize(const Module& module) const { + MemoryStream stream; + switch (type) { + case Type::Binary: + return hint.data; + case Type::CompilationHint: { + WriteU32Leb128(&stream, hint.compilation_priority.compilation_priority, + "compilation priority"); + if (hint.compilation_priority.optimization_priority.has_value()) + WriteU32Leb128(&stream, + *hint.compilation_priority.optimization_priority, + "optimization priority"); + break; + } + case Type::InstructionFrequency: { + WriteU32Leb128(&stream, hint.instruction_frequency.frequency, + "instruction frequency"); + break; + } + case Type::CallTargets: { + for (const auto& [func, freq] : hint.call_targets) { + const uint32_t func_idx = module.GetFuncIndex(func); + WriteU32Leb128(&stream, func_idx, "call target function index"); + WriteU32Leb128(&stream, freq, "call target offset"); + } + break; + } + } + return stream.ReleaseOutputBuffer()->data; +} + void LocalTypes::Set(const TypeVector& types) { decls_.clear(); if (types.empty()) { diff --git a/src/leb128.cc b/src/leb128.cc index 6c5a650fa9..493f946168 100644 --- a/src/leb128.cc +++ b/src/leb128.cc @@ -64,11 +64,14 @@ void WriteU32Leb128(Stream* stream, uint32_t value, const char* desc) { stream->WriteData(data, length, desc); } -void WriteFixedU32Leb128(Stream* stream, uint32_t value, const char* desc) { +void WriteFixedU32Leb128(Stream* stream, + const uint32_t value, + const char* desc) { uint8_t data[MAX_U32_LEB128_BYTES]; - Offset length = + const Offset length = WriteFixedU32Leb128Raw(data, data + MAX_U32_LEB128_BYTES, value); - stream->WriteData(data, length, desc); + assert(length == MAX_U32_LEB128_BYTES); + stream->WriteData(data, MAX_U32_LEB128_BYTES, desc); } // returns the length of the leb128. diff --git a/src/lexer-keywords.txt b/src/lexer-keywords.txt index 5923c7109c..31289e39f5 100644 --- a/src/lexer-keywords.txt +++ b/src/lexer-keywords.txt @@ -17,6 +17,7 @@ struct TokenInfo { }; }; %% +always_opt, TokenType::AlwaysOpt array, Type::Array, TokenType::Array after, TokenType::After assert_exception, TokenType::AssertException @@ -41,6 +42,7 @@ catch_all, TokenType::CatchAll, Opcode::CatchAll catch_ref, TokenType::CatchRef catch_all_ref, TokenType::CatchAllRef code, TokenType::Code +compilation, TokenType::Compilation data.drop, TokenType::DataDrop, Opcode::DataDrop data, TokenType::Data declare, TokenType::Declare @@ -53,6 +55,7 @@ elem, TokenType::Elem else, TokenType::Else, Opcode::Else end, TokenType::End, Opcode::End tag, TokenType::Tag +target, TokenType::Target extern, Type::ExternRef, TokenType::Extern externref, Type::ExternRef exn, Type::ExnRef, TokenType::Exn @@ -183,6 +186,7 @@ f64x2.convert_low_i32x4_u, TokenType::Unary, Opcode::F64X2ConvertLowI32X4U f64x2.promote_low_f32x4, TokenType::Unary, Opcode::F64X2PromoteLowF32X4 f64x2, TokenType::F64X2 field, TokenType::Field +freq, TokenType::Freq funcref, Type::FuncRef func, Type::FuncRef, TokenType::Func function, TokenType::Function @@ -555,8 +559,10 @@ module, TokenType::Module mut, TokenType::Mut nan:arithmetic, TokenType::NanArithmetic nan:canonical, TokenType::NanCanonical +never_opt, TokenType::NeverOpt nop, TokenType::Nop, Opcode::Nop offset, TokenType::Offset +optimization, TokenType::Optimization output, TokenType::Output pagesize, TokenType::PageSize param, TokenType::Param @@ -572,6 +578,7 @@ rethrow, TokenType::Rethrow, Opcode::Rethrow return_call_indirect, TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect return_call, TokenType::ReturnCall, Opcode::ReturnCall return, TokenType::Return, Opcode::Return +run_once, TokenType::RunOnce select, TokenType::Select, Opcode::Select shared, TokenType::Shared start, TokenType::Start diff --git a/src/prebuilt/lexer-keywords.cc b/src/prebuilt/lexer-keywords.cc index 89f14dbaca..51bca32761 100644 --- a/src/prebuilt/lexer-keywords.cc +++ b/src/prebuilt/lexer-keywords.cc @@ -1,4 +1,4 @@ -/* C++ code produced by gperf version 3.1 */ +/* C++ code produced by gperf version 3.3 */ /* Command-line: gperf -m 50 -L C++ -N InWordSet -E -t -c --output-file=src/prebuilt/lexer-keywords.cc src/lexer-keywords.txt */ /* Computed positions: -k'1,3,5-8,10,12,15,17-19,23,27,$' */ @@ -48,7 +48,7 @@ struct TokenInfo { Opcode opcode; }; }; -/* maximum key range = 2193, duplicates = 0 */ +/* maximum key range = 2476, duplicates = 0 */ class Perfect_Hash { @@ -63,32 +63,32 @@ Perfect_Hash::hash (const char *str, size_t len) { static unsigned short asso_values[] = { - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 13, 2230, 2230, 426, - 351, 14, 17, 13, 176, 531, 32, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 183, 13, 16, 811, 21, - 68, 16, 326, 13, 347, 223, 20, 13, 15, 140, - 80, 54, 559, 611, 14, 15, 24, 13, 556, 521, - 125, 416, 213, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230, - 2230, 2230, 2230, 2230, 2230, 2230, 2230 + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 13, 2513, 2513, 538, + 351, 14, 17, 13, 176, 531, 32, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 183, 19, 16, 863, 21, + 68, 16, 326, 13, 347, 223, 20, 15, 15, 140, + 80, 54, 757, 715, 14, 15, 24, 13, 462, 606, + 125, 416, 113, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, 2513, + 2513, 2513, 2513, 2513, 2513, 2513, 2513 }; unsigned int hval = len; @@ -96,54 +96,119 @@ Perfect_Hash::hash (const char *str, size_t len) { default: hval += asso_values[static_cast(str[26])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 26: case 25: case 24: case 23: hval += asso_values[static_cast(str[22])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 22: case 21: case 20: case 19: hval += asso_values[static_cast(str[18])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 18: hval += asso_values[static_cast(str[17])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 17: hval += asso_values[static_cast(str[16])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 16: case 15: hval += asso_values[static_cast(str[14])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 14: case 13: case 12: hval += asso_values[static_cast(str[11])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 11: case 10: hval += asso_values[static_cast(str[9])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 9: case 8: hval += asso_values[static_cast(str[7])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 7: hval += asso_values[static_cast(str[6])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 6: hval += asso_values[static_cast(str[5])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 5: hval += asso_values[static_cast(str[4])]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 4: case 3: hval += asso_values[static_cast(str[2]+1)]; +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) + [[fallthrough]]; +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) + __attribute__ ((__fallthrough__)); +#endif /*FALLTHROUGH*/ case 2: case 1: @@ -158,13 +223,17 @@ Perfect_Hash::InWordSet (const char *str, size_t len) { enum { - TOTAL_KEYWORDS = 601, + TOTAL_KEYWORDS = 608, MIN_WORD_LENGTH = 2, MAX_WORD_LENGTH = 35, MIN_HASH_VALUE = 37, - MAX_HASH_VALUE = 2229 + MAX_HASH_VALUE = 2512 }; +#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif static struct TokenInfo wordlist[] = { {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -172,1485 +241,1479 @@ Perfect_Hash::InWordSet (const char *str, size_t len) {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 35 "src/lexer-keywords.txt" +#line 36 "src/lexer-keywords.txt" {"br", TokenType::Br, Opcode::Br}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 152 "src/lexer-keywords.txt" +#line 155 "src/lexer-keywords.txt" {"f64", Type::F64}, {""}, {""}, -#line 45 "src/lexer-keywords.txt" +#line 47 "src/lexer-keywords.txt" {"data", TokenType::Data}, {""}, {""}, {""}, -#line 464 "src/lexer-keywords.txt" +#line 468 "src/lexer-keywords.txt" {"i64", Type::I64}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 122 "src/lexer-keywords.txt" +#line 125 "src/lexer-keywords.txt" {"f32x4", TokenType::F32X4}, {""}, {""}, {""}, {""}, -#line 586 "src/lexer-keywords.txt" +#line 593 "src/lexer-keywords.txt" {"table", TokenType::Table}, -#line 48 "src/lexer-keywords.txt" +#line 50 "src/lexer-keywords.txt" {"do", TokenType::Do}, -#line 364 "src/lexer-keywords.txt" +#line 368 "src/lexer-keywords.txt" {"i32x4", TokenType::I32X4}, {""}, {""}, {""}, -#line 135 "src/lexer-keywords.txt" +#line 138 "src/lexer-keywords.txt" {"f64.ge", TokenType::Compare, Opcode::F64Ge}, -#line 74 "src/lexer-keywords.txt" +#line 77 "src/lexer-keywords.txt" {"f32.ge", TokenType::Compare, Opcode::F32Ge}, -#line 137 "src/lexer-keywords.txt" +#line 140 "src/lexer-keywords.txt" {"f64.le", TokenType::Compare, Opcode::F64Le}, -#line 76 "src/lexer-keywords.txt" +#line 79 "src/lexer-keywords.txt" {"f32.le", TokenType::Compare, Opcode::F32Le}, {""}, {""}, {""}, {""}, {""}, -#line 30 "src/lexer-keywords.txt" +#line 31 "src/lexer-keywords.txt" {"before", TokenType::Before}, {""}, {""}, {""}, {""}, {""}, -#line 187 "src/lexer-keywords.txt" +#line 191 "src/lexer-keywords.txt" {"func", Type::FuncRef, TokenType::Func}, -#line 136 "src/lexer-keywords.txt" +#line 139 "src/lexer-keywords.txt" {"f64.gt", TokenType::Compare, Opcode::F64Gt}, -#line 75 "src/lexer-keywords.txt" +#line 78 "src/lexer-keywords.txt" {"f32.gt", TokenType::Compare, Opcode::F32Gt}, -#line 139 "src/lexer-keywords.txt" +#line 142 "src/lexer-keywords.txt" {"f64.lt", TokenType::Compare, Opcode::F64Lt}, -#line 78 "src/lexer-keywords.txt" +#line 81 "src/lexer-keywords.txt" {"f32.lt", TokenType::Compare, Opcode::F32Lt}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 43 "src/lexer-keywords.txt" + {""}, +#line 58 "src/lexer-keywords.txt" + {"target", TokenType::Target}, + {""}, {""}, {""}, {""}, {""}, +#line 44 "src/lexer-keywords.txt" {"code", TokenType::Code}, {""}, {""}, {""}, -#line 570 "src/lexer-keywords.txt" +#line 576 "src/lexer-keywords.txt" {"result", TokenType::Result}, {""}, -#line 100 "src/lexer-keywords.txt" +#line 103 "src/lexer-keywords.txt" {"f32x4.ge", TokenType::Compare, Opcode::F32X4Ge}, {""}, -#line 102 "src/lexer-keywords.txt" +#line 105 "src/lexer-keywords.txt" {"f32x4.le", TokenType::Compare, Opcode::F32X4Le}, {""}, -#line 578 "src/lexer-keywords.txt" +#line 585 "src/lexer-keywords.txt" {"struct", Type::Struct, TokenType::Struct}, {""}, {""}, {""}, {""}, {""}, -#line 555 "src/lexer-keywords.txt" +#line 559 "src/lexer-keywords.txt" {"mut", TokenType::Mut}, -#line 441 "src/lexer-keywords.txt" +#line 445 "src/lexer-keywords.txt" {"i64.or", TokenType::Binary, Opcode::I64Or}, -#line 298 "src/lexer-keywords.txt" +#line 302 "src/lexer-keywords.txt" {"i32.or", TokenType::Binary, Opcode::I32Or}, {""}, {""}, -#line 581 "src/lexer-keywords.txt" +#line 588 "src/lexer-keywords.txt" {"table.get", TokenType::TableGet, Opcode::TableGet}, -#line 101 "src/lexer-keywords.txt" +#line 104 "src/lexer-keywords.txt" {"f32x4.gt", TokenType::Compare, Opcode::F32X4Gt}, -#line 584 "src/lexer-keywords.txt" +#line 591 "src/lexer-keywords.txt" {"table.set", TokenType::TableSet, Opcode::TableSet}, -#line 103 "src/lexer-keywords.txt" +#line 106 "src/lexer-keywords.txt" {"f32x4.lt", TokenType::Compare, Opcode::F32X4Lt}, -#line 330 "src/lexer-keywords.txt" +#line 334 "src/lexer-keywords.txt" {"i32x4.ge_u", TokenType::Compare, Opcode::I32X4GeU}, {""}, -#line 334 "src/lexer-keywords.txt" +#line 338 "src/lexer-keywords.txt" {"i32x4.le_u", TokenType::Compare, Opcode::I32X4LeU}, {""}, -#line 329 "src/lexer-keywords.txt" +#line 333 "src/lexer-keywords.txt" {"i32x4.ge_s", TokenType::Compare, Opcode::I32X4GeS}, -#line 93 "src/lexer-keywords.txt" +#line 96 "src/lexer-keywords.txt" {"f32x4.ceil", TokenType::Unary, Opcode::F32X4Ceil}, -#line 333 "src/lexer-keywords.txt" +#line 337 "src/lexer-keywords.txt" {"i32x4.le_s", TokenType::Compare, Opcode::I32X4LeS}, {""}, -#line 332 "src/lexer-keywords.txt" +#line 336 "src/lexer-keywords.txt" {"i32x4.gt_u", TokenType::Compare, Opcode::I32X4GtU}, {""}, -#line 342 "src/lexer-keywords.txt" +#line 346 "src/lexer-keywords.txt" {"i32x4.lt_u", TokenType::Compare, Opcode::I32X4LtU}, {""}, -#line 331 "src/lexer-keywords.txt" +#line 335 "src/lexer-keywords.txt" {"i32x4.gt_s", TokenType::Compare, Opcode::I32X4GtS}, {""}, -#line 341 "src/lexer-keywords.txt" +#line 345 "src/lexer-keywords.txt" {"i32x4.lt_s", TokenType::Compare, Opcode::I32X4LtS}, -#line 145 "src/lexer-keywords.txt" +#line 148 "src/lexer-keywords.txt" {"f64.ne", TokenType::Compare, Opcode::F64Ne}, -#line 84 "src/lexer-keywords.txt" +#line 87 "src/lexer-keywords.txt" {"f32.ne", TokenType::Compare, Opcode::F32Ne}, {""}, {""}, {""}, -#line 554 "src/lexer-keywords.txt" +#line 558 "src/lexer-keywords.txt" {"module", TokenType::Module}, {""}, -#line 440 "src/lexer-keywords.txt" +#line 444 "src/lexer-keywords.txt" {"i64.ne", TokenType::Compare, Opcode::I64Ne}, -#line 297 "src/lexer-keywords.txt" +#line 301 "src/lexer-keywords.txt" {"i32.ne", TokenType::Compare, Opcode::I32Ne}, -#line 46 "src/lexer-keywords.txt" +#line 48 "src/lexer-keywords.txt" {"declare", TokenType::Declare}, {""}, -#line 144 "src/lexer-keywords.txt" +#line 147 "src/lexer-keywords.txt" {"f64.neg", TokenType::Unary, Opcode::F64Neg}, -#line 83 "src/lexer-keywords.txt" +#line 86 "src/lexer-keywords.txt" {"f32.neg", TokenType::Unary, Opcode::F32Neg}, {""}, -#line 149 "src/lexer-keywords.txt" +#line 152 "src/lexer-keywords.txt" {"f64.store", TokenType::Store, Opcode::F64Store}, -#line 87 "src/lexer-keywords.txt" +#line 90 "src/lexer-keywords.txt" {"f32.store", TokenType::Store, Opcode::F32Store}, {""}, -#line 447 "src/lexer-keywords.txt" +#line 451 "src/lexer-keywords.txt" {"i64.rotr", TokenType::Binary, Opcode::I64Rotr}, -#line 304 "src/lexer-keywords.txt" +#line 308 "src/lexer-keywords.txt" {"i32.rotr", TokenType::Binary, Opcode::I32Rotr}, -#line 446 "src/lexer-keywords.txt" +#line 450 "src/lexer-keywords.txt" {"i64.rotl", TokenType::Binary, Opcode::I64Rotl}, -#line 303 "src/lexer-keywords.txt" +#line 307 "src/lexer-keywords.txt" {"i32.rotl", TokenType::Binary, Opcode::I32Rotl}, -#line 454 "src/lexer-keywords.txt" +#line 458 "src/lexer-keywords.txt" {"i64.store", TokenType::Store, Opcode::I64Store}, -#line 310 "src/lexer-keywords.txt" +#line 314 "src/lexer-keywords.txt" {"i32.store", TokenType::Store, Opcode::I32Store}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 568 "src/lexer-keywords.txt" +#line 574 "src/lexer-keywords.txt" {"ref.null", TokenType::RefNull, Opcode::RefNull}, -#line 108 "src/lexer-keywords.txt" +#line 111 "src/lexer-keywords.txt" {"f32x4.neg", TokenType::Unary, Opcode::F32X4Neg}, {""}, -#line 109 "src/lexer-keywords.txt" +#line 112 "src/lexer-keywords.txt" {"f32x4.ne", TokenType::Compare, Opcode::F32X4Ne}, {""}, {""}, {""}, {""}, -#line 349 "src/lexer-keywords.txt" +#line 353 "src/lexer-keywords.txt" {"i32x4.neg", TokenType::Unary, Opcode::I32X4Neg}, {""}, -#line 350 "src/lexer-keywords.txt" +#line 354 "src/lexer-keywords.txt" {"i32x4.ne", TokenType::Compare, Opcode::I32X4Ne}, {""}, {""}, -#line 151 "src/lexer-keywords.txt" +#line 154 "src/lexer-keywords.txt" {"f64.trunc", TokenType::Unary, Opcode::F64Trunc}, -#line 89 "src/lexer-keywords.txt" +#line 92 "src/lexer-keywords.txt" {"f32.trunc", TokenType::Unary, Opcode::F32Trunc}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 143 "src/lexer-keywords.txt" +#line 146 "src/lexer-keywords.txt" {"f64.nearest", TokenType::Unary, Opcode::F64Nearest}, -#line 82 "src/lexer-keywords.txt" +#line 85 "src/lexer-keywords.txt" {"f32.nearest", TokenType::Unary, Opcode::F32Nearest}, {""}, {""}, {""}, -#line 120 "src/lexer-keywords.txt" +#line 123 "src/lexer-keywords.txt" {"f32x4.trunc", TokenType::Unary, Opcode::F32X4Trunc}, -#line 574 "src/lexer-keywords.txt" +#line 580 "src/lexer-keywords.txt" {"return", TokenType::Return, Opcode::Return}, {""}, {""}, {""}, {""}, {""}, -#line 453 "src/lexer-keywords.txt" +#line 457 "src/lexer-keywords.txt" {"i64.store8", TokenType::Store, Opcode::I64Store8}, -#line 309 "src/lexer-keywords.txt" +#line 313 "src/lexer-keywords.txt" {"i32.store8", TokenType::Store, Opcode::I32Store8}, -#line 142 "src/lexer-keywords.txt" +#line 145 "src/lexer-keywords.txt" {"f64.mul", TokenType::Binary, Opcode::F64Mul}, -#line 81 "src/lexer-keywords.txt" +#line 84 "src/lexer-keywords.txt" {"f32.mul", TokenType::Binary, Opcode::F32Mul}, -#line 92 "src/lexer-keywords.txt" +#line 95 "src/lexer-keywords.txt" {"f32x4.add", TokenType::Binary, Opcode::F32X4Add}, -#line 107 "src/lexer-keywords.txt" +#line 110 "src/lexer-keywords.txt" {"f32x4.nearest", TokenType::Unary, Opcode::F32X4Nearest}, {""}, {""}, {""}, -#line 439 "src/lexer-keywords.txt" +#line 443 "src/lexer-keywords.txt" {"i64.mul", TokenType::Binary, Opcode::I64Mul}, -#line 296 "src/lexer-keywords.txt" +#line 300 "src/lexer-keywords.txt" {"i32.mul", TokenType::Binary, Opcode::I32Mul}, -#line 323 "src/lexer-keywords.txt" +#line 327 "src/lexer-keywords.txt" {"i32x4.add", TokenType::Binary, Opcode::I32X4Add}, {""}, -#line 38 "src/lexer-keywords.txt" +#line 39 "src/lexer-keywords.txt" {"call", TokenType::Call, Opcode::Call}, {""}, -#line 126 "src/lexer-keywords.txt" +#line 129 "src/lexer-keywords.txt" {"f64.const", TokenType::Const, Opcode::F64Const}, -#line 64 "src/lexer-keywords.txt" +#line 67 "src/lexer-keywords.txt" {"f32.const", TokenType::Const, Opcode::F32Const}, {""}, {""}, {""}, -#line 106 "src/lexer-keywords.txt" +#line 109 "src/lexer-keywords.txt" {"f32x4.mul", TokenType::Binary, Opcode::F32X4Mul}, {""}, -#line 413 "src/lexer-keywords.txt" +#line 417 "src/lexer-keywords.txt" {"i64.const", TokenType::Const, Opcode::I64Const}, -#line 275 "src/lexer-keywords.txt" +#line 279 "src/lexer-keywords.txt" {"i32.const", TokenType::Const, Opcode::I32Const}, {""}, -#line 575 "src/lexer-keywords.txt" +#line 582 "src/lexer-keywords.txt" {"select", TokenType::Select, Opcode::Select}, {""}, -#line 348 "src/lexer-keywords.txt" +#line 352 "src/lexer-keywords.txt" {"i32x4.mul", TokenType::Binary, Opcode::I32X4Mul}, {""}, -#line 543 "src/lexer-keywords.txt" +#line 547 "src/lexer-keywords.txt" {"local", TokenType::Local}, {""}, {""}, {""}, -#line 496 "src/lexer-keywords.txt" +#line 500 "src/lexer-keywords.txt" {"i64.xor", TokenType::Binary, Opcode::I64Xor}, -#line 373 "src/lexer-keywords.txt" +#line 377 "src/lexer-keywords.txt" {"i32.xor", TokenType::Binary, Opcode::I32Xor}, -#line 47 "src/lexer-keywords.txt" +#line 49 "src/lexer-keywords.txt" {"delegate", TokenType::Delegate}, {""}, {""}, {""}, -#line 124 "src/lexer-keywords.txt" +#line 127 "src/lexer-keywords.txt" {"f64.add", TokenType::Binary, Opcode::F64Add}, -#line 62 "src/lexer-keywords.txt" +#line 65 "src/lexer-keywords.txt" {"f32.add", TokenType::Binary, Opcode::F32Add}, -#line 138 "src/lexer-keywords.txt" +#line 141 "src/lexer-keywords.txt" {"f64.load", TokenType::Load, Opcode::F64Load}, -#line 77 "src/lexer-keywords.txt" +#line 80 "src/lexer-keywords.txt" {"f32.load", TokenType::Load, Opcode::F32Load}, {""}, {""}, {""}, -#line 374 "src/lexer-keywords.txt" +#line 378 "src/lexer-keywords.txt" {"i64.add", TokenType::Binary, Opcode::I64Add}, -#line 245 "src/lexer-keywords.txt" +#line 249 "src/lexer-keywords.txt" {"i32.add", TokenType::Binary, Opcode::I32Add}, -#line 436 "src/lexer-keywords.txt" +#line 440 "src/lexer-keywords.txt" {"i64.load", TokenType::Load, Opcode::I64Load}, -#line 293 "src/lexer-keywords.txt" +#line 297 "src/lexer-keywords.txt" {"i32.load", TokenType::Load, Opcode::I32Load}, - {""}, {""}, {""}, {""}, -#line 116 "src/lexer-keywords.txt" +#line 581 "src/lexer-keywords.txt" + {"run_once", TokenType::RunOnce}, + {""}, {""}, {""}, +#line 119 "src/lexer-keywords.txt" {"f32x4.replace_lane", TokenType::SimdLaneOp, Opcode::F32X4ReplaceLane}, {""}, {""}, {""}, -#line 375 "src/lexer-keywords.txt" +#line 379 "src/lexer-keywords.txt" {"i64.and", TokenType::Binary, Opcode::I64And}, -#line 246 "src/lexer-keywords.txt" +#line 250 "src/lexer-keywords.txt" {"i32.and", TokenType::Binary, Opcode::I32And}, {""}, -#line 352 "src/lexer-keywords.txt" +#line 356 "src/lexer-keywords.txt" {"i32x4.replace_lane", TokenType::SimdLaneOp, Opcode::I32X4ReplaceLane}, {""}, {""}, {""}, -#line 425 "src/lexer-keywords.txt" +#line 429 "src/lexer-keywords.txt" {"i64.ge_u", TokenType::Compare, Opcode::I64GeU}, -#line 284 "src/lexer-keywords.txt" +#line 288 "src/lexer-keywords.txt" {"i32.ge_u", TokenType::Compare, Opcode::I32GeU}, -#line 429 "src/lexer-keywords.txt" +#line 433 "src/lexer-keywords.txt" {"i64.le_u", TokenType::Compare, Opcode::I64LeU}, -#line 288 "src/lexer-keywords.txt" +#line 292 "src/lexer-keywords.txt" {"i32.le_u", TokenType::Compare, Opcode::I32LeU}, -#line 424 "src/lexer-keywords.txt" +#line 428 "src/lexer-keywords.txt" {"i64.ge_s", TokenType::Compare, Opcode::I64GeS}, -#line 283 "src/lexer-keywords.txt" +#line 287 "src/lexer-keywords.txt" {"i32.ge_s", TokenType::Compare, Opcode::I32GeS}, -#line 428 "src/lexer-keywords.txt" +#line 432 "src/lexer-keywords.txt" {"i64.le_s", TokenType::Compare, Opcode::I64LeS}, -#line 287 "src/lexer-keywords.txt" +#line 291 "src/lexer-keywords.txt" {"i32.le_s", TokenType::Compare, Opcode::I32LeS}, -#line 427 "src/lexer-keywords.txt" +#line 431 "src/lexer-keywords.txt" {"i64.gt_u", TokenType::Compare, Opcode::I64GtU}, -#line 286 "src/lexer-keywords.txt" +#line 290 "src/lexer-keywords.txt" {"i32.gt_u", TokenType::Compare, Opcode::I32GtU}, -#line 438 "src/lexer-keywords.txt" +#line 442 "src/lexer-keywords.txt" {"i64.lt_u", TokenType::Compare, Opcode::I64LtU}, -#line 295 "src/lexer-keywords.txt" +#line 299 "src/lexer-keywords.txt" {"i32.lt_u", TokenType::Compare, Opcode::I32LtU}, -#line 426 "src/lexer-keywords.txt" +#line 430 "src/lexer-keywords.txt" {"i64.gt_s", TokenType::Compare, Opcode::I64GtS}, -#line 285 "src/lexer-keywords.txt" +#line 289 "src/lexer-keywords.txt" {"i32.gt_s", TokenType::Compare, Opcode::I32GtS}, -#line 437 "src/lexer-keywords.txt" +#line 441 "src/lexer-keywords.txt" {"i64.lt_s", TokenType::Compare, Opcode::I64LtS}, -#line 294 "src/lexer-keywords.txt" +#line 298 "src/lexer-keywords.txt" {"i32.lt_s", TokenType::Compare, Opcode::I32LtS}, {""}, {""}, {""}, -#line 540 "src/lexer-keywords.txt" +#line 544 "src/lexer-keywords.txt" {"local.get", TokenType::LocalGet, Opcode::LocalGet}, {""}, -#line 541 "src/lexer-keywords.txt" +#line 545 "src/lexer-keywords.txt" {"local.set", TokenType::LocalSet, Opcode::LocalSet}, -#line 542 "src/lexer-keywords.txt" +#line 546 "src/lexer-keywords.txt" {"local.tee", TokenType::LocalTee, Opcode::LocalTee}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 351 "src/lexer-keywords.txt" +#line 416 "src/lexer-keywords.txt" + {"i64.clz", TokenType::Unary, Opcode::I64Clz}, +#line 278 "src/lexer-keywords.txt" + {"i32.clz", TokenType::Unary, Opcode::I32Clz}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 418 "src/lexer-keywords.txt" + {"i64.ctz", TokenType::Unary, Opcode::I64Ctz}, +#line 280 "src/lexer-keywords.txt" + {"i32.ctz", TokenType::Unary, Opcode::I32Ctz}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 355 "src/lexer-keywords.txt" {"i32x4.relaxed_laneselect", TokenType::Ternary, Opcode::I32X4RelaxedLaneSelect}, -#line 324 "src/lexer-keywords.txt" +#line 328 "src/lexer-keywords.txt" {"i32x4.all_true", TokenType::Unary, Opcode::I32X4AllTrue}, {""}, -#line 125 "src/lexer-keywords.txt" +#line 128 "src/lexer-keywords.txt" {"f64.ceil", TokenType::Unary, Opcode::F64Ceil}, -#line 63 "src/lexer-keywords.txt" +#line 66 "src/lexer-keywords.txt" {"f32.ceil", TokenType::Unary, Opcode::F32Ceil}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 585 "src/lexer-keywords.txt" +#line 592 "src/lexer-keywords.txt" {"table.size", TokenType::TableSize, Opcode::TableSize}, {""}, {""}, {""}, -#line 104 "src/lexer-keywords.txt" +#line 107 "src/lexer-keywords.txt" {"f32x4.max", TokenType::Binary, Opcode::F32X4Max}, -#line 535 "src/lexer-keywords.txt" +#line 539 "src/lexer-keywords.txt" {"if", TokenType::If, Opcode::If}, -#line 411 "src/lexer-keywords.txt" +#line 415 "src/lexer-keywords.txt" {"i64.atomic.store", TokenType::AtomicStore, Opcode::I64AtomicStore}, -#line 273 "src/lexer-keywords.txt" +#line 277 "src/lexer-keywords.txt" {"i32.atomic.store", TokenType::AtomicStore, Opcode::I32AtomicStore}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 563 "src/lexer-keywords.txt" +#line 569 "src/lexer-keywords.txt" {"ref", TokenType::Ref}, {""}, {""}, -#line 404 "src/lexer-keywords.txt" +#line 408 "src/lexer-keywords.txt" {"i64.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I64AtomicRmwOr}, -#line 267 "src/lexer-keywords.txt" +#line 271 "src/lexer-keywords.txt" {"i32.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I32AtomicRmwOr}, {""}, {""}, {""}, {""}, {""}, -#line 573 "src/lexer-keywords.txt" +#line 579 "src/lexer-keywords.txt" {"return_call", TokenType::ReturnCall, Opcode::ReturnCall}, {""}, {""}, -#line 53 "src/lexer-keywords.txt" +#line 55 "src/lexer-keywords.txt" {"else", TokenType::Else, Opcode::Else}, {""}, {""}, {""}, {""}, {""}, -#line 55 "src/lexer-keywords.txt" +#line 57 "src/lexer-keywords.txt" {"tag", TokenType::Tag}, {""}, -#line 98 "src/lexer-keywords.txt" +#line 101 "src/lexer-keywords.txt" {"f32x4.extract_lane", TokenType::SimdLaneOp, Opcode::F32X4ExtractLane}, -#line 565 "src/lexer-keywords.txt" +#line 571 "src/lexer-keywords.txt" {"ref.extern", TokenType::RefExtern}, -#line 338 "src/lexer-keywords.txt" +#line 342 "src/lexer-keywords.txt" {"i32x4.relaxed_trunc_f64x2_u_zero", TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2UZero}, -#line 90 "src/lexer-keywords.txt" +#line 93 "src/lexer-keywords.txt" {"f32", Type::F32}, -#line 337 "src/lexer-keywords.txt" +#line 341 "src/lexer-keywords.txt" {"i32x4.relaxed_trunc_f64x2_s_zero", TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2SZero}, {""}, {""}, -#line 328 "src/lexer-keywords.txt" +#line 332 "src/lexer-keywords.txt" {"i32x4.extract_lane", TokenType::SimdLaneOp, Opcode::I32X4ExtractLane}, {""}, -#line 189 "src/lexer-keywords.txt" +#line 193 "src/lexer-keywords.txt" {"get", TokenType::Get}, -#line 320 "src/lexer-keywords.txt" +#line 324 "src/lexer-keywords.txt" {"i32", Type::I32}, -#line 50 "src/lexer-keywords.txt" +#line 52 "src/lexer-keywords.txt" {"either", TokenType::Either}, {""}, {""}, -#line 391 "src/lexer-keywords.txt" +#line 395 "src/lexer-keywords.txt" {"i64.atomic.rmw32.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32SubU}, -#line 435 "src/lexer-keywords.txt" +#line 439 "src/lexer-keywords.txt" {"i64.load8_u", TokenType::Load, Opcode::I64Load8U}, -#line 292 "src/lexer-keywords.txt" +#line 296 "src/lexer-keywords.txt" {"i32.load8_u", TokenType::Load, Opcode::I32Load8U}, -#line 434 "src/lexer-keywords.txt" +#line 438 "src/lexer-keywords.txt" {"i64.load8_s", TokenType::Load, Opcode::I64Load8S}, -#line 291 "src/lexer-keywords.txt" +#line 295 "src/lexer-keywords.txt" {"i32.load8_s", TokenType::Load, Opcode::I32Load8S}, {""}, -#line 410 "src/lexer-keywords.txt" +#line 414 "src/lexer-keywords.txt" {"i64.atomic.store8", TokenType::AtomicStore, Opcode::I64AtomicStore8}, -#line 272 "src/lexer-keywords.txt" +#line 276 "src/lexer-keywords.txt" {"i32.atomic.store8", TokenType::AtomicStore, Opcode::I32AtomicStore8}, -#line 431 "src/lexer-keywords.txt" +#line 435 "src/lexer-keywords.txt" {"i64.load16_u", TokenType::Load, Opcode::I64Load16U}, -#line 290 "src/lexer-keywords.txt" +#line 294 "src/lexer-keywords.txt" {"i32.load16_u", TokenType::Load, Opcode::I32Load16U}, -#line 457 "src/lexer-keywords.txt" +#line 461 "src/lexer-keywords.txt" {"i64.trunc_f32_u", TokenType::Convert, Opcode::I64TruncF32U}, -#line 313 "src/lexer-keywords.txt" +#line 317 "src/lexer-keywords.txt" {"i32.trunc_f32_u", TokenType::Convert, Opcode::I32TruncF32U}, -#line 430 "src/lexer-keywords.txt" +#line 434 "src/lexer-keywords.txt" {"i64.load16_s", TokenType::Load, Opcode::I64Load16S}, -#line 289 "src/lexer-keywords.txt" +#line 293 "src/lexer-keywords.txt" {"i32.load16_s", TokenType::Load, Opcode::I32Load16S}, -#line 456 "src/lexer-keywords.txt" +#line 460 "src/lexer-keywords.txt" {"i64.trunc_f32_s", TokenType::Convert, Opcode::I64TruncF32S}, -#line 312 "src/lexer-keywords.txt" +#line 316 "src/lexer-keywords.txt" {"i32.trunc_f32_s", TokenType::Convert, Opcode::I32TruncF32S}, -#line 445 "src/lexer-keywords.txt" +#line 449 "src/lexer-keywords.txt" {"i64.rem_u", TokenType::Binary, Opcode::I64RemU}, -#line 302 "src/lexer-keywords.txt" +#line 306 "src/lexer-keywords.txt" {"i32.rem_u", TokenType::Binary, Opcode::I32RemU}, -#line 444 "src/lexer-keywords.txt" +#line 448 "src/lexer-keywords.txt" {"i64.rem_s", TokenType::Binary, Opcode::I64RemS}, -#line 301 "src/lexer-keywords.txt" +#line 305 "src/lexer-keywords.txt" {"i32.rem_s", TokenType::Binary, Opcode::I32RemS}, {""}, -#line 54 "src/lexer-keywords.txt" +#line 56 "src/lexer-keywords.txt" {"end", TokenType::End, Opcode::End}, {""}, -#line 407 "src/lexer-keywords.txt" +#line 411 "src/lexer-keywords.txt" {"i64.atomic.rmw.xor", TokenType::AtomicRmw, Opcode::I64AtomicRmwXor}, -#line 270 "src/lexer-keywords.txt" +#line 274 "src/lexer-keywords.txt" {"i32.atomic.rmw.xor", TokenType::AtomicRmw, Opcode::I32AtomicRmwXor}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 587 "src/lexer-keywords.txt" +#line 594 "src/lexer-keywords.txt" {"then", TokenType::Then}, -#line 583 "src/lexer-keywords.txt" +#line 590 "src/lexer-keywords.txt" {"table.init", TokenType::TableInit, Opcode::TableInit}, {""}, {""}, -#line 344 "src/lexer-keywords.txt" +#line 348 "src/lexer-keywords.txt" {"i32x4.max_u", TokenType::Binary, Opcode::I32X4MaxU}, {""}, -#line 343 "src/lexer-keywords.txt" +#line 347 "src/lexer-keywords.txt" {"i32x4.max_s", TokenType::Binary, Opcode::I32X4MaxS}, {""}, -#line 390 "src/lexer-keywords.txt" +#line 394 "src/lexer-keywords.txt" {"i64.atomic.rmw32.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32OrU}, -#line 448 "src/lexer-keywords.txt" +#line 452 "src/lexer-keywords.txt" {"i64.shl", TokenType::Binary, Opcode::I64Shl}, -#line 305 "src/lexer-keywords.txt" +#line 309 "src/lexer-keywords.txt" {"i32.shl", TokenType::Binary, Opcode::I32Shl}, {""}, {""}, -#line 114 "src/lexer-keywords.txt" +#line 117 "src/lexer-keywords.txt" {"f32x4.relaxed_min", TokenType::Binary, Opcode::F32X4RelaxedMin}, {""}, -#line 115 "src/lexer-keywords.txt" +#line 118 "src/lexer-keywords.txt" {"f32x4.relaxed_nmadd", TokenType::Ternary, Opcode::F32X4RelaxedNmadd}, -#line 140 "src/lexer-keywords.txt" +#line 143 "src/lexer-keywords.txt" {"f64.max", TokenType::Binary, Opcode::F64Max}, -#line 79 "src/lexer-keywords.txt" +#line 82 "src/lexer-keywords.txt" {"f32.max", TokenType::Binary, Opcode::F32Max}, {""}, {""}, -#line 160 "src/lexer-keywords.txt" +#line 163 "src/lexer-keywords.txt" {"f64x2.ge", TokenType::Compare, Opcode::F64X2Ge}, {""}, -#line 162 "src/lexer-keywords.txt" +#line 165 "src/lexer-keywords.txt" {"f64x2.le", TokenType::Compare, Opcode::F64X2Le}, {""}, {""}, -#line 387 "src/lexer-keywords.txt" +#line 391 "src/lexer-keywords.txt" {"i64.atomic.rmw32.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AddU}, {""}, -#line 353 "src/lexer-keywords.txt" +#line 357 "src/lexer-keywords.txt" {"i32x4.shl", TokenType::Binary, Opcode::I32X4Shl}, {""}, {""}, -#line 569 "src/lexer-keywords.txt" +#line 575 "src/lexer-keywords.txt" {"register", TokenType::Register}, -#line 379 "src/lexer-keywords.txt" +#line 383 "src/lexer-keywords.txt" {"i64.atomic.load", TokenType::AtomicLoad, Opcode::I64AtomicLoad}, -#line 249 "src/lexer-keywords.txt" +#line 253 "src/lexer-keywords.txt" {"i32.atomic.load", TokenType::AtomicLoad, Opcode::I32AtomicLoad}, {""}, {""}, {""}, -#line 161 "src/lexer-keywords.txt" +#line 164 "src/lexer-keywords.txt" {"f64x2.gt", TokenType::Compare, Opcode::F64X2Gt}, -#line 388 "src/lexer-keywords.txt" +#line 392 "src/lexer-keywords.txt" {"i64.atomic.rmw32.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AndU}, -#line 163 "src/lexer-keywords.txt" +#line 166 "src/lexer-keywords.txt" {"f64x2.lt", TokenType::Compare, Opcode::F64X2Lt}, {""}, -#line 58 "src/lexer-keywords.txt" +#line 61 "src/lexer-keywords.txt" {"exn", Type::ExnRef, TokenType::Exn}, {""}, {""}, -#line 475 "src/lexer-keywords.txt" +#line 479 "src/lexer-keywords.txt" {"i64x2.ge_s", TokenType::Binary, Opcode::I64X2GeS}, -#line 155 "src/lexer-keywords.txt" +#line 158 "src/lexer-keywords.txt" {"f64x2.ceil", TokenType::Unary, Opcode::F64X2Ceil}, -#line 474 "src/lexer-keywords.txt" +#line 478 "src/lexer-keywords.txt" {"i64x2.le_s", TokenType::Binary, Opcode::I64X2LeS}, {""}, {""}, {""}, {""}, {""}, -#line 473 "src/lexer-keywords.txt" +#line 477 "src/lexer-keywords.txt" {"i64x2.gt_s", TokenType::Binary, Opcode::I64X2GtS}, {""}, -#line 472 "src/lexer-keywords.txt" +#line 476 "src/lexer-keywords.txt" {"i64x2.lt_s", TokenType::Binary, Opcode::I64X2LtS}, -#line 99 "src/lexer-keywords.txt" +#line 102 "src/lexer-keywords.txt" {"f32x4.floor", TokenType::Unary, Opcode::F32X4Floor}, {""}, {""}, -#line 185 "src/lexer-keywords.txt" +#line 188 "src/lexer-keywords.txt" {"field", TokenType::Field}, -#line 112 "src/lexer-keywords.txt" +#line 115 "src/lexer-keywords.txt" {"f32x4.relaxed_madd", TokenType::Ternary, Opcode::F32X4RelaxedMadd}, {""}, {""}, {""}, {""}, {""}, -#line 419 "src/lexer-keywords.txt" +#line 423 "src/lexer-keywords.txt" {"i64.extend16_s", TokenType::Unary, Opcode::I64Extend16S}, -#line 281 "src/lexer-keywords.txt" +#line 285 "src/lexer-keywords.txt" {"i32.extend16_s", TokenType::Unary, Opcode::I32Extend16S}, {""}, -#line 539 "src/lexer-keywords.txt" +#line 543 "src/lexer-keywords.txt" {"item", TokenType::Item}, {""}, {""}, -#line 421 "src/lexer-keywords.txt" +#line 425 "src/lexer-keywords.txt" {"i64.extend8_s", TokenType::Unary, Opcode::I64Extend8S}, -#line 282 "src/lexer-keywords.txt" +#line 286 "src/lexer-keywords.txt" {"i32.extend8_s", TokenType::Unary, Opcode::I32Extend8S}, {""}, {""}, -#line 566 "src/lexer-keywords.txt" +#line 572 "src/lexer-keywords.txt" {"ref.func", TokenType::RefFunc, Opcode::RefFunc}, -#line 134 "src/lexer-keywords.txt" +#line 137 "src/lexer-keywords.txt" {"f64.floor", TokenType::Unary, Opcode::F64Floor}, -#line 73 "src/lexer-keywords.txt" +#line 76 "src/lexer-keywords.txt" {"f32.floor", TokenType::Unary, Opcode::F32Floor}, - {""}, {""}, -#line 412 "src/lexer-keywords.txt" - {"i64.clz", TokenType::Unary, Opcode::I64Clz}, -#line 274 "src/lexer-keywords.txt" - {"i32.clz", TokenType::Unary, Opcode::I32Clz}, - {""}, {""}, {""}, {""}, -#line 168 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 171 "src/lexer-keywords.txt" {"f64x2.neg", TokenType::Unary, Opcode::F64X2Neg}, -#line 105 "src/lexer-keywords.txt" +#line 108 "src/lexer-keywords.txt" {"f32x4.min", TokenType::Binary, Opcode::F32X4Min}, -#line 169 "src/lexer-keywords.txt" +#line 172 "src/lexer-keywords.txt" {"f64x2.ne", TokenType::Compare, Opcode::F64X2Ne}, -#line 414 "src/lexer-keywords.txt" - {"i64.ctz", TokenType::Unary, Opcode::I64Ctz}, -#line 276 "src/lexer-keywords.txt" - {"i32.ctz", TokenType::Unary, Opcode::I32Ctz}, - {""}, {""}, -#line 477 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 481 "src/lexer-keywords.txt" {"i64x2.neg", TokenType::Unary, Opcode::I64X2Neg}, -#line 452 "src/lexer-keywords.txt" +#line 456 "src/lexer-keywords.txt" {"i64.store32", TokenType::Store, Opcode::I64Store32}, -#line 471 "src/lexer-keywords.txt" +#line 475 "src/lexer-keywords.txt" {"i64x2.ne", TokenType::Binary, Opcode::I64X2Ne}, {""}, -#line 56 "src/lexer-keywords.txt" +#line 59 "src/lexer-keywords.txt" {"extern", Type::ExternRef, TokenType::Extern}, -#line 394 "src/lexer-keywords.txt" +#line 398 "src/lexer-keywords.txt" {"i64.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AddU}, -#line 257 "src/lexer-keywords.txt" +#line 261 "src/lexer-keywords.txt" {"i32.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AddU}, {""}, {""}, -#line 392 "src/lexer-keywords.txt" +#line 396 "src/lexer-keywords.txt" {"i64.atomic.rmw32.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XchgU}, {""}, -#line 113 "src/lexer-keywords.txt" +#line 116 "src/lexer-keywords.txt" {"f32x4.relaxed_max", TokenType::Binary, Opcode::F32X4RelaxedMax}, {""}, {""}, {""}, {""}, {""}, -#line 395 "src/lexer-keywords.txt" +#line 399 "src/lexer-keywords.txt" {"i64.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AndU}, -#line 258 "src/lexer-keywords.txt" +#line 262 "src/lexer-keywords.txt" {"i32.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AndU}, {""}, {""}, -#line 188 "src/lexer-keywords.txt" +#line 192 "src/lexer-keywords.txt" {"function", TokenType::Function}, -#line 401 "src/lexer-keywords.txt" +#line 405 "src/lexer-keywords.txt" {"i64.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I64AtomicRmwAdd}, -#line 264 "src/lexer-keywords.txt" +#line 268 "src/lexer-keywords.txt" {"i32.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I32AtomicRmwAdd}, {""}, -#line 180 "src/lexer-keywords.txt" +#line 183 "src/lexer-keywords.txt" {"f64x2.trunc", TokenType::Unary, Opcode::F64X2Trunc}, {""}, {""}, -#line 393 "src/lexer-keywords.txt" +#line 397 "src/lexer-keywords.txt" {"i64.atomic.rmw32.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XorU}, - {""}, {""}, -#line 557 "src/lexer-keywords.txt" + {""}, +#line 597 "src/lexer-keywords.txt" + {"try", TokenType::Try, Opcode::Try}, +#line 561 "src/lexer-keywords.txt" {"nan:canonical", TokenType::NanCanonical}, {""}, {""}, -#line 402 "src/lexer-keywords.txt" +#line 406 "src/lexer-keywords.txt" {"i64.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I64AtomicRmwAnd}, -#line 265 "src/lexer-keywords.txt" +#line 269 "src/lexer-keywords.txt" {"i32.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I32AtomicRmwAnd}, -#line 154 "src/lexer-keywords.txt" +#line 157 "src/lexer-keywords.txt" {"f64x2.add", TokenType::Binary, Opcode::F64X2Add}, -#line 167 "src/lexer-keywords.txt" +#line 170 "src/lexer-keywords.txt" {"f64x2.nearest", TokenType::Unary, Opcode::F64X2Nearest}, {""}, {""}, {""}, -#line 141 "src/lexer-keywords.txt" +#line 144 "src/lexer-keywords.txt" {"f64.min", TokenType::Binary, Opcode::F64Min}, -#line 80 "src/lexer-keywords.txt" +#line 83 "src/lexer-keywords.txt" {"f32.min", TokenType::Binary, Opcode::F32Min}, -#line 465 "src/lexer-keywords.txt" +#line 469 "src/lexer-keywords.txt" {"i64x2.add", TokenType::Binary, Opcode::I64X2Add}, {""}, {""}, -#line 400 "src/lexer-keywords.txt" +#line 404 "src/lexer-keywords.txt" {"i64.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XorU}, -#line 263 "src/lexer-keywords.txt" +#line 267 "src/lexer-keywords.txt" {"i32.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XorU}, {""}, -#line 459 "src/lexer-keywords.txt" +#line 463 "src/lexer-keywords.txt" {"i64.trunc_f64_u", TokenType::Convert, Opcode::I64TruncF64U}, -#line 315 "src/lexer-keywords.txt" +#line 319 "src/lexer-keywords.txt" {"i32.trunc_f64_u", TokenType::Convert, Opcode::I32TruncF64U}, {""}, -#line 166 "src/lexer-keywords.txt" +#line 169 "src/lexer-keywords.txt" {"f64x2.mul", TokenType::Binary, Opcode::F64X2Mul}, -#line 458 "src/lexer-keywords.txt" +#line 462 "src/lexer-keywords.txt" {"i64.trunc_f64_s", TokenType::Convert, Opcode::I64TruncF64S}, -#line 314 "src/lexer-keywords.txt" +#line 318 "src/lexer-keywords.txt" {"i32.trunc_f64_s", TokenType::Convert, Opcode::I32TruncF64S}, -#line 567 "src/lexer-keywords.txt" +#line 573 "src/lexer-keywords.txt" {"ref.is_null", TokenType::RefIsNull, Opcode::RefIsNull}, -#line 605 "src/lexer-keywords.txt" - {"v128", Type::V128}, +#line 45 "src/lexer-keywords.txt" + {"compilation", TokenType::Compilation}, {""}, {""}, -#line 469 "src/lexer-keywords.txt" +#line 473 "src/lexer-keywords.txt" {"i64x2.mul", TokenType::Binary, Opcode::I64X2Mul}, -#line 433 "src/lexer-keywords.txt" +#line 437 "src/lexer-keywords.txt" {"i64.load32_u", TokenType::Load, Opcode::I64Load32U}, {""}, {""}, {""}, -#line 432 "src/lexer-keywords.txt" +#line 436 "src/lexer-keywords.txt" {"i64.load32_s", TokenType::Load, Opcode::I64Load32S}, {""}, {""}, {""}, {""}, -#line 556 "src/lexer-keywords.txt" +#line 560 "src/lexer-keywords.txt" {"nan:arithmetic", TokenType::NanArithmetic}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 538 "src/lexer-keywords.txt" - {"invoke", TokenType::Invoke}, - {""}, {""}, {""}, {""}, {""}, -#line 378 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 382 "src/lexer-keywords.txt" {"i64.atomic.load8_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad8U}, -#line 248 "src/lexer-keywords.txt" +#line 252 "src/lexer-keywords.txt" {"i32.atomic.load8_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad8U}, {""}, -#line 176 "src/lexer-keywords.txt" +#line 179 "src/lexer-keywords.txt" {"f64x2.replace_lane", TokenType::SimdLaneOp, Opcode::F64X2ReplaceLane}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 485 "src/lexer-keywords.txt" +#line 489 "src/lexer-keywords.txt" {"i64x2.replace_lane", TokenType::SimdLaneOp, Opcode::I64X2ReplaceLane}, - {""}, -#line 564 "src/lexer-keywords.txt" - {"quote", TokenType::Quote}, -#line 32 "src/lexer-keywords.txt" - {"block", TokenType::Block, Opcode::Block}, - {""}, {""}, -#line 450 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, +#line 454 "src/lexer-keywords.txt" {"i64.shr_u", TokenType::Binary, Opcode::I64ShrU}, -#line 307 "src/lexer-keywords.txt" +#line 311 "src/lexer-keywords.txt" {"i32.shr_u", TokenType::Binary, Opcode::I32ShrU}, -#line 449 "src/lexer-keywords.txt" +#line 453 "src/lexer-keywords.txt" {"i64.shr_s", TokenType::Binary, Opcode::I64ShrS}, -#line 306 "src/lexer-keywords.txt" +#line 310 "src/lexer-keywords.txt" {"i32.shr_s", TokenType::Binary, Opcode::I32ShrS}, -#line 397 "src/lexer-keywords.txt" +#line 401 "src/lexer-keywords.txt" {"i64.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8OrU}, -#line 260 "src/lexer-keywords.txt" +#line 264 "src/lexer-keywords.txt" {"i32.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8OrU}, -#line 240 "src/lexer-keywords.txt" +#line 244 "src/lexer-keywords.txt" {"i16x8", TokenType::I16X8}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 355 "src/lexer-keywords.txt" +#line 359 "src/lexer-keywords.txt" {"i32x4.shr_u", TokenType::Binary, Opcode::I32X4ShrU}, -#line 346 "src/lexer-keywords.txt" +#line 350 "src/lexer-keywords.txt" {"i32x4.min_u", TokenType::Binary, Opcode::I32X4MinU}, -#line 354 "src/lexer-keywords.txt" +#line 358 "src/lexer-keywords.txt" {"i32x4.shr_s", TokenType::Binary, Opcode::I32X4ShrS}, -#line 345 "src/lexer-keywords.txt" +#line 349 "src/lexer-keywords.txt" {"i32x4.min_s", TokenType::Binary, Opcode::I32X4MinS}, -#line 600 "src/lexer-keywords.txt" - {"v128.or", TokenType::Binary, Opcode::V128Or}, - {""}, -#line 560 "src/lexer-keywords.txt" - {"output", TokenType::Output}, - {""}, {""}, -#line 559 "src/lexer-keywords.txt" - {"offset", TokenType::Offset}, - {""}, -#line 592 "src/lexer-keywords.txt" - {"type", TokenType::Type}, -#line 590 "src/lexer-keywords.txt" - {"try", TokenType::Try, Opcode::Try}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 580 "src/lexer-keywords.txt" +#line 587 "src/lexer-keywords.txt" {"table.fill", TokenType::TableFill, Opcode::TableFill}, {""}, -#line 484 "src/lexer-keywords.txt" +#line 488 "src/lexer-keywords.txt" {"i64x2.relaxed_laneselect", TokenType::Ternary, Opcode::I64X2RelaxedLaneSelect}, -#line 478 "src/lexer-keywords.txt" +#line 482 "src/lexer-keywords.txt" {"i64x2.all_true", TokenType::Unary, Opcode::I64X2AllTrue}, - {""}, {""}, {""}, {""}, {""}, -#line 205 "src/lexer-keywords.txt" +#line 612 "src/lexer-keywords.txt" + {"v128", Type::V128}, + {""}, {""}, {""}, {""}, +#line 209 "src/lexer-keywords.txt" {"i16x8.ge_u", TokenType::Compare, Opcode::I16X8GeU}, -#line 420 "src/lexer-keywords.txt" +#line 424 "src/lexer-keywords.txt" {"i64.extend32_s", TokenType::Unary, Opcode::I64Extend32S}, -#line 209 "src/lexer-keywords.txt" +#line 213 "src/lexer-keywords.txt" {"i16x8.le_u", TokenType::Compare, Opcode::I16X8LeU}, {""}, -#line 204 "src/lexer-keywords.txt" +#line 208 "src/lexer-keywords.txt" {"i16x8.ge_s", TokenType::Compare, Opcode::I16X8GeS}, -#line 40 "src/lexer-keywords.txt" +#line 41 "src/lexer-keywords.txt" {"catch_all", TokenType::CatchAll, Opcode::CatchAll}, -#line 208 "src/lexer-keywords.txt" +#line 212 "src/lexer-keywords.txt" {"i16x8.le_s", TokenType::Compare, Opcode::I16X8LeS}, -#line 336 "src/lexer-keywords.txt" +#line 340 "src/lexer-keywords.txt" {"i32x4.relaxed_trunc_f32x4_u", TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4U}, -#line 207 "src/lexer-keywords.txt" +#line 211 "src/lexer-keywords.txt" {"i16x8.gt_u", TokenType::Compare, Opcode::I16X8GtU}, {""}, -#line 213 "src/lexer-keywords.txt" +#line 217 "src/lexer-keywords.txt" {"i16x8.lt_u", TokenType::Compare, Opcode::I16X8LtU}, -#line 335 "src/lexer-keywords.txt" +#line 339 "src/lexer-keywords.txt" {"i32x4.relaxed_trunc_f32x4_s", TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4S}, -#line 206 "src/lexer-keywords.txt" +#line 210 "src/lexer-keywords.txt" {"i16x8.gt_s", TokenType::Compare, Opcode::I16X8GtS}, {""}, -#line 212 "src/lexer-keywords.txt" +#line 216 "src/lexer-keywords.txt" {"i16x8.lt_s", TokenType::Compare, Opcode::I16X8LtS}, {""}, {""}, -#line 70 "src/lexer-keywords.txt" +#line 73 "src/lexer-keywords.txt" {"f32.demote_f64", TokenType::Convert, Opcode::F32DemoteF64}, - {""}, -#line 164 "src/lexer-keywords.txt" +#line 542 "src/lexer-keywords.txt" + {"invoke", TokenType::Invoke}, +#line 167 "src/lexer-keywords.txt" {"f64x2.max", TokenType::Binary, Opcode::F64X2Max}, - {""}, -#line 117 "src/lexer-keywords.txt" - {"f32x4.splat", TokenType::Unary, Opcode::F32X4Splat}, -#line 604 "src/lexer-keywords.txt" - {"v128.store", TokenType::Store, Opcode::V128Store}, -#line 537 "src/lexer-keywords.txt" - {"input", TokenType::Input}, - {""}, {""}, -#line 572 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, +#line 578 "src/lexer-keywords.txt" {"return_call_indirect", TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect}, - {""}, -#line 356 "src/lexer-keywords.txt" - {"i32x4.splat", TokenType::Unary, Opcode::I32X4Splat}, -#line 508 "src/lexer-keywords.txt" - {"i8x16.ge_u", TokenType::Compare, Opcode::I8X16GeU}, -#line 33 "src/lexer-keywords.txt" - {"br_if", TokenType::BrIf, Opcode::BrIf}, + {""}, {""}, #line 512 "src/lexer-keywords.txt" + {"i8x16.ge_u", TokenType::Compare, Opcode::I8X16GeU}, + {""}, +#line 516 "src/lexer-keywords.txt" {"i8x16.le_u", TokenType::Compare, Opcode::I8X16LeU}, {""}, -#line 507 "src/lexer-keywords.txt" +#line 511 "src/lexer-keywords.txt" {"i8x16.ge_s", TokenType::Compare, Opcode::I8X16GeS}, {""}, -#line 511 "src/lexer-keywords.txt" +#line 515 "src/lexer-keywords.txt" {"i8x16.le_s", TokenType::Compare, Opcode::I8X16LeS}, - {""}, -#line 510 "src/lexer-keywords.txt" - {"i8x16.gt_u", TokenType::Compare, Opcode::I8X16GtU}, -#line 536 "src/lexer-keywords.txt" - {"import", TokenType::Import}, +#line 34 "src/lexer-keywords.txt" + {"br_if", TokenType::BrIf, Opcode::BrIf}, #line 514 "src/lexer-keywords.txt" + {"i8x16.gt_u", TokenType::Compare, Opcode::I8X16GtU}, + {""}, +#line 518 "src/lexer-keywords.txt" {"i8x16.lt_u", TokenType::Compare, Opcode::I8X16LtU}, {""}, -#line 509 "src/lexer-keywords.txt" +#line 513 "src/lexer-keywords.txt" {"i8x16.gt_s", TokenType::Compare, Opcode::I8X16GtS}, {""}, -#line 513 "src/lexer-keywords.txt" +#line 517 "src/lexer-keywords.txt" {"i8x16.lt_s", TokenType::Compare, Opcode::I8X16LtS}, - {""}, {""}, {""}, {""}, {""}, -#line 598 "src/lexer-keywords.txt" - {"v128.load", TokenType::Load, Opcode::V128Load}, -#line 158 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, +#line 161 "src/lexer-keywords.txt" {"f64x2.extract_lane", TokenType::SimdLaneOp, Opcode::F64X2ExtractLane}, {""}, {""}, -#line 221 "src/lexer-keywords.txt" +#line 225 "src/lexer-keywords.txt" {"i16x8.neg", TokenType::Unary, Opcode::I16X8Neg}, {""}, -#line 223 "src/lexer-keywords.txt" +#line 227 "src/lexer-keywords.txt" {"i16x8.ne", TokenType::Compare, Opcode::I16X8Ne}, -#line 423 "src/lexer-keywords.txt" +#line 427 "src/lexer-keywords.txt" {"i64.extend_i32_u", TokenType::Convert, Opcode::I64ExtendI32U}, -#line 466 "src/lexer-keywords.txt" +#line 470 "src/lexer-keywords.txt" {"i64x2.extract_lane", TokenType::SimdLaneOp, Opcode::I64X2ExtractLane}, -#line 422 "src/lexer-keywords.txt" +#line 426 "src/lexer-keywords.txt" {"i64.extend_i32_s", TokenType::Convert, Opcode::I64ExtendI32S}, {""}, {""}, -#line 148 "src/lexer-keywords.txt" - {"f64.sqrt", TokenType::Unary, Opcode::F64Sqrt}, -#line 86 "src/lexer-keywords.txt" - {"f32.sqrt", TokenType::Unary, Opcode::F32Sqrt}, -#line 211 "src/lexer-keywords.txt" - {"v128.load8x8_u", TokenType::Load, Opcode::V128Load8X8U}, - {""}, -#line 210 "src/lexer-keywords.txt" - {"v128.load8x8_s", TokenType::Load, Opcode::V128Load8X8S}, -#line 611 "src/lexer-keywords.txt" - {"v128.load8_lane", TokenType::SimdLoadLane, Opcode::V128Load8Lane}, -#line 406 "src/lexer-keywords.txt" +#line 607 "src/lexer-keywords.txt" + {"v128.or", TokenType::Binary, Opcode::V128Or}, + {""}, {""}, {""}, {""}, {""}, +#line 410 "src/lexer-keywords.txt" {"i64.atomic.rmw.xchg", TokenType::AtomicRmw, Opcode::I64AtomicRmwXchg}, -#line 269 "src/lexer-keywords.txt" +#line 273 "src/lexer-keywords.txt" {"i32.atomic.rmw.xchg", TokenType::AtomicRmw, Opcode::I32AtomicRmwXchg}, {""}, {""}, {""}, -#line 184 "src/lexer-keywords.txt" +#line 187 "src/lexer-keywords.txt" {"f64x2", TokenType::F64X2}, - {""}, {""}, -#line 610 "src/lexer-keywords.txt" - {"v128.load8_splat", TokenType::Load, Opcode::V128Load8Splat}, - {""}, -#line 599 "src/lexer-keywords.txt" - {"v128.not", TokenType::Unary, Opcode::V128Not}, -#line 618 "src/lexer-keywords.txt" - {"v128.store64_lane", TokenType::SimdStoreLane, Opcode::V128Store64Lane}, -#line 495 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, +#line 499 "src/lexer-keywords.txt" {"i64x2", TokenType::I64X2}, -#line 118 "src/lexer-keywords.txt" - {"f32x4.sqrt", TokenType::Unary, Opcode::F32X4Sqrt}, - {""}, -#line 521 "src/lexer-keywords.txt" + {""}, {""}, +#line 525 "src/lexer-keywords.txt" {"i8x16.neg", TokenType::Unary, Opcode::I8X16Neg}, {""}, -#line 523 "src/lexer-keywords.txt" +#line 527 "src/lexer-keywords.txt" {"i8x16.ne", TokenType::Compare, Opcode::I8X16Ne}, -#line 44 "src/lexer-keywords.txt" - {"data.drop", TokenType::DataDrop, Opcode::DataDrop}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 451 "src/lexer-keywords.txt" - {"i64.store16", TokenType::Store, Opcode::I64Store16}, -#line 308 "src/lexer-keywords.txt" - {"i32.store16", TokenType::Store, Opcode::I32Store16}, - {""}, -#line 186 "src/lexer-keywords.txt" + {""}, {""}, +#line 599 "src/lexer-keywords.txt" + {"type", TokenType::Type}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 190 "src/lexer-keywords.txt" {"funcref", Type::FuncRef}, -#line 196 "src/lexer-keywords.txt" +#line 200 "src/lexer-keywords.txt" {"i16x8.add", TokenType::Binary, Opcode::I16X8Add}, - {""}, {""}, {""}, -#line 597 "src/lexer-keywords.txt" - {"v128.const", TokenType::Const, Opcode::V128Const}, - {""}, -#line 606 "src/lexer-keywords.txt" - {"v128.xor", TokenType::Binary, Opcode::V128Xor}, - {""}, {""}, {""}, {""}, {""}, -#line 174 "src/lexer-keywords.txt" +#line 556 "src/lexer-keywords.txt" + {"memory.size", TokenType::MemorySize, Opcode::MemorySize}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 611 "src/lexer-keywords.txt" + {"v128.store", TokenType::Store, Opcode::V128Store}, +#line 177 "src/lexer-keywords.txt" {"f64x2.relaxed_min", TokenType::Binary, Opcode::F64X2RelaxedMin}, {""}, -#line 175 "src/lexer-keywords.txt" +#line 178 "src/lexer-keywords.txt" {"f64x2.relaxed_nmadd", TokenType::Ternary, Opcode::F64X2RelaxedNmadd}, {""}, -#line 218 "src/lexer-keywords.txt" +#line 222 "src/lexer-keywords.txt" {"i16x8.mul", TokenType::Binary, Opcode::I16X8Mul}, {""}, -#line 376 "src/lexer-keywords.txt" +#line 380 "src/lexer-keywords.txt" {"i64.atomic.load16_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad16U}, -#line 247 "src/lexer-keywords.txt" +#line 251 "src/lexer-keywords.txt" {"i32.atomic.load16_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad16U}, {""}, {""}, {""}, -#line 39 "src/lexer-keywords.txt" +#line 40 "src/lexer-keywords.txt" {"catch", TokenType::Catch, Opcode::Catch}, {""}, {""}, -#line 486 "src/lexer-keywords.txt" +#line 490 "src/lexer-keywords.txt" {"i64x2.shl", TokenType::Binary, Opcode::I64X2Shl}, {""}, {""}, -#line 500 "src/lexer-keywords.txt" +#line 504 "src/lexer-keywords.txt" {"i8x16.add", TokenType::Binary, Opcode::I8X16Add}, {""}, -#line 595 "src/lexer-keywords.txt" - {"v128.and", TokenType::Binary, Opcode::V128And}, +#line 541 "src/lexer-keywords.txt" + {"input", TokenType::Input}, {""}, {""}, {""}, {""}, -#line 534 "src/lexer-keywords.txt" +#line 538 "src/lexer-keywords.txt" {"i8x16", TokenType::I8X16}, - {""}, {""}, -#line 52 "src/lexer-keywords.txt" + {""}, +#line 605 "src/lexer-keywords.txt" + {"v128.load", TokenType::Load, Opcode::V128Load}, +#line 54 "src/lexer-keywords.txt" {"elem", TokenType::Elem}, {""}, -#line 57 "src/lexer-keywords.txt" +#line 60 "src/lexer-keywords.txt" {"externref", Type::ExternRef}, - {""}, {""}, -#line 594 "src/lexer-keywords.txt" - {"v128.andnot", TokenType::Binary, Opcode::V128Andnot}, - {""}, {""}, -#line 384 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU}, -#line 254 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU}, - {""}, -#line 226 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 540 "src/lexer-keywords.txt" + {"import", TokenType::Import}, + {""}, {""}, {""}, +#line 230 "src/lexer-keywords.txt" {"i16x8.replace_lane", TokenType::SimdLaneOp, Opcode::I16X8ReplaceLane}, - {""}, {""}, -#line 159 "src/lexer-keywords.txt" +#line 570 "src/lexer-keywords.txt" + {"quote", TokenType::Quote}, +#line 215 "src/lexer-keywords.txt" + {"v128.load8x8_u", TokenType::Load, Opcode::V128Load8X8U}, +#line 162 "src/lexer-keywords.txt" {"f64x2.floor", TokenType::Unary, Opcode::F64X2Floor}, - {""}, {""}, -#line 468 "src/lexer-keywords.txt" - {"v128.load32x2_u", TokenType::Load, Opcode::V128Load32X2U}, -#line 172 "src/lexer-keywords.txt" +#line 214 "src/lexer-keywords.txt" + {"v128.load8x8_s", TokenType::Load, Opcode::V128Load8X8S}, +#line 618 "src/lexer-keywords.txt" + {"v128.load8_lane", TokenType::SimdLoadLane, Opcode::V128Load8Lane}, +#line 33 "src/lexer-keywords.txt" + {"block", TokenType::Block, Opcode::Block}, +#line 175 "src/lexer-keywords.txt" {"f64x2.relaxed_madd", TokenType::Ternary, Opcode::F64X2RelaxedMadd}, - {""}, {""}, -#line 467 "src/lexer-keywords.txt" - {"v128.load32x2_s", TokenType::Load, Opcode::V128Load32X2S}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 36 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 99 "src/lexer-keywords.txt" + {"f32x4.div", TokenType::Binary, Opcode::F32X4Div}, + {""}, +#line 617 "src/lexer-keywords.txt" + {"v128.load8_splat", TokenType::Load, Opcode::V128Load8Splat}, + {""}, +#line 606 "src/lexer-keywords.txt" + {"v128.not", TokenType::Unary, Opcode::V128Not}, +#line 625 "src/lexer-keywords.txt" + {"v128.store64_lane", TokenType::SimdStoreLane, Opcode::V128Store64Lane}, + {""}, +#line 151 "src/lexer-keywords.txt" + {"f64.sqrt", TokenType::Unary, Opcode::F64Sqrt}, +#line 89 "src/lexer-keywords.txt" + {"f32.sqrt", TokenType::Unary, Opcode::F32Sqrt}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 37 "src/lexer-keywords.txt" {"call_indirect", TokenType::CallIndirect, Opcode::CallIndirect}, {""}, -#line 526 "src/lexer-keywords.txt" +#line 530 "src/lexer-keywords.txt" {"i8x16.replace_lane", TokenType::SimdLaneOp, Opcode::I8X16ReplaceLane}, - {""}, {""}, {""}, {""}, {""}, -#line 165 "src/lexer-keywords.txt" +#line 566 "src/lexer-keywords.txt" + {"output", TokenType::Output}, + {""}, {""}, +#line 564 "src/lexer-keywords.txt" + {"offset", TokenType::Offset}, + {""}, +#line 168 "src/lexer-keywords.txt" {"f64x2.min", TokenType::Binary, Opcode::F64X2Min}, -#line 383 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU}, -#line 253 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 224 "src/lexer-keywords.txt" + {""}, {""}, +#line 121 "src/lexer-keywords.txt" + {"f32x4.sqrt", TokenType::Unary, Opcode::F32X4Sqrt}, +#line 604 "src/lexer-keywords.txt" + {"v128.const", TokenType::Const, Opcode::V128Const}, + {""}, +#line 613 "src/lexer-keywords.txt" + {"v128.xor", TokenType::Binary, Opcode::V128Xor}, + {""}, {""}, {""}, {""}, +#line 228 "src/lexer-keywords.txt" {"i16x8.relaxed_laneselect", TokenType::Ternary, Opcode::I16X8RelaxedLaneSelect}, -#line 197 "src/lexer-keywords.txt" +#line 201 "src/lexer-keywords.txt" {"i16x8.all_true", TokenType::Unary, Opcode::I16X8AllTrue}, - {""}, {""}, -#line 21 "src/lexer-keywords.txt" - {"after", TokenType::After}, -#line 552 "src/lexer-keywords.txt" - {"memory.size", TokenType::MemorySize, Opcode::MemorySize}, -#line 173 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 176 "src/lexer-keywords.txt" {"f64x2.relaxed_max", TokenType::Binary, Opcode::F64X2RelaxedMax}, -#line 380 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AddU}, -#line 250 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AddU}, -#line 399 "src/lexer-keywords.txt" + {""}, {""}, +#line 403 "src/lexer-keywords.txt" {"i64.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XchgU}, -#line 262 "src/lexer-keywords.txt" +#line 266 "src/lexer-keywords.txt" {"i32.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XchgU}, -#line 232 "src/lexer-keywords.txt" +#line 236 "src/lexer-keywords.txt" {"i16x8.sub_sat_u", TokenType::Binary, Opcode::I16X8SubSatU}, - {""}, {""}, {""}, -#line 231 "src/lexer-keywords.txt" +#line 455 "src/lexer-keywords.txt" + {"i64.store16", TokenType::Store, Opcode::I64Store16}, +#line 312 "src/lexer-keywords.txt" + {"i32.store16", TokenType::Store, Opcode::I32Store16}, + {""}, +#line 235 "src/lexer-keywords.txt" {"i16x8.sub_sat_s", TokenType::Binary, Opcode::I16X8SubSatS}, + {""}, {""}, {""}, {""}, +#line 602 "src/lexer-keywords.txt" + {"v128.and", TokenType::Binary, Opcode::V128And}, + {""}, {""}, +#line 393 "src/lexer-keywords.txt" + {"i64.atomic.rmw32.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU}, {""}, {""}, {""}, -#line 381 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU}, -#line 251 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU}, -#line 347 "src/lexer-keywords.txt" - {"i32x4.dot_i16x8_s", TokenType::Binary, Opcode::I32X4DotI16X8S}, +#line 120 "src/lexer-keywords.txt" + {"f32x4.splat", TokenType::Unary, Opcode::F32X4Splat}, {""}, -#line 389 "src/lexer-keywords.txt" - {"i64.atomic.rmw32.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU}, - {""}, {""}, {""}, {""}, {""}, -#line 525 "src/lexer-keywords.txt" +#line 529 "src/lexer-keywords.txt" {"i8x16.relaxed_laneselect", TokenType::Ternary, Opcode::I8X16RelaxedLaneSelect}, -#line 501 "src/lexer-keywords.txt" +#line 505 "src/lexer-keywords.txt" {"i8x16.all_true", TokenType::Unary, Opcode::I8X16AllTrue}, - {""}, {""}, {""}, {""}, -#line 577 "src/lexer-keywords.txt" - {"start", TokenType::Start}, - {""}, -#line 123 "src/lexer-keywords.txt" - {"f64.abs", TokenType::Unary, Opcode::F64Abs}, -#line 61 "src/lexer-keywords.txt" - {"f32.abs", TokenType::Unary, Opcode::F32Abs}, - {""}, -#line 532 "src/lexer-keywords.txt" + {""}, {""}, +#line 601 "src/lexer-keywords.txt" + {"v128.andnot", TokenType::Binary, Opcode::V128Andnot}, +#line 360 "src/lexer-keywords.txt" + {"i32x4.splat", TokenType::Unary, Opcode::I32X4Splat}, + {""}, {""}, {""}, {""}, {""}, +#line 536 "src/lexer-keywords.txt" {"i8x16.sub_sat_u", TokenType::Binary, Opcode::I8X16SubSatU}, {""}, {""}, {""}, -#line 531 "src/lexer-keywords.txt" +#line 535 "src/lexer-keywords.txt" {"i8x16.sub_sat_s", TokenType::Binary, Opcode::I8X16SubSatS}, -#line 616 "src/lexer-keywords.txt" - {"v128.store16_lane", TokenType::SimdStoreLane, Opcode::V128Store16Lane}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 119 "src/lexer-keywords.txt" - {"f32x4.sub", TokenType::Binary, Opcode::F32X4Sub}, - {""}, {""}, -#line 91 "src/lexer-keywords.txt" - {"f32x4.abs", TokenType::Unary, Opcode::F32X4Abs}, +#line 472 "src/lexer-keywords.txt" + {"v128.load32x2_u", TokenType::Load, Opcode::V128Load32X2U}, {""}, -#line 608 "src/lexer-keywords.txt" - {"v128.load32_splat", TokenType::Load, Opcode::V128Load32Splat}, -#line 562 "src/lexer-keywords.txt" - {"param", TokenType::Param}, -#line 357 "src/lexer-keywords.txt" - {"i32x4.sub", TokenType::Binary, Opcode::I32X4Sub}, -#line 96 "src/lexer-keywords.txt" - {"f32x4.div", TokenType::Binary, Opcode::F32X4Div}, -#line 602 "src/lexer-keywords.txt" - {"v128.load32_zero", TokenType::Load, Opcode::V128Load32Zero}, -#line 322 "src/lexer-keywords.txt" - {"i32x4.abs", TokenType::Unary, Opcode::I32X4Abs}, -#line 34 "src/lexer-keywords.txt" - {"br_table", TokenType::BrTable, Opcode::BrTable}, +#line 133 "src/lexer-keywords.txt" + {"f64.convert_i64_u", TokenType::Convert, Opcode::F64ConvertI64U}, +#line 71 "src/lexer-keywords.txt" + {"f32.convert_i64_u", TokenType::Convert, Opcode::F32ConvertI64U}, +#line 471 "src/lexer-keywords.txt" + {"v128.load32x2_s", TokenType::Load, Opcode::V128Load32X2S}, + {""}, +#line 132 "src/lexer-keywords.txt" + {"f64.convert_i64_s", TokenType::Convert, Opcode::F64ConvertI64S}, +#line 70 "src/lexer-keywords.txt" + {"f32.convert_i64_s", TokenType::Convert, Opcode::F32ConvertI64S}, {""}, {""}, {""}, -#line 195 "src/lexer-keywords.txt" +#line 22 "src/lexer-keywords.txt" + {"after", TokenType::After}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 388 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU}, +#line 258 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU}, + {""}, +#line 600 "src/lexer-keywords.txt" + {"unreachable", TokenType::Unreachable, Opcode::Unreachable}, +#line 199 "src/lexer-keywords.txt" {"i16x8.add_sat_u", TokenType::Binary, Opcode::I16X8AddSatU}, {""}, {""}, {""}, -#line 194 "src/lexer-keywords.txt" +#line 198 "src/lexer-keywords.txt" {"i16x8.add_sat_s", TokenType::Binary, Opcode::I16X8AddSatS}, - {""}, -#line 111 "src/lexer-keywords.txt" - {"f32x4.pmin", TokenType::Binary, Opcode::F32X4PMin}, -#line 31 "src/lexer-keywords.txt" + {""}, {""}, +#line 32 "src/lexer-keywords.txt" {"binary", TokenType::Bin}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 463 "src/lexer-keywords.txt" +#line 467 "src/lexer-keywords.txt" {"i64.trunc_sat_f64_u", TokenType::Convert, Opcode::I64TruncSatF64U}, -#line 319 "src/lexer-keywords.txt" +#line 323 "src/lexer-keywords.txt" {"i32.trunc_sat_f64_u", TokenType::Convert, Opcode::I32TruncSatF64U}, -#line 385 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU}, -#line 255 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU}, -#line 462 "src/lexer-keywords.txt" + {""}, {""}, +#line 466 "src/lexer-keywords.txt" {"i64.trunc_sat_f64_s", TokenType::Convert, Opcode::I64TruncSatF64S}, -#line 318 "src/lexer-keywords.txt" +#line 322 "src/lexer-keywords.txt" {"i32.trunc_sat_f64_s", TokenType::Convert, Opcode::I32TruncSatF64S}, - {""}, {""}, -#line 613 "src/lexer-keywords.txt" - {"v128.load32_lane", TokenType::SimdLoadLane, Opcode::V128Load32Lane}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 499 "src/lexer-keywords.txt" +#line 584 "src/lexer-keywords.txt" + {"start", TokenType::Start}, + {""}, +#line 126 "src/lexer-keywords.txt" + {"f64.abs", TokenType::Unary, Opcode::F64Abs}, +#line 64 "src/lexer-keywords.txt" + {"f32.abs", TokenType::Unary, Opcode::F32Abs}, +#line 46 "src/lexer-keywords.txt" + {"data.drop", TokenType::DataDrop, Opcode::DataDrop}, + {""}, {""}, {""}, {""}, +#line 503 "src/lexer-keywords.txt" {"i8x16.add_sat_u", TokenType::Binary, Opcode::I8X16AddSatU}, -#line 377 "src/lexer-keywords.txt" +#line 381 "src/lexer-keywords.txt" {"i64.atomic.load32_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad32U}, - {""}, -#line 615 "src/lexer-keywords.txt" - {"v128.store8_lane", TokenType::SimdStoreLane, Opcode::V128Store8Lane}, -#line 498 "src/lexer-keywords.txt" + {""}, {""}, +#line 502 "src/lexer-keywords.txt" {"i8x16.add_sat_s", TokenType::Binary, Opcode::I8X16AddSatS}, {""}, -#line 386 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU}, -#line 256 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU}, +#line 387 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU}, +#line 257 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU}, +#line 122 "src/lexer-keywords.txt" + {"f32x4.sub", TokenType::Binary, Opcode::F32X4Sub}, {""}, -#line 192 "src/lexer-keywords.txt" - {"global", TokenType::Global}, -#line 215 "src/lexer-keywords.txt" +#line 219 "src/lexer-keywords.txt" {"i16x8.max_u", TokenType::Binary, Opcode::I16X8MaxU}, - {""}, -#line 214 "src/lexer-keywords.txt" +#line 94 "src/lexer-keywords.txt" + {"f32x4.abs", TokenType::Unary, Opcode::F32X4Abs}, +#line 218 "src/lexer-keywords.txt" {"i16x8.max_s", TokenType::Binary, Opcode::I16X8MaxS}, - {""}, {""}, {""}, {""}, -#line 488 "src/lexer-keywords.txt" - {"i64x2.shr_u", TokenType::Binary, Opcode::I64X2ShrU}, + {""}, {""}, +#line 361 "src/lexer-keywords.txt" + {"i32x4.sub", TokenType::Binary, Opcode::I32X4Sub}, {""}, -#line 487 "src/lexer-keywords.txt" +#line 492 "src/lexer-keywords.txt" + {"i64x2.shr_u", TokenType::Binary, Opcode::I64X2ShrU}, +#line 326 "src/lexer-keywords.txt" + {"i32x4.abs", TokenType::Unary, Opcode::I32X4Abs}, +#line 491 "src/lexer-keywords.txt" {"i64x2.shr_s", TokenType::Binary, Opcode::I64X2ShrS}, {""}, -#line 549 "src/lexer-keywords.txt" +#line 553 "src/lexer-keywords.txt" {"memory.fill", TokenType::MemoryFill, Opcode::MemoryFill}, - {""}, {""}, {""}, {""}, -#line 326 "src/lexer-keywords.txt" + {""}, +#line 384 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AddU}, +#line 254 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AddU}, +#line 35 "src/lexer-keywords.txt" + {"br_table", TokenType::BrTable, Opcode::BrTable}, +#line 330 "src/lexer-keywords.txt" {"i32x4.relaxed_dot_i8x16_i7x16_add_s", TokenType::Ternary, Opcode::I32X4DotI8X16I7X16AddS}, -#line 41 "src/lexer-keywords.txt" +#line 42 "src/lexer-keywords.txt" {"catch_ref", TokenType::CatchRef}, {""}, {""}, {""}, -#line 579 "src/lexer-keywords.txt" +#line 586 "src/lexer-keywords.txt" {"table.copy", TokenType::TableCopy, Opcode::TableCopy}, {""}, -#line 227 "src/lexer-keywords.txt" +#line 231 "src/lexer-keywords.txt" {"i16x8.shl", TokenType::Binary, Opcode::I16X8Shl}, - {""}, {""}, {""}, {""}, {""}, -#line 516 "src/lexer-keywords.txt" +#line 623 "src/lexer-keywords.txt" + {"v128.store16_lane", TokenType::SimdStoreLane, Opcode::V128Store16Lane}, +#line 385 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU}, +#line 255 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU}, +#line 351 "src/lexer-keywords.txt" + {"i32x4.dot_i16x8_s", TokenType::Binary, Opcode::I32X4DotI16X8S}, + {""}, +#line 520 "src/lexer-keywords.txt" {"i8x16.max_u", TokenType::Binary, Opcode::I8X16MaxU}, {""}, -#line 515 "src/lexer-keywords.txt" +#line 519 "src/lexer-keywords.txt" {"i8x16.max_s", TokenType::Binary, Opcode::I8X16MaxS}, +#line 420 "src/lexer-keywords.txt" + {"i64.div_u", TokenType::Binary, Opcode::I64DivU}, +#line 282 "src/lexer-keywords.txt" + {"i32.div_u", TokenType::Binary, Opcode::I32DivU}, +#line 419 "src/lexer-keywords.txt" + {"i64.div_s", TokenType::Binary, Opcode::I64DivS}, +#line 281 "src/lexer-keywords.txt" + {"i32.div_s", TokenType::Binary, Opcode::I32DivS}, +#line 615 "src/lexer-keywords.txt" + {"v128.load32_splat", TokenType::Load, Opcode::V128Load32Splat}, + {""}, +#line 422 "src/lexer-keywords.txt" + {"i64.eqz", TokenType::Convert, Opcode::I64Eqz}, +#line 284 "src/lexer-keywords.txt" + {"i32.eqz", TokenType::Convert, Opcode::I32Eqz}, +#line 609 "src/lexer-keywords.txt" + {"v128.load32_zero", TokenType::Load, Opcode::V128Load32Zero}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 576 "src/lexer-keywords.txt" - {"shared", TokenType::Shared}, -#line 130 "src/lexer-keywords.txt" - {"f64.convert_i64_u", TokenType::Convert, Opcode::F64ConvertI64U}, -#line 68 "src/lexer-keywords.txt" - {"f32.convert_i64_u", TokenType::Convert, Opcode::F32ConvertI64U}, - {""}, {""}, -#line 129 "src/lexer-keywords.txt" - {"f64.convert_i64_s", TokenType::Convert, Opcode::F64ConvertI64S}, -#line 67 "src/lexer-keywords.txt" - {"f32.convert_i64_s", TokenType::Convert, Opcode::F32ConvertI64S}, - {""}, {""}, {""}, {""}, {""}, -#line 60 "src/lexer-keywords.txt" - {"export", TokenType::Export}, - {""}, {""}, {""}, {""}, {""}, -#line 527 "src/lexer-keywords.txt" +#line 531 "src/lexer-keywords.txt" {"i8x16.shl", TokenType::Binary, Opcode::I8X16Shl}, -#line 553 "src/lexer-keywords.txt" +#line 557 "src/lexer-keywords.txt" {"memory", TokenType::Memory}, -#line 593 "src/lexer-keywords.txt" - {"unreachable", TokenType::Unreachable, Opcode::Unreachable}, + {""}, {""}, +#line 568 "src/lexer-keywords.txt" + {"param", TokenType::Param}, {""}, -#line 177 "src/lexer-keywords.txt" - {"f64x2.splat", TokenType::Unary, Opcode::F64X2Splat}, -#line 110 "src/lexer-keywords.txt" - {"f32x4.pmax", TokenType::Binary, Opcode::F32X4PMax}, -#line 372 "src/lexer-keywords.txt" +#line 376 "src/lexer-keywords.txt" {"i32x4.trunc_sat_f64x2_u_zero", TokenType::Unary, Opcode::I32X4TruncSatF64X2UZero}, {""}, -#line 371 "src/lexer-keywords.txt" +#line 375 "src/lexer-keywords.txt" {"i32x4.trunc_sat_f64x2_s_zero", TokenType::Unary, Opcode::I32X4TruncSatF64X2SZero}, - {""}, -#line 190 "src/lexer-keywords.txt" - {"global.get", TokenType::GlobalGet, Opcode::GlobalGet}, -#line 489 "src/lexer-keywords.txt" - {"i64x2.splat", TokenType::Unary, Opcode::I64X2Splat}, -#line 191 "src/lexer-keywords.txt" - {"global.set", TokenType::GlobalSet, Opcode::GlobalSet}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 620 "src/lexer-keywords.txt" + {"v128.load32_lane", TokenType::SimdLoadLane, Opcode::V128Load32Lane}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 409 "src/lexer-keywords.txt" +#line 622 "src/lexer-keywords.txt" + {"v128.store8_lane", TokenType::SimdStoreLane, Opcode::V128Store8Lane}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 583 "src/lexer-keywords.txt" + {"shared", TokenType::Shared}, + {""}, {""}, +#line 389 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU}, +#line 259 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU}, + {""}, +#line 413 "src/lexer-keywords.txt" {"i64.atomic.store32", TokenType::AtomicStore, Opcode::I64AtomicStore32}, {""}, {""}, -#line 59 "src/lexer-keywords.txt" +#line 62 "src/lexer-keywords.txt" {"exnref", Type::ExnRef}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, +#line 189 "src/lexer-keywords.txt" + {"freq", TokenType::Freq}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 609 "src/lexer-keywords.txt" - {"v128.load64_splat", TokenType::Load, Opcode::V128Load64Splat}, -#line 617 "src/lexer-keywords.txt" - {"v128.store32_lane", TokenType::SimdStoreLane, Opcode::V128Store32Lane}, -#line 178 "src/lexer-keywords.txt" - {"f64x2.sqrt", TokenType::Unary, Opcode::F64X2Sqrt}, -#line 588 "src/lexer-keywords.txt" - {"throw", TokenType::Throw, Opcode::Throw}, -#line 603 "src/lexer-keywords.txt" - {"v128.load64_zero", TokenType::Load, Opcode::V128Load64Zero}, - {""}, {""}, {""}, {""}, -#line 37 "src/lexer-keywords.txt" +#line 390 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU}, +#line 260 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU}, +#line 598 "src/lexer-keywords.txt" + {"try_table", TokenType::TryTable, Opcode::TryTable}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 38 "src/lexer-keywords.txt" {"call_ref", TokenType::CallRef, Opcode::CallRef}, {""}, {""}, -#line 551 "src/lexer-keywords.txt" +#line 555 "src/lexer-keywords.txt" {"memory.init", TokenType::MemoryInit, Opcode::MemoryInit}, -#line 416 "src/lexer-keywords.txt" - {"i64.div_u", TokenType::Binary, Opcode::I64DivU}, -#line 278 "src/lexer-keywords.txt" - {"i32.div_u", TokenType::Binary, Opcode::I32DivU}, -#line 415 "src/lexer-keywords.txt" - {"i64.div_s", TokenType::Binary, Opcode::I64DivS}, -#line 277 "src/lexer-keywords.txt" - {"i32.div_s", TokenType::Binary, Opcode::I32DivS}, - {""}, {""}, {""}, {""}, -#line 418 "src/lexer-keywords.txt" - {"i64.eqz", TokenType::Convert, Opcode::I64Eqz}, -#line 280 "src/lexer-keywords.txt" - {"i32.eqz", TokenType::Convert, Opcode::I32Eqz}, - {""}, {""}, -#line 589 "src/lexer-keywords.txt" - {"throw_ref", TokenType::ThrowRef, Opcode::ThrowRef}, - {""}, -#line 203 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, +#line 207 "src/lexer-keywords.txt" {"i16x8.extract_lane_u", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneU}, {""}, -#line 202 "src/lexer-keywords.txt" +#line 206 "src/lexer-keywords.txt" {"i16x8.extract_lane_s", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneS}, - {""}, {""}, -#line 614 "src/lexer-keywords.txt" - {"v128.load64_lane", TokenType::SimdLoadLane, Opcode::V128Load64Lane}, -#line 396 "src/lexer-keywords.txt" - {"i64.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU}, -#line 259 "src/lexer-keywords.txt" - {"i32.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 408 "src/lexer-keywords.txt" - {"i64.atomic.store16", TokenType::AtomicStore, Opcode::I64AtomicStore16}, -#line 271 "src/lexer-keywords.txt" - {"i32.atomic.store16", TokenType::AtomicStore, Opcode::I32AtomicStore16}, - {""}, {""}, -#line 591 "src/lexer-keywords.txt" - {"try_table", TokenType::TryTable, Opcode::TryTable}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 601 "src/lexer-keywords.txt" - {"v128.any_true", TokenType::Unary, Opcode::V128AnyTrue}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 63 "src/lexer-keywords.txt" + {"export", TokenType::Export}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, +#line 114 "src/lexer-keywords.txt" + {"f32x4.pmin", TokenType::Binary, Opcode::F32X4PMin}, {""}, -#line 506 "src/lexer-keywords.txt" +#line 202 "src/lexer-keywords.txt" + {"i16x8.avgr_u", TokenType::Binary, Opcode::I16X8AvgrU}, + {""}, +#line 510 "src/lexer-keywords.txt" {"i8x16.extract_lane_u", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneU}, -#line 366 "src/lexer-keywords.txt" +#line 370 "src/lexer-keywords.txt" {"i32x4.trunc_sat_f32x4_u", TokenType::Unary, Opcode::I32X4TruncSatF32X4U}, -#line 505 "src/lexer-keywords.txt" +#line 509 "src/lexer-keywords.txt" {"i8x16.extract_lane_s", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneS}, {""}, {""}, -#line 365 "src/lexer-keywords.txt" +#line 369 "src/lexer-keywords.txt" {"i32x4.trunc_sat_f32x4_s", TokenType::Unary, Opcode::I32X4TruncSatF32X4S}, - {""}, {""}, {""}, {""}, -#line 49 "src/lexer-keywords.txt" - {"drop", TokenType::Drop, Opcode::Drop}, - {""}, {""}, {""}, -#line 582 "src/lexer-keywords.txt" - {"table.grow", TokenType::TableGrow, Opcode::TableGrow}, - {""}, {""}, -#line 571 "src/lexer-keywords.txt" - {"rethrow", TokenType::Rethrow, Opcode::Rethrow}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 229 "src/lexer-keywords.txt" +#line 159 "src/lexer-keywords.txt" + {"f64x2.div", TokenType::Binary, Opcode::F64X2Div}, + {""}, {""}, +#line 506 "src/lexer-keywords.txt" + {"i8x16.avgr_u", TokenType::Binary, Opcode::I8X16AvgrU}, +#line 196 "src/lexer-keywords.txt" + {"global", TokenType::Global}, +#line 616 "src/lexer-keywords.txt" + {"v128.load64_splat", TokenType::Load, Opcode::V128Load64Splat}, +#line 624 "src/lexer-keywords.txt" + {"v128.store32_lane", TokenType::SimdStoreLane, Opcode::V128Store32Lane}, + {""}, {""}, +#line 610 "src/lexer-keywords.txt" + {"v128.load64_zero", TokenType::Load, Opcode::V128Load64Zero}, + {""}, {""}, {""}, +#line 233 "src/lexer-keywords.txt" {"i16x8.shr_u", TokenType::Binary, Opcode::I16X8ShrU}, -#line 217 "src/lexer-keywords.txt" +#line 221 "src/lexer-keywords.txt" {"i16x8.min_u", TokenType::Binary, Opcode::I16X8MinU}, -#line 228 "src/lexer-keywords.txt" +#line 232 "src/lexer-keywords.txt" {"i16x8.shr_s", TokenType::Binary, Opcode::I16X8ShrS}, -#line 216 "src/lexer-keywords.txt" +#line 220 "src/lexer-keywords.txt" {"i16x8.min_s", TokenType::Binary, Opcode::I16X8MinS}, - {""}, {""}, {""}, {""}, {""}, -#line 403 "src/lexer-keywords.txt" - {"i64.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg}, -#line 266 "src/lexer-keywords.txt" - {"i32.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg}, - {""}, -#line 121 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 124 "src/lexer-keywords.txt" {"f32x4.demote_f64x2_zero", TokenType::Unary, Opcode::F32X4DemoteF64X2Zero}, - {""}, {""}, -#line 42 "src/lexer-keywords.txt" +#line 181 "src/lexer-keywords.txt" + {"f64x2.sqrt", TokenType::Unary, Opcode::F64X2Sqrt}, + {""}, +#line 43 "src/lexer-keywords.txt" {"catch_all_ref", TokenType::CatchAllRef}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, +#line 596 "src/lexer-keywords.txt" + {"throw_ref", TokenType::ThrowRef, Opcode::ThrowRef}, + {""}, {""}, {""}, {""}, {""}, +#line 528 "src/lexer-keywords.txt" + {"i8x16.relaxed_swizzle", TokenType::Binary, Opcode::I8X16RelaxedSwizzle}, +#line 621 "src/lexer-keywords.txt" + {"v128.load64_lane", TokenType::SimdLoadLane, Opcode::V128Load64Lane}, {""}, {""}, {""}, {""}, -#line 529 "src/lexer-keywords.txt" +#line 533 "src/lexer-keywords.txt" {"i8x16.shr_u", TokenType::Binary, Opcode::I8X16ShrU}, -#line 518 "src/lexer-keywords.txt" +#line 522 "src/lexer-keywords.txt" {"i8x16.min_u", TokenType::Binary, Opcode::I8X16MinU}, -#line 528 "src/lexer-keywords.txt" +#line 532 "src/lexer-keywords.txt" {"i8x16.shr_s", TokenType::Binary, Opcode::I8X16ShrS}, -#line 517 "src/lexer-keywords.txt" +#line 521 "src/lexer-keywords.txt" {"i8x16.min_s", TokenType::Binary, Opcode::I8X16MinS}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 608 "src/lexer-keywords.txt" + {"v128.any_true", TokenType::Unary, Opcode::V128AnyTrue}, + {""}, +#line 180 "src/lexer-keywords.txt" + {"f64x2.splat", TokenType::Unary, Opcode::F64X2Splat}, +#line 113 "src/lexer-keywords.txt" + {"f32x4.pmax", TokenType::Binary, Opcode::F32X4PMax}, + {""}, {""}, {""}, {""}, +#line 194 "src/lexer-keywords.txt" + {"global.get", TokenType::GlobalGet, Opcode::GlobalGet}, +#line 493 "src/lexer-keywords.txt" + {"i64x2.splat", TokenType::Unary, Opcode::I64X2Splat}, +#line 195 "src/lexer-keywords.txt" + {"global.set", TokenType::GlobalSet, Opcode::GlobalSet}, {""}, {""}, {""}, -#line 26 "src/lexer-keywords.txt" +#line 412 "src/lexer-keywords.txt" + {"i64.atomic.store16", TokenType::AtomicStore, Opcode::I64AtomicStore16}, +#line 275 "src/lexer-keywords.txt" + {"i32.atomic.store16", TokenType::AtomicStore, Opcode::I32AtomicStore16}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 131 "src/lexer-keywords.txt" + {"f64.convert_i32_u", TokenType::Convert, Opcode::F64ConvertI32U}, +#line 69 "src/lexer-keywords.txt" + {"f32.convert_i32_u", TokenType::Convert, Opcode::F32ConvertI32U}, + {""}, {""}, +#line 130 "src/lexer-keywords.txt" + {"f64.convert_i32_s", TokenType::Convert, Opcode::F64ConvertI32S}, +#line 68 "src/lexer-keywords.txt" + {"f32.convert_i32_s", TokenType::Convert, Opcode::F32ConvertI32S}, + {""}, {""}, {""}, {""}, {""}, +#line 595 "src/lexer-keywords.txt" + {"throw", TokenType::Throw, Opcode::Throw}, + {""}, {""}, +#line 135 "src/lexer-keywords.txt" + {"f64.div", TokenType::Binary, Opcode::F64Div}, +#line 74 "src/lexer-keywords.txt" + {"f32.div", TokenType::Binary, Opcode::F32Div}, + {""}, {""}, {""}, +#line 27 "src/lexer-keywords.txt" {"assert_return", TokenType::AssertReturn}, -#line 550 "src/lexer-keywords.txt" - {"memory.grow", TokenType::MemoryGrow, Opcode::MemoryGrow}, - {""}, {""}, {""}, {""}, -#line 398 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, +#line 402 "src/lexer-keywords.txt" {"i64.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8SubU}, -#line 261 "src/lexer-keywords.txt" +#line 265 "src/lexer-keywords.txt" {"i32.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8SubU}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 465 "src/lexer-keywords.txt" + {"i64.trunc_sat_f32_u", TokenType::Convert, Opcode::I64TruncSatF32U}, +#line 321 "src/lexer-keywords.txt" + {"i32.trunc_sat_f32_u", TokenType::Convert, Opcode::I32TruncSatF32U}, + {""}, {""}, +#line 464 "src/lexer-keywords.txt" + {"i64.trunc_sat_f32_s", TokenType::Convert, Opcode::I64TruncSatF32S}, +#line 320 "src/lexer-keywords.txt" + {"i32.trunc_sat_f32_s", TokenType::Convert, Opcode::I32TruncSatF32S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 554 "src/lexer-keywords.txt" + {"memory.grow", TokenType::MemoryGrow, Opcode::MemoryGrow}, {""}, {""}, -#line 198 "src/lexer-keywords.txt" - {"i16x8.avgr_u", TokenType::Binary, Opcode::I16X8AvgrU}, -#line 230 "src/lexer-keywords.txt" - {"i16x8.splat", TokenType::Unary, Opcode::I16X8Splat}, - {""}, {""}, {""}, -#line 340 "src/lexer-keywords.txt" - {"v128.load16x4_u", TokenType::Load, Opcode::V128Load16X4U}, - {""}, -#line 558 "src/lexer-keywords.txt" - {"nop", TokenType::Nop, Opcode::Nop}, - {""}, -#line 339 "src/lexer-keywords.txt" - {"v128.load16x4_s", TokenType::Load, Opcode::V128Load16X4S}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 179 "src/lexer-keywords.txt" +#line 182 "src/lexer-keywords.txt" {"f64x2.sub", TokenType::Binary, Opcode::F64X2Sub}, {""}, {""}, -#line 153 "src/lexer-keywords.txt" +#line 156 "src/lexer-keywords.txt" {"f64x2.abs", TokenType::Unary, Opcode::F64X2Abs}, {""}, {""}, {""}, -#line 490 "src/lexer-keywords.txt" +#line 494 "src/lexer-keywords.txt" {"i64x2.sub", TokenType::Binary, Opcode::I64X2Sub}, -#line 156 "src/lexer-keywords.txt" - {"f64x2.div", TokenType::Binary, Opcode::F64X2Div}, - {""}, -#line 476 "src/lexer-keywords.txt" + {""}, {""}, +#line 480 "src/lexer-keywords.txt" {"i64x2.abs", TokenType::Unary, Opcode::I64X2Abs}, -#line 502 "src/lexer-keywords.txt" - {"i8x16.avgr_u", TokenType::Binary, Opcode::I8X16AvgrU}, -#line 530 "src/lexer-keywords.txt" - {"i8x16.splat", TokenType::Unary, Opcode::I8X16Splat}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 171 "src/lexer-keywords.txt" - {"f64x2.pmin", TokenType::Binary, Opcode::F64X2PMin}, {""}, {""}, -#line 544 "src/lexer-keywords.txt" - {"loop", TokenType::Loop, Opcode::Loop}, - {""}, {""}, {""}, {""}, {""}, -#line 461 "src/lexer-keywords.txt" - {"i64.trunc_sat_f32_u", TokenType::Convert, Opcode::I64TruncSatF32U}, -#line 317 "src/lexer-keywords.txt" - {"i32.trunc_sat_f32_u", TokenType::Convert, Opcode::I32TruncSatF32U}, -#line 133 "src/lexer-keywords.txt" - {"f64.eq", TokenType::Compare, Opcode::F64Eq}, -#line 72 "src/lexer-keywords.txt" - {"f32.eq", TokenType::Compare, Opcode::F32Eq}, -#line 460 "src/lexer-keywords.txt" - {"i64.trunc_sat_f32_s", TokenType::Convert, Opcode::I64TruncSatF32S}, -#line 316 "src/lexer-keywords.txt" - {"i32.trunc_sat_f32_s", TokenType::Convert, Opcode::I32TruncSatF32S}, - {""}, {""}, {""}, -#line 417 "src/lexer-keywords.txt" - {"i64.eq", TokenType::Compare, Opcode::I64Eq}, -#line 279 "src/lexer-keywords.txt" - {"i32.eq", TokenType::Compare, Opcode::I32Eq}, -#line 325 "src/lexer-keywords.txt" - {"i32x4.bitmask", TokenType::Unary, Opcode::I32X4Bitmask}, - {""}, {""}, {""}, {""}, -#line 442 "src/lexer-keywords.txt" - {"i64.popcnt", TokenType::Unary, Opcode::I64Popcnt}, -#line 299 "src/lexer-keywords.txt" - {"i32.popcnt", TokenType::Unary, Opcode::I32Popcnt}, +#line 400 "src/lexer-keywords.txt" + {"i64.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU}, +#line 263 "src/lexer-keywords.txt" + {"i32.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 589 "src/lexer-keywords.txt" + {"table.grow", TokenType::TableGrow, Opcode::TableGrow}, {""}, {""}, -#line 382 "src/lexer-keywords.txt" - {"i64.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU}, -#line 252 "src/lexer-keywords.txt" - {"i32.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, -#line 97 "src/lexer-keywords.txt" - {"f32x4.eq", TokenType::Compare, Opcode::F32X4Eq}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 327 "src/lexer-keywords.txt" - {"i32x4.eq", TokenType::Compare, Opcode::I32X4Eq}, - {""}, {""}, {""}, {""}, {""}, -#line 482 "src/lexer-keywords.txt" +#line 577 "src/lexer-keywords.txt" + {"rethrow", TokenType::Rethrow, Opcode::Rethrow}, +#line 486 "src/lexer-keywords.txt" {"i64x2.extend_low_i32x4_u", TokenType::Unary, Opcode::I64X2ExtendLowI32X4U}, {""}, -#line 480 "src/lexer-keywords.txt" +#line 484 "src/lexer-keywords.txt" {"i64x2.extend_low_i32x4_s", TokenType::Unary, Opcode::I64X2ExtendLowI32X4S}, -#line 522 "src/lexer-keywords.txt" - {"i8x16.popcnt", TokenType::Unary, Opcode::I8X16Popcnt}, - {""}, {""}, -#line 607 "src/lexer-keywords.txt" - {"v128.load16_splat", TokenType::Load, Opcode::V128Load16Splat}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 128 "src/lexer-keywords.txt" - {"f64.convert_i32_u", TokenType::Convert, Opcode::F64ConvertI32U}, -#line 66 "src/lexer-keywords.txt" - {"f32.convert_i32_u", TokenType::Convert, Opcode::F32ConvertI32U}, - {""}, {""}, -#line 127 "src/lexer-keywords.txt" - {"f64.convert_i32_s", TokenType::Convert, Opcode::F64ConvertI32S}, -#line 65 "src/lexer-keywords.txt" - {"f32.convert_i32_s", TokenType::Convert, Opcode::F32ConvertI32S}, +#line 329 "src/lexer-keywords.txt" + {"i32x4.bitmask", TokenType::Unary, Opcode::I32X4Bitmask}, {""}, -#line 368 "src/lexer-keywords.txt" +#line 372 "src/lexer-keywords.txt" {"i32x4.extend_high_i16x8_u", TokenType::Unary, Opcode::I32X4ExtendHighI16X8U}, {""}, -#line 367 "src/lexer-keywords.txt" +#line 371 "src/lexer-keywords.txt" {"i32x4.extend_high_i16x8_s", TokenType::Unary, Opcode::I32X4ExtendHighI16X8S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 170 "src/lexer-keywords.txt" - {"f64x2.pmax", TokenType::Binary, Opcode::F64X2PMax}, - {""}, {""}, {""}, {""}, -#line 612 "src/lexer-keywords.txt" - {"v128.load16_lane", TokenType::SimdLoadLane, Opcode::V128Load16Lane}, - {""}, {""}, -#line 619 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, +#line 626 "src/lexer-keywords.txt" {"i8x16.shuffle", TokenType::SimdShuffleOp, Opcode::I8X16Shuffle}, - {""}, {""}, -#line 359 "src/lexer-keywords.txt" - {"i32x4.extadd_pairwise_i16x8_u", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8U}, +#line 98 "src/lexer-keywords.txt" + {"f32x4.convert_i32x4_u", TokenType::Unary, Opcode::F32X4ConvertI32X4U}, {""}, -#line 358 "src/lexer-keywords.txt" - {"i32x4.extadd_pairwise_i16x8_s", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8S}, +#line 97 "src/lexer-keywords.txt" + {"f32x4.convert_i32x4_s", TokenType::Unary, Opcode::F32X4ConvertI32X4S}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 25 "src/lexer-keywords.txt" - {"assert_malformed", TokenType::AssertMalformed}, - {""}, {""}, {""}, -#line 51 "src/lexer-keywords.txt" - {"elem.drop", TokenType::ElemDrop, Opcode::ElemDrop}, +#line 407 "src/lexer-keywords.txt" + {"i64.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg}, +#line 270 "src/lexer-keywords.txt" + {"i32.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 493 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 497 "src/lexer-keywords.txt" {"i64x2.extmul_low_i32x4_u", TokenType::Binary, Opcode::I64X2ExtmulLowI32X4U}, -#line 524 "src/lexer-keywords.txt" - {"i8x16.relaxed_swizzle", TokenType::Binary, Opcode::I8X16RelaxedSwizzle}, -#line 491 "src/lexer-keywords.txt" + {""}, +#line 495 "src/lexer-keywords.txt" {"i64x2.extmul_low_i32x4_s", TokenType::Binary, Opcode::I64X2ExtmulLowI32X4S}, - {""}, {""}, {""}, {""}, {""}, -#line 370 "src/lexer-keywords.txt" - {"i32x4.extend_low_i16x8_u", TokenType::Unary, Opcode::I32X4ExtendLowI16X8U}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 369 "src/lexer-keywords.txt" - {"i32x4.extend_low_i16x8_s", TokenType::Unary, Opcode::I32X4ExtendLowI16X8S}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 363 "src/lexer-keywords.txt" +#line 386 "src/lexer-keywords.txt" + {"i64.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU}, +#line 256 "src/lexer-keywords.txt" + {"i32.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU}, + {""}, +#line 627 "src/lexer-keywords.txt" + {"i8x16.swizzle", TokenType::Binary, Opcode::I8X16Swizzle}, + {""}, {""}, +#line 367 "src/lexer-keywords.txt" {"i32x4.extmul_high_i16x8_u", TokenType::Binary, Opcode::I32X4ExtmulHighI16X8U}, {""}, -#line 361 "src/lexer-keywords.txt" +#line 365 "src/lexer-keywords.txt" {"i32x4.extmul_high_i16x8_s", TokenType::Binary, Opcode::I32X4ExtmulHighI16X8S}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 26 "src/lexer-keywords.txt" + {"assert_malformed", TokenType::AssertMalformed}, {""}, -#line 147 "src/lexer-keywords.txt" - {"f64.reinterpret_i64", TokenType::Convert, Opcode::F64ReinterpretI64}, +#line 234 "src/lexer-keywords.txt" + {"i16x8.splat", TokenType::Unary, Opcode::I16X8Splat}, {""}, {""}, -#line 321 "src/lexer-keywords.txt" - {"i32.wrap_i64", TokenType::Convert, Opcode::I32WrapI64}, - {""}, {""}, {""}, {""}, -#line 620 "src/lexer-keywords.txt" - {"i8x16.swizzle", TokenType::Binary, Opcode::I8X16Swizzle}, +#line 344 "src/lexer-keywords.txt" + {"v128.load16x4_u", TokenType::Load, Opcode::V128Load16X4U}, + {""}, {""}, {""}, +#line 343 "src/lexer-keywords.txt" + {"v128.load16x4_s", TokenType::Load, Opcode::V128Load16X4S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 132 "src/lexer-keywords.txt" - {"f64.div", TokenType::Binary, Opcode::F64Div}, -#line 71 "src/lexer-keywords.txt" - {"f32.div", TokenType::Binary, Opcode::F32Div}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 233 "src/lexer-keywords.txt" - {"i16x8.sub", TokenType::Binary, Opcode::I16X8Sub}, - {""}, {""}, -#line 193 "src/lexer-keywords.txt" - {"i16x8.abs", TokenType::Unary, Opcode::I16X8Abs}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 363 "src/lexer-keywords.txt" + {"i32x4.extadd_pairwise_i16x8_u", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8U}, {""}, -#line 561 "src/lexer-keywords.txt" +#line 362 "src/lexer-keywords.txt" + {"i32x4.extadd_pairwise_i16x8_s", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8S}, +#line 534 "src/lexer-keywords.txt" + {"i8x16.splat", TokenType::Unary, Opcode::I8X16Splat}, + {""}, {""}, {""}, {""}, +#line 567 "src/lexer-keywords.txt" {"pagesize", TokenType::PageSize}, + {""}, {""}, {""}, +#line 174 "src/lexer-keywords.txt" + {"f64x2.pmin", TokenType::Binary, Opcode::F64X2PMin}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 95 "src/lexer-keywords.txt" - {"f32x4.convert_i32x4_u", TokenType::Unary, Opcode::F32X4ConvertI32X4U}, - {""}, -#line 94 "src/lexer-keywords.txt" - {"f32x4.convert_i32x4_s", TokenType::Unary, Opcode::F32X4ConvertI32X4S}, +#line 136 "src/lexer-keywords.txt" + {"f64.eq", TokenType::Compare, Opcode::F64Eq}, +#line 75 "src/lexer-keywords.txt" + {"f32.eq", TokenType::Compare, Opcode::F32Eq}, + {""}, {""}, {""}, {""}, {""}, +#line 421 "src/lexer-keywords.txt" + {"i64.eq", TokenType::Compare, Opcode::I64Eq}, +#line 283 "src/lexer-keywords.txt" + {"i32.eq", TokenType::Compare, Opcode::I32Eq}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 237 "src/lexer-keywords.txt" + {"i16x8.sub", TokenType::Binary, Opcode::I16X8Sub}, {""}, {""}, -#line 362 "src/lexer-keywords.txt" - {"i32x4.extmul_low_i16x8_u", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8U}, +#line 197 "src/lexer-keywords.txt" + {"i16x8.abs", TokenType::Unary, Opcode::I16X8Abs}, + {""}, {""}, {""}, +#line 204 "src/lexer-keywords.txt" + {"i16x8.relaxed_dot_i8x16_i7x16_s", TokenType::Binary, Opcode::I16X8DotI8X16I7X16S}, + {""}, {""}, {""}, +#line 374 "src/lexer-keywords.txt" + {"i32x4.extend_low_i16x8_u", TokenType::Unary, Opcode::I32X4ExtendLowI16X8U}, {""}, -#line 360 "src/lexer-keywords.txt" - {"i32x4.extmul_low_i16x8_s", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8S}, - {""}, {""}, -#line 131 "src/lexer-keywords.txt" - {"f64.copysign", TokenType::Binary, Opcode::F64Copysign}, -#line 69 "src/lexer-keywords.txt" - {"f32.copysign", TokenType::Binary, Opcode::F32Copysign}, -#line 533 "src/lexer-keywords.txt" +#line 373 "src/lexer-keywords.txt" + {"i32x4.extend_low_i16x8_s", TokenType::Unary, Opcode::I32X4ExtendLowI16X8S}, + {""}, +#line 100 "src/lexer-keywords.txt" + {"f32x4.eq", TokenType::Compare, Opcode::F32X4Eq}, + {""}, {""}, {""}, {""}, {""}, +#line 526 "src/lexer-keywords.txt" + {"i8x16.popcnt", TokenType::Unary, Opcode::I8X16Popcnt}, +#line 331 "src/lexer-keywords.txt" + {"i32x4.eq", TokenType::Compare, Opcode::I32X4Eq}, +#line 614 "src/lexer-keywords.txt" + {"v128.load16_splat", TokenType::Load, Opcode::V128Load16Splat}, + {""}, {""}, {""}, {""}, {""}, +#line 537 "src/lexer-keywords.txt" {"i8x16.sub", TokenType::Binary, Opcode::I8X16Sub}, {""}, {""}, -#line 497 "src/lexer-keywords.txt" +#line 501 "src/lexer-keywords.txt" {"i8x16.abs", TokenType::Unary, Opcode::I8X16Abs}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 225 "src/lexer-keywords.txt" - {"i16x8.relaxed_q15mulr_s", TokenType::Binary, Opcode::I16X8RelaxedQ15mulrS}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, -#line 200 "src/lexer-keywords.txt" - {"i16x8.relaxed_dot_i8x16_i7x16_s", TokenType::Binary, Opcode::I16X8DotI8X16I7X16S}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 443 "src/lexer-keywords.txt" - {"i64.reinterpret_f64", TokenType::Convert, Opcode::I64ReinterpretF64}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 563 "src/lexer-keywords.txt" + {"nop", TokenType::Nop, Opcode::Nop}, {""}, {""}, {""}, -#line 244 "src/lexer-keywords.txt" +#line 248 "src/lexer-keywords.txt" {"i16x8.extend_low_i8x16_u", TokenType::Unary, Opcode::I16X8ExtendLowI8X16U}, - {""}, -#line 243 "src/lexer-keywords.txt" +#line 51 "src/lexer-keywords.txt" + {"drop", TokenType::Drop, Opcode::Drop}, +#line 247 "src/lexer-keywords.txt" {"i16x8.extend_low_i8x16_s", TokenType::Unary, Opcode::I16X8ExtendLowI8X16S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 173 "src/lexer-keywords.txt" + {"f64x2.pmax", TokenType::Binary, Opcode::F64X2PMax}, + {""}, {""}, {""}, +#line 619 "src/lexer-keywords.txt" + {"v128.load16_lane", TokenType::SimdLoadLane, Opcode::V128Load16Lane}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 53 "src/lexer-keywords.txt" + {"elem.drop", TokenType::ElemDrop, Opcode::ElemDrop}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, +#line 366 "src/lexer-keywords.txt" + {"i32x4.extmul_low_i16x8_u", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8U}, + {""}, +#line 364 "src/lexer-keywords.txt" + {"i32x4.extmul_low_i16x8_s", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 229 "src/lexer-keywords.txt" + {"i16x8.relaxed_q15mulr_s", TokenType::Binary, Opcode::I16X8RelaxedQ15mulrS}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 220 "src/lexer-keywords.txt" - {"i16x8.narrow_i32x4_u", TokenType::Binary, Opcode::I16X8NarrowI32X4U}, - {""}, -#line 219 "src/lexer-keywords.txt" - {"i16x8.narrow_i32x4_s", TokenType::Binary, Opcode::I16X8NarrowI32X4S}, {""}, {""}, -#line 238 "src/lexer-keywords.txt" +#line 242 "src/lexer-keywords.txt" {"i16x8.extmul_low_i8x16_u", TokenType::Binary, Opcode::I16X8ExtmulLowI8X16U}, {""}, -#line 236 "src/lexer-keywords.txt" +#line 240 "src/lexer-keywords.txt" {"i16x8.extmul_low_i8x16_s", TokenType::Binary, Opcode::I16X8ExtmulLowI8X16S}, - {""}, {""}, {""}, -#line 548 "src/lexer-keywords.txt" - {"memory.copy", TokenType::MemoryCopy, Opcode::MemoryCopy}, {""}, -#line 479 "src/lexer-keywords.txt" - {"i64x2.bitmask", TokenType::Unary, Opcode::I64X2Bitmask}, +#line 150 "src/lexer-keywords.txt" + {"f64.reinterpret_i64", TokenType::Convert, Opcode::F64ReinterpretI64}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, -#line 157 "src/lexer-keywords.txt" - {"f64x2.eq", TokenType::Compare, Opcode::F64X2Eq}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 470 "src/lexer-keywords.txt" - {"i64x2.eq", TokenType::Binary, Opcode::I64X2Eq}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 483 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 487 "src/lexer-keywords.txt" {"i64x2.extend_high_i32x4_u", TokenType::Unary, Opcode::I64X2ExtendHighI32X4U}, {""}, -#line 481 "src/lexer-keywords.txt" +#line 485 "src/lexer-keywords.txt" {"i64x2.extend_high_i32x4_s", TokenType::Unary, Opcode::I64X2ExtendHighI32X4S}, + {""}, +#line 565 "src/lexer-keywords.txt" + {"optimization", TokenType::Optimization}, +#line 548 "src/lexer-keywords.txt" + {"loop", TokenType::Loop, Opcode::Loop}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 20 "src/lexer-keywords.txt" - {"array", Type::Array, TokenType::Array}, +#line 483 "src/lexer-keywords.txt" + {"i64x2.bitmask", TokenType::Unary, Opcode::I64X2Bitmask}, {""}, {""}, -#line 27 "src/lexer-keywords.txt" - {"assert_trap", TokenType::AssertTrap}, +#line 134 "src/lexer-keywords.txt" + {"f64.copysign", TokenType::Binary, Opcode::F64Copysign}, +#line 72 "src/lexer-keywords.txt" + {"f32.copysign", TokenType::Binary, Opcode::F32Copysign}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 596 "src/lexer-keywords.txt" - {"v128.bitselect", TokenType::Ternary, Opcode::V128BitSelect}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 150 "src/lexer-keywords.txt" - {"f64.sub", TokenType::Binary, Opcode::F64Sub}, -#line 88 "src/lexer-keywords.txt" - {"f32.sub", TokenType::Binary, Opcode::F32Sub}, - {""}, {""}, {""}, {""}, {""}, -#line 455 "src/lexer-keywords.txt" - {"i64.sub", TokenType::Binary, Opcode::I64Sub}, -#line 311 "src/lexer-keywords.txt" - {"i32.sub", TokenType::Binary, Opcode::I32Sub}, +#line 446 "src/lexer-keywords.txt" + {"i64.popcnt", TokenType::Unary, Opcode::I64Popcnt}, +#line 303 "src/lexer-keywords.txt" + {"i32.popcnt", TokenType::Unary, Opcode::I32Popcnt}, + {""}, {""}, +#line 224 "src/lexer-keywords.txt" + {"i16x8.narrow_i32x4_u", TokenType::Binary, Opcode::I16X8NarrowI32X4U}, + {""}, +#line 223 "src/lexer-keywords.txt" + {"i16x8.narrow_i32x4_s", TokenType::Binary, Opcode::I16X8NarrowI32X4S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 325 "src/lexer-keywords.txt" + {"i32.wrap_i64", TokenType::Convert, Opcode::I32WrapI64}, + {""}, {""}, {""}, {""}, +#line 562 "src/lexer-keywords.txt" + {"never_opt", TokenType::NeverOpt}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 146 "src/lexer-keywords.txt" - {"f64.promote_f32", TokenType::Convert, Opcode::F64PromoteF32}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 494 "src/lexer-keywords.txt" + {""}, {""}, {""}, +#line 20 "src/lexer-keywords.txt" + {"always_opt", TokenType::AlwaysOpt}, +#line 21 "src/lexer-keywords.txt" + {"array", Type::Array, TokenType::Array}, + {""}, {""}, +#line 447 "src/lexer-keywords.txt" + {"i64.reinterpret_f64", TokenType::Convert, Opcode::I64ReinterpretF64}, + {""}, {""}, {""}, {""}, {""}, +#line 498 "src/lexer-keywords.txt" {"i64x2.extmul_high_i32x4_u", TokenType::Binary, Opcode::I64X2ExtmulHighI32X4U}, {""}, -#line 492 "src/lexer-keywords.txt" +#line 496 "src/lexer-keywords.txt" {"i64x2.extmul_high_i32x4_s", TokenType::Binary, Opcode::I64X2ExtmulHighI32X4S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -1658,107 +1721,154 @@ Perfect_Hash::InWordSet (const char *str, size_t len) {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 153 "src/lexer-keywords.txt" + {"f64.sub", TokenType::Binary, Opcode::F64Sub}, +#line 91 "src/lexer-keywords.txt" + {"f32.sub", TokenType::Binary, Opcode::F32Sub}, + {""}, {""}, {""}, {""}, {""}, +#line 459 "src/lexer-keywords.txt" + {"i64.sub", TokenType::Binary, Opcode::I64Sub}, +#line 315 "src/lexer-keywords.txt" + {"i32.sub", TokenType::Binary, Opcode::I32Sub}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 22 "src/lexer-keywords.txt" - {"assert_exception", TokenType::AssertException}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 199 "src/lexer-keywords.txt" - {"i16x8.bitmask", TokenType::Unary, Opcode::I16X8Bitmask}, +#line 552 "src/lexer-keywords.txt" + {"memory.copy", TokenType::MemoryCopy, Opcode::MemoryCopy}, + {""}, {""}, {""}, {""}, +#line 603 "src/lexer-keywords.txt" + {"v128.bitselect", TokenType::Ternary, Opcode::V128BitSelect}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 23 "src/lexer-keywords.txt" - {"assert_exhaustion", TokenType::AssertExhaustion}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 503 "src/lexer-keywords.txt" - {"i8x16.bitmask", TokenType::Unary, Opcode::I8X16Bitmask}, - {""}, -#line 201 "src/lexer-keywords.txt" - {"i16x8.eq", TokenType::Compare, Opcode::I16X8Eq}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, +#line 160 "src/lexer-keywords.txt" + {"f64x2.eq", TokenType::Compare, Opcode::F64X2Eq}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 474 "src/lexer-keywords.txt" + {"i64x2.eq", TokenType::Binary, Opcode::I64X2Eq}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 203 "src/lexer-keywords.txt" + {"i16x8.bitmask", TokenType::Unary, Opcode::I16X8Bitmask}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 504 "src/lexer-keywords.txt" - {"i8x16.eq", TokenType::Compare, Opcode::I8X16Eq}, +#line 24 "src/lexer-keywords.txt" + {"assert_exhaustion", TokenType::AssertExhaustion}, {""}, {""}, {""}, {""}, {""}, -#line 547 "src/lexer-keywords.txt" - {"memory.atomic.wait64", TokenType::AtomicWait, Opcode::MemoryAtomicWait64}, +#line 25 "src/lexer-keywords.txt" + {"assert_invalid", TokenType::AssertInvalid}, + {""}, {""}, {""}, +#line 507 "src/lexer-keywords.txt" + {"i8x16.bitmask", TokenType::Unary, Opcode::I8X16Bitmask}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 149 "src/lexer-keywords.txt" + {"f64.promote_f32", TokenType::Convert, Opcode::F64PromoteF32}, +#line 28 "src/lexer-keywords.txt" + {"assert_trap", TokenType::AssertTrap}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, -#line 85 "src/lexer-keywords.txt" - {"f32.reinterpret_i32", TokenType::Convert, Opcode::F32ReinterpretI32}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, -#line 24 "src/lexer-keywords.txt" - {"assert_invalid", TokenType::AssertInvalid}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 551 "src/lexer-keywords.txt" + {"memory.atomic.wait64", TokenType::AtomicWait, Opcode::MemoryAtomicWait64}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 405 "src/lexer-keywords.txt" - {"i64.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I64AtomicRmwSub}, -#line 268 "src/lexer-keywords.txt" - {"i32.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I32AtomicRmwSub}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 545 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, +#line 549 "src/lexer-keywords.txt" {"memory.atomic.notify", TokenType::AtomicNotify, Opcode::MemoryAtomicNotify}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 242 "src/lexer-keywords.txt" +#line 246 "src/lexer-keywords.txt" {"i16x8.extend_high_i8x16_u", TokenType::Unary, Opcode::I16X8ExtendHighI8X16U}, {""}, -#line 241 "src/lexer-keywords.txt" +#line 245 "src/lexer-keywords.txt" {"i16x8.extend_high_i8x16_s", TokenType::Unary, Opcode::I16X8ExtendHighI8X16S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 28 "src/lexer-keywords.txt" - {"assert_unlinkable", TokenType::AssertUnlinkable}, - {""}, {""}, -#line 300 "src/lexer-keywords.txt" - {"i32.reinterpret_f32", TokenType::Convert, Opcode::I32ReinterpretF32}, - {""}, {""}, {""}, {""}, -#line 182 "src/lexer-keywords.txt" +#line 185 "src/lexer-keywords.txt" {"f64x2.convert_low_i32x4_u", TokenType::Unary, Opcode::F64X2ConvertLowI32X4U}, {""}, -#line 181 "src/lexer-keywords.txt" +#line 184 "src/lexer-keywords.txt" {"f64x2.convert_low_i32x4_s", TokenType::Unary, Opcode::F64X2ConvertLowI32X4S}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 205 "src/lexer-keywords.txt" + {"i16x8.eq", TokenType::Compare, Opcode::I16X8Eq}, {""}, -#line 235 "src/lexer-keywords.txt" - {"i16x8.extadd_pairwise_i8x16_u", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16U}, +#line 23 "src/lexer-keywords.txt" + {"assert_exception", TokenType::AssertException}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 234 "src/lexer-keywords.txt" - {"i16x8.extadd_pairwise_i8x16_s", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16S}, +#line 409 "src/lexer-keywords.txt" + {"i64.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I64AtomicRmwSub}, +#line 272 "src/lexer-keywords.txt" + {"i32.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I32AtomicRmwSub}, + {""}, {""}, {""}, {""}, {""}, +#line 508 "src/lexer-keywords.txt" + {"i8x16.eq", TokenType::Compare, Opcode::I8X16Eq}, + {""}, {""}, +#line 243 "src/lexer-keywords.txt" + {"i16x8.extmul_high_i8x16_u", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16U}, + {""}, +#line 241 "src/lexer-keywords.txt" + {"i16x8.extmul_high_i8x16_s", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, +#line 88 "src/lexer-keywords.txt" + {"f32.reinterpret_i32", TokenType::Convert, Opcode::F32ReinterpretI32}, + {""}, {""}, {""}, {""}, {""}, +#line 239 "src/lexer-keywords.txt" + {"i16x8.extadd_pairwise_i8x16_u", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16U}, {""}, -#line 546 "src/lexer-keywords.txt" - {"memory.atomic.wait32", TokenType::AtomicWait, Opcode::MemoryAtomicWait32}, +#line 238 "src/lexer-keywords.txt" + {"i16x8.extadd_pairwise_i8x16_s", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16S}, + {""}, {""}, {""}, {""}, +#line 29 "src/lexer-keywords.txt" + {"assert_unlinkable", TokenType::AssertUnlinkable}, {""}, {""}, {""}, {""}, {""}, -#line 520 "src/lexer-keywords.txt" +#line 550 "src/lexer-keywords.txt" + {"memory.atomic.wait32", TokenType::AtomicWait, Opcode::MemoryAtomicWait32}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 304 "src/lexer-keywords.txt" + {"i32.reinterpret_f32", TokenType::Convert, Opcode::I32ReinterpretF32}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 524 "src/lexer-keywords.txt" {"i8x16.narrow_i16x8_u", TokenType::Binary, Opcode::I8X16NarrowI16X8U}, {""}, -#line 519 "src/lexer-keywords.txt" +#line 523 "src/lexer-keywords.txt" {"i8x16.narrow_i16x8_s", TokenType::Binary, Opcode::I8X16NarrowI16X8S}, - {""}, -#line 222 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, +#line 226 "src/lexer-keywords.txt" {"i16x8.q15mulr_sat_s", TokenType::Binary, Opcode::I16X8Q15mulrSatS}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 29 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 30 "src/lexer-keywords.txt" {"atomic.fence", TokenType::AtomicFence, Opcode::AtomicFence}, - {""}, {""}, {""}, {""}, -#line 239 "src/lexer-keywords.txt" - {"i16x8.extmul_high_i8x16_u", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16U}, - {""}, -#line 237 "src/lexer-keywords.txt" - {"i16x8.extmul_high_i8x16_s", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16S}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, @@ -1775,9 +1885,17 @@ Perfect_Hash::InWordSet (const char *str, size_t len) {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 183 "src/lexer-keywords.txt" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 186 "src/lexer-keywords.txt" {"f64x2.promote_low_f32x4", TokenType::Unary, Opcode::F64X2PromoteLowF32X4} }; +#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3) +#pragma GCC diagnostic pop +#endif if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { @@ -1791,5 +1909,5 @@ Perfect_Hash::InWordSet (const char *str, size_t len) return &wordlist[key]; } } - return 0; + return static_cast (0); } diff --git a/src/wast-parser.cc b/src/wast-parser.cc index b452697bfa..d4243b4c1e 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -28,6 +28,8 @@ #define WABT_TRACING 0 #include "wabt/tracing.h" +#include + #define EXPECT(token_type) CHECK_RESULT(Expect(TokenType::token_type)) namespace wabt { @@ -2166,17 +2168,165 @@ Result WastParser::ParseInstr(ExprList* exprs) { } } +Result WastParser::ParseCodeMetaDataCompilationPriorityAnnotation( + ExprList* exprs, + std::string_view name, + Location loc) { + // 1: (@metadata.code.compilation_priority (compilation 1) (optimization 10)) + // 2: (@metadata.code.compilation_priority (compilation 1)) + // 3: (@metadata.code.compilation_priority (compilation 1) (run_once)) + CodeMetadataExpr::CompilationPriority compilation_priority_info; + Result result = Result::Ok; + { + EXPECT(Lpar); + EXPECT(Compilation); + if (!PeekMatch(TokenType::Nat)) { + Error(GetLocation(), + "expected compilation priority natural number value"); + return Result::Error; + } + const Token prio_token = Consume(); + result |= ParseInt32(prio_token.literal().text, + &compilation_priority_info.compilation_priority, + ParseIntType::UnsignedOnly); + EXPECT(Rpar); + } + if (PeekMatchLpar(TokenType::Optimization)) { + EXPECT(Lpar); + EXPECT(Optimization); + if (!PeekMatch(TokenType::Nat)) { + Error(GetLocation(), + "expected optimization priority natural number value"); + return Result::Error; + } + const Token opt_prio_token = Consume(); + uint32_t optimization_priority = 0; + result |= ParseInt32(opt_prio_token.literal().text, &optimization_priority, + ParseIntType::UnsignedOnly); + compilation_priority_info.optimization_priority = optimization_priority; + EXPECT(Rpar); + } + if (PeekMatchLpar(TokenType::RunOnce)) { + EXPECT(Lpar); + EXPECT(RunOnce); + compilation_priority_info.optimization_priority = 127; + EXPECT(Rpar); + } + exprs->push_back( + std::make_unique(name, compilation_priority_info, loc)); + return result; +} + +Result WastParser::ParseCodeMetaDataInstrFreqAnnotation(ExprList* exprs, + std::string_view name, + Location loc) { + // 1: (@metadata.code.instr_freq (freq 123.45)) + // 2: (@metadata.code.instr_freq (freq never_opt)) + // 2: (@metadata.code.instr_freq (freq always_opt)) + CodeMetadataExpr::InstructionFrequency instr_freq{}; + std::vector instr_freqs; + EXPECT(Lpar); + EXPECT(Freq); + if (PeekMatch(TokenType::Nat) || PeekMatch(TokenType::Float)) { + const Token freq_token = Consume(); + const auto freq_text = std::string(freq_token.literal().text); + char* endptr = nullptr; + double value = strtod(freq_text.c_str(), &endptr); + if (endptr == freq_text.c_str()) { + Error(freq_token.loc, "invalid frequency value"); + return Result::Error; + } + instr_freq.frequency = + std::max(1u, static_cast(std::round(std::log2(value))) + 32); + } else if (PeekMatch(TokenType::NeverOpt)) { + EXPECT(NeverOpt); + instr_freq.frequency = 0; + } else if (PeekMatch(TokenType::AlwaysOpt)) { + EXPECT(AlwaysOpt); + instr_freq.frequency = 127; + } else { + Error(GetLocation(), + "expected frequency value or 'never_opt'/'always_opt'"); + return Result::Error; + } + EXPECT(Rpar); + exprs->push_back(std::make_unique(name, instr_freq, loc)); + return Result::Ok; +} + +Result WastParser::ParseCodeMetaDataCallTargetsAnnotation(ExprList* exprs, + std::string_view name, + Location loc) { + std::vector targets; + while (PeekMatch(TokenType::Lpar)) { + EXPECT(Lpar); + if (!PeekMatch(TokenType::Target)) { + Error(GetLocation(), "expected 'target' in code metadata annotation"); + return Result::Error; + } + EXPECT(Target); + Var func_var; + CHECK_RESULT(ParseVar(&func_var)); + double frequency = 0.0; + if (PeekMatch(TokenType::Float) || PeekMatch(TokenType::Nat)) { + const Token freq_token = Consume(); + const auto freq_text = std::string(freq_token.literal().text); + char* endptr = nullptr; + frequency = strtod(freq_text.c_str(), &endptr); + if (endptr == freq_text.c_str() || frequency > 1.0 || frequency < 0.0) { + Error(freq_token.loc, "invalid frequency value"); + return Result::Error; + } + } else { + Error(GetLocation(), "expected frequency value after function var"); + return Result::Error; + } + const auto percent_freq = static_cast(frequency * 100); + targets.push_back({func_var, percent_freq}); + EXPECT(Rpar); + } + exprs->push_back( + std::make_unique(name, std::move(targets), loc)); + return Result::Ok; +} + Result WastParser::ParseCodeMetadataAnnotation(ExprList* exprs) { WABT_TRACE(ParseCodeMetadataAnnotation); - Token tk = Consume(); + const Token tk = Consume(); std::string_view name = tk.text(); name.remove_prefix(sizeof("metadata.code.") - 1); - std::string data_text; - CHECK_RESULT(ParseQuotedText(&data_text, false)); - std::vector data(data_text.begin(), data_text.end()); - exprs->push_back(std::make_unique(name, std::move(data))); + const Location loc = tk.loc; + + Result result = Result::Ok; + if (PeekMatch(TokenType::Text)) { + // parse binary hint data from string (generic format) + std::string data_text; + CHECK_RESULT(ParseQuotedText(&data_text, false)); + std::vector data(data_text.begin(), data_text.end()); + exprs->push_back(std::make_unique(name, std::move(data))); + } else if (PeekMatchLpar(TokenType::Target) && name == "call_targets") { + result |= ParseCodeMetaDataCallTargetsAnnotation(exprs, name, loc); + } else if (PeekMatchLpar(TokenType::Compilation) && + name == "compilation_priority") { + result |= ParseCodeMetaDataCompilationPriorityAnnotation(exprs, name, loc); + } else if (PeekMatchLpar(TokenType::Freq) && name == "instr_freq") { + result |= ParseCodeMetaDataInstrFreqAnnotation(exprs, name, loc); + } else if (PeekMatch(TokenType::NeverOpt) && name == "instr_freq") { + EXPECT(NeverOpt); + exprs->push_back(std::make_unique( + name, CodeMetadataExpr::InstructionFrequency{.frequency = 0}, loc)); + } else if (PeekMatch(TokenType::AlwaysOpt) && name == "instr_freq") { + EXPECT(AlwaysOpt); + exprs->push_back(std::make_unique( + name, CodeMetadataExpr::InstructionFrequency{.frequency = 127}, loc)); + } else { + Error(GetLocation(), + "expected quoted string or structured list in code metadata " + "annotation"); + return Result::Error; + } EXPECT(Rpar); - return Result::Ok; + return result; } template diff --git a/src/wat-writer.cc b/src/wat-writer.cc index f19e3c3c86..f34b69e013 100644 --- a/src/wat-writer.cc +++ b/src/wat-writer.cc @@ -694,7 +694,8 @@ Result WatWriter::ExprVisitorDelegate::OnCodeMetadataExpr( writer_->WriteOpen("@metadata.code.", NextChar::None); writer_->WriteDataWithNextChar(expr->name.data(), expr->name.size()); writer_->WritePutc(' '); - writer_->WriteQuotedData(expr->data.data(), expr->data.size()); + const auto data = expr->serialize(this->writer_->module); + writer_->WriteQuotedData(data.data(), data.size()); writer_->WriteCloseSpace(); return Result::Ok; } diff --git a/test/parse/compilation-hint-call-targets.txt b/test/parse/compilation-hint-call-targets.txt new file mode 100644 index 0000000000..6bf8bc477e --- /dev/null +++ b/test/parse/compilation-hint-call-targets.txt @@ -0,0 +1,84 @@ +;;; TOOL: run-objdump +;;; ARGS0: --enable-annotations --enable-code-metadata +;;; ARGS1: -x -j "metadata.code.call_targets" +(module + (type $sig (func (result i32))) + (func $func0 (type $sig) (result i32) i32.const 0) + (func $func1 (type $sig) (result i32) i32.const 1) + (func $func2 (type $sig) (result i32) i32.const 2) + (func $func3 (type $sig) (result i32) i32.const 3) + (func $func4 (type $sig) (result i32) i32.const 4) + (func $func5 (type $sig) (result i32) i32.const 5) + + (table 6 funcref) + (elem (i32.const 0) $func0 $func1 $func2 $func3 $func4 $func5) + + (func $main (param i32) (result i32) + ;; First indirect call (multiple targets) + local.get 0 + (@metadata.code.call_targets (target $func0 0.75) (target $func1 0.2) (target $func2 0.02)) + call_indirect (type $sig) + drop + + ;; Second indirect call (invalid target hint) + i32.const 4 + (@metadata.code.call_targets (target $func3 1)) + call_indirect (type $sig) + drop + + ;; Third indirect call (binary hint repr) + i32.const 5 + (@metadata.code.call_targets "\05\49") + call_indirect (type $sig) + ) + (export "main" (func $main)) +) + +(;; STDOUT ;;; +compilation-hint-call-targets.wasm: file format wasm 0x1 + +Section Details: + +Custom: + - name: "metadata.code.call_targets" + - func[6]
: + - meta[3]: + - target [0]: 75% + - target [1]: 20% + - target [2]: 2% + - meta[9]: + - target [3]: 100% + - meta[f]: + - target [5]: 73% + +Code Disassembly: + +000070 func[0]: + 000071: 41 00 | i32.const 0 + 000073: 0b | end +000075 func[1]: + 000076: 41 01 | i32.const 1 + 000078: 0b | end +00007a func[2]: + 00007b: 41 02 | i32.const 2 + 00007d: 0b | end +00007f func[3]: + 000080: 41 03 | i32.const 3 + 000082: 0b | end +000084 func[4]: + 000085: 41 04 | i32.const 4 + 000087: 0b | end +000089 func[5]: + 00008a: 41 05 | i32.const 5 + 00008c: 0b | end +00008e func[6]
: + 00008f: 20 00 | local.get 0 + 000091: 11 00 00 | call_indirect 0 (type 0) + 000094: 1a | drop + 000095: 41 04 | i32.const 4 + 000097: 11 00 00 | call_indirect 0 (type 0) + 00009a: 1a | drop + 00009b: 41 05 | i32.const 5 + 00009d: 11 00 00 | call_indirect 0 (type 0) + 0000a0: 0b | end +;;; STDOUT ;;) diff --git a/test/parse/compilation-hint-compilation-priority.txt b/test/parse/compilation-hint-compilation-priority.txt new file mode 100644 index 0000000000..127d8fb07a --- /dev/null +++ b/test/parse/compilation-hint-compilation-priority.txt @@ -0,0 +1,124 @@ +;;; TOOL: run-objdump +;;; ARGS0: --enable-annotations --enable-code-metadata +;;; ARGS1: -x -j "metadata.code.compilation_priority" +(module + (type $sig (func (result i32))) + + ;; High priority function with optimization priority + (func $init (type $sig) (result i32) + (@metadata.code.compilation_priority (compilation 0) (optimization 5)) + i32.const 42) + + ;; Medium priority function with optimization priority + (func $main_loop (type $sig) (result i32) + (@metadata.code.compilation_priority (compilation 1) (optimization 2)) + i32.const 1) + + ;; Low priority function with optimization priority + (func $cleanup (type $sig) (result i32) + (@metadata.code.compilation_priority (compilation 2) (optimization 15)) + i32.const 2) + + ;; Function with run_once optimization (special value 127) + (func $startup (type $sig) (result i32) + (@metadata.code.compilation_priority (compilation 0) (run_once)) + i32.const 3) + + ;; Function with only compilation priority (no optimization priority) + (func $helper (type $sig) (result i32) + (@metadata.code.compilation_priority (compilation 3)) + i32.const 4) + + ;; Function with binary hint representation + (func $binary_hint (type $sig) (result i32) + (@metadata.code.compilation_priority "\02\0C") + i32.const 5) + + ;; Function without any compilation priority hints (should be compiled last/lazily) + (func $no_hints (type $sig) (result i32) + i32.const 6) + + (func $main (result i32) + call $init + call $main_loop + call $cleanup + call $startup + call $helper + call $binary_hint + call $no_hints + i32.add + i32.add + i32.add + i32.add + i32.add + i32.add + ) + + (export "main" (func $main)) +) + +(;; STDOUT ;;; +compilation-hint-compilation-priority.wasm: file format wasm 0x1 + +Section Details: + +Custom: + - name: "metadata.code.compilation_priority" + - func[0]: + - meta[0]: + - 0000000: 0005 .. + - func[1]: + - meta[0]: + - 0000000: 0102 .. + - func[2]: + - meta[0]: + - 0000000: 020f .. + - func[3]: + - meta[0]: + - 0000000: 007f .. + - func[4]: + - meta[0]: + - 0000000: 03 . + - func[5]: + - meta[1]: + - 0000000: 020c .. + +Code Disassembly: + +000071 func[0]: + 000072: 41 2a | i32.const 42 + 000074: 0b | end +000076 func[1]: + 000077: 41 01 | i32.const 1 + 000079: 0b | end +00007b func[2]: + 00007c: 41 02 | i32.const 2 + 00007e: 0b | end +000080 func[3]: + 000081: 41 03 | i32.const 3 + 000083: 0b | end +000085 func[4]: + 000086: 41 04 | i32.const 4 + 000088: 0b | end +00008a func[5]: + 00008b: 41 05 | i32.const 5 + 00008d: 0b | end +00008f func[6]: + 000090: 41 06 | i32.const 6 + 000092: 0b | end +000094 func[7]
: + 000095: 10 00 | call 0 + 000097: 10 01 | call 1 + 000099: 10 02 | call 2 + 00009b: 10 03 | call 3 + 00009d: 10 04 | call 4 + 00009f: 10 05 | call 5 + 0000a1: 10 06 | call 6 + 0000a3: 6a | i32.add + 0000a4: 6a | i32.add + 0000a5: 6a | i32.add + 0000a6: 6a | i32.add + 0000a7: 6a | i32.add + 0000a8: 6a | i32.add + 0000a9: 0b | end +;;; STDOUT ;;) diff --git a/test/parse/compilation-hint-instr-freq.txt b/test/parse/compilation-hint-instr-freq.txt new file mode 100644 index 0000000000..3c123d78e2 --- /dev/null +++ b/test/parse/compilation-hint-instr-freq.txt @@ -0,0 +1,119 @@ +;;; TOOL: run-objdump +;;; ARGS0: --enable-annotations --enable-code-metadata +;;; ARGS1: -x -j "metadata.code.instr_freq" +(module + (type $sig (func (result i32))) + (func $helper (type $sig) (result i32) i32.const 42) + + (func $main (param i32) (result i32) + ;; Hot loop - high frequency (freq 256 -> binary 40) + (loop $hot_loop (result i32) + (@metadata.code.instr_freq (freq 256)) + local.get 0 + i32.const 1 + i32.sub + local.tee 0 + i32.eqz + if (result i32) + i32.const 0 + else + ;; Hot call inside loop - very high frequency (freq 1024 -> binary 42) + (@metadata.code.instr_freq (freq 1024)) + call $helper + drop + br $hot_loop + end + ) + drop + + ;; Cold path - low frequency (freq 0.25 -> binary 30) + local.get 0 + i32.const 100 + i32.gt_s + if + (@metadata.code.instr_freq (freq 0.25)) + call $helper + drop + end + + ;; Never optimize call (binary "\00") + local.get 0 + i32.const 1000 + i32.gt_s + if + (@metadata.code.instr_freq never_opt) + call $helper + drop + end + + ;; Always optimize call (binary "\7f") + (@metadata.code.instr_freq always_opt) + call $helper + drop + + ;; Binary representation example (freq 16 -> binary "\24") + (@metadata.code.instr_freq "\24") + call $helper + ) + (export "main" (func $main)) +) +(;; STDOUT ;;; +compilation-hint-instr-freq.wasm: file format wasm 0x1 + +Section Details: + +Custom: + - name: "metadata.code.instr_freq" + - func[1]
: + - meta[3]: + - 0000000: 28 ( + - meta[10]: + - 0000000: 2a * + - meta[20]: + - 0000000: 1e . + - meta[2c]: + - 0000000: 00 . + - meta[30]: + - 0000000: 7f . + - meta[33]: + - 0000000: 24 $ + +Code Disassembly: + +000057 func[0]: + 000058: 41 2a | i32.const 42 + 00005a: 0b | end +00005c func[1]
: + 00005d: 03 7f | loop i32 + 00005f: 20 00 | local.get 0 + 000061: 41 01 | i32.const 1 + 000063: 6b | i32.sub + 000064: 22 00 | local.tee 0 + 000066: 45 | i32.eqz + 000067: 04 7f | if i32 + 000069: 41 00 | i32.const 0 + 00006b: 05 | else + 00006c: 10 00 | call 0 + 00006e: 1a | drop + 00006f: 0c 01 | br 1 + 000071: 0b | end + 000072: 0b | end + 000073: 1a | drop + 000074: 20 00 | local.get 0 + 000076: 41 e4 00 | i32.const 100 + 000079: 4a | i32.gt_s + 00007a: 04 40 | if + 00007c: 10 00 | call 0 + 00007e: 1a | drop + 00007f: 0b | end + 000080: 20 00 | local.get 0 + 000082: 41 e8 07 | i32.const 1000 + 000085: 4a | i32.gt_s + 000086: 04 40 | if + 000088: 10 00 | call 0 + 00008a: 1a | drop + 00008b: 0b | end + 00008c: 10 00 | call 0 + 00008e: 1a | drop + 00008f: 10 00 | call 0 + 000091: 0b | end From 869a125af04c7d54b92f69d10b807783dd98a53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Mon, 18 Aug 2025 14:16:30 +0200 Subject: [PATCH 2/7] remove designated initializers for windows build --- src/wast-parser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wast-parser.cc b/src/wast-parser.cc index d4243b4c1e..a58a585edb 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2314,11 +2314,11 @@ Result WastParser::ParseCodeMetadataAnnotation(ExprList* exprs) { } else if (PeekMatch(TokenType::NeverOpt) && name == "instr_freq") { EXPECT(NeverOpt); exprs->push_back(std::make_unique( - name, CodeMetadataExpr::InstructionFrequency{.frequency = 0}, loc)); + name, CodeMetadataExpr::InstructionFrequency{0}, loc)); } else if (PeekMatch(TokenType::AlwaysOpt) && name == "instr_freq") { EXPECT(AlwaysOpt); exprs->push_back(std::make_unique( - name, CodeMetadataExpr::InstructionFrequency{.frequency = 127}, loc)); + name, CodeMetadataExpr::InstructionFrequency{127}, loc)); } else { Error(GetLocation(), "expected quoted string or structured list in code metadata " From b0acf3793abaab428fba239a021909bab17cd945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Mon, 18 Aug 2025 14:38:21 +0200 Subject: [PATCH 3/7] fix error in instruction frequency calculation --- src/wast-parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wast-parser.cc b/src/wast-parser.cc index a58a585edb..c13ce8278a 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2237,7 +2237,7 @@ Result WastParser::ParseCodeMetaDataInstrFreqAnnotation(ExprList* exprs, return Result::Error; } instr_freq.frequency = - std::max(1u, static_cast(std::round(std::log2(value))) + 32); + std::max(1u, static_cast(std::floor(std::log2(value))) + 32); } else if (PeekMatch(TokenType::NeverOpt)) { EXPECT(NeverOpt); instr_freq.frequency = 0; From b8720025becebc06ef407fb4d9aebcc2dfb7d72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Mon, 18 Aug 2025 14:50:32 +0200 Subject: [PATCH 4/7] fix error in instruction frequency calculation --- src/wast-parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wast-parser.cc b/src/wast-parser.cc index c13ce8278a..2284d8b5c2 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2237,7 +2237,7 @@ Result WastParser::ParseCodeMetaDataInstrFreqAnnotation(ExprList* exprs, return Result::Error; } instr_freq.frequency = - std::max(1u, static_cast(std::floor(std::log2(value))) + 32); + std::max(1u, static_cast(std::floor(std::log2(value)) + 32)); } else if (PeekMatch(TokenType::NeverOpt)) { EXPECT(NeverOpt); instr_freq.frequency = 0; From 6ea1e1903c54df8b0643b8253e8b25e5ffd97647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Fri, 22 Aug 2025 15:26:09 +0200 Subject: [PATCH 5/7] check if macos test is flaky From 9be7e77f9e922f35d67e7123705556eed9a14cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Fri, 22 Aug 2025 16:09:17 +0200 Subject: [PATCH 6/7] changes from review --- include/wabt/ir.h | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/include/wabt/ir.h b/include/wabt/ir.h index e812e2847a..fb8ae1d2e0 100644 --- a/include/wabt/ir.h +++ b/include/wabt/ir.h @@ -715,32 +715,26 @@ class CodeMetadataExpr : public ExprMixin { struct InstructionFrequency { uint32_t frequency; }; - enum class Type { - Binary, - CompilationHint, - InstructionFrequency, - CallTargets - }; - explicit CodeMetadataExpr(std::string_view name, - std::vector data, - const Location& loc = Location()) + CodeMetadataExpr(std::string_view name, + std::vector data, + const Location& loc = Location()) : ExprMixin(loc), name(name), type(Type::Binary) { new (&hint.data) std::vector(std::move(data)); } - explicit CodeMetadataExpr(std::string_view name, - CompilationPriority compilation_priority, - const Location& loc = Location()) + CodeMetadataExpr(std::string_view name, + CompilationPriority compilation_priority, + const Location& loc = Location()) : ExprMixin(loc), name(name), type(Type::CompilationHint) { new (&hint.compilation_priority) CompilationPriority(compilation_priority); } - explicit CodeMetadataExpr(std::string_view name, - InstructionFrequency instruction_frequency, - const Location& loc = Location()) + CodeMetadataExpr(std::string_view name, + InstructionFrequency instruction_frequency, + const Location& loc = Location()) : ExprMixin(loc), name(name), type(Type::InstructionFrequency) { @@ -748,9 +742,9 @@ class CodeMetadataExpr : public ExprMixin { InstructionFrequency(instruction_frequency); } - explicit CodeMetadataExpr(std::string_view name, - std::vector targets, - const Location& loc = Location()) + CodeMetadataExpr(std::string_view name, + std::vector targets, + const Location& loc = Location()) : ExprMixin(loc), name(name), type(Type::CallTargets) { @@ -777,7 +771,6 @@ class CodeMetadataExpr : public ExprMixin { std::vector serialize(const Module&) const; std::string_view name; - Type type; private: union Hint { @@ -785,9 +778,17 @@ class CodeMetadataExpr : public ExprMixin { CompilationPriority compilation_priority; InstructionFrequency instruction_frequency{}; std::vector call_targets; - Hint() {} ~Hint() {} } hint; + + enum class Type { + Binary, + CompilationHint, + InstructionFrequency, + CallTargets + }; + + Type type; }; class ReturnCallIndirectExpr : public ExprMixin { From 0dd087642ccd8c21400b334a676c27953601563e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6llerer?= Date: Fri, 22 Aug 2025 16:14:33 +0200 Subject: [PATCH 7/7] revert: add default union constructor --- include/wabt/ir.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/wabt/ir.h b/include/wabt/ir.h index fb8ae1d2e0..0eb1b6b25c 100644 --- a/include/wabt/ir.h +++ b/include/wabt/ir.h @@ -778,6 +778,7 @@ class CodeMetadataExpr : public ExprMixin { CompilationPriority compilation_priority; InstructionFrequency instruction_frequency{}; std::vector call_targets; + Hint() {} ~Hint() {} } hint;