From 9c481e945c76900c135472fc5fada6f7751e87ba Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Mon, 4 Nov 2024 16:26:36 +0100 Subject: [PATCH] o1vm/riscv32i: split interpret_instruction in subroutines --- o1vm/src/interpreters/riscv32i/interpreter.rs | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/o1vm/src/interpreters/riscv32i/interpreter.rs b/o1vm/src/interpreters/riscv32i/interpreter.rs index 19a97428dc..3996177358 100644 --- a/o1vm/src/interpreters/riscv32i/interpreter.rs +++ b/o1vm/src/interpreters/riscv32i/interpreter.rs @@ -1043,6 +1043,36 @@ pub trait InterpreterEnv { pub fn interpret_instruction(env: &mut Env, instr: Instruction) { env.activate_selector(instr); - // TODO: match on instructions - unimplemented!("TODO"); + match instr { + Instruction::RType(rtype) => interpret_rtype(env, rtype), + Instruction::IType(itype) => interpret_itype(env, itype), + Instruction::SType(stype) => interpret_stype(env, stype), + Instruction::SBType(sbtype) => interpret_sbtype(env, sbtype), + Instruction::UType(utype) => interpret_utype(env, utype), + Instruction::UJType(ujtype) => interpret_ujtype(env, ujtype), + } +} + +pub fn interpret_rtype(_env: &mut Env, _instr: RInstruction) { + unimplemented!("TODO") +} + +pub fn interpret_itype(_env: &mut Env, _instr: IInstruction) { + unimplemented!("TODO") +} + +pub fn interpret_stype(_env: &mut Env, _instr: SInstruction) { + unimplemented!("TODO") +} + +pub fn interpret_sbtype(_env: &mut Env, _instr: SBInstruction) { + unimplemented!("TODO") +} + +pub fn interpret_utype(_env: &mut Env, _instr: UInstruction) { + unimplemented!("TODO") +} + +pub fn interpret_ujtype(_env: &mut Env, _instr: UJInstruction) { + unimplemented!("TODO") }