Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv32: align stack pointer to 16-bytes #21

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

xobs
Copy link
Contributor

@xobs xobs commented Dec 27, 2023

Ensure RISC-V targets are aligned to 16-byte boundaries.

Even though rv32 is only 32-bits, all RISC-V stacks must be aligned to a 16-byte boundary. For discussion on this, see:

riscv-non-isa/riscv-elf-psabi-doc#21

As an example of why this is important, the c.addi16sp compressed instruction is only able to adjust the stack pointer by 16-byte increments.

Even though rv32 is only 32-bits, all RISC-V stacks must be aligned to a
16-byte boundary. For discussion on this, see:

riscv-non-isa/riscv-elf-psabi-doc#21

As an example of why this is important, the `c.addi16sp` compressed
instruction is only able to adjust the stack pointer by 16-byte
increments.

Signed-off-by: Sean Cross <[email protected]>
@nbdd0121 nbdd0121 merged commit cf89c19 into nbdd0121:trunk Dec 27, 2023
5 checks passed
@xobs xobs deleted the riscv32-alignment branch December 28, 2023 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants