A complete native counting and placement call #
This routine actually computes the residues and histogram before extracting a heavy array and placing the corresponding packed column. The histogram is not a premise of the execution contract. It also writes the compact output count to its caller-supplied descriptor cell.
Main definitions #
CountPlace.program: modulus encoding, completeCountCall.program 2, runtime argument delivery, completePlace.program, and the count store.
References #
This native composition is original and reuses the existing Chan–He mathematical definitions.
Input length (the selected third argument of the existing counting call).
Signed input base.
Unsigned residue workspace base.
Histogram workspace base.
Compact heavy output base.
Packed node array base.
Positive modulus, decoded unsigned.
Encoded positive tag.
Packed column.
Distance between the two stores.
Zero for X/Y, one for Z.
Cell in which the exact heavy count is stored.
Fixed embedding of the placement workspace below all caller parameters.
Input array base.
Unsigned residue array base.
Input length.
Histogram base.
Compact heavy output base.
Packed node output base.
Positive modulus, decoded unsigned.
Twice the positive tag added to a light integer.
Column in a four-cell group.
Distance to the second write: zero for X/Y, 4M for Z.
Zero for X/Y, one for Z.
Number of heavy integers already written.
All eleven runtime argument copies are real instructions.
Complete fixed native routine: no host histogram, heavy filter or output constructor.
Only the counting/placement workspace, the encoded modulus, and the discarded collision counter can change. All caller registers at least 46 are included in this frame.
Polynomial envelope for addresses, counters, encoded magnitudes and every scan intermediate.
Complete native count/extract/place execution, charging modulus encoding, all subroutine argument/result copies and the final count write. The caller supplies actual signed input words; no histogram or light/heavy-output contract is assumed.