afonso360 opened issue #7190:
:wave: Hey,
In the RISC-V backend the clobber save and restore implementations use a negative SP offset. We should switch these to always use a positive SP offset.
When the Compressed instruction extension is enabled we have access to
c.l*sp
andc.s*sp
which allow us to store and load any register into the stack using a positive SP offset.Implementing this as a positive offset has no downsides even when the C extension is disabled. So there isn't very much of a downside to this.
afonso360 added the cranelift:area:riscv64 label to Issue #7190.
afonso360 edited issue #7190:
:wave: Hey,
In the RISC-V backend the clobber save and restore implementations use a negative SP offset. We should switch these to always use a positive SP offset.
When the Compressed instruction extension is enabled we have access to
c.l*sp
andc.s*sp
which allow us to store and load any register into the stack using a positive SP offset.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.
afonso360 edited issue #7190:
:wave: Hey,
In the RISC-V backend the clobber save and restore implementations use a negative SP offset. We should switch these to always use a positive SP offset.
When the Compressed instruction extension is enabled we have access to
c.l*sp
andc.s*sp
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 lower instruction footprints.
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.
afonso360 edited issue #7190:
:wave: Hey,
In the RISC-V backend the clobber save and restore implementations use a negative SP offset. We should switch these to always use a positive SP offset.
When the Compressed instruction extension is enabled we have access to
c.ldsp
andc.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 lower instruction footprints.
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.
afonso360 edited issue #7190:
:wave: 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
andc.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 lower instruction footprints.
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.
afonso360 edited issue #7190:
:wave: 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
andc.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.
Last updated: Dec 23 2024 at 12:05 UTC