bytecodealliance / bytecodealliance/wasmtime

riscv64: Improve Clobber Save/Restore Sequence

Open
#7,190 0 comments 0 reactions 0 assignees View on GitHub
cranelift:area:riscv64
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

👋 Hey,

In the RISC-V backend the clobber save and restore implementation uses a negative SP offset. We should switch it to always use a positive SP offset.

When the Compressed instruction extension is enabled we have access to `c.ldsp` and `c.sdsp` which allow us to store and load any register into the stack using a positive SP offset.

Using these instruction in the prologue and epilogue would be nice due to the lower instruction footprint.

Implementing this as a positive offset has no downsides when the C extension is disabled. So there isn't very much of a downside to this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.