aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorLehua Ding <lehua.ding@rivai.ai>2023-09-05 15:44:51 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-09-06 16:11:11 +0800
commitfdd59c0f73e9e681cd5f4d0eee2dd58d60d8dbe1 (patch)
treeea09bef16eb54aeb563044e38ec509f31cfe2c2c /libobjc
parent94a4b93292f8ab19910c844bb9b63e4a68b55d33 (diff)
downloadgcc-fdd59c0f73e9e681cd5f4d0eee2dd58d60d8dbe1.zip
gcc-fdd59c0f73e9e681cd5f4d0eee2dd58d60d8dbe1.tar.gz
gcc-fdd59c0f73e9e681cd5f4d0eee2dd58d60d8dbe1.tar.bz2
RISC-V: Part-2: Save/Restore vector registers which need to be preversed
Because functions which follow vector calling convention variant has callee-saved vector reigsters but functions which follow standard calling convention don't have. We need to distinguish which function callee is so that we can tell GCC exactly which vector registers callee will clobber. So I encode the callee's calling convention information into the calls rtx pattern like AArch64. The old operand 2 and 3 of call pattern which copy from MIPS target are useless and removed according to my analysis. gcc/ChangeLog: * config/riscv/riscv-sr.cc (riscv_remove_unneeded_save_restore_calls): Pass riscv_cc. * config/riscv/riscv.cc (struct riscv_frame_info): Add new fileds. (riscv_frame_info::reset): Reset new fileds. (riscv_call_tls_get_addr): Pass riscv_cc. (riscv_function_arg): Return riscv_cc for call patterm. (get_riscv_cc): New function return riscv_cc from rtl call_insn. (riscv_insn_callee_abi): Implement TARGET_INSN_CALLEE_ABI. (riscv_save_reg_p): Add vector callee-saved check. (riscv_stack_align): Add vector save area comment. (riscv_compute_frame_info): Ditto. (riscv_restore_reg): Update for type change. (riscv_for_each_saved_v_reg): New function save vector registers. (riscv_first_stack_step): Handle funciton with vector callee-saved registers. (riscv_expand_prologue): Ditto. (riscv_expand_epilogue): Ditto. (riscv_output_mi_thunk): Pass riscv_cc. (TARGET_INSN_CALLEE_ABI): Implement TARGET_INSN_CALLEE_ABI. * config/riscv/riscv.h (get_riscv_cc): Export get_riscv_cc function. * config/riscv/riscv.md: Add CALLEE_CC operand for call pattern. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-1.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c: New test. * gcc.target/riscv/rvv/base/abi-callee-saved-2.c: New test.
Diffstat (limited to 'libobjc')
0 files changed, 0 insertions, 0 deletions