Checked mask-and-multiply compression #
The multiplier is supplied as three precomputed half-word digits. The query arrives as one physical word: masking and conversion to digits are part of the charged execution. The retained window fits inside the third product digit, including at odd physical widths.
Main definitions #
CompressProgram.embed,CompressProgram.query,CompressProgram.positions,CompressProgram.retained,CompressProgram.offset,CompressProgram.out,CompressProgram.base,CompressProgram.a₀,CompressProgram.a₁,CompressProgram.a₂,CompressProgram.productDigit: register embedding and named registers of the compression workspace.CompressProgram.split,CompressProgram.code: query digit-splitting fragment and fixed standard-basis compression program.
Main results #
CompressProgram.exec: checked execution of mask-and-multiply compression.CompressProgram.exec_approximateSketch: execution of the arithmetic fusion sketch.
Node preprocessing and loading the constants are separate from query execution.
References #
Embed the multiplication workspace in the first sixteen registers.
Query word, preserved.
Input position mask, preserved.
Retained output mask, preserved.
Offset w - 2 * (w / 2), supplied by the caller and preserved.
Conversion scratch and final compressed result.
Half-word radix workspace.
Lowest query digit.
Middle query digit.
Highest query digit.
Third product digit, containing the retained window.
Mask the query and split it using division and remainder by the half-word radix. No squared radix is ever installed in a physical register.
A multiplier of at most w + L bits has three bounded half-word digits whenever the
retained window fits. This is a preprocessing representation theorem; loading is separate.
Initialize the radix, convert the query, multiply three digits by three digits, and extract the retained window. Registers 7--9 contain the precomputed multiplier digits.
The compression program consists of 94 primitive instructions.
In 94 checked standard instructions, compute the masked product window. The query and
all node parameters are preserved, as is memory. Only registers 0--6, 10--15 and 20 may
change. Multiplier digits in registers 7--9 must be preloaded; conversion of the physical
query word is charged. The retained mask occupies L bits and satisfies the stated
half-word window condition.
Specialize the actual execution to the arithmetic approximate sketch. The collision-free parameter construction and comparison theorem are independent of this execution theorem. The caller supplies the position and retained masks and three multiplier digits.