riscv: Restructure callee-saved register save/restore code
authorChristoph Müllner <christoph.muellner@vrull.eu>
Mon, 5 Dec 2022 03:26:03 +0000 (04:26 +0100)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Tue, 27 Dec 2022 19:49:50 +0000 (20:49 +0100)
commit7c755fd9018821b79ddc32ee507897860510986c
treedfa796817ca72a1d5501d9fb8de6d69d355441bc
parent3895dd7675197167789e3b346057be417eede943
riscv: Restructure callee-saved register save/restore code

This patch restructures the loop over the GP registers
which saves/restores then as part of the prologue/epilogue.
No functional change is intended by this patch, but it
offers the possibility to use load-pair/store-pair instructions.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_next_saved_reg): New function.
(riscv_is_eh_return_data_register): New function.
(riscv_for_each_saved_reg): Restructure loop.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/config/riscv/riscv.cc