From c9102655312f5d9824fcf9a6b2f090b46b1bb93d Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Mon, 13 May 2024 21:51:28 +0200 Subject: [PATCH] runtime: adapt to new instruction set --- src/runtime.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/runtime.rs b/src/runtime.rs index 97a13f1..47b613e 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -59,11 +59,11 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { linker.add_procedure( "i+", tisc::Assembler::new() - .inst(tisc::VM_Instruction::Add) + .inst(tisc::VM_Instruction::IntAdd) .build(), ); - /* Floating-point Additionu + /* Floating-point Addition */ symbols.write().unwrap().declare_proc_parse( "f+", @@ -78,7 +78,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { linker.add_procedure( "f+", tisc::Assembler::new() - .inst(tisc::VM_Instruction::Addf) + .inst(tisc::VM_Instruction::FltAdd) .build(), ); @@ -97,10 +97,10 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { "i-", tisc::Assembler::new() .inst(tisc::VM_Instruction::Swap) - .inst(tisc::VM_Instruction::BitwiseNot) + .inst(tisc::VM_Instruction::BitNeg) .lit(1) - .inst(tisc::VM_Instruction::Add) - .inst(tisc::VM_Instruction::Add) + .inst(tisc::VM_Instruction::IntAdd) + .inst(tisc::VM_Instruction::IntAdd) .build(), ); @@ -173,7 +173,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { .lit(3) .inst(tisc::VM_Instruction::Pick) // [ a b sum a -- a b (sum+a) ] - .inst(tisc::VM_Instruction::Add) + .inst(tisc::VM_Instruction::IntAdd) // [ a b sum -- a sum b ] .inst(tisc::VM_Instruction::Swap) // [ a sum b -- a sum b 1 ] @@ -218,7 +218,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { tisc::Assembler::new() .static_ref("data-frame-ptr") .inst(tisc::VM_Instruction::Fetch) - .inst(tisc::VM_Instruction::Add) + .inst(tisc::VM_Instruction::IntAdd) .inst(tisc::VM_Instruction::Store) .build(), ); @@ -234,7 +234,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc> { tisc::Assembler::new() .static_ref("data-frame-ptr") .inst(tisc::VM_Instruction::Fetch) - .inst(tisc::VM_Instruction::Add) + .inst(tisc::VM_Instruction::IntAdd) .inst(tisc::VM_Instruction::Fetch) .build(), );