From 53bb44f45cfda750250e0835425307e3a1d763bc Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Thu, 9 May 2024 22:36:14 +0200 Subject: feat: implement I32StoreLocal & I32LocalGetConstAdd Signed-off-by: Henry Gressmann --- crates/types/src/instructions.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/types/src') diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index 402cc9a..fc6fba2 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -84,16 +84,14 @@ pub enum Instruction { // Custom Instructions BrLabel(LabelAddr), - // Not implemented yet // LocalGet + I32Const + I32Add // One of the most common patterns in the Rust compiler output - // I32LocalGetConstAdd(LocalAddr, i32), + I32LocalGetConstAdd(LocalAddr, i32), - // Not implemented yet // LocalGet + I32Const + I32Store => I32LocalGetConstStore + I32Const // Also common, helps us skip the stack entirely. // Has to be followed by an I32Const instruction - // I32StoreLocal { local: LocalAddr, offset: i32, mem_addr: MemAddr }, + I32StoreLocal { local: LocalAddr, consti32: i32, offset: u32, mem_addr: u8 }, // I64Xor + I64Const + I64RotL // Commonly used by a few crypto libraries -- cgit v1.3.1