Skip to main content

execute

Function execute 

Source
pub const fn execute(
    d: Decoded,
    rs_val: u64,
    rt_val: u64,
    hilo: HiLo,
    pc: u64,
    fp_condition: bool,
) -> Result<Executed, Exception>
Expand description

Execute one decoded instruction.

rs_val / rt_val are the register values resolved through the bypass network at EX; hilo is the current multiply-divide pair; pc is the address of this instruction, needed by the control-flow forms.

§Errors

Exception::Overflow from the trapping arithmetic forms, and Exception::ReservedInstruction for anything not yet decoded. Returning Reserved rather than treating an unknown encoding as a NOP is deliberate: a missing opcode should be loud, not silently produce wrong results. fp_condition is FCSR.C, which only the BC1 family reads. It is passed in rather than reached for because this function is pure and has no view of the coprocessor state — and passing it as a parameter makes every call site a compile error until it supplies one, which is what stopped BC1 from being wired up to a stale or defaulted condition.