Skip to content

Commit

Permalink
Merge pull request #2748 from o1-labs/dw/split-interpret-instruction-…
Browse files Browse the repository at this point in the history
…riscv32

o1vm/riscv32i: split interpret_instruction in subroutines
  • Loading branch information
dannywillems authored Nov 14, 2024
2 parents af20066 + 9c481e9 commit c38c88e
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 c38c88e

Please sign in to comment.