Skip to content

Commit

Permalink
Add clarification for FMV behaviour.
Browse files Browse the repository at this point in the history
This clarifies cases like:

```C
__attribute__((target_version("default")))
int foo(int (* x)[12]){
    return (*x)[11];
}

__attribute__((target_version("sve")))
int foo(int (* x)[10]){
    return (*x)[7];
}

int bar()
{
    int y[10];
    return foo(&y);
}
```

```C
int __attribute__((target_version("default"))) fn (int x) {
    return 1;
}

void bar () {
    int __attribute__((target_version("sve2"))) fn (int);
    fn(1);
}
```
  • Loading branch information
AlfieRichardsArm committed Nov 12, 2024
1 parent 36736ea commit 17e9e30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main/acle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2696,10 +2696,12 @@ following:
in one of the translation units.
* Implicitly, without this attribute,
* or explicitly providing the `default` in the attribute.
* All instances of the versions shall share the same function
signature and calling convention.
* All instances of the versions shall share the same calling convention
* All function declarations shall share compatible function signatures
that are combined to a single signature for all versions.
* All the function versions must be declared at the translation
unit in which the definition of the default version resides.
* All function declarations must be at file scope level.

The attribute `__attribute__((target_clones("name",...)))` expresses the
following:
Expand Down

0 comments on commit 17e9e30

Please sign in to comment.