runtime: adapt to new instruction set
This commit is contained in:
parent
f26e24bba1
commit
c910265531
1 changed files with 9 additions and 9 deletions
|
@ -59,11 +59,11 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
linker.add_procedure(
|
linker.add_procedure(
|
||||||
"i+",
|
"i+",
|
||||||
tisc::Assembler::new()
|
tisc::Assembler::new()
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Floating-point Additionu
|
/* Floating-point Addition
|
||||||
*/
|
*/
|
||||||
symbols.write().unwrap().declare_proc_parse(
|
symbols.write().unwrap().declare_proc_parse(
|
||||||
"f+",
|
"f+",
|
||||||
|
@ -78,7 +78,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
linker.add_procedure(
|
linker.add_procedure(
|
||||||
"f+",
|
"f+",
|
||||||
tisc::Assembler::new()
|
tisc::Assembler::new()
|
||||||
.inst(tisc::VM_Instruction::Addf)
|
.inst(tisc::VM_Instruction::FltAdd)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -97,10 +97,10 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
"i-",
|
"i-",
|
||||||
tisc::Assembler::new()
|
tisc::Assembler::new()
|
||||||
.inst(tisc::VM_Instruction::Swap)
|
.inst(tisc::VM_Instruction::Swap)
|
||||||
.inst(tisc::VM_Instruction::BitwiseNot)
|
.inst(tisc::VM_Instruction::BitNeg)
|
||||||
.lit(1)
|
.lit(1)
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
.lit(3)
|
.lit(3)
|
||||||
.inst(tisc::VM_Instruction::Pick)
|
.inst(tisc::VM_Instruction::Pick)
|
||||||
// [ a b sum a -- a b (sum+a) ]
|
// [ a b sum a -- a b (sum+a) ]
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
// [ a b sum -- a sum b ]
|
// [ a b sum -- a sum b ]
|
||||||
.inst(tisc::VM_Instruction::Swap)
|
.inst(tisc::VM_Instruction::Swap)
|
||||||
// [ a sum b -- a sum b 1 ]
|
// [ a sum b -- a sum b 1 ]
|
||||||
|
@ -218,7 +218,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
tisc::Assembler::new()
|
tisc::Assembler::new()
|
||||||
.static_ref("data-frame-ptr")
|
.static_ref("data-frame-ptr")
|
||||||
.inst(tisc::VM_Instruction::Fetch)
|
.inst(tisc::VM_Instruction::Fetch)
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
.inst(tisc::VM_Instruction::Store)
|
.inst(tisc::VM_Instruction::Store)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
@ -234,7 +234,7 @@ pub fn init_runtime(linker: &mut Linker) -> Arc<RwLock<Scope>> {
|
||||||
tisc::Assembler::new()
|
tisc::Assembler::new()
|
||||||
.static_ref("data-frame-ptr")
|
.static_ref("data-frame-ptr")
|
||||||
.inst(tisc::VM_Instruction::Fetch)
|
.inst(tisc::VM_Instruction::Fetch)
|
||||||
.inst(tisc::VM_Instruction::Add)
|
.inst(tisc::VM_Instruction::IntAdd)
|
||||||
.inst(tisc::VM_Instruction::Fetch)
|
.inst(tisc::VM_Instruction::Fetch)
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue