Register Guide

RISC-V t4 / x29 Register: Temporary

Temporary register 4 (x29). The standard psABI marks t4 as not preserved across calls.

ABI name: t4; physical register: x29.
Save rule: Not preserved across calls.
Read it through its psABI role first, then inspect how each instruction reads or writes it.
Physical Name x29ABI Name t4Save Rule Not preserved across calls
Role
Temporary
Convention
Not preserved across calls
Remember This First
t4 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

t4 / x29 belongs to the t0-t6 temporary-register group. The psABI marks it not preserved across calls; callers must save any value that needs to survive a call.

t0-t6 are temporary registers and are not preserved across calls.
If a t4 value is still needed across a call, the caller must save it explicitly.

When It Fits Best

  • - Recognize t4 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 t4 value remains available after a call.
  • - Do not describe the psABI temporary classification as special hardware behavior.

What Happens Around A Call

1

t4 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 t4

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

FAQ

Is t4 / x29 preserved across calls?

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

What if a t4 value is needed after a call?

The caller must save it before the call, usually to the stack or another suitable location, and restore it afterward.