hex.minΒΆ
dst[:n] = min(a[:n], b[:n]) (unsigned)
@Assumes dst is distinct from a and b
SignatureΒΆ
def min n, dst, a, b @ use_a, use_b, end { ... }
Defined in hex/cond_jumps.fj β lines 168β177 (view on GitHub).
ComplexityΒΆ
Time:
n(5@+8) (cmp is data-dependent; worst case)Space:
n(6@+66)
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires initΒΆ
The following must be initialised before this macro is invoked:
hex.cmp.init (or hex.init)
SourceΒΆ
Click to view the macro body
def min n, dst, a, b @ use_a, use_b, end {
.zero n, dst
.cmp n, a, b, use_a, use_a, use_b // a <= b -> a
use_a:
.xor n, dst, a
;end
use_b:
.xor n, dst, b
end:
}
Depends onΒΆ
β Previous: hex.cmp.init
Next: hex.max β