Gcc vector extensions do not work as indicated in the docs

By Using vector instructions through built-in functions , this program should compile:

int main(){
    double v_sse __attribute__ ((vector_size (16)));

    /*
     * Should work: "For the convenience in C it is allowed to use a binary vector operation where one operand is a scalar."
     */
    v_sse=v_sse+3.4;

    /*
     * Should work: "Vectors can be subscripted as if the vector were an array with the same number of elements and base type."
     */
    double result=v_sse[0];
}

Instead, I get errors in both operations complaining of invalid operands / types.

I compile on the x86-64 system, so -msse2 is implicit, and my compiler is 4.6.3 (checked also with 4.7.0, it does not work). Where is the catch?

+3
source share
1 answer

The documentation at http://gcc.gnu.org/onlinedocs/gcc/ refers to the current development.

http://gcc.gnu.org/onlinedocs/gcc-XYZ/, (. http://gcc.gnu.org/onlinedocs/ ).

:

... , .

4.7.0 C, ++.

+5

All Articles