Skip to main content

reg_slot_or_ff

Function reg_slot_or_ff 

Source
pub const fn reg_slot_or_ff(x: u8) -> u8
Expand description

PVM2 GPR slot (0..=14) for x, or 0xFF if x has no slot — x0 (hardwired zero) or a reserved register (x16..x31). The gas simulator reads 0xFF as “no dependency / no write”; both engines’ gas paths use this (the recompiler via the const-folded REG_SLOT_LUT) so gas agrees bit-for-bit. Note 0xFF conflates x0 with reserved — use reg_is_reserved when that distinction matters.