This is the mail archive of the gcc-help@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]

Re: Accessing the vector elements


Aren Villanueva <aren@indigo-designs.info> writes:

> How would I access the vector elements in that vector float??
> I can't seem to find any comprehensive information on this topic.

gcc doesn't implement [] for vectors.  The only way to access the
elements is something like:

    union
    {
      vectortype v;
      float af[4];
    } u;
    u.v = v;
    return u.af[0];

Ian


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