Native stable digit-selection scan #
The scan appends a stable digit-selected subsequence to a disjoint destination array. Both orders of the two disjoint blocks are allowed, so consecutive radix passes can swap pointers. All loads, address calculations, stores and loop control are native instructions.
Main definitions #
Scan.body: read, test, conditionally append, and advance.Scan.code: reset the input cursor and scan the array.
Main results #
Scan.exec: stable selection with a linear instruction bound and memory frame.
Array length.
Instances For
Source pointer; the sorter returns the final sorted pointer here.
Instances For
Scratch pointer.
Instances For
Current bit index.
Instances For
Digit selected by the current scan.
Instances For
Constant one.
Instances For
Constant two.
Instances For
Input cursor.
Instances For
Output cursor.
Instances For
Address temporary.
Instances For
Loaded key.
Instances For
Current key digit.
Instances For
Number of key bits, supplied by the caller.
Instances For
Temporary used to swap the two pointers.
Instances For
One stable-selection iteration, with every address and counter operation charged.
Instances For
Reset the input cursor, then perform one stable-selection scan.
Instances For
Append a stable digit-selected subsequence in 11n+3 instructions. The destination has
capacity n; source and destination blocks are disjoint, in either order. The caller's existing
destination prefix is retained. Only destination cells may change.