hex.ptr_index

dst[:w/4] = ptr + index*2w — the address of the index-th dw-aligned op past *ptr.

dst, ptr are hex[:w/4]; index is a signed hex[:w/4]. Works for negative index too.

@Assumes: w in {16, 32, 64, 128}.

Signature

def ptr_index dst, ptr, index { ... }

Defined in hex/pointers/pointer_arithmetics.fj — lines 45–51 (view on GitHub).

Complexity

  • Time: w(2.25@+5.25)    // for w=64

  • Space: w(2.25@+40)      // for w=64

See the complexity glossary for what @, w, dw, dbit, n mean.

Requires init

The following must be initialised before this macro is invoked:

  • hex.add.init (or hex.init)

Source

Depends on

Used by

Example uses


← Previous: hex.ptr_sub