nki.isa.register_move#
- nki.isa.register_move(dst, imm)[source]#
Move a compile-time constant integer value into a virtual register.
This instruction loads an immediate (compile-time constant) integer value into the specified virtual register. The immediate value must be known at compile time and cannot be a runtime variable. This is typically used to initialize registers with known constants for loop bounds, counters, or other control flow operations.
The virtual register system allows the NKI compiler to allocate physical registers across different engine sequencers as needed. See
nisa.register_allocfor more details on virtual register allocation.This instruction operates on virtual registers only and does not access SBUF, PSUM, or HBM.
- Parameters:
dst – the destination virtual register (allocated via
nisa.register_alloc)imm – a compile-time constant integer value to load into the register
Example:
# Allocate a register and initialize it with a constant loop_count = nisa.register_alloc() nisa.register_move(loop_count, 10) # Set register to 10