bit.ptr_wflipΒΆ
Complexity 3w@ (actually a bit smaller, 3w@+3w)
Effectively: wflip *ptr, value
ptr is a bit[:w] that holds an address, which we assume is w-aligned.
SignatureΒΆ
def ptr_wflip ptr, value { ... }
Defined in bit/pointers.fj β lines 109β112 (view on GitHub).
Requires initΒΆ
The following must be initialised before this macro is invoked:
bit.pointers.ptr_init
SourceΒΆ
Click to view the macro body
def ptr_wflip ptr, value {
.pointers.set_flip_pointer ptr
rep(w, i) .pointers.advance_by_one_and_flip__ptr_wflip (#(i^((i+1)%w))), (value>>i)&1
}
Depends onΒΆ
Used byΒΆ
Example usesΒΆ
bit.ptr_wflip_2nd_wordinbit/pointers.fj
β Previous: bit.xor_to_ptr
Next: bit.pointers.advance_by_one_and_flip__ptr_wflip β