aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/BinaryFormat/Code.php19
-rw-r--r--src/BinaryFormat/Decoder.php1153
-rw-r--r--src/BinaryFormat/InvalidBinaryFormatException.php11
-rw-r--r--src/BinaryFormat/Locals.php19
-rw-r--r--src/BinaryFormat/SectionId.php22
-rw-r--r--src/Structure/Instructions/Expr.php23
-rw-r--r--src/Structure/Instructions/Instr.php977
-rw-r--r--src/Structure/Instructions/Instrs/Control/Block.php19
-rw-r--r--src/Structure/Instructions/Instrs/Control/BlockType.php21
-rw-r--r--src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php15
-rw-r--r--src/Structure/Instructions/Instrs/Control/BlockTypes/ValType.php15
-rw-r--r--src/Structure/Instructions/Instrs/Control/Br.php16
-rw-r--r--src/Structure/Instructions/Instrs/Control/BrIf.php16
-rw-r--r--src/Structure/Instructions/Instrs/Control/BrTable.php20
-rw-r--r--src/Structure/Instructions/Instrs/Control/Call.php16
-rw-r--r--src/Structure/Instructions/Instrs/Control/CallIndirect.php18
-rw-r--r--src/Structure/Instructions/Instrs/Control/Else_.php11
-rw-r--r--src/Structure/Instructions/Instrs/Control/End.php11
-rw-r--r--src/Structure/Instructions/Instrs/Control/If_.php21
-rw-r--r--src/Structure/Instructions/Instrs/Control/Loop.php19
-rw-r--r--src/Structure/Instructions/Instrs/Control/Nop.php11
-rw-r--r--src/Structure/Instructions/Instrs/Control/Return_.php11
-rw-r--r--src/Structure/Instructions/Instrs/Control/Unreachable.php11
-rw-r--r--src/Structure/Instructions/Instrs/Memory/DataDrop.php16
-rw-r--r--src/Structure/Instructions/Instrs/Memory/F32Load.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/F32Store.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/F64Load.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/F64Store.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Load.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Load16S.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Load16U.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Load8S.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Load8U.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Store.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Store16.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I32Store8.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load16S.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load16U.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load32S.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load32U.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load8S.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Load8U.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Store.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Store16.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Store32.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/I64Store8.php20
-rw-r--r--src/Structure/Instructions/Instrs/Memory/MemoryCopy.php11
-rw-r--r--src/Structure/Instructions/Instrs/Memory/MemoryFill.php11
-rw-r--r--src/Structure/Instructions/Instrs/Memory/MemoryGrow.php11
-rw-r--r--src/Structure/Instructions/Instrs/Memory/MemoryInit.php16
-rw-r--r--src/Structure/Instructions/Instrs/Memory/MemorySize.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Abs.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Add.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Ceil.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Const.php18
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ConvertI32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ConvertI32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ConvertI64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ConvertI64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32CopySign.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32DemoteF64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Div.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Eq.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Floor.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Ge.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Gt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Le.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Lt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Max.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Min.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Mul.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Ne.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Nearest.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Neg.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI32.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Sqrt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Sub.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F32Trunc.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Abs.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Add.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Ceil.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Const.php18
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ConvertI32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ConvertI32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ConvertI64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ConvertI64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64CopySign.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Div.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Eq.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Floor.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Ge.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Gt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Le.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Lt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Max.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Min.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Mul.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Ne.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Nearest.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Neg.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64PromoteF32.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI32.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Sqrt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Sub.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/F64Trunc.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Add.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32And.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Clz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Const.php18
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Ctz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32DivS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32DivU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Eq.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Eqz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Extend16S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Extend8S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32GeS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32GeU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32GtS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32GtU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32LeS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32LeU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32LtS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32LtU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Mul.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Ne.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Or.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Popcnt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF32.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32RemS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32RemU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32RotL.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32RotR.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Shl.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32ShrS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32ShrU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Sub.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncF32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncF32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncF64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncF64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32WrapI64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I32Xor.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Add.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64And.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Clz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Const.php18
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Ctz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64DivS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64DivU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Eq.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Eqz.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Extend16S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Extend32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Extend8S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ExtendI32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ExtendI32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64GeS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64GeU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64GtS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64GtU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64LeS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64LeU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64LtS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64LtU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Mul.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Ne.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Or.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Popcnt.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF32.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF64.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64RemS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64RemU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64RotL.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64RotR.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Shl.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ShrS.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64ShrU.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Sub.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncF32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncF32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncF64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncF64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64S.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64U.php11
-rw-r--r--src/Structure/Instructions/Instrs/Numeric/I64Xor.php11
-rw-r--r--src/Structure/Instructions/Instrs/Parametric/Drop.php11
-rw-r--r--src/Structure/Instructions/Instrs/Parametric/Select.php19
-rw-r--r--src/Structure/Instructions/Instrs/Reference/RefFunc.php16
-rw-r--r--src/Structure/Instructions/Instrs/Reference/RefIsNull.php11
-rw-r--r--src/Structure/Instructions/Instrs/Reference/RefNull.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/ElemDrop.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableCopy.php17
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableFill.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableGet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableGrow.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableInit.php18
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableSet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Table/TableSize.php16
-rw-r--r--src/Structure/Instructions/Instrs/Variable/GlobalGet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Variable/GlobalSet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Variable/LocalGet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Variable/LocalSet.php16
-rw-r--r--src/Structure/Instructions/Instrs/Variable/LocalTee.php16
-rw-r--r--src/Structure/Modules/Data.php17
-rw-r--r--src/Structure/Modules/DataMode.php23
-rw-r--r--src/Structure/Modules/DataModes/Active.php18
-rw-r--r--src/Structure/Modules/DataModes/Passive.php14
-rw-r--r--src/Structure/Modules/Elem.php21
-rw-r--r--src/Structure/Modules/ElemMode.php28
-rw-r--r--src/Structure/Modules/ElemModes/Active.php18
-rw-r--r--src/Structure/Modules/ElemModes/Declarative.php14
-rw-r--r--src/Structure/Modules/ElemModes/Passive.php14
-rw-r--r--src/Structure/Modules/Export.php17
-rw-r--r--src/Structure/Modules/ExportDesc.php33
-rw-r--r--src/Structure/Modules/ExportDescs/Func.php16
-rw-r--r--src/Structure/Modules/ExportDescs/Global_.php16
-rw-r--r--src/Structure/Modules/ExportDescs/Mem.php16
-rw-r--r--src/Structure/Modules/ExportDescs/Table.php16
-rw-r--r--src/Structure/Modules/Func.php21
-rw-r--r--src/Structure/Modules/Global_.php17
-rw-r--r--src/Structure/Modules/Import.php19
-rw-r--r--src/Structure/Modules/ImportDesc.php33
-rw-r--r--src/Structure/Modules/ImportDescs/Func.php16
-rw-r--r--src/Structure/Modules/ImportDescs/Global_.php16
-rw-r--r--src/Structure/Modules/ImportDescs/Mem.php16
-rw-r--r--src/Structure/Modules/ImportDescs/Table.php16
-rw-r--r--src/Structure/Modules/Local.php15
-rw-r--r--src/Structure/Modules/Mem.php15
-rw-r--r--src/Structure/Modules/Module.php35
-rw-r--r--src/Structure/Modules/Start.php15
-rw-r--r--src/Structure/Modules/Table.php15
-rw-r--r--src/Structure/Types/DataIdx.php16
-rw-r--r--src/Structure/Types/ElemIdx.php16
-rw-r--r--src/Structure/Types/ExternType.php28
-rw-r--r--src/Structure/Types/ExternTypes/Func.php16
-rw-r--r--src/Structure/Types/ExternTypes/Global_.php16
-rw-r--r--src/Structure/Types/ExternTypes/Mem.php16
-rw-r--r--src/Structure/Types/ExternTypes/Table.php16
-rw-r--r--src/Structure/Types/FuncIdx.php16
-rw-r--r--src/Structure/Types/FuncType.php14
-rw-r--r--src/Structure/Types/GlobalIdx.php16
-rw-r--r--src/Structure/Types/GlobalType.php14
-rw-r--r--src/Structure/Types/LabelIdx.php16
-rw-r--r--src/Structure/Types/Limits.php18
-rw-r--r--src/Structure/Types/LocalIdx.php16
-rw-r--r--src/Structure/Types/MemIdx.php16
-rw-r--r--src/Structure/Types/MemType.php13
-rw-r--r--src/Structure/Types/Mut.php11
-rw-r--r--src/Structure/Types/NumType.php13
-rw-r--r--src/Structure/Types/RefType.php11
-rw-r--r--src/Structure/Types/ResultType.php16
-rw-r--r--src/Structure/Types/TableIdx.php16
-rw-r--r--src/Structure/Types/TableType.php14
-rw-r--r--src/Structure/Types/TypeIdx.php16
-rw-r--r--src/Structure/Types/ValType.php23
-rw-r--r--src/Structure/Types/ValTypes/NumType.php15
-rw-r--r--src/Structure/Types/ValTypes/RefType.php15
-rw-r--r--src/Structure/Types/ValTypes/VecType.php15
-rw-r--r--src/Structure/Types/VecType.php10
270 files changed, 5875 insertions, 0 deletions
diff --git a/src/BinaryFormat/Code.php b/src/BinaryFormat/Code.php
new file mode 100644
index 0000000..cb0dbe6
--- /dev/null
+++ b/src/BinaryFormat/Code.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\BinaryFormat;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+
+final readonly class Code
+{
+ /**
+ * @param list<Locals> $compressedLocals
+ */
+ public function __construct(
+ public array $compressedLocals,
+ public Expr $body,
+ ) {
+ }
+}
diff --git a/src/BinaryFormat/Decoder.php b/src/BinaryFormat/Decoder.php
new file mode 100644
index 0000000..f95c26e
--- /dev/null
+++ b/src/BinaryFormat/Decoder.php
@@ -0,0 +1,1153 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\BinaryFormat;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockType;
+use Nsfisis\Waddiwasi\Structure\Modules\Data;
+use Nsfisis\Waddiwasi\Structure\Modules\DataMode;
+use Nsfisis\Waddiwasi\Structure\Modules\Elem;
+use Nsfisis\Waddiwasi\Structure\Modules\ElemMode;
+use Nsfisis\Waddiwasi\Structure\Modules\Export;
+use Nsfisis\Waddiwasi\Structure\Modules\ExportDesc;
+use Nsfisis\Waddiwasi\Structure\Modules\Func;
+use Nsfisis\Waddiwasi\Structure\Modules\Global_;
+use Nsfisis\Waddiwasi\Structure\Modules\Import;
+use Nsfisis\Waddiwasi\Structure\Modules\ImportDesc;
+use Nsfisis\Waddiwasi\Structure\Modules\Local;
+use Nsfisis\Waddiwasi\Structure\Modules\Mem;
+use Nsfisis\Waddiwasi\Structure\Modules\Module;
+use Nsfisis\Waddiwasi\Structure\Modules\Start;
+use Nsfisis\Waddiwasi\Structure\Modules\Table;
+use Nsfisis\Waddiwasi\Structure\Types\DataIdx;
+use Nsfisis\Waddiwasi\Structure\Types\ElemIdx;
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+use Nsfisis\Waddiwasi\Structure\Types\FuncType;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
+use Nsfisis\Waddiwasi\Structure\Types\LabelIdx;
+use Nsfisis\Waddiwasi\Structure\Types\Limits;
+use Nsfisis\Waddiwasi\Structure\Types\LocalIdx;
+use Nsfisis\Waddiwasi\Structure\Types\MemIdx;
+use Nsfisis\Waddiwasi\Structure\Types\MemType;
+use Nsfisis\Waddiwasi\Structure\Types\Mut;
+use Nsfisis\Waddiwasi\Structure\Types\NumType;
+use Nsfisis\Waddiwasi\Structure\Types\RefType;
+use Nsfisis\Waddiwasi\Structure\Types\ResultType;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+use Nsfisis\Waddiwasi\Structure\Types\TableType;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+use Nsfisis\Waddiwasi\Structure\Types\VecType;
+
+final class Decoder
+{
+ private string $input;
+ private int $inputSize;
+ private int $pos;
+
+ public function __construct(string $wasmBinary)
+ {
+ $this->input = $wasmBinary;
+ $this->inputSize = strlen($wasmBinary);
+ $this->pos = 0;
+ }
+
+ public function decode(): Module
+ {
+ $this->checkMagic();
+ $this->checkVersion();
+
+ $types = $this->decodeSection(SectionId::Type, $this->decodeTypeSecRest(...)) ?? [];
+ $imports = $this->decodeSection(SectionId::Import, $this->decodeImportSecRest(...)) ?? [];
+ $typeIndices = $this->decodeSection(SectionId::Func, $this->decodeFuncSecRest(...)) ?? [];
+ $tables = $this->decodeSection(SectionId::Table, $this->decodeTableSecRest(...)) ?? [];
+ $mems = $this->decodeSection(SectionId::Mem, $this->decodeMemSecRest(...)) ?? [];
+ $globals = $this->decodeSection(SectionId::Global, $this->decodeGlobalSecRest(...)) ?? [];
+ $exports = $this->decodeSection(SectionId::Export, $this->decodeExportSecRest(...)) ?? [];
+ $start = $this->decodeSection(SectionId::Start, $this->decodeStartSecRest(...));
+ $elems = $this->decodeSection(SectionId::Elem, $this->decodeElemSecRest(...)) ?? [];
+ $dataCount = $this->decodeSection(SectionId::DataCount, $this->decodeDataCountSecRest(...));
+ $codes = $this->decodeSection(SectionId::Code, $this->decodeCodeSecRest(...)) ?? [];
+ $datas = $this->decodeSection(SectionId::Data, $this->decodeDataSecRest(...)) ?? [];
+
+ if (!$this->eof()) {
+ throw new InvalidBinaryFormatException("eof");
+ }
+ if ($dataCount === null) {
+ // TODO: dataidx(code) must be empty
+ } else {
+ if (count($datas) !== $dataCount) {
+ throw new InvalidBinaryFormatException("datasec");
+ }
+ }
+
+ $funcs = [];
+ foreach ($typeIndices as $i => $type) {
+ $code = $codes[$i];
+ $decompressedLocals = array_map(
+ fn ($l) => array_fill(0, $l->count, new Local($l->type)),
+ $code->compressedLocals,
+ );
+ $funcs[] = new Func(
+ $type,
+ array_merge(...$decompressedLocals),
+ $code->body,
+ );
+ }
+
+ return new Module(
+ $types,
+ $funcs,
+ $tables,
+ $mems,
+ $globals,
+ $elems,
+ $datas,
+ $start,
+ $imports,
+ $exports,
+ );
+ }
+
+ private function checkMagic(): void
+ {
+ assert($this->pos === 0);
+ $this->ensureNBytesRemains(4);
+ $b1 = ord($this->input[0]);
+ $b2 = ord($this->input[1]);
+ $b3 = ord($this->input[2]);
+ $b4 = ord($this->input[3]);
+ if ([$b1, $b2, $b3, $b4] !== [0x00, 0x61, 0x73, 0x6D]) {
+ throw new InvalidBinaryFormatException("magic");
+ }
+ $this->pos += 4;
+ }
+
+ private function checkVersion(): void
+ {
+ assert($this->pos === 4);
+ $this->ensureNBytesRemains(4);
+ $b1 = ord($this->input[0]);
+ $b2 = ord($this->input[1]);
+ $b3 = ord($this->input[2]);
+ $b4 = ord($this->input[3]);
+ if ([$b1, $b2, $b3, $b4] !== [0x01, 0x00, 0x00, 0x00]) {
+ throw new InvalidBinaryFormatException("version");
+ }
+ $this->pos += 4;
+ }
+
+ /**
+ * @template T
+ * @param callable(): T $decoder
+ * @return ?T
+ */
+ private function decodeSection(SectionId $sectionId, callable $decoder): mixed
+ {
+ $this->skipCustomSections();
+
+ $idValue = $this->peekByte();
+ $id = SectionId::tryFrom($idValue);
+ if ($id === null) {
+ throw new InvalidBinaryFormatException("section id");
+ }
+ if ($id !== $sectionId) {
+ return null;
+ }
+ $this->skipNBytes(1);
+
+ $size = $this->decodeU32();
+ $prevPos = $this->pos;
+ $result = $decoder();
+ if ($this->pos - $prevPos !== $size) {
+ throw new InvalidBinaryFormatException("type section size");
+ }
+ return $result;
+ }
+
+ private function skipCustomSections(): void
+ {
+ while (!$this->eof()) {
+ $b = $this->peekByte();
+ if ($b !== SectionId::Custom->value) {
+ break;
+ }
+ $this->skipNBytes(1);
+ $size = $this->decodeU32();
+ $prevPos = $this->pos;
+ $this->decodeName();
+ $encodedSizeOfName = $this->pos - $prevPos;
+ $this->skipNBytes($size - $encodedSizeOfName);
+ }
+ }
+
+ /**
+ * @return list<FuncType>
+ */
+ private function decodeTypeSecRest(): array
+ {
+ return $this->decodeVec($this->decodeFuncType(...));
+ }
+
+ /**
+ * @return list<Import>
+ */
+ private function decodeImportSecRest(): array
+ {
+ return $this->decodeVec($this->decodeImport(...));
+ }
+
+ /**
+ * @return list<TypeIdx>
+ */
+ private function decodeFuncSecRest(): array
+ {
+ return $this->decodeVec($this->decodeTypeIdx(...));
+ }
+
+ /**
+ * @return list<Table>
+ */
+ private function decodeTableSecRest(): array
+ {
+ return $this->decodeVec($this->decodeTable(...));
+ }
+
+ /**
+ * @return list<Mem>
+ */
+ private function decodeMemSecRest(): array
+ {
+ return $this->decodeVec($this->decodeMem(...));
+ }
+
+ /**
+ * @return list<Global_>
+ */
+ private function decodeGlobalSecRest(): array
+ {
+ return $this->decodeVec($this->decodeGlobal(...));
+ }
+
+ /**
+ * @return list<Export>
+ */
+ private function decodeExportSecRest(): array
+ {
+ return $this->decodeVec($this->decodeExport(...));
+ }
+
+ private function decodeStartSecRest(): Start
+ {
+ return new Start($this->decodeFuncIdx());
+ }
+
+ /**
+ * @return list<Elem>
+ */
+ private function decodeElemSecRest(): array
+ {
+ return $this->decodeVec($this->decodeElem(...));
+ }
+
+ /**
+ * @return list<Code>
+ */
+ private function decodeCodeSecRest(): array
+ {
+ return $this->decodeVec($this->decodeCode(...));
+ }
+
+ /**
+ * @return list<Data>
+ */
+ private function decodeDataSecRest(): array
+ {
+ return $this->decodeVec($this->decodeData(...));
+ }
+
+ /**
+ * @return U32
+ */
+ private function decodeDataCountSecRest(): int
+ {
+ return $this->decodeU32();
+ }
+
+ private function decodeResultType(): ResultType
+ {
+ return new ResultType($this->decodeVec($this->decodeValType(...)));
+ }
+
+ private function decodeFuncType(): FuncType
+ {
+ $b = $this->decodeByte();
+ if ($b !== 0x60) {
+ throw new InvalidBinaryFormatException("functype");
+ }
+ $args = $this->decodeResultType();
+ $returns = $this->decodeResultType();
+ return new FuncType(
+ $args,
+ $returns,
+ );
+ }
+
+ private function decodeValType(): ValType
+ {
+ $b = $this->peekByte();
+ if ($b === 0x7F) {
+ $this->skipNBytes(1);
+ return ValType::NumType(NumType::I32);
+ } elseif ($b === 0x7E) {
+ $this->skipNBytes(1);
+ return ValType::NumType(NumType::I64);
+ } elseif ($b === 0x7D) {
+ $this->skipNBytes(1);
+ return ValType::NumType(NumType::F32);
+ } elseif ($b === 0x7C) {
+ $this->skipNBytes(1);
+ return ValType::NumType(NumType::F64);
+ } elseif ($b === 0x7B) {
+ $this->skipNBytes(1);
+ return ValType::VecType(VecType::V128);
+ } else {
+ return ValType::RefType($this->decodeRefType());
+ }
+ }
+
+ private function decodeRefType(): RefType
+ {
+ return match ($this->decodeByte()) {
+ 0x70 => RefType::FuncRef,
+ 0x6F => RefType::ExternRef,
+ default => throw new InvalidBinaryFormatException("reftype"),
+ };
+ }
+
+ private function decodeLimits(): Limits
+ {
+ $b = $this->decodeByte();
+ if ($b === 0x00) {
+ $min = $this->decodeU32();
+ return new Limits($min, null);
+ } elseif ($b === 0x01) {
+ $min = $this->decodeU32();
+ $max = $this->decodeU32();
+ return new Limits($min, $max);
+ } else {
+ throw new InvalidBinaryFormatException("limits");
+ }
+ }
+
+ private function decodeMemType(): MemType
+ {
+ return new MemType($this->decodeLimits());
+ }
+
+ private function decodeTableType(): TableType
+ {
+ $refType = $this->decodeRefType();
+ $limits = $this->decodeLimits();
+ return new TableType(
+ $limits,
+ $refType,
+ );
+ }
+
+ private function decodeGlobalType(): GlobalType
+ {
+ $valType = $this->decodeValType();
+ $mut = $this->decodeMut();
+ return new GlobalType(
+ $mut,
+ $valType,
+ );
+ }
+
+ private function decodeMut(): Mut
+ {
+ return match ($this->decodeByte()) {
+ 0x00 => Mut::Const,
+ 0x01 => Mut::Var,
+ default => throw new InvalidBinaryFormatException("mutability"),
+ };
+ }
+
+ private function decodeImport(): Import
+ {
+ $module = $this->decodeName();
+ $name = $this->decodeName();
+ $desc = $this->decodeImportDesc();
+ return new Import(
+ $module,
+ $name,
+ $desc,
+ );
+ }
+
+ private function decodeTable(): Table
+ {
+ return new Table($this->decodeTableType());
+ }
+
+ private function decodeMem(): Mem
+ {
+ $type = $this->decodeMemType();
+ return new Mem(
+ $type,
+ );
+ }
+
+ private function decodeGlobal(): Global_
+ {
+ $type = $this->decodeGlobalType();
+ $init = $this->decodeExpr();
+ return new Global_(
+ $type,
+ $init,
+ );
+ }
+
+ private function decodeExport(): Export
+ {
+ $name = $this->decodeName();
+ $desc = $this->decodeExportDesc();
+ return new Export(
+ $name,
+ $desc,
+ );
+ }
+
+ private function decodeElem(): Elem
+ {
+ $mode = $this->decodeU32();
+ if ($mode === 0) {
+ $offset = $this->decodeExpr();
+ $initFuncRefs = $this->decodeVec($this->decodeFuncIdx(...));
+ return new Elem(
+ RefType::FuncRef,
+ array_map(
+ fn ($funcRef) => new Expr([Instr::RefFunc($funcRef)]),
+ $initFuncRefs,
+ ),
+ ElemMode::Active(new TableIdx(0), $offset),
+ );
+ } elseif ($mode === 1) {
+ $refType = $this->decodeElemKind();
+ $initFuncRefs = $this->decodeVec($this->decodeFuncIdx(...));
+ return new Elem(
+ $refType,
+ array_map(
+ fn ($funcRef) => new Expr([Instr::RefFunc($funcRef)]),
+ $initFuncRefs,
+ ),
+ ElemMode::Passive(),
+ );
+ } elseif ($mode === 2) {
+ $table = $this->decodeTableIdx();
+ $offset = $this->decodeExpr();
+ $refType = $this->decodeElemKind();
+ $initFuncRefs = $this->decodeVec($this->decodeFuncIdx(...));
+ return new Elem(
+ $refType,
+ array_map(
+ fn ($funcRef) => new Expr([Instr::RefFunc($funcRef)]),
+ $initFuncRefs,
+ ),
+ ElemMode::Active($table, $offset),
+ );
+ } elseif ($mode === 3) {
+ $refType = $this->decodeElemKind();
+ $initFuncRefs = $this->decodeVec($this->decodeFuncIdx(...));
+ return new Elem(
+ $refType,
+ array_map(
+ fn ($funcRef) => new Expr([Instr::RefFunc($funcRef)]),
+ $initFuncRefs,
+ ),
+ ElemMode::Declarative(),
+ );
+ } elseif ($mode === 4) {
+ $offset = $this->decodeExpr();
+ $init = $this->decodeVec($this->decodeExpr(...));
+ return new Elem(
+ RefType::FuncRef,
+ $init,
+ ElemMode::Active(new TableIdx(0), $offset),
+ );
+ } elseif ($mode === 5) {
+ $refType = $this->decodeRefType();
+ $init = $this->decodeVec($this->decodeExpr(...));
+ return new Elem(
+ $refType,
+ $init,
+ ElemMode::Passive(),
+ );
+ } elseif ($mode === 6) {
+ $table = $this->decodeTableIdx();
+ $offset = $this->decodeExpr();
+ $refType = $this->decodeRefType();
+ $init = $this->decodeVec($this->decodeExpr(...));
+ return new Elem(
+ $refType,
+ $init,
+ ElemMode::Active($table, $offset),
+ );
+ } elseif ($mode === 7) {
+ $refType = $this->decodeRefType();
+ $init = $this->decodeVec($this->decodeExpr(...));
+ return new Elem(
+ $refType,
+ $init,
+ ElemMode::Declarative(),
+ );
+ } else {
+ throw new InvalidBinaryFormatException("code");
+ }
+ }
+
+ private function decodeCode(): Code
+ {
+ $size = $this->decodeU32();
+ $prevPos = $this->pos;
+ $compressedLocals = $this->decodeVec($this->decodeLocals(...));
+ $body = $this->decodeExpr();
+ if ($this->pos - $prevPos !== $size) {
+ throw new InvalidBinaryFormatException("code size");
+ }
+ return new Code(
+ $compressedLocals,
+ $body,
+ );
+ }
+
+ private function decodeData(): Data
+ {
+ $mode = $this->decodeU32();
+ if ($mode === 0) {
+ $offset = $this->decodeExpr();
+ $init = $this->decodeVec($this->decodeByte(...));
+ return new Data(
+ $init,
+ DataMode::Active(
+ new MemIdx(0),
+ $offset,
+ ),
+ );
+ } elseif ($mode === 1) {
+ $init = $this->decodeVec($this->decodeByte(...));
+ return new Data(
+ $init,
+ DataMode::Passive(),
+ );
+ } elseif ($mode === 2) {
+ $memory = $this->decodeMemIdx();
+ $offset = $this->decodeExpr();
+ $init = $this->decodeVec($this->decodeByte(...));
+ return new Data(
+ $init,
+ DataMode::Active(
+ $memory,
+ $offset,
+ ),
+ );
+ } else {
+ throw new InvalidBinaryFormatException("data");
+ }
+ }
+
+ private function decodeImportDesc(): ImportDesc
+ {
+ return match ($this->decodeByte()) {
+ 0x00 => ImportDesc::Func($this->decodeTypeIdx()),
+ 0x01 => ImportDesc::Table($this->decodeTableType()),
+ 0x02 => ImportDesc::Mem($this->decodeMemType()),
+ 0x03 => ImportDesc::Global($this->decodeGlobalType()),
+ default => throw new InvalidBinaryFormatException("importdesc"),
+ };
+ }
+
+ private function decodeExportDesc(): ExportDesc
+ {
+ return match ($this->decodeByte()) {
+ 0x00 => ExportDesc::Func($this->decodeFuncIdx()),
+ 0x01 => ExportDesc::Table($this->decodeTableIdx()),
+ 0x02 => ExportDesc::Mem($this->decodeMemIdx()),
+ 0x03 => ExportDesc::Global($this->decodeGlobalIdx()),
+ default => throw new InvalidBinaryFormatException("exportdesc"),
+ };
+ }
+
+ private function decodeElemKind(): RefType
+ {
+ $b = $this->decodeByte();
+ if ($b === 0x00) {
+ return RefType::FuncRef;
+ } else {
+ throw new InvalidBinaryFormatException("elemkind");
+ }
+ }
+
+ private function decodeLocals(): Locals
+ {
+ $count = $this->decodeU32();
+ $type = $this->decodeValType();
+ return new Locals(
+ $count,
+ $type,
+ );
+ }
+
+ private function decodeTypeIdx(): TypeIdx
+ {
+ return new TypeIdx($this->decodeU32());
+ }
+
+ private function decodeMemIdx(): MemIdx
+ {
+ return new MemIdx($this->decodeU32());
+ }
+
+ private function decodeFuncIdx(): FuncIdx
+ {
+ return new FuncIdx($this->decodeU32());
+ }
+
+ private function decodeTableIdx(): TableIdx
+ {
+ return new TableIdx($this->decodeU32());
+ }
+
+ private function decodeGlobalIdx(): GlobalIdx
+ {
+ return new GlobalIdx($this->decodeU32());
+ }
+
+ private function decodeLocalIdx(): LocalIdx
+ {
+ return new LocalIdx($this->decodeU32());
+ }
+
+ private function decodeLabelIdx(): LabelIdx
+ {
+ return new LabelIdx($this->decodeU32());
+ }
+
+ private function decodeDataIdx(): DataIdx
+ {
+ return new DataIdx($this->decodeU32());
+ }
+
+ private function decodeElemIdx(): ElemIdx
+ {
+ return new ElemIdx($this->decodeU32());
+ }
+
+ private function decodeExpr(): Expr
+ {
+ return new Expr($this->decodeInstrsUntil([Instrs\Control\End::class])[0]);
+ }
+
+ private function decodeInstr(): Instr
+ {
+ switch ($this->decodeByte()) {
+ case 0x00: return Instr::Unreachable();
+ case 0x01: return Instr::Nop();
+ case 0x02:
+ $blockType = $this->decodeBlockType();
+ $body = $this->decodeInstrsUntil([Instrs\Control\End::class])[0];
+ return Instr::Block($blockType, $body);
+ case 0x03:
+ $blockType = $this->decodeBlockType();
+ $body = $this->decodeInstrsUntil([Instrs\Control\End::class])[0];
+ return Instr::Loop($blockType, $body);
+ case 0x04:
+ $blockType = $this->decodeBlockType();
+ [$thenBody, $delimiter] = $this->decodeInstrsUntil([Instrs\Control\End::class, Instrs\Control\Else_::class]);
+ if ($delimiter instanceof Instrs\Control\End) {
+ return Instr::If_($blockType, $thenBody, []);
+ }
+ $elseBody = $this->decodeInstrsUntil([Instrs\Control\End::class])[0];
+ return Instr::If_($blockType, $thenBody, $elseBody);
+ case 0x05: return Instr::Else_();
+ case 0x0B: return Instr::End();
+ case 0x0C: return Instr::Br($this->decodeLabelIdx());
+ case 0x0D: return Instr::BrIf($this->decodeLabelIdx());
+ case 0x0E:
+ $labelTable = $this->decodeVec($this->decodeLabelIdx(...));
+ $defaultLabel = $this->decodeLabelIdx();
+ return Instr::BrTable($labelTable, $defaultLabel);
+ case 0x0F: return Instr::Return_();
+ case 0x10: return Instr::Call($this->decodeFuncIdx());
+ case 0x11:
+ $type = $this->decodeTypeIdx();
+ $funcTable = $this->decodeTableIdx();
+ return Instr::CallIndirect($funcTable, $type);
+ case 0x1A: return Instr::Drop();
+ case 0x1B: return Instr::Select([]);
+ case 0x1C: return Instr::Select($this->decodeVec($this->decodeValType(...)));
+ case 0x20: return Instr::LocalGet($this->decodeLocalIdx());
+ case 0x21: return Instr::LocalSet($this->decodeLocalIdx());
+ case 0x22: return Instr::LocalTee($this->decodeLocalIdx());
+ case 0x23: return Instr::GlobalGet($this->decodeGlobalIdx());
+ case 0x24: return Instr::GlobalSet($this->decodeGlobalIdx());
+ case 0x25: return Instr::TableGet($this->decodeTableIdx());
+ case 0x26: return Instr::TableSet($this->decodeTableIdx());
+ case 0x28: return Instr::I32Load(...$this->decodeMemArg());
+ case 0x29: return Instr::I64Load(...$this->decodeMemArg());
+ case 0x2A: return Instr::F32Load(...$this->decodeMemArg());
+ case 0x2B: return Instr::F64Load(...$this->decodeMemArg());
+ case 0x2C: return Instr::I32Load8S(...$this->decodeMemArg());
+ case 0x2D: return Instr::I32Load8U(...$this->decodeMemArg());
+ case 0x2E: return Instr::I32Load16S(...$this->decodeMemArg());
+ case 0x2F: return Instr::I32Load16U(...$this->decodeMemArg());
+ case 0x30: return Instr::I64Load8S(...$this->decodeMemArg());
+ case 0x31: return Instr::I64Load8U(...$this->decodeMemArg());
+ case 0x32: return Instr::I64Load16S(...$this->decodeMemArg());
+ case 0x33: return Instr::I64Load16U(...$this->decodeMemArg());
+ case 0x34: return Instr::I64Load32S(...$this->decodeMemArg());
+ case 0x35: return Instr::I64Load32U(...$this->decodeMemArg());
+ case 0x36: return Instr::I32Store(...$this->decodeMemArg());
+ case 0x37: return Instr::I64Store(...$this->decodeMemArg());
+ case 0x38: return Instr::F32Store(...$this->decodeMemArg());
+ case 0x39: return Instr::F64Store(...$this->decodeMemArg());
+ case 0x3A: return Instr::I32Store8(...$this->decodeMemArg());
+ case 0x3B: return Instr::I32Store16(...$this->decodeMemArg());
+ case 0x3C: return Instr::I64Store8(...$this->decodeMemArg());
+ case 0x3D: return Instr::I64Store16(...$this->decodeMemArg());
+ case 0x3E: return Instr::I64Store32(...$this->decodeMemArg());
+ case 0x3F:
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory size");
+ }
+ return Instr::MemorySize();
+ case 0x40:
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory grow");
+ }
+ return Instr::MemoryGrow();
+ case 0x41: return Instr::I32Const($this->decodeS32());
+ case 0x42: return Instr::I64Const($this->decodeS64());
+ case 0x43: return Instr::F32Const($this->decodeF32());
+ case 0x44: return Instr::F64Const($this->decodeF64());
+ case 0x45: return Instr::I32Eqz();
+ case 0x46: return Instr::I32Eq();
+ case 0x47: return Instr::I32Ne();
+ case 0x48: return Instr::I32LtS();
+ case 0x49: return Instr::I32LtU();
+ case 0x4A: return Instr::I32GtS();
+ case 0x4B: return Instr::I32GtU();
+ case 0x4C: return Instr::I32LeS();
+ case 0x4D: return Instr::I32LeU();
+ case 0x4E: return Instr::I32GeS();
+ case 0x4F: return Instr::I32GeU();
+ case 0x50: return Instr::I64Eqz();
+ case 0x51: return Instr::I64Eq();
+ case 0x52: return Instr::I64Ne();
+ case 0x53: return Instr::I64LtS();
+ case 0x54: return Instr::I64LtU();
+ case 0x55: return Instr::I64GtS();
+ case 0x56: return Instr::I64GtU();
+ case 0x57: return Instr::I64LeS();
+ case 0x58: return Instr::I64LeU();
+ case 0x59: return Instr::I64GeS();
+ case 0x5A: return Instr::I64GeU();
+ case 0x5B: return Instr::F32Eq();
+ case 0x5C: return Instr::F32Ne();
+ case 0x5D: return Instr::F32Lt();
+ case 0x5E: return Instr::F32Gt();
+ case 0x5F: return Instr::F32Le();
+ case 0x60: return Instr::F32Ge();
+ case 0x61: return Instr::F64Eq();
+ case 0x62: return Instr::F64Ne();
+ case 0x63: return Instr::F64Lt();
+ case 0x64: return Instr::F64Gt();
+ case 0x65: return Instr::F64Le();
+ case 0x66: return Instr::F64Ge();
+ case 0x67: return Instr::I32Clz();
+ case 0x68: return Instr::I32Ctz();
+ case 0x69: return Instr::I32Popcnt();
+ case 0x6A: return Instr::I32Add();
+ case 0x6B: return Instr::I32Sub();
+ case 0x6C: return Instr::I32Mul();
+ case 0x6D: return Instr::I32DivS();
+ case 0x6E: return Instr::I32DivU();
+ case 0x6F: return Instr::I32RemS();
+ case 0x70: return Instr::I32RemU();
+ case 0x71: return Instr::I32And();
+ case 0x72: return Instr::I32Or();
+ case 0x73: return Instr::I32Xor();
+ case 0x74: return Instr::I32Shl();
+ case 0x75: return Instr::I32ShrS();
+ case 0x76: return Instr::I32ShrU();
+ case 0x77: return Instr::I32RotL();
+ case 0x78: return Instr::I32RotR();
+ case 0x79: return Instr::I64Clz();
+ case 0x7A: return Instr::I64Ctz();
+ case 0x7B: return Instr::I64Popcnt();
+ case 0x7C: return Instr::I64Add();
+ case 0x7D: return Instr::I64Sub();
+ case 0x7E: return Instr::I64Mul();
+ case 0x7F: return Instr::I64DivS();
+ case 0x80: return Instr::I64DivU();
+ case 0x81: return Instr::I64RemS();
+ case 0x82: return Instr::I64RemU();
+ case 0x83: return Instr::I64And();
+ case 0x84: return Instr::I64Or();
+ case 0x85: return Instr::I64Xor();
+ case 0x86: return Instr::I64Shl();
+ case 0x87: return Instr::I64ShrS();
+ case 0x88: return Instr::I64ShrU();
+ case 0x89: return Instr::I64RotL();
+ case 0x8A: return Instr::I64RotR();
+ case 0x8B: return Instr::F32Abs();
+ case 0x8C: return Instr::F32Neg();
+ case 0x8D: return Instr::F32Ceil();
+ case 0x8E: return Instr::F32Floor();
+ case 0x8F: return Instr::F32Trunc();
+ case 0x90: return Instr::F32Nearest();
+ case 0x91: return Instr::F32Sqrt();
+ case 0x92: return Instr::F32Add();
+ case 0x93: return Instr::F32Sub();
+ case 0x94: return Instr::F32Mul();
+ case 0x95: return Instr::F32Div();
+ case 0x96: return Instr::F32Min();
+ case 0x97: return Instr::F32Max();
+ case 0x98: return Instr::F32CopySign();
+ case 0x99: return Instr::F64Abs();
+ case 0x9A: return Instr::F64Neg();
+ case 0x9B: return Instr::F64Ceil();
+ case 0x9C: return Instr::F64Floor();
+ case 0x9D: return Instr::F64Trunc();
+ case 0x9E: return Instr::F64Nearest();
+ case 0x9F: return Instr::F64Sqrt();
+ case 0xA0: return Instr::F64Add();
+ case 0xA1: return Instr::F64Sub();
+ case 0xA2: return Instr::F64Mul();
+ case 0xA3: return Instr::F64Div();
+ case 0xA4: return Instr::F64Min();
+ case 0xA5: return Instr::F64Max();
+ case 0xA6: return Instr::F64CopySign();
+ case 0xA7: return Instr::I32WrapI64();
+ case 0xA8: return Instr::I32TruncF32S();
+ case 0xA9: return Instr::I32TruncF32U();
+ case 0xAA: return Instr::I32TruncF64S();
+ case 0xAB: return Instr::I32TruncF64U();
+ case 0xAC: return Instr::I64ExtendI32S();
+ case 0xAD: return Instr::I64ExtendI32U();
+ case 0xAE: return Instr::I64TruncF32S();
+ case 0xAF: return Instr::I64TruncF32U();
+ case 0xB0: return Instr::I64TruncF64S();
+ case 0xB1: return Instr::I64TruncF64U();
+ case 0xB2: return Instr::F32ConvertI32S();
+ case 0xB3: return Instr::F32ConvertI32U();
+ case 0xB4: return Instr::F32ConvertI64S();
+ case 0xB5: return Instr::F32ConvertI64U();
+ case 0xB6: return Instr::F32DemoteF64();
+ case 0xB7: return Instr::F64ConvertI32S();
+ case 0xB8: return Instr::F64ConvertI32U();
+ case 0xB9: return Instr::F64ConvertI64S();
+ case 0xBA: return Instr::F64ConvertI64U();
+ case 0xBB: return Instr::F64PromoteF32();
+ case 0xBC: return Instr::I32ReinterpretF32();
+ case 0xBD: return Instr::I64ReinterpretF64();
+ case 0xBE: return Instr::F32ReinterpretI32();
+ case 0xBF: return Instr::F64ReinterpretI64();
+ case 0xC0: return Instr::I32Extend8S();
+ case 0xC1: return Instr::I32Extend16S();
+ case 0xC2: return Instr::I64Extend8S();
+ case 0xC3: return Instr::I64Extend16S();
+ case 0xC4: return Instr::I64Extend32S();
+ case 0xD0: return Instr::RefNull($this->decodeRefType());
+ case 0xD1: return Instr::RefIsNull();
+ case 0xD2: return Instr::RefFunc($this->decodeFuncIdx());
+ case 0xFC:
+ switch ($this->decodeU32()) {
+ case 0: return Instr::I32TruncSatF32S();
+ case 1: return Instr::I32TruncSatF32U();
+ case 2: return Instr::I32TruncSatF64S();
+ case 3: return Instr::I32TruncSatF64U();
+ case 4: return Instr::I64TruncSatF32S();
+ case 5: return Instr::I64TruncSatF32U();
+ case 6: return Instr::I64TruncSatF64S();
+ case 7: return Instr::I64TruncSatF64U();
+ case 8:
+ $data = $this->decodeDataIdx();
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory init");
+ }
+ return Instr::MemoryInit($data);
+ case 9: return Instr::DataDrop($this->decodeDataIdx());
+ case 10:
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory copy");
+ }
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory copy");
+ }
+ return Instr::MemoryCopy();
+ case 11:
+ if ($this->decodeByte() !== 0) {
+ throw new InvalidBinaryFormatException("memory fill");
+ }
+ return Instr::MemoryFill();
+ case 12:
+ $from = $this->decodeElemIdx();
+ $to = $this->decodeTableIdx();
+ return Instr::TableInit($to, $from);
+ case 13: return Instr::ElemDrop($this->decodeElemIdx());
+ case 14:
+ $to = $this->decodeTableIdx();
+ $from = $this->decodeTableIdx();
+ return Instr::TableCopy($to, $from);
+ case 15: return Instr::TableGrow($this->decodeTableIdx());
+ case 16: return Instr::TableSize($this->decodeTableIdx());
+ case 17: return Instr::TableFill($this->decodeTableIdx());
+ default:
+ throw new InvalidBinaryFormatException("instr");
+ }
+ // no break
+ default: throw new InvalidBinaryFormatException("instr");
+ }
+ }
+
+ /**
+ * @return array{0: U32, 1: U32}
+ */
+ private function decodeMemArg(): array
+ {
+ $align = $this->decodeU32();
+ $offset = $this->decodeU32();
+ return [$align, $offset];
+ }
+
+ private function decodeBlockType(): BlockType
+ {
+ $b = $this->peekByte();
+ if ($b === 0x40) {
+ $this->skipNBytes(1);
+ return BlockType::ValType(null);
+ } elseif (in_array($b, [0x7F, 0x7E, 0x7D, 0x7C, 0x7B, 0x70, 0x6F], true)) {
+ return BlockType::ValType($this->decodeValType());
+ } else {
+ $type = $this->decodeS33();
+ if ($type < 0) {
+ throw new InvalidBinaryFormatException("blocktype");
+ }
+ return BlockType::TypeIdx(new TypeIdx($type));
+ }
+ }
+
+ /**
+ * @param list<class-string<Instr>> $delimiters
+ * @return array{0: list<Instr>, 1: Instr}
+ */
+ private function decodeInstrsUntil(array $delimiters): array
+ {
+ $result = [];
+ while (true) {
+ $instr = $this->decodeInstr();
+ if (in_array(get_class($instr), $delimiters, true)) {
+ return [$result, $instr];
+ }
+ $result[] = $instr;
+ }
+ }
+
+ /**
+ * @template T
+ * @param callable(): T $decoder
+ * @return list<T>
+ */
+ private function decodeVec(callable $decoder): array
+ {
+ $count = $this->decodeU32();
+ $result = [];
+ for ($i = 0; $i < $count; $i++) {
+ $result[] = $decoder();
+ }
+ return $result;
+ }
+
+ private function eof(): bool
+ {
+ return strlen($this->input) <= $this->pos;
+ }
+
+ private function ensureNBytesRemains(int $n): void
+ {
+ if ($this->inputSize < $this->pos + $n) {
+ throw new InvalidBinaryFormatException("ensureNBytesRemains");
+ }
+ }
+
+ private function skipNBytes(int $n): void
+ {
+ $this->ensureNBytesRemains($n);
+ $this->pos += $n;
+ }
+
+ private function peekByte(): int
+ {
+ $this->ensureNBytesRemains(1);
+ return ord($this->input[$this->pos]);
+ }
+
+ /**
+ * @phpstan-impure
+ */
+ private function decodeByte(): int
+ {
+ $this->ensureNBytesRemains(1);
+ return ord($this->input[$this->pos++]);
+ }
+
+ private function decodeU32(): int
+ {
+ return $this->decodeUnsignedLeb128(32);
+ }
+
+ private function decodeUnsignedLeb128(int $maxBits): int
+ {
+ $result = 0;
+ $shiftBits = 0;
+ while (true) {
+ $b = $this->decodeByte();
+ $result |= ($b & 0b01111111) << $shiftBits;
+ if ($b < 0b10000000) {
+ return $result;
+ }
+ $shiftBits += 7;
+ if ($maxBits <= $shiftBits) {
+ throw new InvalidBinaryFormatException("unsigned leb128");
+ }
+ }
+ }
+
+ private function decodeSignedLeb128(int $bits): int
+ {
+ $result = 0;
+ $shiftBits = 0;
+ while (true) {
+ $b = $this->decodeByte();
+ $result |= ($b & 0b01111111) << $shiftBits;
+ if ($b < 0b10000000) {
+ if (($b & 0b01000000) !== 0) {
+ $result |= -(1 << $shiftBits);
+ }
+ return $result;
+ }
+ $shiftBits += 7;
+ if ($bits <= $shiftBits) {
+ throw new InvalidBinaryFormatException("signed leb128");
+ }
+ }
+ }
+
+ /**
+ * @return S32
+ */
+ private function decodeS32(): int
+ {
+ return $this->decodeSignedLeb128(32);
+ }
+
+ /**
+ * @return S33
+ */
+ private function decodeS33(): int
+ {
+ return $this->decodeSignedLeb128(33);
+ }
+
+ /**
+ * @return S64
+ */
+ private function decodeS64(): int
+ {
+ return $this->decodeSignedLeb128(64);
+ }
+
+ /**
+ * @return F32
+ */
+ private function decodeF32(): float
+ {
+ $this->ensureNBytesRemains(4);
+ $result = unpack('g', $this->input, $this->pos);
+ if ($result === false) {
+ throw new InvalidBinaryFormatException("f32");
+ }
+ assert(isset($result[1]) && is_float($result[1]));
+ return $result[1];
+ }
+
+ /**
+ * @return F64
+ */
+ private function decodeF64(): float
+ {
+ $this->ensureNBytesRemains(8);
+ $result = unpack('e', $this->input, $this->pos);
+ if ($result === false) {
+ throw new InvalidBinaryFormatException("f64");
+ }
+ assert(isset($result[1]) && is_float($result[1]));
+ return $result[1];
+ }
+
+ /**
+ * @return Name
+ */
+ private function decodeName(): string
+ {
+ $bytes = $this->decodeVec($this->decodeByte(...));
+ $name = $this->implodeUtf8BytesToString($bytes);
+ if ($name === null) {
+ throw new InvalidBinaryFormatException("name");
+ }
+ return $name;
+ }
+
+ /**
+ * @param list<int> $bytes
+ */
+ private function implodeUtf8BytesToString(array $bytes): ?string
+ {
+ $s = '';
+ $count = count($bytes);
+ for ($i = 0; $i < $count; $i++) {
+ if (($bytes[$i] & 0x80) === 0) {
+ $code = $bytes[$i];
+ } elseif (($bytes[$i] & 0xE0) === 0xC0) {
+ if ($count <= $i + 1) {
+ return null;
+ }
+ $code = (($bytes[$i] & 0x1F) << 6) | ($bytes[$i + 1] & 0x3F);
+ $i++;
+ } elseif (($bytes[$i] & 0xF0) === 0xE0) {
+ if ($count <= $i + 2) {
+ return null;
+ }
+ $code = (($bytes[$i] & 0x0F) << 12) | (($bytes[$i + 1] & 0x3F) << 6) | ($bytes[$i + 2] & 0x3F);
+ $i += 2;
+ } elseif (($bytes[$i] & 0xF8) === 0xF0) {
+ if ($count <= $i + 3) {
+ return null;
+ }
+ $code = (($bytes[$i] & 0x07) << 18) | (($bytes[$i + 1] & 0x3F) << 12) | (($bytes[$i + 2] & 0x3F) << 6) | ($bytes[$i + 3] & 0x3F);
+ $i += 3;
+ } else {
+ return null;
+ }
+ $s .= mb_chr($code, 'UTF-8');
+ }
+ return $s;
+ }
+}
diff --git a/src/BinaryFormat/InvalidBinaryFormatException.php b/src/BinaryFormat/InvalidBinaryFormatException.php
new file mode 100644
index 0000000..59b046c
--- /dev/null
+++ b/src/BinaryFormat/InvalidBinaryFormatException.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\BinaryFormat;
+
+use RuntimeException;
+
+class InvalidBinaryFormatException extends RuntimeException
+{
+}
diff --git a/src/BinaryFormat/Locals.php b/src/BinaryFormat/Locals.php
new file mode 100644
index 0000000..de190a8
--- /dev/null
+++ b/src/BinaryFormat/Locals.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\BinaryFormat;
+
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+final readonly class Locals
+{
+ /**
+ * @param U32 $count
+ */
+ public function __construct(
+ public int $count,
+ public ValType $type,
+ ) {
+ }
+}
diff --git a/src/BinaryFormat/SectionId.php b/src/BinaryFormat/SectionId.php
new file mode 100644
index 0000000..f11063f
--- /dev/null
+++ b/src/BinaryFormat/SectionId.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\BinaryFormat;
+
+enum SectionId: int
+{
+ case Custom = 0;
+ case Type = 1;
+ case Import = 2;
+ case Func = 3;
+ case Table = 4;
+ case Mem = 5;
+ case Global = 6;
+ case Export = 7;
+ case Start = 8;
+ case Elem = 9;
+ case Code = 10;
+ case Data = 11;
+ case DataCount = 12;
+}
diff --git a/src/Structure/Instructions/Expr.php b/src/Structure/Instructions/Expr.php
new file mode 100644
index 0000000..ceefcc0
--- /dev/null
+++ b/src/Structure/Instructions/Expr.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions;
+
+final readonly class Expr
+{
+ /**
+ * @var non-empty-list<Instr>
+ */
+ public array $instrs;
+
+ /**
+ * @param list<Instr> $instrs
+ */
+ public function __construct(
+ array $instrs,
+ ) {
+ $instrs[] = Instr::End();
+ $this->instrs = $instrs;
+ }
+}
diff --git a/src/Structure/Instructions/Instr.php b/src/Structure/Instructions/Instr.php
new file mode 100644
index 0000000..f4f85cc
--- /dev/null
+++ b/src/Structure/Instructions/Instr.php
@@ -0,0 +1,977 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockType;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Parametric;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Reference;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+use Nsfisis\Waddiwasi\Structure\Types\DataIdx;
+use Nsfisis\Waddiwasi\Structure\Types\ElemIdx;
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+use Nsfisis\Waddiwasi\Structure\Types\LabelIdx;
+use Nsfisis\Waddiwasi\Structure\Types\LocalIdx;
+use Nsfisis\Waddiwasi\Structure\Types\RefType;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+abstract readonly class Instr
+{
+ // Numeric instructions
+ final public static function F32Abs(): Numeric\F32Abs
+ {
+ return new Numeric\F32Abs();
+ }
+ final public static function F32Add(): Numeric\F32Add
+ {
+ return new Numeric\F32Add();
+ }
+ final public static function F32Ceil(): Numeric\F32Ceil
+ {
+ return new Numeric\F32Ceil();
+ }
+ /**
+ * @param F32 $value
+ */
+ final public static function F32Const(float $value): Numeric\F32Const
+ {
+ return new Numeric\F32Const($value);
+ }
+ final public static function F32ConvertI32S(): Numeric\F32ConvertI32S
+ {
+ return new Numeric\F32ConvertI32S();
+ }
+ final public static function F32ConvertI32U(): Numeric\F32ConvertI32U
+ {
+ return new Numeric\F32ConvertI32U();
+ }
+ final public static function F32ConvertI64S(): Numeric\F32ConvertI64S
+ {
+ return new Numeric\F32ConvertI64S();
+ }
+ final public static function F32ConvertI64U(): Numeric\F32ConvertI64U
+ {
+ return new Numeric\F32ConvertI64U();
+ }
+ final public static function F32CopySign(): Numeric\F32CopySign
+ {
+ return new Numeric\F32CopySign();
+ }
+ final public static function F32DemoteF64(): Numeric\F32DemoteF64
+ {
+ return new Numeric\F32DemoteF64();
+ }
+ final public static function F32Div(): Numeric\F32Div
+ {
+ return new Numeric\F32Div();
+ }
+ final public static function F32Eq(): Numeric\F32Eq
+ {
+ return new Numeric\F32Eq();
+ }
+ final public static function F32Floor(): Numeric\F32Floor
+ {
+ return new Numeric\F32Floor();
+ }
+ final public static function F32Ge(): Numeric\F32Ge
+ {
+ return new Numeric\F32Ge();
+ }
+ final public static function F32Gt(): Numeric\F32Gt
+ {
+ return new Numeric\F32Gt();
+ }
+ final public static function F32Le(): Numeric\F32Le
+ {
+ return new Numeric\F32Le();
+ }
+ final public static function F32Lt(): Numeric\F32Lt
+ {
+ return new Numeric\F32Lt();
+ }
+ final public static function F32Max(): Numeric\F32Max
+ {
+ return new Numeric\F32Max();
+ }
+ final public static function F32Min(): Numeric\F32Min
+ {
+ return new Numeric\F32Min();
+ }
+ final public static function F32Mul(): Numeric\F32Mul
+ {
+ return new Numeric\F32Mul();
+ }
+ final public static function F32Ne(): Numeric\F32Ne
+ {
+ return new Numeric\F32Ne();
+ }
+ final public static function F32Nearest(): Numeric\F32Nearest
+ {
+ return new Numeric\F32Nearest();
+ }
+ final public static function F32Neg(): Numeric\F32Neg
+ {
+ return new Numeric\F32Neg();
+ }
+ final public static function F32ReinterpretI32(): Numeric\F32ReinterpretI32
+ {
+ return new Numeric\F32ReinterpretI32();
+ }
+ final public static function F32ReinterpretI64(): Numeric\F32ReinterpretI64
+ {
+ return new Numeric\F32ReinterpretI64();
+ }
+ final public static function F32Sqrt(): Numeric\F32Sqrt
+ {
+ return new Numeric\F32Sqrt();
+ }
+ final public static function F32Sub(): Numeric\F32Sub
+ {
+ return new Numeric\F32Sub();
+ }
+ final public static function F32Trunc(): Numeric\F32Trunc
+ {
+ return new Numeric\F32Trunc();
+ }
+ final public static function F64Abs(): Numeric\F64Abs
+ {
+ return new Numeric\F64Abs();
+ }
+ final public static function F64Add(): Numeric\F64Add
+ {
+ return new Numeric\F64Add();
+ }
+ final public static function F64Ceil(): Numeric\F64Ceil
+ {
+ return new Numeric\F64Ceil();
+ }
+ /**
+ * @param F64 $value
+ */
+ final public static function F64Const(float $value): Numeric\F64Const
+ {
+ return new Numeric\F64Const($value);
+ }
+ final public static function F64ConvertI32S(): Numeric\F64ConvertI32S
+ {
+ return new Numeric\F64ConvertI32S();
+ }
+ final public static function F64ConvertI32U(): Numeric\F64ConvertI32U
+ {
+ return new Numeric\F64ConvertI32U();
+ }
+ final public static function F64ConvertI64S(): Numeric\F64ConvertI64S
+ {
+ return new Numeric\F64ConvertI64S();
+ }
+ final public static function F64ConvertI64U(): Numeric\F64ConvertI64U
+ {
+ return new Numeric\F64ConvertI64U();
+ }
+ final public static function F64CopySign(): Numeric\F64CopySign
+ {
+ return new Numeric\F64CopySign();
+ }
+ final public static function F64Div(): Numeric\F64Div
+ {
+ return new Numeric\F64Div();
+ }
+ final public static function F64Eq(): Numeric\F64Eq
+ {
+ return new Numeric\F64Eq();
+ }
+ final public static function F64Floor(): Numeric\F64Floor
+ {
+ return new Numeric\F64Floor();
+ }
+ final public static function F64Ge(): Numeric\F64Ge
+ {
+ return new Numeric\F64Ge();
+ }
+ final public static function F64Gt(): Numeric\F64Gt
+ {
+ return new Numeric\F64Gt();
+ }
+ final public static function F64Le(): Numeric\F64Le
+ {
+ return new Numeric\F64Le();
+ }
+ final public static function F64Lt(): Numeric\F64Lt
+ {
+ return new Numeric\F64Lt();
+ }
+ final public static function F64Max(): Numeric\F64Max
+ {
+ return new Numeric\F64Max();
+ }
+ final public static function F64Min(): Numeric\F64Min
+ {
+ return new Numeric\F64Min();
+ }
+ final public static function F64Mul(): Numeric\F64Mul
+ {
+ return new Numeric\F64Mul();
+ }
+ final public static function F64Ne(): Numeric\F64Ne
+ {
+ return new Numeric\F64Ne();
+ }
+ final public static function F64Nearest(): Numeric\F64Nearest
+ {
+ return new Numeric\F64Nearest();
+ }
+ final public static function F64Neg(): Numeric\F64Neg
+ {
+ return new Numeric\F64Neg();
+ }
+ final public static function F64PromoteF32(): Numeric\F64PromoteF32
+ {
+ return new Numeric\F64PromoteF32();
+ }
+ final public static function F64ReinterpretI32(): Numeric\F64ReinterpretI32
+ {
+ return new Numeric\F64ReinterpretI32();
+ }
+ final public static function F64ReinterpretI64(): Numeric\F64ReinterpretI64
+ {
+ return new Numeric\F64ReinterpretI64();
+ }
+ final public static function F64Sqrt(): Numeric\F64Sqrt
+ {
+ return new Numeric\F64Sqrt();
+ }
+ final public static function F64Sub(): Numeric\F64Sub
+ {
+ return new Numeric\F64Sub();
+ }
+ final public static function F64Trunc(): Numeric\F64Trunc
+ {
+ return new Numeric\F64Trunc();
+ }
+ final public static function I32Add(): Numeric\I32Add
+ {
+ return new Numeric\I32Add();
+ }
+ final public static function I32And(): Numeric\I32And
+ {
+ return new Numeric\I32And();
+ }
+ final public static function I32Clz(): Numeric\I32Clz
+ {
+ return new Numeric\I32Clz();
+ }
+ /**
+ * @param S64 $value
+ */
+ final public static function I32Const(int $value): Numeric\I32Const
+ {
+ return new Numeric\I32Const($value);
+ }
+ final public static function I32Ctz(): Numeric\I32Ctz
+ {
+ return new Numeric\I32Ctz();
+ }
+ final public static function I32DivS(): Numeric\I32DivS
+ {
+ return new Numeric\I32DivS();
+ }
+ final public static function I32DivU(): Numeric\I32DivU
+ {
+ return new Numeric\I32DivU();
+ }
+ final public static function I32Eq(): Numeric\I32Eq
+ {
+ return new Numeric\I32Eq();
+ }
+ final public static function I32Eqz(): Numeric\I32Eqz
+ {
+ return new Numeric\I32Eqz();
+ }
+ final public static function I32Extend16S(): Numeric\I32Extend16S
+ {
+ return new Numeric\I32Extend16S();
+ }
+ final public static function I32Extend8S(): Numeric\I32Extend8S
+ {
+ return new Numeric\I32Extend8S();
+ }
+ final public static function I32GeS(): Numeric\I32GeS
+ {
+ return new Numeric\I32GeS();
+ }
+ final public static function I32GeU(): Numeric\I32GeU
+ {
+ return new Numeric\I32GeU();
+ }
+ final public static function I32GtS(): Numeric\I32GtS
+ {
+ return new Numeric\I32GtS();
+ }
+ final public static function I32GtU(): Numeric\I32GtU
+ {
+ return new Numeric\I32GtU();
+ }
+ final public static function I32LeS(): Numeric\I32LeS
+ {
+ return new Numeric\I32LeS();
+ }
+ final public static function I32LeU(): Numeric\I32LeU
+ {
+ return new Numeric\I32LeU();
+ }
+ final public static function I32LtS(): Numeric\I32LtS
+ {
+ return new Numeric\I32LtS();
+ }
+ final public static function I32LtU(): Numeric\I32LtU
+ {
+ return new Numeric\I32LtU();
+ }
+ final public static function I32Mul(): Numeric\I32Mul
+ {
+ return new Numeric\I32Mul();
+ }
+ final public static function I32Ne(): Numeric\I32Ne
+ {
+ return new Numeric\I32Ne();
+ }
+ final public static function I32Or(): Numeric\I32Or
+ {
+ return new Numeric\I32Or();
+ }
+ final public static function I32Popcnt(): Numeric\I32Popcnt
+ {
+ return new Numeric\I32Popcnt();
+ }
+ final public static function I32ReinterpretF32(): Numeric\I32ReinterpretF32
+ {
+ return new Numeric\I32ReinterpretF32();
+ }
+ final public static function I32ReinterpretF64(): Numeric\I32ReinterpretF64
+ {
+ return new Numeric\I32ReinterpretF64();
+ }
+ final public static function I32RemS(): Numeric\I32RemS
+ {
+ return new Numeric\I32RemS();
+ }
+ final public static function I32RemU(): Numeric\I32RemU
+ {
+ return new Numeric\I32RemU();
+ }
+ final public static function I32RotL(): Numeric\I32RotL
+ {
+ return new Numeric\I32RotL();
+ }
+ final public static function I32RotR(): Numeric\I32RotR
+ {
+ return new Numeric\I32RotR();
+ }
+ final public static function I32Shl(): Numeric\I32Shl
+ {
+ return new Numeric\I32Shl();
+ }
+ final public static function I32ShrS(): Numeric\I32ShrS
+ {
+ return new Numeric\I32ShrS();
+ }
+ final public static function I32ShrU(): Numeric\I32ShrU
+ {
+ return new Numeric\I32ShrU();
+ }
+ final public static function I32Sub(): Numeric\I32Sub
+ {
+ return new Numeric\I32Sub();
+ }
+ final public static function I32TruncF32S(): Numeric\I32TruncF32S
+ {
+ return new Numeric\I32TruncF32S();
+ }
+ final public static function I32TruncF32U(): Numeric\I32TruncF32U
+ {
+ return new Numeric\I32TruncF32U();
+ }
+ final public static function I32TruncF64S(): Numeric\I32TruncF64S
+ {
+ return new Numeric\I32TruncF64S();
+ }
+ final public static function I32TruncF64U(): Numeric\I32TruncF64U
+ {
+ return new Numeric\I32TruncF64U();
+ }
+ final public static function I32TruncSatF32S(): Numeric\I32TruncSatF32S
+ {
+ return new Numeric\I32TruncSatF32S();
+ }
+ final public static function I32TruncSatF32U(): Numeric\I32TruncSatF32U
+ {
+ return new Numeric\I32TruncSatF32U();
+ }
+ final public static function I32TruncSatF64S(): Numeric\I32TruncSatF64S
+ {
+ return new Numeric\I32TruncSatF64S();
+ }
+ final public static function I32TruncSatF64U(): Numeric\I32TruncSatF64U
+ {
+ return new Numeric\I32TruncSatF64U();
+ }
+ final public static function I32WrapI64(): Numeric\I32WrapI64
+ {
+ return new Numeric\I32WrapI64();
+ }
+ final public static function I32Xor(): Numeric\I32Xor
+ {
+ return new Numeric\I32Xor();
+ }
+ final public static function I64Add(): Numeric\I64Add
+ {
+ return new Numeric\I64Add();
+ }
+ final public static function I64And(): Numeric\I64And
+ {
+ return new Numeric\I64And();
+ }
+ final public static function I64Clz(): Numeric\I64Clz
+ {
+ return new Numeric\I64Clz();
+ }
+ /**
+ * @param S64 $value
+ */
+ final public static function I64Const(int $value): Numeric\I64Const
+ {
+ return new Numeric\I64Const($value);
+ }
+ final public static function I64Ctz(): Numeric\I64Ctz
+ {
+ return new Numeric\I64Ctz();
+ }
+ final public static function I64DivS(): Numeric\I64DivS
+ {
+ return new Numeric\I64DivS();
+ }
+ final public static function I64DivU(): Numeric\I64DivU
+ {
+ return new Numeric\I64DivU();
+ }
+ final public static function I64Eq(): Numeric\I64Eq
+ {
+ return new Numeric\I64Eq();
+ }
+ final public static function I64Eqz(): Numeric\I64Eqz
+ {
+ return new Numeric\I64Eqz();
+ }
+ final public static function I64Extend16S(): Numeric\I64Extend16S
+ {
+ return new Numeric\I64Extend16S();
+ }
+ final public static function I64Extend32S(): Numeric\I64Extend32S
+ {
+ return new Numeric\I64Extend32S();
+ }
+ final public static function I64Extend8S(): Numeric\I64Extend8S
+ {
+ return new Numeric\I64Extend8S();
+ }
+ final public static function I64ExtendI32S(): Numeric\I64ExtendI32S
+ {
+ return new Numeric\I64ExtendI32S();
+ }
+ final public static function I64ExtendI32U(): Numeric\I64ExtendI32U
+ {
+ return new Numeric\I64ExtendI32U();
+ }
+ final public static function I64GeS(): Numeric\I64GeS
+ {
+ return new Numeric\I64GeS();
+ }
+ final public static function I64GeU(): Numeric\I64GeU
+ {
+ return new Numeric\I64GeU();
+ }
+ final public static function I64GtS(): Numeric\I64GtS
+ {
+ return new Numeric\I64GtS();
+ }
+ final public static function I64GtU(): Numeric\I64GtU
+ {
+ return new Numeric\I64GtU();
+ }
+ final public static function I64LeS(): Numeric\I64LeS
+ {
+ return new Numeric\I64LeS();
+ }
+ final public static function I64LeU(): Numeric\I64LeU
+ {
+ return new Numeric\I64LeU();
+ }
+ final public static function I64LtS(): Numeric\I64LtS
+ {
+ return new Numeric\I64LtS();
+ }
+ final public static function I64LtU(): Numeric\I64LtU
+ {
+ return new Numeric\I64LtU();
+ }
+ final public static function I64Mul(): Numeric\I64Mul
+ {
+ return new Numeric\I64Mul();
+ }
+ final public static function I64Ne(): Numeric\I64Ne
+ {
+ return new Numeric\I64Ne();
+ }
+ final public static function I64Or(): Numeric\I64Or
+ {
+ return new Numeric\I64Or();
+ }
+ final public static function I64Popcnt(): Numeric\I64Popcnt
+ {
+ return new Numeric\I64Popcnt();
+ }
+ final public static function I64ReinterpretF32(): Numeric\I64ReinterpretF32
+ {
+ return new Numeric\I64ReinterpretF32();
+ }
+ final public static function I64ReinterpretF64(): Numeric\I64ReinterpretF64
+ {
+ return new Numeric\I64ReinterpretF64();
+ }
+ final public static function I64RemS(): Numeric\I64RemS
+ {
+ return new Numeric\I64RemS();
+ }
+ final public static function I64RemU(): Numeric\I64RemU
+ {
+ return new Numeric\I64RemU();
+ }
+ final public static function I64RotL(): Numeric\I64RotL
+ {
+ return new Numeric\I64RotL();
+ }
+ final public static function I64RotR(): Numeric\I64RotR
+ {
+ return new Numeric\I64RotR();
+ }
+ final public static function I64Shl(): Numeric\I64Shl
+ {
+ return new Numeric\I64Shl();
+ }
+ final public static function I64ShrS(): Numeric\I64ShrS
+ {
+ return new Numeric\I64ShrS();
+ }
+ final public static function I64ShrU(): Numeric\I64ShrU
+ {
+ return new Numeric\I64ShrU();
+ }
+ final public static function I64Sub(): Numeric\I64Sub
+ {
+ return new Numeric\I64Sub();
+ }
+ final public static function I64TruncF32S(): Numeric\I64TruncF32S
+ {
+ return new Numeric\I64TruncF32S();
+ }
+ final public static function I64TruncF32U(): Numeric\I64TruncF32U
+ {
+ return new Numeric\I64TruncF32U();
+ }
+ final public static function I64TruncF64S(): Numeric\I64TruncF64S
+ {
+ return new Numeric\I64TruncF64S();
+ }
+ final public static function I64TruncF64U(): Numeric\I64TruncF64U
+ {
+ return new Numeric\I64TruncF64U();
+ }
+ final public static function I64TruncSatF32S(): Numeric\I64TruncSatF32S
+ {
+ return new Numeric\I64TruncSatF32S();
+ }
+ final public static function I64TruncSatF32U(): Numeric\I64TruncSatF32U
+ {
+ return new Numeric\I64TruncSatF32U();
+ }
+ final public static function I64TruncSatF64S(): Numeric\I64TruncSatF64S
+ {
+ return new Numeric\I64TruncSatF64S();
+ }
+ final public static function I64TruncSatF64U(): Numeric\I64TruncSatF64U
+ {
+ return new Numeric\I64TruncSatF64U();
+ }
+ final public static function I64Xor(): Numeric\I64Xor
+ {
+ return new Numeric\I64Xor();
+ }
+
+ // Reference instructions
+ final public static function RefFunc(FuncIdx $func): Reference\RefFunc
+ {
+ return new Reference\RefFunc($func);
+ }
+ final public static function RefIsNull(): Reference\RefIsNull
+ {
+ return new Reference\RefIsNull();
+ }
+ final public static function RefNull(RefType $type): Reference\RefNull
+ {
+ return new Reference\RefNull($type);
+ }
+
+ // Parametric instructions
+ final public static function Drop(): Parametric\Drop
+ {
+ return new Parametric\Drop();
+ }
+ /**
+ * @param list<ValType> $types
+ */
+ final public static function Select(array $types): Parametric\Select
+ {
+ return new Parametric\Select($types);
+ }
+
+ // Variable instructions
+ final public static function GlobalGet(GlobalIdx $var): Variable\GlobalGet
+ {
+ return new Variable\GlobalGet($var);
+ }
+ final public static function GlobalSet(GlobalIdx $var): Variable\GlobalSet
+ {
+ return new Variable\GlobalSet($var);
+ }
+ final public static function LocalGet(LocalIdx $var): Variable\LocalGet
+ {
+ return new Variable\LocalGet($var);
+ }
+ final public static function LocalSet(LocalIdx $var): Variable\LocalSet
+ {
+ return new Variable\LocalSet($var);
+ }
+ final public static function LocalTee(LocalIdx $var): Variable\LocalTee
+ {
+ return new Variable\LocalTee($var);
+ }
+
+ // Table instructions
+ final public static function ElemDrop(ElemIdx $elem): Table\ElemDrop
+ {
+ return new Table\ElemDrop($elem);
+ }
+ final public static function TableCopy(TableIdx $to, TableIdx $from): Table\TableCopy
+ {
+ return new Table\TableCopy($to, $from);
+ }
+ final public static function TableFill(TableIdx $table): Table\TableFill
+ {
+ return new Table\TableFill($table);
+ }
+ final public static function TableGet(TableIdx $table): Table\TableGet
+ {
+ return new Table\TableGet($table);
+ }
+ final public static function TableGrow(TableIdx $table): Table\TableGrow
+ {
+ return new Table\TableGrow($table);
+ }
+ final public static function TableInit(TableIdx $to, ElemIdx $from): Table\TableInit
+ {
+ return new Table\TableInit($to, $from);
+ }
+ final public static function TableSet(TableIdx $table): Table\TableSet
+ {
+ return new Table\TableSet($table);
+ }
+ final public static function TableSize(TableIdx $table): Table\TableSize
+ {
+ return new Table\TableSize($table);
+ }
+
+ // Memory instructions
+ final public static function DataDrop(DataIdx $data): Memory\DataDrop
+ {
+ return new Memory\DataDrop($data);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function F32Load(int $offset, int $align): Memory\F32Load
+ {
+ return new Memory\F32Load($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function F32Store(int $offset, int $align): Memory\F32Store
+ {
+ return new Memory\F32Store($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function F64Load(int $offset, int $align): Memory\F64Load
+ {
+ return new Memory\F64Load($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function F64Store(int $offset, int $align): Memory\F64Store
+ {
+ return new Memory\F64Store($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Load(int $offset, int $align): Memory\I32Load
+ {
+ return new Memory\I32Load($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Load16S(int $offset, int $align): Memory\I32Load16S
+ {
+ return new Memory\I32Load16S($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Load16U(int $offset, int $align): Memory\I32Load16U
+ {
+ return new Memory\I32Load16U($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Load8S(int $offset, int $align): Memory\I32Load8S
+ {
+ return new Memory\I32Load8S($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Load8U(int $offset, int $align): Memory\I32Load8U
+ {
+ return new Memory\I32Load8U($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Store(int $offset, int $align): Memory\I32Store
+ {
+ return new Memory\I32Store($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Store16(int $offset, int $align): Memory\I32Store16
+ {
+ return new Memory\I32Store16($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I32Store8(int $offset, int $align): Memory\I32Store8
+ {
+ return new Memory\I32Store8($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load(int $offset, int $align): Memory\I64Load
+ {
+ return new Memory\I64Load($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load16S(int $offset, int $align): Memory\I64Load16S
+ {
+ return new Memory\I64Load16S($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load16U(int $offset, int $align): Memory\I64Load16U
+ {
+ return new Memory\I64Load16U($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load32S(int $offset, int $align): Memory\I64Load32S
+ {
+ return new Memory\I64Load32S($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load32U(int $offset, int $align): Memory\I64Load32U
+ {
+ return new Memory\I64Load32U($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load8S(int $offset, int $align): Memory\I64Load8S
+ {
+ return new Memory\I64Load8S($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Load8U(int $offset, int $align): Memory\I64Load8U
+ {
+ return new Memory\I64Load8U($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Store(int $offset, int $align): Memory\I64Store
+ {
+ return new Memory\I64Store($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Store16(int $offset, int $align): Memory\I64Store16
+ {
+ return new Memory\I64Store16($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Store32(int $offset, int $align): Memory\I64Store32
+ {
+ return new Memory\I64Store32($offset, $align);
+ }
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ final public static function I64Store8(int $offset, int $align): Memory\I64Store8
+ {
+ return new Memory\I64Store8($offset, $align);
+ }
+ final public static function MemoryCopy(): Memory\MemoryCopy
+ {
+ return new Memory\MemoryCopy();
+ }
+ final public static function MemoryFill(): Memory\MemoryFill
+ {
+ return new Memory\MemoryFill();
+ }
+ final public static function MemoryGrow(): Memory\MemoryGrow
+ {
+ return new Memory\MemoryGrow();
+ }
+ final public static function MemoryInit(DataIdx $data): Memory\MemoryInit
+ {
+ return new Memory\MemoryInit($data);
+ }
+ final public static function MemorySize(): Memory\MemorySize
+ {
+ return new Memory\MemorySize();
+ }
+
+ // Control instructions
+ /**
+ * @param list<Instr> $body
+ */
+ final public static function Block(BlockType $type, array $body): Control\Block
+ {
+ return new Control\Block($type, $body);
+ }
+ final public static function Br(LabelIdx $label): Control\Br
+ {
+ return new Control\Br($label);
+ }
+ final public static function BrIf(LabelIdx $label): Control\BrIf
+ {
+ return new Control\BrIf($label);
+ }
+ /**
+ * @param list<LabelIdx> $labelTable
+ */
+ final public static function BrTable(array $labelTable, LabelIdx $defaultLabel): Control\BrTable
+ {
+ return new Control\BrTable($labelTable, $defaultLabel);
+ }
+ final public static function Call(FuncIdx $func): Control\Call
+ {
+ return new Control\Call($func);
+ }
+ final public static function CallIndirect(TableIdx $funcTable, TypeIdx $type): Control\CallIndirect
+ {
+ return new Control\CallIndirect($funcTable, $type);
+ }
+ final public static function Else_(): Control\Else_
+ {
+ return new Control\Else_();
+ }
+ final public static function End(): Control\End
+ {
+ return new Control\End();
+ }
+ /**
+ * @param list<Instr> $thenBody
+ * @param list<Instr> $elseBody
+ */
+ final public static function If_(BlockType $type, array $thenBody, array $elseBody): Control\If_
+ {
+ return new Control\If_($type, $thenBody, $elseBody);
+ }
+ /**
+ * @param list<Instr> $body
+ */
+ final public static function Loop(BlockType $type, array $body): Control\Loop
+ {
+ return new Control\Loop($type, $body);
+ }
+ final public static function Nop(): Control\Nop
+ {
+ return new Control\Nop();
+ }
+ final public static function Return_(): Control\Return_
+ {
+ return new Control\Return_();
+ }
+ final public static function Unreachable(): Control\Unreachable
+ {
+ return new Control\Unreachable();
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Block.php b/src/Structure/Instructions/Instrs/Control/Block.php
new file mode 100644
index 0000000..2be7a1f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Block.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Block extends Instr
+{
+ /**
+ * @param list<Instr> $body
+ */
+ public function __construct(
+ public BlockType $type,
+ public array $body,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/BlockType.php b/src/Structure/Instructions/Instrs/Control/BlockType.php
new file mode 100644
index 0000000..68c6bd4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/BlockType.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+abstract readonly class BlockType
+{
+ final public static function TypeIdx(TypeIdx $type): BlockTypes\TypeIdx
+ {
+ return new BlockTypes\TypeIdx($type);
+ }
+
+ final public static function ValType(?ValType $type): BlockTypes\ValType
+ {
+ return new BlockTypes\ValType($type);
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php b/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php
new file mode 100644
index 0000000..b633bb7
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockTypes;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockType;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx as OrigTypeIdx;
+
+final readonly class TypeIdx extends BlockType
+{
+ protected function __construct(public OrigTypeIdx $inner)
+ {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/BlockTypes/ValType.php b/src/Structure/Instructions/Instrs/Control/BlockTypes/ValType.php
new file mode 100644
index 0000000..1a56ce4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/BlockTypes/ValType.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockTypes;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockType;
+use Nsfisis\Waddiwasi\Structure\Types\ValType as OrigValType;
+
+final readonly class ValType extends BlockType
+{
+ protected function __construct(public ?OrigValType $inner)
+ {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Br.php b/src/Structure/Instructions/Instrs/Control/Br.php
new file mode 100644
index 0000000..836f3f1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Br.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LabelIdx;
+
+final readonly class Br extends Instr
+{
+ public function __construct(
+ public LabelIdx $label,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/BrIf.php b/src/Structure/Instructions/Instrs/Control/BrIf.php
new file mode 100644
index 0000000..a15a716
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/BrIf.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LabelIdx;
+
+final readonly class BrIf extends Instr
+{
+ public function __construct(
+ public LabelIdx $label,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/BrTable.php b/src/Structure/Instructions/Instrs/Control/BrTable.php
new file mode 100644
index 0000000..57a08f3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/BrTable.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LabelIdx;
+
+final readonly class BrTable extends Instr
+{
+ /**
+ * @param list<LabelIdx> $labelTable
+ */
+ public function __construct(
+ public array $labelTable,
+ public LabelIdx $defaultLabel,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Call.php b/src/Structure/Instructions/Instrs/Control/Call.php
new file mode 100644
index 0000000..c8702d3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Call.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+
+final readonly class Call extends Instr
+{
+ public function __construct(
+ public FuncIdx $func,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/CallIndirect.php b/src/Structure/Instructions/Instrs/Control/CallIndirect.php
new file mode 100644
index 0000000..2cf28a5
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/CallIndirect.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+
+final readonly class CallIndirect extends Instr
+{
+ public function __construct(
+ public TableIdx $funcTable,
+ public TypeIdx $type,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Else_.php b/src/Structure/Instructions/Instrs/Control/Else_.php
new file mode 100644
index 0000000..665b11f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Else_.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Else_ extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Control/End.php b/src/Structure/Instructions/Instrs/Control/End.php
new file mode 100644
index 0000000..275dc6d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/End.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class End extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Control/If_.php b/src/Structure/Instructions/Instrs/Control/If_.php
new file mode 100644
index 0000000..0536be0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/If_.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class If_ extends Instr
+{
+ /**
+ * @param list<Instr> $thenBody
+ * @param list<Instr> $elseBody
+ */
+ public function __construct(
+ public BlockType $type,
+ public array $thenBody,
+ public array $elseBody,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Loop.php b/src/Structure/Instructions/Instrs/Control/Loop.php
new file mode 100644
index 0000000..30c85ef
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Loop.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Loop extends Instr
+{
+ /**
+ * @param list<Instr> $body
+ */
+ public function __construct(
+ public BlockType $type,
+ public array $body,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Nop.php b/src/Structure/Instructions/Instrs/Control/Nop.php
new file mode 100644
index 0000000..dbb1b6c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Nop.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Nop extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Return_.php b/src/Structure/Instructions/Instrs/Control/Return_.php
new file mode 100644
index 0000000..0322076
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Return_.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Return_ extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Control/Unreachable.php b/src/Structure/Instructions/Instrs/Control/Unreachable.php
new file mode 100644
index 0000000..49f586b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Control/Unreachable.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Unreachable extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/DataDrop.php b/src/Structure/Instructions/Instrs/Memory/DataDrop.php
new file mode 100644
index 0000000..4d08ef8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/DataDrop.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\DataIdx;
+
+final readonly class DataDrop extends Instr
+{
+ public function __construct(
+ public DataIdx $data,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/F32Load.php b/src/Structure/Instructions/Instrs/Memory/F32Load.php
new file mode 100644
index 0000000..d315ffc
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/F32Load.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Load extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/F32Store.php b/src/Structure/Instructions/Instrs/Memory/F32Store.php
new file mode 100644
index 0000000..702698d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/F32Store.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Store extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/F64Load.php b/src/Structure/Instructions/Instrs/Memory/F64Load.php
new file mode 100644
index 0000000..8ea4742
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/F64Load.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Load extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/F64Store.php b/src/Structure/Instructions/Instrs/Memory/F64Store.php
new file mode 100644
index 0000000..3cda981
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/F64Store.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Store extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load.php b/src/Structure/Instructions/Instrs/Memory/I32Load.php
new file mode 100644
index 0000000..98e5e35
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Load.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Load extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load16S.php b/src/Structure/Instructions/Instrs/Memory/I32Load16S.php
new file mode 100644
index 0000000..f4fa975
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Load16S.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Load16S extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load16U.php b/src/Structure/Instructions/Instrs/Memory/I32Load16U.php
new file mode 100644
index 0000000..8d6d772
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Load16U.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Load16U extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load8S.php b/src/Structure/Instructions/Instrs/Memory/I32Load8S.php
new file mode 100644
index 0000000..3d93375
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Load8S.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Load8S extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load8U.php b/src/Structure/Instructions/Instrs/Memory/I32Load8U.php
new file mode 100644
index 0000000..dcc94bc
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Load8U.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Load8U extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store.php b/src/Structure/Instructions/Instrs/Memory/I32Store.php
new file mode 100644
index 0000000..c65e9c1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Store.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Store extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store16.php b/src/Structure/Instructions/Instrs/Memory/I32Store16.php
new file mode 100644
index 0000000..01401df
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Store16.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Store16 extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store8.php b/src/Structure/Instructions/Instrs/Memory/I32Store8.php
new file mode 100644
index 0000000..07f0f90
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I32Store8.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Store8 extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load.php b/src/Structure/Instructions/Instrs/Memory/I64Load.php
new file mode 100644
index 0000000..ccb8069
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load16S.php b/src/Structure/Instructions/Instrs/Memory/I64Load16S.php
new file mode 100644
index 0000000..34f9a9d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load16S.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load16S extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load16U.php b/src/Structure/Instructions/Instrs/Memory/I64Load16U.php
new file mode 100644
index 0000000..171ed96
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load16U.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load16U extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load32S.php b/src/Structure/Instructions/Instrs/Memory/I64Load32S.php
new file mode 100644
index 0000000..e26fbc8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load32S.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load32S extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load32U.php b/src/Structure/Instructions/Instrs/Memory/I64Load32U.php
new file mode 100644
index 0000000..6568d25
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load32U.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load32U extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load8S.php b/src/Structure/Instructions/Instrs/Memory/I64Load8S.php
new file mode 100644
index 0000000..7f4a8ef
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load8S.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load8S extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load8U.php b/src/Structure/Instructions/Instrs/Memory/I64Load8U.php
new file mode 100644
index 0000000..1982714
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Load8U.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Load8U extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store.php b/src/Structure/Instructions/Instrs/Memory/I64Store.php
new file mode 100644
index 0000000..75e0303
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Store.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Store extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store16.php b/src/Structure/Instructions/Instrs/Memory/I64Store16.php
new file mode 100644
index 0000000..66ecec6
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Store16.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Store16 extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store32.php b/src/Structure/Instructions/Instrs/Memory/I64Store32.php
new file mode 100644
index 0000000..8307efd
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Store32.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Store32 extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store8.php b/src/Structure/Instructions/Instrs/Memory/I64Store8.php
new file mode 100644
index 0000000..dd52475
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/I64Store8.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Store8 extends Instr
+{
+ /**
+ * @param U32 $offset
+ * @param U32 $align
+ */
+ public function __construct(
+ public int $offset,
+ public int $align,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryCopy.php b/src/Structure/Instructions/Instrs/Memory/MemoryCopy.php
new file mode 100644
index 0000000..49a2700
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/MemoryCopy.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class MemoryCopy extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryFill.php b/src/Structure/Instructions/Instrs/Memory/MemoryFill.php
new file mode 100644
index 0000000..0de6d5e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/MemoryFill.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class MemoryFill extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryGrow.php b/src/Structure/Instructions/Instrs/Memory/MemoryGrow.php
new file mode 100644
index 0000000..2b16de1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/MemoryGrow.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class MemoryGrow extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryInit.php b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php
new file mode 100644
index 0000000..72f7ee9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\DataIdx;
+
+final readonly class MemoryInit extends Instr
+{
+ public function __construct(
+ public DataIdx $data,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Memory/MemorySize.php b/src/Structure/Instructions/Instrs/Memory/MemorySize.php
new file mode 100644
index 0000000..e411762
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Memory/MemorySize.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class MemorySize extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Abs.php b/src/Structure/Instructions/Instrs/Numeric/F32Abs.php
new file mode 100644
index 0000000..94fc22b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Abs.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Abs extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Add.php b/src/Structure/Instructions/Instrs/Numeric/F32Add.php
new file mode 100644
index 0000000..8a69f34
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Add.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Add extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Ceil.php b/src/Structure/Instructions/Instrs/Numeric/F32Ceil.php
new file mode 100644
index 0000000..75469a6
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Ceil.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Ceil extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Const.php b/src/Structure/Instructions/Instrs/Numeric/F32Const.php
new file mode 100644
index 0000000..d9ce335
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Const.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Const extends Instr
+{
+ /**
+ * @param F32 $value
+ */
+ public function __construct(
+ public float $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32S.php b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32S.php
new file mode 100644
index 0000000..6443f07
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ConvertI32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32U.php b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32U.php
new file mode 100644
index 0000000..c845057
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ConvertI32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64S.php b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64S.php
new file mode 100644
index 0000000..ff9515e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ConvertI64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64U.php b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64U.php
new file mode 100644
index 0000000..2a321c7
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ConvertI64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ConvertI64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32CopySign.php b/src/Structure/Instructions/Instrs/Numeric/F32CopySign.php
new file mode 100644
index 0000000..80ca681
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32CopySign.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32CopySign extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32DemoteF64.php b/src/Structure/Instructions/Instrs/Numeric/F32DemoteF64.php
new file mode 100644
index 0000000..bfe7221
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32DemoteF64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32DemoteF64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Div.php b/src/Structure/Instructions/Instrs/Numeric/F32Div.php
new file mode 100644
index 0000000..034a161
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Div.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Div extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Eq.php b/src/Structure/Instructions/Instrs/Numeric/F32Eq.php
new file mode 100644
index 0000000..acfaa91
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Eq.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Eq extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Floor.php b/src/Structure/Instructions/Instrs/Numeric/F32Floor.php
new file mode 100644
index 0000000..6b8c760
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Floor.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Floor extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Ge.php b/src/Structure/Instructions/Instrs/Numeric/F32Ge.php
new file mode 100644
index 0000000..bd8a7ce
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Ge.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Ge extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Gt.php b/src/Structure/Instructions/Instrs/Numeric/F32Gt.php
new file mode 100644
index 0000000..4f071b5
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Gt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Gt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Le.php b/src/Structure/Instructions/Instrs/Numeric/F32Le.php
new file mode 100644
index 0000000..76d53ed
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Le.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Le extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Lt.php b/src/Structure/Instructions/Instrs/Numeric/F32Lt.php
new file mode 100644
index 0000000..9286087
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Lt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Lt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Max.php b/src/Structure/Instructions/Instrs/Numeric/F32Max.php
new file mode 100644
index 0000000..e2d68cd
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Max.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Max extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Min.php b/src/Structure/Instructions/Instrs/Numeric/F32Min.php
new file mode 100644
index 0000000..2b07d3a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Min.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Min extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Mul.php b/src/Structure/Instructions/Instrs/Numeric/F32Mul.php
new file mode 100644
index 0000000..f232268
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Mul.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Mul extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Ne.php b/src/Structure/Instructions/Instrs/Numeric/F32Ne.php
new file mode 100644
index 0000000..4d88d58
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Ne.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Ne extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Nearest.php b/src/Structure/Instructions/Instrs/Numeric/F32Nearest.php
new file mode 100644
index 0000000..5ef087c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Nearest.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Nearest extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Neg.php b/src/Structure/Instructions/Instrs/Numeric/F32Neg.php
new file mode 100644
index 0000000..0ee1c81
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Neg.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Neg extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI32.php b/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI32.php
new file mode 100644
index 0000000..ca6bbc9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI32.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ReinterpretI32 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI64.php b/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI64.php
new file mode 100644
index 0000000..4c0c1cc
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32ReinterpretI64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32ReinterpretI64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Sqrt.php b/src/Structure/Instructions/Instrs/Numeric/F32Sqrt.php
new file mode 100644
index 0000000..8889df2
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Sqrt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Sqrt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Sub.php b/src/Structure/Instructions/Instrs/Numeric/F32Sub.php
new file mode 100644
index 0000000..79efc3c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Sub.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Sub extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Trunc.php b/src/Structure/Instructions/Instrs/Numeric/F32Trunc.php
new file mode 100644
index 0000000..6c273ac
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F32Trunc.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F32Trunc extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Abs.php b/src/Structure/Instructions/Instrs/Numeric/F64Abs.php
new file mode 100644
index 0000000..cc0a7d3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Abs.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Abs extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Add.php b/src/Structure/Instructions/Instrs/Numeric/F64Add.php
new file mode 100644
index 0000000..6e8ed1a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Add.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Add extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Ceil.php b/src/Structure/Instructions/Instrs/Numeric/F64Ceil.php
new file mode 100644
index 0000000..42bc77d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Ceil.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Ceil extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Const.php b/src/Structure/Instructions/Instrs/Numeric/F64Const.php
new file mode 100644
index 0000000..dcfa9e8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Const.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Const extends Instr
+{
+ /**
+ * @param F64 $value
+ */
+ public function __construct(
+ public float $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32S.php b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32S.php
new file mode 100644
index 0000000..ca52f39
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ConvertI32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32U.php b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32U.php
new file mode 100644
index 0000000..2b0cb1b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ConvertI32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64S.php b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64S.php
new file mode 100644
index 0000000..9f2d8ad
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ConvertI64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64U.php b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64U.php
new file mode 100644
index 0000000..a86cd01
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ConvertI64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ConvertI64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64CopySign.php b/src/Structure/Instructions/Instrs/Numeric/F64CopySign.php
new file mode 100644
index 0000000..2e11ae4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64CopySign.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64CopySign extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Div.php b/src/Structure/Instructions/Instrs/Numeric/F64Div.php
new file mode 100644
index 0000000..d655879
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Div.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Div extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Eq.php b/src/Structure/Instructions/Instrs/Numeric/F64Eq.php
new file mode 100644
index 0000000..5155b0b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Eq.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Eq extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Floor.php b/src/Structure/Instructions/Instrs/Numeric/F64Floor.php
new file mode 100644
index 0000000..a55785f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Floor.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Floor extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Ge.php b/src/Structure/Instructions/Instrs/Numeric/F64Ge.php
new file mode 100644
index 0000000..f9dc40e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Ge.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Ge extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Gt.php b/src/Structure/Instructions/Instrs/Numeric/F64Gt.php
new file mode 100644
index 0000000..bf33336
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Gt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Gt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Le.php b/src/Structure/Instructions/Instrs/Numeric/F64Le.php
new file mode 100644
index 0000000..eae4b93
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Le.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Le extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Lt.php b/src/Structure/Instructions/Instrs/Numeric/F64Lt.php
new file mode 100644
index 0000000..755914a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Lt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Lt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Max.php b/src/Structure/Instructions/Instrs/Numeric/F64Max.php
new file mode 100644
index 0000000..3f07d6d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Max.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Max extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Min.php b/src/Structure/Instructions/Instrs/Numeric/F64Min.php
new file mode 100644
index 0000000..272dc4a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Min.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Min extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Mul.php b/src/Structure/Instructions/Instrs/Numeric/F64Mul.php
new file mode 100644
index 0000000..f22dbab
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Mul.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Mul extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Ne.php b/src/Structure/Instructions/Instrs/Numeric/F64Ne.php
new file mode 100644
index 0000000..91c86e3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Ne.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Ne extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Nearest.php b/src/Structure/Instructions/Instrs/Numeric/F64Nearest.php
new file mode 100644
index 0000000..52bcfd8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Nearest.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Nearest extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Neg.php b/src/Structure/Instructions/Instrs/Numeric/F64Neg.php
new file mode 100644
index 0000000..4589529
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Neg.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Neg extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64PromoteF32.php b/src/Structure/Instructions/Instrs/Numeric/F64PromoteF32.php
new file mode 100644
index 0000000..a14aa36
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64PromoteF32.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64PromoteF32 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI32.php b/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI32.php
new file mode 100644
index 0000000..b37bf7e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI32.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ReinterpretI32 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI64.php b/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI64.php
new file mode 100644
index 0000000..0f8a3fb
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64ReinterpretI64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64ReinterpretI64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Sqrt.php b/src/Structure/Instructions/Instrs/Numeric/F64Sqrt.php
new file mode 100644
index 0000000..647d95f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Sqrt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Sqrt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Sub.php b/src/Structure/Instructions/Instrs/Numeric/F64Sub.php
new file mode 100644
index 0000000..31677c1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Sub.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Sub extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Trunc.php b/src/Structure/Instructions/Instrs/Numeric/F64Trunc.php
new file mode 100644
index 0000000..6ed7314
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/F64Trunc.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class F64Trunc extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Add.php b/src/Structure/Instructions/Instrs/Numeric/I32Add.php
new file mode 100644
index 0000000..45b1fea
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Add.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Add extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32And.php b/src/Structure/Instructions/Instrs/Numeric/I32And.php
new file mode 100644
index 0000000..8f0a906
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32And.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32And extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Clz.php b/src/Structure/Instructions/Instrs/Numeric/I32Clz.php
new file mode 100644
index 0000000..124995b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Clz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Clz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Const.php b/src/Structure/Instructions/Instrs/Numeric/I32Const.php
new file mode 100644
index 0000000..7beaae0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Const.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Const extends Instr
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Ctz.php b/src/Structure/Instructions/Instrs/Numeric/I32Ctz.php
new file mode 100644
index 0000000..fc17042
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Ctz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Ctz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32DivS.php b/src/Structure/Instructions/Instrs/Numeric/I32DivS.php
new file mode 100644
index 0000000..789716d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32DivS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32DivS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32DivU.php b/src/Structure/Instructions/Instrs/Numeric/I32DivU.php
new file mode 100644
index 0000000..f7797f4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32DivU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32DivU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Eq.php b/src/Structure/Instructions/Instrs/Numeric/I32Eq.php
new file mode 100644
index 0000000..e6c5969
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Eq.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Eq extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Eqz.php b/src/Structure/Instructions/Instrs/Numeric/I32Eqz.php
new file mode 100644
index 0000000..16d7b44
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Eqz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Eqz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Extend16S.php b/src/Structure/Instructions/Instrs/Numeric/I32Extend16S.php
new file mode 100644
index 0000000..cdb3227
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Extend16S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Extend16S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Extend8S.php b/src/Structure/Instructions/Instrs/Numeric/I32Extend8S.php
new file mode 100644
index 0000000..73c95f9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Extend8S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Extend8S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32GeS.php b/src/Structure/Instructions/Instrs/Numeric/I32GeS.php
new file mode 100644
index 0000000..c9f9bf4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32GeS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32GeS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32GeU.php b/src/Structure/Instructions/Instrs/Numeric/I32GeU.php
new file mode 100644
index 0000000..8c16771
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32GeU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32GeU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32GtS.php b/src/Structure/Instructions/Instrs/Numeric/I32GtS.php
new file mode 100644
index 0000000..4b044a3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32GtS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32GtS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32GtU.php b/src/Structure/Instructions/Instrs/Numeric/I32GtU.php
new file mode 100644
index 0000000..6f915e8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32GtU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32GtU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32LeS.php b/src/Structure/Instructions/Instrs/Numeric/I32LeS.php
new file mode 100644
index 0000000..e82233a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32LeS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32LeS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32LeU.php b/src/Structure/Instructions/Instrs/Numeric/I32LeU.php
new file mode 100644
index 0000000..99a470d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32LeU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32LeU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32LtS.php b/src/Structure/Instructions/Instrs/Numeric/I32LtS.php
new file mode 100644
index 0000000..09ba5a0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32LtS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32LtS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32LtU.php b/src/Structure/Instructions/Instrs/Numeric/I32LtU.php
new file mode 100644
index 0000000..a7526e9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32LtU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32LtU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Mul.php b/src/Structure/Instructions/Instrs/Numeric/I32Mul.php
new file mode 100644
index 0000000..53c7909
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Mul.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Mul extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Ne.php b/src/Structure/Instructions/Instrs/Numeric/I32Ne.php
new file mode 100644
index 0000000..01d16a1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Ne.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Ne extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Or.php b/src/Structure/Instructions/Instrs/Numeric/I32Or.php
new file mode 100644
index 0000000..93ef312
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Or.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Or extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Popcnt.php b/src/Structure/Instructions/Instrs/Numeric/I32Popcnt.php
new file mode 100644
index 0000000..6519b81
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Popcnt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Popcnt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF32.php b/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF32.php
new file mode 100644
index 0000000..4bbd00b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF32.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32ReinterpretF32 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF64.php b/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF64.php
new file mode 100644
index 0000000..452b94c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32ReinterpretF64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32ReinterpretF64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32RemS.php b/src/Structure/Instructions/Instrs/Numeric/I32RemS.php
new file mode 100644
index 0000000..57ee14e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32RemS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32RemS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32RemU.php b/src/Structure/Instructions/Instrs/Numeric/I32RemU.php
new file mode 100644
index 0000000..4ff68af
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32RemU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32RemU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32RotL.php b/src/Structure/Instructions/Instrs/Numeric/I32RotL.php
new file mode 100644
index 0000000..66597f3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32RotL.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32RotL extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32RotR.php b/src/Structure/Instructions/Instrs/Numeric/I32RotR.php
new file mode 100644
index 0000000..732a609
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32RotR.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32RotR extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Shl.php b/src/Structure/Instructions/Instrs/Numeric/I32Shl.php
new file mode 100644
index 0000000..51da4d7
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Shl.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Shl extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32ShrS.php b/src/Structure/Instructions/Instrs/Numeric/I32ShrS.php
new file mode 100644
index 0000000..bd450c7
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32ShrS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32ShrS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32ShrU.php b/src/Structure/Instructions/Instrs/Numeric/I32ShrU.php
new file mode 100644
index 0000000..45a9591
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32ShrU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32ShrU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Sub.php b/src/Structure/Instructions/Instrs/Numeric/I32Sub.php
new file mode 100644
index 0000000..bccb57b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Sub.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Sub extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncF32S.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncF32S.php
new file mode 100644
index 0000000..eceb6aa
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncF32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncF32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncF32U.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncF32U.php
new file mode 100644
index 0000000..1b63b10
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncF32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncF32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncF64S.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncF64S.php
new file mode 100644
index 0000000..8290349
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncF64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncF64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncF64U.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncF64U.php
new file mode 100644
index 0000000..61bc0fe
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncF64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncF64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32S.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32S.php
new file mode 100644
index 0000000..e5d490d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncSatF32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32U.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32U.php
new file mode 100644
index 0000000..e032eb8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncSatF32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64S.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64S.php
new file mode 100644
index 0000000..3094a68
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncSatF64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64U.php b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64U.php
new file mode 100644
index 0000000..fa2fa63
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32TruncSatF64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32TruncSatF64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32WrapI64.php b/src/Structure/Instructions/Instrs/Numeric/I32WrapI64.php
new file mode 100644
index 0000000..f9467c3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32WrapI64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32WrapI64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Xor.php b/src/Structure/Instructions/Instrs/Numeric/I32Xor.php
new file mode 100644
index 0000000..1526d59
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I32Xor.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I32Xor extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Add.php b/src/Structure/Instructions/Instrs/Numeric/I64Add.php
new file mode 100644
index 0000000..f94c7e8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Add.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Add extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64And.php b/src/Structure/Instructions/Instrs/Numeric/I64And.php
new file mode 100644
index 0000000..f82d3d9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64And.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64And extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Clz.php b/src/Structure/Instructions/Instrs/Numeric/I64Clz.php
new file mode 100644
index 0000000..e0846ae
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Clz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Clz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Const.php b/src/Structure/Instructions/Instrs/Numeric/I64Const.php
new file mode 100644
index 0000000..59f34f3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Const.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Const extends Instr
+{
+ /**
+ * @param U64 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Ctz.php b/src/Structure/Instructions/Instrs/Numeric/I64Ctz.php
new file mode 100644
index 0000000..0422f68
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Ctz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Ctz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64DivS.php b/src/Structure/Instructions/Instrs/Numeric/I64DivS.php
new file mode 100644
index 0000000..9294d17
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64DivS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64DivS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64DivU.php b/src/Structure/Instructions/Instrs/Numeric/I64DivU.php
new file mode 100644
index 0000000..4c5242c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64DivU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64DivU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Eq.php b/src/Structure/Instructions/Instrs/Numeric/I64Eq.php
new file mode 100644
index 0000000..2145985
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Eq.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Eq extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Eqz.php b/src/Structure/Instructions/Instrs/Numeric/I64Eqz.php
new file mode 100644
index 0000000..dd7af0d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Eqz.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Eqz extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Extend16S.php b/src/Structure/Instructions/Instrs/Numeric/I64Extend16S.php
new file mode 100644
index 0000000..c9ec236
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Extend16S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Extend16S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Extend32S.php b/src/Structure/Instructions/Instrs/Numeric/I64Extend32S.php
new file mode 100644
index 0000000..f5cf6e3
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Extend32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Extend32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Extend8S.php b/src/Structure/Instructions/Instrs/Numeric/I64Extend8S.php
new file mode 100644
index 0000000..8aabde1
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Extend8S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Extend8S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32S.php b/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32S.php
new file mode 100644
index 0000000..4758071
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ExtendI32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32U.php b/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32U.php
new file mode 100644
index 0000000..255676c
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ExtendI32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ExtendI32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64GeS.php b/src/Structure/Instructions/Instrs/Numeric/I64GeS.php
new file mode 100644
index 0000000..7ab7587
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64GeS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64GeS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64GeU.php b/src/Structure/Instructions/Instrs/Numeric/I64GeU.php
new file mode 100644
index 0000000..2695524
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64GeU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64GeU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64GtS.php b/src/Structure/Instructions/Instrs/Numeric/I64GtS.php
new file mode 100644
index 0000000..6aada91
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64GtS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64GtS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64GtU.php b/src/Structure/Instructions/Instrs/Numeric/I64GtU.php
new file mode 100644
index 0000000..396b8e2
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64GtU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64GtU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64LeS.php b/src/Structure/Instructions/Instrs/Numeric/I64LeS.php
new file mode 100644
index 0000000..c6a7ecb
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64LeS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64LeS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64LeU.php b/src/Structure/Instructions/Instrs/Numeric/I64LeU.php
new file mode 100644
index 0000000..c0037be
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64LeU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64LeU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64LtS.php b/src/Structure/Instructions/Instrs/Numeric/I64LtS.php
new file mode 100644
index 0000000..662f082
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64LtS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64LtS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64LtU.php b/src/Structure/Instructions/Instrs/Numeric/I64LtU.php
new file mode 100644
index 0000000..fd5f3b0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64LtU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64LtU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Mul.php b/src/Structure/Instructions/Instrs/Numeric/I64Mul.php
new file mode 100644
index 0000000..c6133c9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Mul.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Mul extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Ne.php b/src/Structure/Instructions/Instrs/Numeric/I64Ne.php
new file mode 100644
index 0000000..5c076c0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Ne.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Ne extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Or.php b/src/Structure/Instructions/Instrs/Numeric/I64Or.php
new file mode 100644
index 0000000..c1d1d1a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Or.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Or extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Popcnt.php b/src/Structure/Instructions/Instrs/Numeric/I64Popcnt.php
new file mode 100644
index 0000000..33ec288
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Popcnt.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Popcnt extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF32.php b/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF32.php
new file mode 100644
index 0000000..d3104b9
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF32.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ReinterpretF32 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF64.php b/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF64.php
new file mode 100644
index 0000000..0a6245a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ReinterpretF64.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ReinterpretF64 extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64RemS.php b/src/Structure/Instructions/Instrs/Numeric/I64RemS.php
new file mode 100644
index 0000000..1d66b60
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64RemS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64RemS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64RemU.php b/src/Structure/Instructions/Instrs/Numeric/I64RemU.php
new file mode 100644
index 0000000..0241747
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64RemU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64RemU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64RotL.php b/src/Structure/Instructions/Instrs/Numeric/I64RotL.php
new file mode 100644
index 0000000..6a6fdba
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64RotL.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64RotL extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64RotR.php b/src/Structure/Instructions/Instrs/Numeric/I64RotR.php
new file mode 100644
index 0000000..e77fab0
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64RotR.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64RotR extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Shl.php b/src/Structure/Instructions/Instrs/Numeric/I64Shl.php
new file mode 100644
index 0000000..d800c6d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Shl.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Shl extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ShrS.php b/src/Structure/Instructions/Instrs/Numeric/I64ShrS.php
new file mode 100644
index 0000000..d44e48f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ShrS.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ShrS extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64ShrU.php b/src/Structure/Instructions/Instrs/Numeric/I64ShrU.php
new file mode 100644
index 0000000..656a662
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64ShrU.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64ShrU extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Sub.php b/src/Structure/Instructions/Instrs/Numeric/I64Sub.php
new file mode 100644
index 0000000..ab87eaf
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Sub.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Sub extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncF32S.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncF32S.php
new file mode 100644
index 0000000..a3421ce
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncF32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncF32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncF32U.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncF32U.php
new file mode 100644
index 0000000..917e940
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncF32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncF32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncF64S.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncF64S.php
new file mode 100644
index 0000000..3f0d5fd
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncF64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncF64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncF64U.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncF64U.php
new file mode 100644
index 0000000..9726bc4
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncF64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncF64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32S.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32S.php
new file mode 100644
index 0000000..71d82a5
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncSatF32S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32U.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32U.php
new file mode 100644
index 0000000..d4dafd7
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF32U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncSatF32U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64S.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64S.php
new file mode 100644
index 0000000..0833520
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64S.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncSatF64S extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64U.php b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64U.php
new file mode 100644
index 0000000..41f1c0e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64TruncSatF64U.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64TruncSatF64U extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Xor.php b/src/Structure/Instructions/Instrs/Numeric/I64Xor.php
new file mode 100644
index 0000000..917f62d
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Numeric/I64Xor.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Numeric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class I64Xor extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Parametric/Drop.php b/src/Structure/Instructions/Instrs/Parametric/Drop.php
new file mode 100644
index 0000000..7513014
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Parametric/Drop.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Parametric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class Drop extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Parametric/Select.php b/src/Structure/Instructions/Instrs/Parametric/Select.php
new file mode 100644
index 0000000..5e5b5ad
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Parametric/Select.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Parametric;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+final readonly class Select extends Instr
+{
+ /**
+ * @param list<ValType> $types
+ */
+ public function __construct(
+ public array $types,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Reference/RefFunc.php b/src/Structure/Instructions/Instrs/Reference/RefFunc.php
new file mode 100644
index 0000000..2849f5f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Reference/RefFunc.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Reference;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+
+final readonly class RefFunc extends Instr
+{
+ public function __construct(
+ public FuncIdx $func,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Reference/RefIsNull.php b/src/Structure/Instructions/Instrs/Reference/RefIsNull.php
new file mode 100644
index 0000000..eb8db06
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Reference/RefIsNull.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Reference;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+
+final readonly class RefIsNull extends Instr
+{
+}
diff --git a/src/Structure/Instructions/Instrs/Reference/RefNull.php b/src/Structure/Instructions/Instrs/Reference/RefNull.php
new file mode 100644
index 0000000..b3727c6
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Reference/RefNull.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Reference;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\RefType;
+
+final readonly class RefNull extends Instr
+{
+ public function __construct(
+ public RefType $type,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/ElemDrop.php b/src/Structure/Instructions/Instrs/Table/ElemDrop.php
new file mode 100644
index 0000000..fcaf9ea
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/ElemDrop.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\ElemIdx;
+
+final readonly class ElemDrop extends Instr
+{
+ public function __construct(
+ public ElemIdx $elem,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableCopy.php b/src/Structure/Instructions/Instrs/Table/TableCopy.php
new file mode 100644
index 0000000..04a50c8
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableCopy.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableCopy extends Instr
+{
+ public function __construct(
+ public TableIdx $to,
+ public TableIdx $from,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableFill.php b/src/Structure/Instructions/Instrs/Table/TableFill.php
new file mode 100644
index 0000000..4128657
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableFill.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableFill extends Instr
+{
+ public function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableGet.php b/src/Structure/Instructions/Instrs/Table/TableGet.php
new file mode 100644
index 0000000..bc1b35f
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableGet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableGet extends Instr
+{
+ public function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableGrow.php b/src/Structure/Instructions/Instrs/Table/TableGrow.php
new file mode 100644
index 0000000..ddd9b2a
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableGrow.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableGrow extends Instr
+{
+ public function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableInit.php b/src/Structure/Instructions/Instrs/Table/TableInit.php
new file mode 100644
index 0000000..d4666ae
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableInit.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\ElemIdx;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableInit extends Instr
+{
+ public function __construct(
+ public TableIdx $to,
+ public ElemIdx $from,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableSet.php b/src/Structure/Instructions/Instrs/Table/TableSet.php
new file mode 100644
index 0000000..8aaf11e
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableSet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableSet extends Instr
+{
+ public function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Table/TableSize.php b/src/Structure/Instructions/Instrs/Table/TableSize.php
new file mode 100644
index 0000000..00200a6
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Table/TableSize.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class TableSize extends Instr
+{
+ public function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php
new file mode 100644
index 0000000..7d25650
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+
+final readonly class GlobalGet extends Instr
+{
+ public function __construct(
+ public GlobalIdx $var,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php
new file mode 100644
index 0000000..2f32855
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+
+final readonly class GlobalSet extends Instr
+{
+ public function __construct(
+ public GlobalIdx $var,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Variable/LocalGet.php b/src/Structure/Instructions/Instrs/Variable/LocalGet.php
new file mode 100644
index 0000000..4c4f794
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Variable/LocalGet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LocalIdx;
+
+final readonly class LocalGet extends Instr
+{
+ public function __construct(
+ public LocalIdx $var,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Variable/LocalSet.php b/src/Structure/Instructions/Instrs/Variable/LocalSet.php
new file mode 100644
index 0000000..d103c22
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Variable/LocalSet.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LocalIdx;
+
+final readonly class LocalSet extends Instr
+{
+ public function __construct(
+ public LocalIdx $var,
+ ) {
+ }
+}
diff --git a/src/Structure/Instructions/Instrs/Variable/LocalTee.php b/src/Structure/Instructions/Instrs/Variable/LocalTee.php
new file mode 100644
index 0000000..89e253b
--- /dev/null
+++ b/src/Structure/Instructions/Instrs/Variable/LocalTee.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Instr;
+use Nsfisis\Waddiwasi\Structure\Types\LocalIdx;
+
+final readonly class LocalTee extends Instr
+{
+ public function __construct(
+ public LocalIdx $var,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Data.php b/src/Structure/Modules/Data.php
new file mode 100644
index 0000000..7d36600
--- /dev/null
+++ b/src/Structure/Modules/Data.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+final readonly class Data
+{
+ /**
+ * @param list<Byte> $init
+ */
+ public function __construct(
+ public array $init,
+ public DataMode $mode,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/DataMode.php b/src/Structure/Modules/DataMode.php
new file mode 100644
index 0000000..08228d9
--- /dev/null
+++ b/src/Structure/Modules/DataMode.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Types\MemIdx;
+
+abstract readonly class DataMode
+{
+ final public static function Passive(): DataModes\Passive
+ {
+ return new DataModes\Passive();
+ }
+
+ final public static function Active(
+ MemIdx $memory,
+ Expr $offset,
+ ): DataModes\Active {
+ return new DataModes\Active($memory, $offset);
+ }
+}
diff --git a/src/Structure/Modules/DataModes/Active.php b/src/Structure/Modules/DataModes/Active.php
new file mode 100644
index 0000000..4e74ced
--- /dev/null
+++ b/src/Structure/Modules/DataModes/Active.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\DataModes;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Modules\DataMode;
+use Nsfisis\Waddiwasi\Structure\Types\MemIdx;
+
+final readonly class Active extends DataMode
+{
+ protected function __construct(
+ public MemIdx $memory,
+ public Expr $offset,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/DataModes/Passive.php b/src/Structure/Modules/DataModes/Passive.php
new file mode 100644
index 0000000..3686cdc
--- /dev/null
+++ b/src/Structure/Modules/DataModes/Passive.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\DataModes;
+
+use Nsfisis\Waddiwasi\Structure\Modules\DataMode;
+
+final readonly class Passive extends DataMode
+{
+ protected function __construct()
+ {
+ }
+}
diff --git a/src/Structure/Modules/Elem.php b/src/Structure/Modules/Elem.php
new file mode 100644
index 0000000..e074590
--- /dev/null
+++ b/src/Structure/Modules/Elem.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Types\RefType;
+
+final readonly class Elem
+{
+ /**
+ * @param list<Expr> $init
+ */
+ public function __construct(
+ public RefType $type,
+ public array $init,
+ public ElemMode $mode,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ElemMode.php b/src/Structure/Modules/ElemMode.php
new file mode 100644
index 0000000..d6496dd
--- /dev/null
+++ b/src/Structure/Modules/ElemMode.php
@@ -0,0 +1,28 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+abstract readonly class ElemMode
+{
+ final public static function Passive(): ElemModes\Passive
+ {
+ return new ElemModes\Passive();
+ }
+
+ final public static function Active(
+ TableIdx $table,
+ Expr $offset,
+ ): ElemModes\Active {
+ return new ElemModes\Active($table, $offset);
+ }
+
+ final public static function Declarative(): ElemModes\Declarative
+ {
+ return new ElemModes\Declarative();
+ }
+}
diff --git a/src/Structure/Modules/ElemModes/Active.php b/src/Structure/Modules/ElemModes/Active.php
new file mode 100644
index 0000000..06f3b41
--- /dev/null
+++ b/src/Structure/Modules/ElemModes/Active.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ElemModes;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Modules\ElemMode;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class Active extends ElemMode
+{
+ protected function __construct(
+ public TableIdx $table,
+ public Expr $offset,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ElemModes/Declarative.php b/src/Structure/Modules/ElemModes/Declarative.php
new file mode 100644
index 0000000..7c68331
--- /dev/null
+++ b/src/Structure/Modules/ElemModes/Declarative.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ElemModes;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ElemMode;
+
+final readonly class Declarative extends ElemMode
+{
+ protected function __construct()
+ {
+ }
+}
diff --git a/src/Structure/Modules/ElemModes/Passive.php b/src/Structure/Modules/ElemModes/Passive.php
new file mode 100644
index 0000000..0f999a9
--- /dev/null
+++ b/src/Structure/Modules/ElemModes/Passive.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ElemModes;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ElemMode;
+
+final readonly class Passive extends ElemMode
+{
+ protected function __construct()
+ {
+ }
+}
diff --git a/src/Structure/Modules/Export.php b/src/Structure/Modules/Export.php
new file mode 100644
index 0000000..dc02a1b
--- /dev/null
+++ b/src/Structure/Modules/Export.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+final readonly class Export
+{
+ /**
+ * @param Name $name
+ */
+ public function __construct(
+ public string $name,
+ public ExportDesc $desc,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ExportDesc.php b/src/Structure/Modules/ExportDesc.php
new file mode 100644
index 0000000..7183c2a
--- /dev/null
+++ b/src/Structure/Modules/ExportDesc.php
@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+use Nsfisis\Waddiwasi\Structure\Types\MemIdx;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+abstract readonly class ExportDesc
+{
+ final public static function Func(FuncIdx $func): ExportDescs\Func
+ {
+ return new ExportDescs\Func($func);
+ }
+
+ final public static function Table(TableIdx $table): ExportDescs\Table
+ {
+ return new ExportDescs\Table($table);
+ }
+
+ final public static function Mem(MemIdx $mem): ExportDescs\Mem
+ {
+ return new ExportDescs\Mem($mem);
+ }
+
+ final public static function Global(GlobalIdx $global): ExportDescs\Global_
+ {
+ return new ExportDescs\Global_($global);
+ }
+}
diff --git a/src/Structure/Modules/ExportDescs/Func.php b/src/Structure/Modules/ExportDescs/Func.php
new file mode 100644
index 0000000..43dc039
--- /dev/null
+++ b/src/Structure/Modules/ExportDescs/Func.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ExportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ExportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+
+final readonly class Func extends ExportDesc
+{
+ protected function __construct(
+ public FuncIdx $func,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ExportDescs/Global_.php b/src/Structure/Modules/ExportDescs/Global_.php
new file mode 100644
index 0000000..4e87b4a
--- /dev/null
+++ b/src/Structure/Modules/ExportDescs/Global_.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ExportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ExportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx;
+
+final readonly class Global_ extends ExportDesc
+{
+ protected function __construct(
+ public GlobalIdx $global,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ExportDescs/Mem.php b/src/Structure/Modules/ExportDescs/Mem.php
new file mode 100644
index 0000000..068963c
--- /dev/null
+++ b/src/Structure/Modules/ExportDescs/Mem.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ExportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ExportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\MemIdx;
+
+final readonly class Mem extends ExportDesc
+{
+ protected function __construct(
+ public MemIdx $mem,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ExportDescs/Table.php b/src/Structure/Modules/ExportDescs/Table.php
new file mode 100644
index 0000000..d9501bd
--- /dev/null
+++ b/src/Structure/Modules/ExportDescs/Table.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ExportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ExportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\TableIdx;
+
+final readonly class Table extends ExportDesc
+{
+ protected function __construct(
+ public TableIdx $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Func.php b/src/Structure/Modules/Func.php
new file mode 100644
index 0000000..c91e8e8
--- /dev/null
+++ b/src/Structure/Modules/Func.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+
+final readonly class Func
+{
+ /**
+ * @param list<Local> $locals
+ */
+ public function __construct(
+ public TypeIdx $type,
+ public array $locals,
+ public Expr $body,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Global_.php b/src/Structure/Modules/Global_.php
new file mode 100644
index 0000000..9d6d371
--- /dev/null
+++ b/src/Structure/Modules/Global_.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Instructions\Expr;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
+
+final readonly class Global_
+{
+ public function __construct(
+ public GlobalType $type,
+ public Expr $init,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Import.php b/src/Structure/Modules/Import.php
new file mode 100644
index 0000000..4609a3f
--- /dev/null
+++ b/src/Structure/Modules/Import.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+final readonly class Import
+{
+ /**
+ * @param Name $module
+ * @param Name $name
+ */
+ public function __construct(
+ public string $module,
+ public string $name,
+ public ImportDesc $desc,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ImportDesc.php b/src/Structure/Modules/ImportDesc.php
new file mode 100644
index 0000000..a5f2b40
--- /dev/null
+++ b/src/Structure/Modules/ImportDesc.php
@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
+use Nsfisis\Waddiwasi\Structure\Types\MemType;
+use Nsfisis\Waddiwasi\Structure\Types\TableType;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+
+abstract readonly class ImportDesc
+{
+ final public static function Func(TypeIdx $func): ImportDescs\Func
+ {
+ return new ImportDescs\Func($func);
+ }
+
+ final public static function Table(TableType $table): ImportDescs\Table
+ {
+ return new ImportDescs\Table($table);
+ }
+
+ final public static function Mem(MemType $mem): ImportDescs\Mem
+ {
+ return new ImportDescs\Mem($mem);
+ }
+
+ final public static function Global(GlobalType $global): ImportDescs\Global_
+ {
+ return new ImportDescs\Global_($global);
+ }
+}
diff --git a/src/Structure/Modules/ImportDescs/Func.php b/src/Structure/Modules/ImportDescs/Func.php
new file mode 100644
index 0000000..8aa3e34
--- /dev/null
+++ b/src/Structure/Modules/ImportDescs/Func.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ImportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ImportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\TypeIdx;
+
+final readonly class Func extends ImportDesc
+{
+ protected function __construct(
+ public TypeIdx $func,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ImportDescs/Global_.php b/src/Structure/Modules/ImportDescs/Global_.php
new file mode 100644
index 0000000..0015583
--- /dev/null
+++ b/src/Structure/Modules/ImportDescs/Global_.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ImportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ImportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
+
+final readonly class Global_ extends ImportDesc
+{
+ protected function __construct(
+ public GlobalType $global,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ImportDescs/Mem.php b/src/Structure/Modules/ImportDescs/Mem.php
new file mode 100644
index 0000000..d6d6639
--- /dev/null
+++ b/src/Structure/Modules/ImportDescs/Mem.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ImportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ImportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\MemType;
+
+final readonly class Mem extends ImportDesc
+{
+ protected function __construct(
+ public MemType $mem,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/ImportDescs/Table.php b/src/Structure/Modules/ImportDescs/Table.php
new file mode 100644
index 0000000..166f6a7
--- /dev/null
+++ b/src/Structure/Modules/ImportDescs/Table.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules\ImportDescs;
+
+use Nsfisis\Waddiwasi\Structure\Modules\ImportDesc;
+use Nsfisis\Waddiwasi\Structure\Types\TableType;
+
+final readonly class Table extends ImportDesc
+{
+ protected function __construct(
+ public TableType $table,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Local.php b/src/Structure/Modules/Local.php
new file mode 100644
index 0000000..5c3e224
--- /dev/null
+++ b/src/Structure/Modules/Local.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+final readonly class Local
+{
+ public function __construct(
+ public ValType $type,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Mem.php b/src/Structure/Modules/Mem.php
new file mode 100644
index 0000000..ab651b0
--- /dev/null
+++ b/src/Structure/Modules/Mem.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\MemType;
+
+final readonly class Mem
+{
+ public function __construct(
+ public MemType $type,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Module.php b/src/Structure/Modules/Module.php
new file mode 100644
index 0000000..ab978a3
--- /dev/null
+++ b/src/Structure/Modules/Module.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\FuncType;
+
+final readonly class Module
+{
+ /**
+ * @param list<FuncType> $types
+ * @param list<Func> $funcs
+ * @param list<Table> $tables
+ * @param list<Mem> $mems
+ * @param list<Global_> $globals
+ * @param list<Elem> $elems
+ * @param list<Data> $datas
+ * @param list<Import> $imports
+ * @param list<Export> $exports
+ */
+ public function __construct(
+ public array $types,
+ public array $funcs,
+ public array $tables,
+ public array $mems,
+ public array $globals,
+ public array $elems,
+ public array $datas,
+ public ?Start $start,
+ public array $imports,
+ public array $exports,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Start.php b/src/Structure/Modules/Start.php
new file mode 100644
index 0000000..afb583b
--- /dev/null
+++ b/src/Structure/Modules/Start.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\FuncIdx;
+
+final readonly class Start
+{
+ public function __construct(
+ public FuncIdx $func,
+ ) {
+ }
+}
diff --git a/src/Structure/Modules/Table.php b/src/Structure/Modules/Table.php
new file mode 100644
index 0000000..06ccdb0
--- /dev/null
+++ b/src/Structure/Modules/Table.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Modules;
+
+use Nsfisis\Waddiwasi\Structure\Types\TableType;
+
+final readonly class Table
+{
+ public function __construct(
+ public TableType $type,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/DataIdx.php b/src/Structure/Types/DataIdx.php
new file mode 100644
index 0000000..5390ad4
--- /dev/null
+++ b/src/Structure/Types/DataIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class DataIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ElemIdx.php b/src/Structure/Types/ElemIdx.php
new file mode 100644
index 0000000..989ef94
--- /dev/null
+++ b/src/Structure/Types/ElemIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class ElemIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ExternType.php b/src/Structure/Types/ExternType.php
new file mode 100644
index 0000000..404f755
--- /dev/null
+++ b/src/Structure/Types/ExternType.php
@@ -0,0 +1,28 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+abstract readonly class ExternType
+{
+ final public static function Func(FuncType $type): ExternTypes\Func
+ {
+ return new ExternTypes\Func($type);
+ }
+
+ final public static function Table(TableType $type): ExternTypes\Table
+ {
+ return new ExternTypes\Table($type);
+ }
+
+ final public static function Mem(MemType $type): ExternTypes\Mem
+ {
+ return new ExternTypes\Mem($type);
+ }
+
+ final public static function Global(GlobalType $type): ExternTypes\Global_
+ {
+ return new ExternTypes\Global_($type);
+ }
+}
diff --git a/src/Structure/Types/ExternTypes/Func.php b/src/Structure/Types/ExternTypes/Func.php
new file mode 100644
index 0000000..74e9215
--- /dev/null
+++ b/src/Structure/Types/ExternTypes/Func.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ExternTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\ExternType;
+use Nsfisis\Waddiwasi\Structure\Types\FuncType;
+
+final readonly class Func extends ExternType
+{
+ protected function __construct(
+ public FuncType $inner,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ExternTypes/Global_.php b/src/Structure/Types/ExternTypes/Global_.php
new file mode 100644
index 0000000..d88b4b2
--- /dev/null
+++ b/src/Structure/Types/ExternTypes/Global_.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ExternTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\ExternType;
+use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
+
+final readonly class Global_ extends ExternType
+{
+ protected function __construct(
+ public GlobalType $inner,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ExternTypes/Mem.php b/src/Structure/Types/ExternTypes/Mem.php
new file mode 100644
index 0000000..3777c5c
--- /dev/null
+++ b/src/Structure/Types/ExternTypes/Mem.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ExternTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\ExternType;
+use Nsfisis\Waddiwasi\Structure\Types\MemType;
+
+final readonly class Mem extends ExternType
+{
+ protected function __construct(
+ public MemType $inner,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ExternTypes/Table.php b/src/Structure/Types/ExternTypes/Table.php
new file mode 100644
index 0000000..26a7675
--- /dev/null
+++ b/src/Structure/Types/ExternTypes/Table.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ExternTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\ExternType;
+use Nsfisis\Waddiwasi\Structure\Types\TableType;
+
+final readonly class Table extends ExternType
+{
+ protected function __construct(
+ public TableType $inner,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/FuncIdx.php b/src/Structure/Types/FuncIdx.php
new file mode 100644
index 0000000..9e2d9f7
--- /dev/null
+++ b/src/Structure/Types/FuncIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class FuncIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/FuncType.php b/src/Structure/Types/FuncType.php
new file mode 100644
index 0000000..17ef98a
--- /dev/null
+++ b/src/Structure/Types/FuncType.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class FuncType
+{
+ public function __construct(
+ public ResultType $args,
+ public ResultType $returns,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/GlobalIdx.php b/src/Structure/Types/GlobalIdx.php
new file mode 100644
index 0000000..c65d182
--- /dev/null
+++ b/src/Structure/Types/GlobalIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class GlobalIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/GlobalType.php b/src/Structure/Types/GlobalType.php
new file mode 100644
index 0000000..182b761
--- /dev/null
+++ b/src/Structure/Types/GlobalType.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class GlobalType
+{
+ public function __construct(
+ public Mut $mut,
+ public ValType $valType,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/LabelIdx.php b/src/Structure/Types/LabelIdx.php
new file mode 100644
index 0000000..e6941b0
--- /dev/null
+++ b/src/Structure/Types/LabelIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class LabelIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/Limits.php b/src/Structure/Types/Limits.php
new file mode 100644
index 0000000..12f6cbf
--- /dev/null
+++ b/src/Structure/Types/Limits.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class Limits
+{
+ /**
+ * @param U32 $min
+ * @param ?U32 $max
+ */
+ public function __construct(
+ public int $min,
+ public ?int $max,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/LocalIdx.php b/src/Structure/Types/LocalIdx.php
new file mode 100644
index 0000000..6620281
--- /dev/null
+++ b/src/Structure/Types/LocalIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class LocalIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/MemIdx.php b/src/Structure/Types/MemIdx.php
new file mode 100644
index 0000000..5fb9d76
--- /dev/null
+++ b/src/Structure/Types/MemIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class MemIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/MemType.php b/src/Structure/Types/MemType.php
new file mode 100644
index 0000000..d4c9009
--- /dev/null
+++ b/src/Structure/Types/MemType.php
@@ -0,0 +1,13 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class MemType
+{
+ public function __construct(
+ public Limits $limits,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/Mut.php b/src/Structure/Types/Mut.php
new file mode 100644
index 0000000..8b3c611
--- /dev/null
+++ b/src/Structure/Types/Mut.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+enum Mut
+{
+ case Const;
+ case Var;
+}
diff --git a/src/Structure/Types/NumType.php b/src/Structure/Types/NumType.php
new file mode 100644
index 0000000..28b6d80
--- /dev/null
+++ b/src/Structure/Types/NumType.php
@@ -0,0 +1,13 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+enum NumType
+{
+ case I32;
+ case I64;
+ case F32;
+ case F64;
+}
diff --git a/src/Structure/Types/RefType.php b/src/Structure/Types/RefType.php
new file mode 100644
index 0000000..0d40d86
--- /dev/null
+++ b/src/Structure/Types/RefType.php
@@ -0,0 +1,11 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+enum RefType
+{
+ case FuncRef;
+ case ExternRef;
+}
diff --git a/src/Structure/Types/ResultType.php b/src/Structure/Types/ResultType.php
new file mode 100644
index 0000000..267916b
--- /dev/null
+++ b/src/Structure/Types/ResultType.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class ResultType
+{
+ /**
+ * @param list<ValType> $types
+ */
+ public function __construct(
+ public array $types,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/TableIdx.php b/src/Structure/Types/TableIdx.php
new file mode 100644
index 0000000..af2d72b
--- /dev/null
+++ b/src/Structure/Types/TableIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class TableIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/TableType.php b/src/Structure/Types/TableType.php
new file mode 100644
index 0000000..619ad25
--- /dev/null
+++ b/src/Structure/Types/TableType.php
@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class TableType
+{
+ public function __construct(
+ public Limits $limits,
+ public RefType $refType,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/TypeIdx.php b/src/Structure/Types/TypeIdx.php
new file mode 100644
index 0000000..c0074d7
--- /dev/null
+++ b/src/Structure/Types/TypeIdx.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+final readonly class TypeIdx
+{
+ /**
+ * @param U32 $value
+ */
+ public function __construct(
+ public int $value,
+ ) {
+ }
+}
diff --git a/src/Structure/Types/ValType.php b/src/Structure/Types/ValType.php
new file mode 100644
index 0000000..58bf32c
--- /dev/null
+++ b/src/Structure/Types/ValType.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+abstract readonly class ValType
+{
+ final public static function NumType(NumType $type): ValTypes\NumType
+ {
+ return new ValTypes\NumType($type);
+ }
+
+ final public static function VecType(VecType $type): ValTypes\VecType
+ {
+ return new ValTypes\VecType($type);
+ }
+
+ final public static function RefType(RefType $type): ValTypes\RefType
+ {
+ return new ValTypes\RefType($type);
+ }
+}
diff --git a/src/Structure/Types/ValTypes/NumType.php b/src/Structure/Types/ValTypes/NumType.php
new file mode 100644
index 0000000..3376d27
--- /dev/null
+++ b/src/Structure/Types/ValTypes/NumType.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ValTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\NumType as OrigNumType;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+final readonly class NumType extends ValType
+{
+ protected function __construct(public OrigNumType $inner)
+ {
+ }
+}
diff --git a/src/Structure/Types/ValTypes/RefType.php b/src/Structure/Types/ValTypes/RefType.php
new file mode 100644
index 0000000..720eb7d
--- /dev/null
+++ b/src/Structure/Types/ValTypes/RefType.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ValTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\RefType as OrigRefType;
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+
+final readonly class RefType extends ValType
+{
+ protected function __construct(public OrigRefType $inner)
+ {
+ }
+}
diff --git a/src/Structure/Types/ValTypes/VecType.php b/src/Structure/Types/ValTypes/VecType.php
new file mode 100644
index 0000000..8fb546c
--- /dev/null
+++ b/src/Structure/Types/ValTypes/VecType.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types\ValTypes;
+
+use Nsfisis\Waddiwasi\Structure\Types\ValType;
+use Nsfisis\Waddiwasi\Structure\Types\VecType as OrigVecType;
+
+final readonly class VecType extends ValType
+{
+ protected function __construct(public OrigVecType $inner)
+ {
+ }
+}
diff --git a/src/Structure/Types/VecType.php b/src/Structure/Types/VecType.php
new file mode 100644
index 0000000..ae8a0f6
--- /dev/null
+++ b/src/Structure/Types/VecType.php
@@ -0,0 +1,10 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Structure\Types;
+
+enum VecType
+{
+ case V128;
+}