Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the FMV rules so target_clones default versions must be explicitly stated #377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions main/acle.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ Armv8.4-A [[ARMARMv84]](#ARMARMv84). Support is added for the Dot Product intrin
* Removed Function Multi Versioning feature dgh.
* Document Function Multi Versioning feature dependencies.
* Simplified Function Multi Versioning version selection rules.
* Changed the Function Multi Versioning default version rules to be more explicit.
* Fixed range of operand `o0` (too small) in AArch64 system register designations.
* Fixed SVE2.1 quadword gather load/scatter store intrinsics.
* Removed unnecessary Zd argument from `svcvtnb_mf8[_f32_x2]_fpm`.
Expand All @@ -439,7 +440,6 @@ Armv8.4-A [[ARMARMv84]](#ARMARMv84). Support is added for the Dot Product intrin
* Changed the status of the SME2p1 ACLE from Alpha to Beta.
* Changed the status of the SVE2p1 ACLE from Alpha to Beta.


### References

This document refers to the following documents.
Expand Down Expand Up @@ -2704,17 +2704,19 @@ The following attributes trigger the multi version code generation:
type of the default version.
* All the function versions must be declared at the translation
unit in which the definition of the default version resides.
* One `default` version of the function is required to be provided
in one of the translation units.
* Implicitly, as a definition without any attribute,
* as a function annotated with `target_version("default")`,
* or, as a function annotated with `target_clones(...)` where one
of the versions is `default`.

The attribute `__attribute__((target_version("name")))` expresses the
following:

* When applied to a function it becomes one of the versions.
* Multiple function versions may exist in the same or in different
translation units.
* One `default` version of the function is required to be provided
in one of the translation units.
* Implicitly, without this attribute,
* or explicitly providing the `default` in the attribute.

For example, the below is valid and 2 is used as the default
value for `c` when calling the multiversioned function `f`.
Expand All @@ -2741,11 +2743,6 @@ following:

* when applied to a function the compiler emits multiple versions
based on the arguments.
* One of them is implicitly the `default`.
* If the `default` matches with another explicitly provided
version in the same translation unit, then the compiler can
emit only one function instead of the two. The explicitly
provided version shall be preferred.
* If a name is not recognized the compiler should ignore it[^fmv-note-ignore].

[^fmv-note-ignore]: The intention is to support the usecase of newer code if
Expand Down
Loading