ARM-software / acle

Arm C Language Extensions (ACLE)
Other
89 stars 58 forks source link

Add clarification and restrictions for FMV #363

Open AlfieRichardsArm opened 3 days ago

AlfieRichardsArm commented 3 days ago

This clarifies cases like:

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

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

__attribute__((target_version("sve")))
int foo(int (* x)[10]){ // Error due to conflicting signatures
    return (*x)[7];
}

int bar()
{
    int y[10];
    return foo(&y);
}
int __attribute__((target_version("default"))) fn (int x) {
    return 1;
}

void bar () {
    int __attribute__((target_version("sve2"))) fn (int); // Error due
    // to non file scope declaration
    fn(1);
}
__attribute__((target_version("sve")))
int foo(){
    return 2;
}

__attribute__((target_version("sve2")))
int foo(){
    return 2;
}

int bar()
{
    return foo(); // Error, due to no visability of default version
}

and

//  Translation unit 1:
__attribute__((target_version("default")))
int foo();

__attribute__((target_version("simd")))
int foo(){
    return 2;
}

__attribute__((target_version("sve")))
int bar()
{
    return foo(); // Should NOT be optimized to use the simd version
    // even though it is the most specific version in this translation
    // unit as this would lead to different versions being used within
    // the same project
}

//  Translation unit 2:
__attribute__((target_version("default")))
int foo() {
    return 1;
};

__attribute__((target_version("simd")))
int foo();

__attribute__((target_version("sve")))
int foo(){
    return 3;
}

name: Pull request about: Technical issues, document format problems, bugs in scripts or feature proposal.


Thank you for submitting a pull request!

If this PR is about a bugfix:

Please use the bugfix label and make sure to go through the checklist below.

If this PR is about a proposal:

We are looking forward to evaluate your proposal, and if possible to make it part of the Arm C Language Extension (ACLE) specifications.

We would like to encourage you reading through the contribution guidelines, in particular the section on submitting a proposal.

Please use the proposal label.

As for any pull request, please make sure to go through the below checklist.

Checklist: (mark with X those which apply)