Shared workspace for multiword operations #
Register zero stores an arithmetic total, register one a carry, register two the half-word radix, and register three a preserved zero. All operand digits lie outside this workspace. Multiplication, transfers, bitwise operations and shifts share this layout.
Main definitions #
Workspace.IsDigit: a register outside the four reserved registers.Workspace.Frame: memory and registers outside destinations and arithmetic scratch are kept.Workspace.setup: initialize the radix and zero in six checked instructions.
Main results #
Workspace.exec_setup: exact initialization at every physical width at least two.Workspace.setup_digit: initialization leaves operand digits unchanged.
@[reducible, inline]
Arithmetic total and partial-sum workspace.
Instances For
@[reducible, inline]
Carry workspace.
Instances For
@[reducible, inline]
Half-word radix.
Instances For
@[reducible, inline]
A preserved zero, used for padding and shifts.
Instances For
Compute the half-word radix and a preserved zero in six standard instructions.
Instances For
theorem Cslib.WordRAM.Multiword.Workspace.exec_setup {r w : ℕ} (hw : 2 ≤ w) (x : Data (r + 4)) :
Exec w setup x (setupResult w x) 6
Initialization executes in exactly six instructions for every width at least two.