pub struct Predecode {
pub insts: Vec<RvPreDecodedInst>,
pub block_costs: Vec<u32>,
pub block_reserves: Vec<u32>,
pub decode_error_at: Option<u32>,
}Expand description
Output of the predecode pass over an RV+C+custom-0 code section.
Fields§
§insts: Vec<RvPreDecodedInst>One entry per static instruction.
block_costs: Vec<u32>Pre-computed per-basic-block gas cost. Aligned with insts:
block_costs[i] is meaningful only when
insts[i].is_gas_block_start == true; entries at non-
block-start indices are 0. Each meaningful entry is
max(simulation_cycles - 3, 1) for the block starting at
that instruction, computed by the pipeline simulator in
gas_cost::rv_gas_cost_for_block.
block_reserves: Vec<u32>Pre-computed per-basic-block worst-case category-#3 reserve.
Aligned with insts exactly like block_costs: meaningful only
at block-start indices, 0 elsewhere. The block-entry gate checks
gas ≥ block_costs[i] + block_reserves[i] but charges only
block_costs[i] — the reserve is a gate, not a charge (see
gas_cost::rv_block_reserve_for_block).
decode_error_at: Option<u32>If decode hit a reserved/illegal encoding, the byte offset of
the first one. None on success.