Register Guide

RISC-V t5 / x30 Register: Temporary

Temporary register 5 (x30). In the standard RISC-V psABI calling convention, t5 is a temporary register and is not preserved across calls.

ABI name: t5; physical register: x30.
Save rule: Not preserved across calls.
Read it through its psABI role first, then inspect how each instruction reads or writes it.
Physical Name x30ABI Name t5Save Rule Not preserved across calls
Role
Temporary
Convention
Not preserved across calls
Remember This First
t5 is a standard-psABI temporary register and is not preserved across calls.
psABI Reference

Temporary register

The psABI marks t0-t6 as temporary registers. They are not callee-saved; callers must save any value that needs to survive a call.

Preserved across calls: No
RISC-V psABI integer register convention
Quick Understanding & Search Notes

psABI Table 1 names x30 t5, a temporary register not preserved across calls.

x28-x31 / t3-t6 are temporary registers and are not preserved across calls.

When It Fits Best

  • - Recognize t5 as a temporary register not preserved across calls in the standard psABI.
  • - On procedure exit, contents not specified as return values or callee-saved are unspecified.
  • - The temporary-register classification does not prescribe a particular call sequence or save location.

When Not To Use It This Way

  • - Do not assume a pre-call t5 value remains available after a call.
  • - Do not describe the psABI temporary classification as special hardware behavior.

What Happens Around A Call

1

t5 is a standard-psABI temporary register and is not preserved across calls.

2

Contents not specified as return values or callee-saved are unspecified on procedure exit.

3

This rule applies to the standard calling convention.

Standard psABI Rule For t5

Examples explain the rule, not a complete program
# t5: temporary register, not preserved across calls
# Scope: standard psABI calling convention

FAQ

Is t5 / x30 preserved across calls?

No. t0-t6 are temporary registers and are not preserved across calls.