pub fn cycles_for_instruction(instruction: &Instruction) -> u32
Expand description
Returns the cost of executing a single instruction.
This is benchmarked on a reference hardware, and calculated based on the multiplies of the cheapest opcode (nop) in the given instruction.
For instance, nop will always have cycle cost of 1, and all other opcodes will have a multiple of that.
The number of cycles for each instruction correlates, but not directly, to the reference x86_64 CPU cycles it takes to execute the instruction as the interpreter does extra work to invoke an instruction.