bit.pointers.advance_by_one_and_flip__ptr_wflip¶
Advances *to_flip by 1 (which takes n flips, from bit0 to bit1, bit2,…).
If do_flip (value) isn’t 0 - then make a flip, like: to_flip;advance.
Signature¶
def advance_by_one_and_flip__ptr_wflip n, do_flip @ cleanup, advance < bit.pointers.to_flip { ... }
Defined in bit/pointers.fj — lines 116–125 (view on GitHub).
Complexity¶
Time:
@+n+1Space:
@+n+1
See the complexity glossary for what @, w, dw, dbit, n mean.
Source¶
Click to view the macro body
def advance_by_one_and_flip__ptr_wflip n, do_flip @ cleanup, advance < bit.pointers.to_flip {
stl.comp_if0 do_flip, advance
wflip bit.pointers.to_flip+w, cleanup, bit.pointers.to_flip
cleanup:
wflip bit.pointers.to_flip+w, cleanup, advance
pad 4
advance:
rep(n, i) bit.exact_not bit.pointers.to_flip+i
}
Depends on¶
← Previous: bit.ptr_wflip
Next: bit.ptr_wflip_2nd_word →