hex.maxΒΆ
dst[:n] = max(a[:n], b[:n]) (unsigned)
@Assumes dst is distinct from a and b
SignatureΒΆ
def max n, dst, a, b @ use_a, use_b, end { ... }
Defined in hex/cond_jumps.fj β lines 184β193 (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 max n, dst, a, b @ use_a, use_b, end {
.zero n, dst
.cmp n, a, b, use_b, use_a, use_a // a >= b -> a
use_a:
.xor n, dst, a
;end
use_b:
.xor n, dst, b
end:
}
Depends onΒΆ
β Previous: hex.min