SBPF.CommType — machine words for the sBPF ISA #
Fixed-width machine words underpinning the Solana eBPF (sBPF) semantics, ported
from the OOPSLA 2025 Isabelle/HOL formalisation (rBPFCommType.thy, Yuan et al.,
A Complete Formal Semantics of eBPF ISA for Solana).
Every width is modelled as BitVec n: a bit container with no inherent
signedness. Signed vs. unsigned behaviour is a property of the operation
(BitVec.sdiv / .smod / .sshiftRight vs / / % / >>>), exactly as on
real hardware — so a single representation serves both the word and sword
roles of the source theory.
Main definitions #
Solanalib.SBPF.U4…U128— the machine-word widths.Solanalib.SBPF.u8ListOfU64and friends — little-endian byte serialisation.Solanalib.SBPF.u64OfU8Listand friends — the parsing inverse.
4-bit word — the register-index field of an encoded instruction.
Equations
Instances For
8-bit word — a byte.
Equations
Instances For
16-bit word — the instruction offset field.
Equations
Instances For
32-bit word — the instruction immediate field.
Equations
Instances For
64-bit word — the register width.
Equations
Instances For
128-bit word — wide-multiply results.
Equations
Instances For
Smallest signed 8-bit value (-128), as raw bits.
Equations
Instances For
Largest signed 8-bit value (127).
Equations
Instances For
Largest unsigned 8-bit value (255).
Equations
Instances For
Smallest signed 64-bit value, as raw bits.
Equations
- Solanalib.SBPF.i64Min = 9223372036854775808
Instances For
Little-endian bytes of a 16-bit word.
Equations
- Solanalib.SBPF.u8ListOfU16 i = [BitVec.setWidth 8 i, BitVec.setWidth 8 (i >>> 8)]
Instances For
Little-endian bytes of a 32-bit word.
Equations
- Solanalib.SBPF.u8ListOfU32 i = [BitVec.setWidth 8 i, BitVec.setWidth 8 (i >>> 8), BitVec.setWidth 8 (i >>> 16), BitVec.setWidth 8 (i >>> 24)]
Instances For
Little-endian bytes of a 64-bit word.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reassemble a little-endian 2-byte list into a 16-bit word.
Equations
- Solanalib.SBPF.u16OfU8List [b0, b1] = some (BitVec.setWidth 16 b0 ||| BitVec.setWidth 16 b1 <<< 8)
- Solanalib.SBPF.u16OfU8List x✝ = none
Instances For
Reassemble a little-endian 4-byte list into a 32-bit word.
Equations
- Solanalib.SBPF.u32OfU8List [b0, b1, b2, b3] = some (BitVec.setWidth 32 b0 ||| BitVec.setWidth 32 b1 <<< 8 ||| BitVec.setWidth 32 b2 <<< 16 ||| BitVec.setWidth 32 b3 <<< 24)
- Solanalib.SBPF.u32OfU8List x✝ = none
Instances For
Reassemble a little-endian 8-byte list into a 64-bit word.
Equations
- One or more equations did not get rendered due to their size.
- Solanalib.SBPF.u64OfU8List x✝ = none