> On Oct 14, 2024, at 12:32, Kito Cheng <kito.ch...@gmail.com> wrote:
>
> I prefer not to handle the extension implication rules, as it's easy
> for them to get out of sync, and this should be the linux kernel's
> responsibility rather than libgcc's.
>
I still prefer to handle the extension here since users may use old
versions / LTS versions of the Linux kernel, which have no some
implied extensions.
I have another patch to let GCC set the minimal required bits to
provide the best compatibility. However, in some cases, such as
some targets requiring Zve32x but not full V and users who have
kernel version < v6.11, the resolver will not probe the Zve32x
extension. Thus, we will not use the corresponding version. If we
check V in zve32x ifunc resolver, building it in gimple will make
it harder to maintain. Thus, I think both handling minimal extension
in libgcc and having the minimal feature bits to generate the IFUNC
resolver will be a better way to handle this.
Meanwhile, handling it in this way does not increase the maintenance
overhead since we don’t need to handle the extensions and implied
extensions appear in the same version of the Linux kernel. So implied
extensions like Zbc->Zbkc does not need to be handled here. Till now,
we only need the handle C->Zca, Zcd, Zcf and V->Zve32x, Zve32f,
Zve64x, Zve64f, Zve64d.
>> +struct {
>> + unsigned vendorID;
>
> This field is gone since it moved to __riscv_cpu_model
>
I missed this update. I will fix it in the next revision.
>> + unsigned length;
>> + unsigned long long features[RISCV_VENDOR_FEATURE_BITS_LENGTH];
>> +} __riscv_vendor_feature_bits __attribute__ ((visibility ("hidden"),
>> nocommon));
>> +
>> +struct {
>> + unsigned mvendorid;
>> + unsigned long long marchid;
>> + unsigned long long mimpid;
>
> although it mismatch with what riscv-c-api-doc defined but you are
> right, it's MXLEN, rather than 32 bits only, also MXLEN may larger than
> UXLEN which is legal, so unsigned long long is the right
>
Thanks. Since the next revision is needed, I will submit the next
revision after that PR to modify the type of marchid and mimpid
being merged to riscv-c-api-doc.
Link: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/91
>> +} __riscv_cpu_model __attribute__ ((visibility ("hidden"), nocommon));
>> +