hex.shifts.shr_bit_onceΒΆ
{next(1bit),dst(1hex)} = dst >> 1
next is the bit-address of the next msb, dst is a hex.
@note, this should be called in a regular order (so that the βnextβ is already shifted).
SignatureΒΆ
def shr_bit_once dst, next @ switch, xor_by, end { ... }
Defined in hex/shifts.fj β lines 90β101 (view on GitHub).
ComplexityΒΆ
Time:
@+1Space:
@+28
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def shr_bit_once dst, next @ switch, xor_by, end {
wflip dst+w, switch, dst
pad 16
switch:
rep(16, i) stl.fj i&1 ? next+dbit+3 : 0, xor_by+(i^((i>>1)&0xf))*dw
xor_by:
..tables.clean_table_entry__table 16, dst, end
end:
wflip dst+w, switch
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
hex.shr_bitinhex/shifts.fj
β Previous: hex.shifts.shl_bit_once