aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorYangyu Chen <cyy@cyyself.name>2024-11-05 11:22:45 +0800
committerKito Cheng <kito.cheng@sifive.com>2024-11-13 17:01:42 +0800
commit78753c75cf154e7432624e24c68aae3b81ed49f0 (patch)
treed747fa9218e21c98f747f6bb41588adf5c36a002 /libgcc
parentbd975bd1ce5fdbe99901df9145ba40d7145fd066 (diff)
downloadgcc-78753c75cf154e7432624e24c68aae3b81ed49f0.zip
gcc-78753c75cf154e7432624e24c68aae3b81ed49f0.tar.gz
gcc-78753c75cf154e7432624e24c68aae3b81ed49f0.tar.bz2
RISC-V: Implement TARGET_COMPARE_VERSION_PRIORITY and TARGET_OPTION_FUNCTION_VERSIONS
This patch implements TARGET_COMPARE_VERSION_PRIORITY and TARGET_OPTION_FUNCTION_VERSIONS for RISC-V. The TARGET_COMPARE_VERSION_PRIORITY is implemented to compare the priority of two function versions based on the rules defined in the RISC-V C-API Doc PR #85: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85/files#diff-79a93ca266139524b8b642e582ac20999357542001f1f4666fbb62b6fb7a5824R721 If multiple versions have equal priority, we select the function with the most number of feature bits generated by riscv_minimal_hwprobe_feature_bits. When it comes to the same number of feature bits, we diff two versions and select the one with the least significant bit set. Since a feature appears earlier in the feature_bits might be more important to performance. The TARGET_OPTION_FUNCTION_VERSIONS is implemented to check whether the two function versions are the same. This Implementation reuses the code in TARGET_COMPARE_VERSION_PRIORITY and check it returns 0, which means the equal priority. Co-Developed-by: Hank Chang <hank.chang@sifive.com> Signed-off-by: Yangyu Chen <cyy@cyyself.name> gcc/ChangeLog: * config/riscv/riscv.cc (parse_features_for_version): New function. (compare_fmv_features): New function. (riscv_compare_version_priority): New function. (riscv_common_function_versions): New function. (TARGET_COMPARE_VERSION_PRIORITY): Implement it. (TARGET_OPTION_FUNCTION_VERSIONS): Implement it.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions