aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorYangyu Chen <cyy@cyyself.name>2024-11-05 11:22:16 +0800
committerKito Cheng <kito.cheng@sifive.com>2024-11-13 17:01:42 +0800
commit1f99a39da290291121d08701b218f23781adddd8 (patch)
tree78f792698e09c617f36637f3eb7071eb05fc97e4 /libgcc
parent6b572d4eecc99c4a014ce1eab5e79976e30f4d9f (diff)
downloadgcc-1f99a39da290291121d08701b218f23781adddd8.zip
gcc-1f99a39da290291121d08701b218f23781adddd8.tar.gz
gcc-1f99a39da290291121d08701b218f23781adddd8.tar.bz2
RISC-V: Implement riscv_minimal_hwprobe_feature_bits
This patch implements the riscv_minimal_hwprobe_feature_bits feature for the RISC-V target. The feature bits are defined in the libgcc/config/riscv/feature_bits.c to provide bitmasks of ISA extensions that defined in RISC-V C-API. Thus, we need a function to generate the feature bits for IFUNC resolver to dispatch between different functions based on the hardware features. The minimal feature bits means to use the earliest extension appeard in the Linux hwprobe to cover the given ISA string. To allow older kernels without some implied extensions probe to run the FMV dispatcher correctly. For example, V implies Zve32x, but Zve32x appears in the Linux kernel since v6.11. If we use isa string directly to generate FMV dispatcher with functions with "arch=+v" extension, since we have V implied the Zve32x, FMV dispatcher will check if the Zve32x extension is supported by the host. If the Linux kernel is older than v6.11, the FMV dispatcher will fail to detect the Zve32x extension even it already implies by the V extension, thus making the FMV dispatcher fail to dispatch the correct function. Thus, we need to generate the minimal feature bits to cover the given ISA string to allow the FMV dispatcher to work correctly on older kernels. Signed-off-by: Yangyu Chen <cyy@cyyself.name> gcc/ChangeLog: * common/config/riscv/riscv-common.cc (RISCV_EXT_BITMASK): New macro. (struct riscv_ext_bitmask_table_t): New struct. (riscv_minimal_hwprobe_feature_bits): New function. * common/config/riscv/riscv-ext-bitmask.def: New file. * config/riscv/riscv-subset.h (GCC_RISCV_SUBSET_H): Include riscv-feature-bits.h. (riscv_minimal_hwprobe_feature_bits): Declare the function. * config/riscv/riscv-feature-bits.h: New file.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions