Register Guide

RISC-V s10 / x26 Register: Saved register

Saved register 10 (x26). Under the standard psABI, a procedure that modifies it restores its entry value before returning.

ABI name: s10; physical register: x26.
Save rule: Preserved across calls.
Read it through its psABI role first, then inspect how each instruction reads or writes it.
Physical Name x26ABI Name s10Save Rule Preserved across calls
Role
Saved register
Convention
Preserved across calls
Remember This First
The standard psABI marks s0-s11 as preserved across calls.
psABI Reference

Saved register

The psABI marks s0-s11 as preserved across calls. A callee that modifies them must restore their entry values before returning. s10 has no frame-pointer alias; the optional frame-pointer rule applies only to x8/s0.

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

s10 / x26 belongs to the s0-s11 saved-register group. The psABI marks it preserved across calls; a callee that modifies it must restore it before returning.

s0-s11 are saved registers preserved across calls.
A callee that modifies s10 must restore its original value before returning.

When It Fits Best

  • - Recognize it as a register preserved across calls in the standard psABI.
  • - Restore its entry value before returning when a procedure modifies it.
  • - s10 is a saved register; the frame-pointer alias belongs only to x8/s0.

When Not To Use It This Way

  • - Do not modify s* and return without restoring it.
  • - Do not describe s10 as a frame pointer; that optional role belongs only to x8/s0.

What Happens Around A Call

1

The standard psABI marks s0-s11 as preserved across calls.

2

A callee that modifies s* must restore its entry value before returning.

3

s10 has no frame-pointer alias.

Standard psABI Preservation Rule

Examples explain the rule, not a complete program
# s10 is a register preserved across calls
# A procedure that modifies s10 must restore its entry value before returning

FAQ

Why is s10 / x26 suitable for values that survive calls?

s0-s11 are preserved across calls; a callee that modifies them must restore them, so callers can rely on their values after return.

Who restores s10 if a function modifies it?

The callee restores it before returning.