aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
authorxuli <xuli1@eswincomputing.com>2024-03-01 09:10:12 +0000
committerPan Li <pan2.li@intel.com>2024-03-01 18:55:26 +0800
commit4547628c78618616595f4b5e1bef2b582c77793d (patch)
tree7589b2bd2633ad30d9498a993e7dccf1e6d19915 /gcc/tree-vect-loop.cc
parent0a01d1232ff0a8b094270fbf45c9fd0ea46df19f (diff)
downloadgcc-4547628c78618616595f4b5e1bef2b582c77793d.zip
gcc-4547628c78618616595f4b5e1bef2b582c77793d.tar.gz
gcc-4547628c78618616595f4b5e1bef2b582c77793d.tar.bz2
RISC-V: Add riscv_vector_cc function attribute
Standard vector calling convention variant will only enabled when function has vector argument or returning value by default, however user may also want to invoke function without that during a vectorized loop at some situation, but it will cause a huge performance penalty due to vector register store/restore. So user can declare function with this riscv_vector_cc attribute like below, that could enforce function will use standard vector calling convention variant. void foo() __attribute__((riscv_vector_cc)); [[riscv::vector_cc]] void foo(); // For C++11 and C23 For more details please reference the below link. https://github.com/riscv-non-isa/riscv-c-api-doc/pull/67 gcc/ChangeLog: * config/riscv/riscv.cc (TARGET_GNU_ATTRIBUTES): Add riscv_vector_cc attribute to riscv_attribute_table. (riscv_vector_cc_function_p): Return true if FUNC is a riscv_vector_cc function. (riscv_fntype_abi): Add riscv_vector_cc attribute check. * doc/extend.texi: Add riscv_vector_cc attribute description. gcc/testsuite/ChangeLog: * g++.target/riscv/rvv/base/attribute-riscv_vector_cc-error.C: New test. * gcc.target/riscv/rvv/base/attribute-riscv_vector_cc-callee-saved.c: New test. * gcc.target/riscv/rvv/base/attribute-riscv_vector_cc-error.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions