diff --git a/o1vm/src/interpreters/riscv32im/interpreter.rs b/o1vm/src/interpreters/riscv32im/interpreter.rs index 85715fcbab..aa3165fc3f 100644 --- a/o1vm/src/interpreters/riscv32im/interpreter.rs +++ b/o1vm/src/interpreters/riscv32im/interpreter.rs @@ -2255,7 +2255,17 @@ pub fn interpret_mtype(env: &mut Env, instr: MInstruction) unimplemented!("Mulhsu") } MInstruction::Mulhu => { - unimplemented!("Mulhu") + let rs1 = env.read_register(&rs1); + let rs2 = env.read_register(&rs2); + // FIXME: constrain + let res = { + let pos = env.alloc_scratch(); + unsafe { env.mul_hi(&rs1, &rs2, pos) } + }; + env.write_register(&rd, res); + + env.set_instruction_pointer(next_instruction_pointer.clone()); + env.set_next_instruction_pointer(next_instruction_pointer + Env::constant(4u32)); } MInstruction::Div => { unimplemented!("Div")