Skip to content

Commit

Permalink
o1vm/riscv32i: split interpret_instruction in subroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Nov 4, 2024
1 parent 692acab commit 9c481e9
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions o1vm/src/interpreters/riscv32i/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,36 @@ pub trait InterpreterEnv {
pub fn interpret_instruction<Env: InterpreterEnv>(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: InterpreterEnv>(_env: &mut Env, _instr: RInstruction) {
unimplemented!("TODO")
}

pub fn interpret_itype<Env: InterpreterEnv>(_env: &mut Env, _instr: IInstruction) {
unimplemented!("TODO")
}

pub fn interpret_stype<Env: InterpreterEnv>(_env: &mut Env, _instr: SInstruction) {
unimplemented!("TODO")
}

pub fn interpret_sbtype<Env: InterpreterEnv>(_env: &mut Env, _instr: SBInstruction) {
unimplemented!("TODO")
}

pub fn interpret_utype<Env: InterpreterEnv>(_env: &mut Env, _instr: UInstruction) {
unimplemented!("TODO")
}

pub fn interpret_ujtype<Env: InterpreterEnv>(_env: &mut Env, _instr: UJInstruction) {
unimplemented!("TODO")
}

0 comments on commit 9c481e9

Please sign in to comment.