hex.shifts.shl_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 reverse order (so that the βnextβ is already shifted).
SignatureΒΆ
def shl_bit_once dst, next @ switch, xor_by, end { ... }
Defined in hex/shifts.fj β lines 70β81 (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 shl_bit_once dst, next @ switch, xor_by, end {
wflip dst+w, switch, dst
pad 16
switch:
rep(16, i) stl.fj i&8 ? next+dbit+0 : 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.shl_bitinhex/shifts.fj
β Previous: hex.shr_hex/3
Next: hex.shifts.shr_bit_once β