]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Enable compressible features when use ZC* extensions.
authorJiawei <jiawei@iscas.ac.cn>
Wed, 7 Jun 2023 12:56:40 +0000 (20:56 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 14 Aug 2023 14:10:26 +0000 (22:10 +0800)
commit6e46fcdf24f99ce1272305aac93cac51d45c04d6
treee8a71a28cdd9e7776ec6b735e1dc96eae4020efe
parent17c22f466162d3a1759f8c607b7e81e7dd631cd9
RISC-V: Enable compressible features when use ZC* extensions.

This patch enables the compressible features with ZC* extensions.

Since all ZC* extension depends on the Zca extension, it's sufficient to only
add the target Zca to extend the target RVC.

Co-Authored by: Mary Bennett <mary.bennett@embecosm.com>
Co-Authored by: Nandni Jamnadas <nandni.jamnadas@embecosm.com>
Co-Authored by: Simon Cook <simon.cook@embecosm.com>

gcc/ChangeLog:

* config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins):
Enable compressed builtins when ZC* extensions enabled.
* config/riscv/riscv-shorten-memrefs.cc:
Enable shorten_memrefs pass when ZC* extensions enabled.
* config/riscv/riscv.cc (riscv_compressed_reg_p):
Enable compressible registers when ZC* extensions enabled.
(riscv_rtx_costs): Allow adjusting rtx costs when ZC* extensions enabled.
(riscv_address_cost): Allow adjusting address cost when ZC* extensions enabled.
(riscv_first_stack_step): Allow compression of the register saves
without adding extra instructions.
* config/riscv/riscv.h (FUNCTION_BOUNDARY): Adjusts function boundary
to 16 bits when ZC* extensions enabled.
gcc/config/riscv/riscv-c.cc
gcc/config/riscv/riscv-shorten-memrefs.cc
gcc/config/riscv/riscv.cc
gcc/config/riscv/riscv.h