Register Guide

RISC-V t1 / x6 Register: Temporary

Temporary register 1 (x6). The psABI classifies t1 as a temporary register for short-lived intermediate values; its value is not preserved across calls.

ABI name: t1; physical register: x6.
Save rule: Caller.
Read it through its psABI role first, then inspect how each instruction reads or writes it.
Physical Name x6ABI Name t1Save Rule Caller
Role
Temporary
Convention
Caller-saved
Remember This First
t1 is a caller-saved temporary register, so callees may overwrite it.
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

t1 / x6 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 t1 value is still needed across a call, the caller must save it explicitly.

When It Fits Best

  • - Hold short-lived temporary computation results.
  • - Use it for local computations that do not need to survive calls.
  • - Use it as a caller-managed scratch register.

When Not To Use It This Way

  • - Do not keep values in it across a call unless you save them yourself first.
  • - Do not expect callees to restore it for you.

What Happens Around A Call

1

t1 is a caller-saved temporary register, so callees may overwrite it.

2

If the caller still needs the t1 value after a call, it must save it in advance.

3

Values that must survive calls should usually live in s* registers or on the stack.

Save t1 Before A Call If Needed

Examples explain the rule, not a complete program
addi t1, a0, 1
# If t1 is needed after the call, the caller must save it to an ABI-valid location first
call foo
# restore t1 from that saved location after the call returns

FAQ

Is t1 / x6 preserved across calls?

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

What if a t1 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.