Why is s2 / x18 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.
Saved register 2 in the standard psABI; a function that modifies it must restore its entry value before returning.
The psABI marks s0-s11 as preserved across calls. A callee that modifies them must restore their entry values before returning. s2 has no frame-pointer alias; the optional frame-pointer rule applies only to x8/s0.
s2 / x18 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.
The standard psABI marks s0-s11 as preserved across calls.
A callee that modifies s* must restore its entry value before returning.
s2 has no frame-pointer alias.
# s2 is a register preserved across calls
# A procedure that modifies s2 must restore its entry value before returnings0-s11 are preserved across calls; a callee that modifies them must restore them, so callers can rely on their values after return.
The callee restores it before returning.