Register
A small, fast storage element inside a processor that holds data being actively worked on.
Definition
A register is a small group of flip-flops that stores a fixed number of bits, typically the processor's word size. Registers hold operands, addresses, and results during computation and are the fastest storage in the memory hierarchy.
Register pressure, having more live values than registers, forces the compiler to spill data to slower memory, hurting performance. Good register allocation is therefore one of a compiler's most impactful optimizations for numerical code.
The number of architectural registers is a defining feature of an instruction set, balancing the speed of keeping data in registers against the cost of encoding many of them in instructions. Techniques such as register renaming let hardware use more physical registers than the instruction set exposes, easing dependencies and enabling out-of-order execution. Effective register use, decided largely by the compiler, is among the strongest influences on numerical code speed.
Kinds
- General-purpose registers for arithmetic operands.
- Special registers: program counter, status flags.
- Shift registers that move bits stepwise.
- Register files: banks of registers with fast access.
Why it matters
Registers sit at the top of the memory hierarchy: because they are inside the processor, access is immediate. Effective use of the limited register set is a key factor in program performance and a major job of compilers.
Fusion connection
Efficient register use in tight numerical kernels contributes to the throughput of the plasma codes Kronos runs on high-performance hardware.