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

Add clarification and restrictions for FMV #363

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 21, 2024

  1. Add clarification and restrictions for FMV.

    This clarifies cases like:
    
    ```C
    __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);
    }
    ```
    
    ```C
    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);
    }
    ```
    
    ```C
    __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
    
    ```C
    //  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;
    }
    ```
    AlfieRichardsArm committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    ecd8de5 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2024

  1. Configuration menu
    Copy the full SHA
    9f40b3a View commit details
    Browse the repository at this point in the history