Native selection of canonical signed keys #
All arithmetic is unsigned. The sign bit and magnitude are decoded explicitly, the label is formed by addition or subtraction, and its two digits are computed with native shifts and remainders. The repeated-value case doubles the key and subtracts its original sign bit.
Main definitions #
Select.program: concrete selection and transformation instructions.
Magnitude bound, followed by two bit positions, selected digit and scan mode.
Magnitude bound, followed by two bit positions, selected digit and scan mode.
Magnitude bound, followed by two bit positions, selected digit and scan mode.
Magnitude bound, followed by two bit positions, selected digit and scan mode.
Magnitude bound, followed by two bit positions, selected digit and scan mode.
Input key; replaced by its selected output value.
Full input multiplicity, read without truncation.
Small constants installed by the scan.
Small constants installed by the scan.
Small constants installed by the scan.
Small constants installed by the scan.
Small constants installed by the scan.
Small constants installed by the scan.
Scratch registers for decoding and label digits.
Scratch registers for decoding and label digits.
Scratch registers for decoding and label digits.
Scratch registers for decoding and label digits.
Selection flag, either zero or one.
Magnitude temporary.
Explicit native sign/magnitude decoding, shifted label and binary digit computation.
A no-op used by unsuccessful selections.
Select one of the six finite scan modes and perform the repeated-value transformation.
Every decoding, arithmetic, branch and selection instruction is part of this code.
This scalar program never reads the physical word width.
Registers below the decoding scratch are preserved by label calculation.
Decoding and both binary digits cost at most eleven native instructions.
Selection from already computed digits, with the full repeated-value count.
Complete native scalar selection. Its cost includes decoding, both label bits and doubling.