Zero register

A zero register is a processor register that always returns the value zero and has no effect when it is written to. It is found in instruction set architectures including the CDC 6600, MIPS, SPARC, Alpha, ARM64, and RISC-V, among others.

Zero appears as a constant in many instructions, notably "branch if zero", and optimizing these instructions can have a positive benefit on performance. Some architectures accomplish this with dedicated opcodes, specialized variations of their basic instructions. Implementing these requires additional logic in the instruction decoder. The zero register can accomplish the same effect without requiring new opcodes, although at the cost of dedicating a register to this feature, which may have negative impact for architectures with limited number of registers. The rationale given for including it in RISC-V is that "Dedicating a register to zero is surprisingly a large factor in simplifying the RISC-V ISA."[1]

The x86 architecture has no zero register, while ARM added a zero register for ARM64.

Some instruction set architectures, such as System/360 through z/Architecture and POWER/PowerPC/Power ISA have registers that are not always zero, but that are zero when the register is used as an index register.

References

  1. ^ Patterson, David. The RISC-V Reader: An Open Architecture Atlas (Beta Ed., 0.0.1 ed.). p. 18.


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.