ARM-software / acle

Arm C Language Extensions (ACLE)
Other
83 stars 51 forks source link

[BUG] Function multiversioning FEAT conditions are incorrect #320

Open Wilco1 opened 3 months ago

Wilco1 commented 3 months ago

In acle.md the table describing multiversioning has many entries like this:

310 FEAT_SVE sve ID_AA64PFR0_EL1.SVE != 0b0000 AND ID_AA64ZFR0_EL1.SVEver == 0b0000

In almost all cases using equality comparison is incorrect. The above means a multiversioned function for SVE would never be selected on a core with SVE2. So these version checks need to use >=, never ==.

Also, why not list the HWCAP instead as that is what actual implementations will use?

kinoshita-fj commented 1 month ago

I'd like to run the same function on both SVE core and SVE2 core using FMV. But FMV doesn't work as expected because of this odd definition. So I posted this issue to LLVM. Could you fix it ?

labrinea commented 1 month ago

It seems to me this is not specific to SVE, more features may be affected. We should be checking >= rather than equality.