Skip to main content

rv_feed_gas_kind

Function rv_feed_gas_kind 

Source
pub fn rv_feed_gas_kind(
    kind: u8,
    src1: u8,
    src2: u8,
    dst: u8,
    gas_sim: &mut GasSimulator,
    mem_cycles: u8,
) -> bool
Expand description

Kind-driven PVM2 gas feed: look up the cost LUT, compute the overlap-dependent decode_slots and the mem_cycles override, then feed the simulator via feed_direct. Takes raw (kind, src1, src2, dst) so the recompiler’s per-arm dispatch can supply them as compile-time constants + slot lookups without going through an RvGasMeta struct.

Slots are PVM2 register indices (0..14) or 0xFF for “no register” (x0 / absent operand). Slots 13/14 are x3/x4, which are host-spilled — see the spill-cost charge below.

Returns is_terminator (RVF_TERM flag from the LUT entry).