This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Why are vectors not arrays?


This may be a dumb question, but why doesn't this work?

typedef int v2si __attribute__ ((vector_size (8)));
int foo (v2si v) { return v[0]; }

I get:

foo2.c: In function `foo':
foo2.c:2: error: subscripted value is neither array nor pointer

We have vector extensions which support addition, subtraction, and so
forth, which is great, but is there any simple way to actually get
values in and out of vectors?  The documentation appears to be silent
on the matter.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]