Checked limbwise Boolean operations #
Little-endian half-word digits support bitwise operations independently in each limb. The fixed register lists determine the code. Four workspace registers are reserved as in schoolbook multiplication.
Main definitions #
Cslib.WordRAM.Multiword.Bitwise.Supported: and, or, and exclusive or.Cslib.WordRAM.Multiword.Bitwise.program: one standard instruction per limb.
Main results #
Cslib.WordRAM.Multiword.Bitwise.exec: checked execution, exact reconstructed result, bounded output digits, and preservation of every register outside the output list.
References #
The binary Boolean operations supported by the limbwise routine.
Instances For
theorem Cslib.WordRAM.Multiword.Bitwise.exec {r w : ℕ} (hw : 2 ≤ w) {f : BinOp} (hf : Supported f) (as bs ds : List (Fin (r + 4))) (hab : as.length = bs.length) (had : as.length = ds.length) (hin : ∀ i ∈ as ++ bs, Workspace.IsDigit i) (hout : ∀ i ∈ ds, Workspace.IsDigit i) (hnd : ds.Nodup) (hdis : ds.Disjoint (as ++ bs)) (x : Data (r + 4)) (ha : Bounded (radix w) x as) (hb : Bounded (radix w) x bs) :
Execute a Boolean operation on equal-length bounded digit lists. Source lists may share registers; destinations are distinct and disjoint from both sources. All non-output registers, including all four workspace registers, are preserved.