This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why are vectors not arrays?
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: gcc at gcc dot gnu dot org
- Date: 9 Apr 2004 10:04:42 -0400
- Subject: 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