1. Registers as Hardware “Bricks”
- Arithmetic operands in LEGv8 (and most architectures) must come from a limited set of registers, not directly from memory.
- Registers are hardware primitives—fast, directly built into the CPU, and also visible to programmers.
- You can think of registers as the “bricks” of computer construction.
- In LEGv8, each register is 64 bits wide, which is called a doubleword.
- A word is 32 bits (another common size).
- A doubleword = 64 bits = the size of each LEGv8 register.
2. Limited Number of Registers
- Most current architectures (including LEGv8) have 32 general-purpose registers.
- Arithmetic instructions in LEGv8 must choose all three operands from one of the 64-bit registers.
Design Principle 2: “Smaller is Faster.”
- A very large number of registers can slow down the clock because the clock signal takes longer to reach every register.
- Designers must balance:
- Programs’ desire for more registers.
- The designer’s desire to keep the clock cycle fast.
- Also, more registers means more bits needed in the instruction format.
Example from textbook:
- 5 registers → clock 1.4 GHz.
- 10 registers → clock 1.2 GHz.
3. Register Naming Convention in LEGv8
- Although you could refer to registers as numbers 0–31, LEGv8 uses X0–X30 plus XZR.
- XZR (register 31) is hardwired to zero.