From 8b689c5ff077252a68c88bc7d70990405fc8dd5a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 Mar 2024 21:01:46 +0900 Subject: feat: implement more instructions --- src/Structure/Instructions/Instrs/Variable/GlobalGet.php | 5 +++++ src/Structure/Instructions/Instrs/Variable/GlobalSet.php | 5 +++++ src/Structure/Instructions/Instrs/Variable/LocalGet.php | 5 +++++ src/Structure/Instructions/Instrs/Variable/LocalSet.php | 5 +++++ src/Structure/Instructions/Instrs/Variable/LocalTee.php | 5 +++++ 5 files changed, 25 insertions(+) (limited to 'src/Structure/Instructions/Instrs/Variable') diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php index a3bd2c6..542a805 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php @@ -13,4 +13,9 @@ final readonly class GlobalGet extends Instr public GlobalIdx $var, ) { } + + public static function opName(): string + { + return "global.get"; + } } diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php index 080e15a..1540dd3 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php @@ -13,4 +13,9 @@ final readonly class GlobalSet extends Instr public GlobalIdx $var, ) { } + + public static function opName(): string + { + return "global.set"; + } } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalGet.php b/src/Structure/Instructions/Instrs/Variable/LocalGet.php index bc764c2..4fc0ced 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalGet.php @@ -13,4 +13,9 @@ final readonly class LocalGet extends Instr public LocalIdx $var, ) { } + + public static function opName(): string + { + return "local.get"; + } } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalSet.php b/src/Structure/Instructions/Instrs/Variable/LocalSet.php index 9b107e8..4a21ca3 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalSet.php @@ -13,4 +13,9 @@ final readonly class LocalSet extends Instr public LocalIdx $var, ) { } + + public static function opName(): string + { + return "local.set"; + } } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalTee.php b/src/Structure/Instructions/Instrs/Variable/LocalTee.php index 3e48e8e..97fb46a 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalTee.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalTee.php @@ -13,4 +13,9 @@ final readonly class LocalTee extends Instr public LocalIdx $var, ) { } + + public static function opName(): string + { + return "local.tee"; + } } -- cgit v1.2.3-70-g09d2