Hey! Here is a small question: I am having trouble understanding what nominal SP is, is there a good place I could read about it? I can't find where it's used and its purpose is not very clear to me.
Probably the value stack pointer outside of the prologue and epilogue.
I see comments like the following in some of Cranelift's backends; does that help?
;; Offset from the "nominal stack pointer", which is where the real SP is ;; just after stack and spill slots are allocated in the function prologue. ;; At emission time, this is converted to `SPOffset` with a fixup added to ;; the offset constant. The fixup is a running value that is tracked as ;; emission iterates through instructions in linear order, and can be ;; adjusted up and down with [Inst::VirtualSPOffsetAdj]. ;; ;; The standard ABI is in charge of handling this (by emitting the ;; adjustment meta-instructions). It maintains the invariant that "nominal ;; SP" is where the actual SP is after the function prologue and before ;; clobber pushes. See the diagram in the documentation for ;; [crate::isa::aarch64::abi](the ABI module) for more details.
Last updated: Dec 23 2024 at 12:05 UTC