Packed sketch ranks #
Guard extraction and multiplication count all simultaneous comparisons. Complementing the sketches reverses the comparison to obtain inclusive ranks. None of these operations assumes a most-significant-bit primitive. Node constants must be precomputed and loaded separately.
Main definitions #
guardMask,guardFlags: extract one zero-or-one digit from each guarded comparison.upperRankExpr: inclusive rank using complemented sketches.
Main results #
guardFlags_eq: exact packed Boolean comparison digits.upperRankExpr_eq_card: the resulting inclusive rank.RankProgram.exec: eight actual checked instructions return the inclusive rank.
References #
One guard bit per field, with all other bits zero.
Instances For
The expression returns the number of sketches at or below the query. Sortedness is unnecessary for the arithmetic identity; a tree uses sorted sketches to interpret the rank.
Query sketch.
Instances For
Packed guarded complements of the stored sketches.
Instances For
Replication multiplier.
Instances For
Mask selecting all guard bits.
Instances For
Number of payload bits per field.
Instances For
Power selecting the count product's middle digit.
Instances For
Field radix.
Instances For
Largest possible payload.
Instances For
Replicated complemented query.
Instances For
Scratch register and final inclusive rank.
Instances For
Eight standard instructions compute the complete inclusive sketch rank. All eight input registers and all memory are preserved. The precomputed constants are supplied by the caller.
Instances For
The exact final data, retaining the intermediate temporary register.
Instances For
Checked execution of the full inclusive rank in eight instructions. The packed word occupies at most half the physical width, making the count multiplication legal too. Construction/loading of the node constants and compressed query remain separate.