RISC-V Topic Guide

Stack Frame

The standard RISC-V psABI calling convention requires sp to be 16-byte aligned at procedure entry and throughout execution; ILP32E requires only 4-byte alignment. Prologue/epilogue code typically allocates and frees stack space, saves ra and callee-saved registers when needed, and may use s0/fp to form an optional frame-pointer chain.

sprafps0s0-s11ADDISDLDSWLW16-byte alignmentstack frameprologueepilogue