Skip to content

Commit f0e8045

Browse files
committed
[FMV] Allow mixing target_version with target_clones.
The combination of these attributes is now permitted. Therefore, it is also worth clarifying the existance of a single default version across all translation units with the explicitly provided version being the preferred in case `target_version` and `target_clones` are mixed.
1 parent 9ec2de7 commit f0e8045

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

main/acle.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ Armv8.4-A [[ARMARMv84]](#ARMARMv84). Support is added for the Dot Product intrin
363363
to use keyword attributes instead of GNU-style attributes.
364364
* Added description of SVE reinterpret intrinsics.
365365
* Changes and fixes for [Function Multi Versioning](#function-multi-versioning):
366+
* Combination of attributes `target_version` and `target_clones` is allowed.
367+
* Clarify the existance of a single default version across all translation
368+
units with the explicitly provided version being the preferred in case
369+
`target_version` and `target_clones` are mixed.
370+
* Emphasise that all instances of the versions share the same calling convention.
366371
* Changed the mangling rules [Name mangling](#name-mangling), such that
367372
feature names are appended in lexicographic order, not in priority order.
368373
* Mangled names contain a unique set of features (no duplicates).
@@ -2474,7 +2479,7 @@ The following attributes trigger the multi version code generation:
24742479
`__attribute__((target_version("name")))` and
24752480
`__attribute__((target_clones("name",...)))`.
24762481

2477-
* These attributes can't be mixed with each other.
2482+
* These attributes can be mixed with each other.
24782483
* The `default` version means the version of the function that would
24792484
be generated without these attributes.
24802485
* `name` is the dependent features from the tables below.
@@ -2498,11 +2503,15 @@ following:
24982503
* when applied to a function it becomes one of the versions. Function
24992504
with the same name may exist with multiple versions in the same
25002505
translation unit.
2501-
* One `default` version of the function is required to be provided.
2506+
* Function versions may reside in different translation units.
2507+
* Each version declaration should be visible at the translation
2508+
unit in which the corresponding function version resides.
2509+
* One `default` version of the function is required to be provided
2510+
in one of the translation units.
25022511
* Implicitly, without this attribute,
25032512
* or explicitly providing the `default` in the attribute.
25042513
* All instances of the versions shall share the same function
2505-
signature.
2514+
signature and calling convention.
25062515

25072516
The attribute `__attribute__((target_clones("name",...)))` expresses the
25082517
following:
@@ -2511,8 +2520,9 @@ following:
25112520
based on the arguments.
25122521
* One of them is implicitly the `default`.
25132522
* If the `default` matches with an other explicitly provided
2514-
version the compiler can emit only one function instead of the
2515-
two.
2523+
version in the same translation unit, then the compiler can
2524+
emit only one function instead of the two. The explicitly
2525+
provided version shall be preferred.
25162526
* If a name is not recognized the compiler should ignore it[^fmv-note-ignore].
25172527

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

0 commit comments

Comments
 (0)