This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC Vector Extensions
- From: Christian Schoenebeck <cuse at users dot sourceforge dot net>
- To: gcc-help at gcc dot gnu dot org
- Cc: linuxsampler-devel at lists dot sourceforge dot net
- Date: Fri, 7 Apr 2006 20:57:54 +0200
- Subject: GCC Vector Extensions
Hi!
I just read the GCC Vector Extensions doc [1] and have a few questions.
a) The last code block in that doc [1] uses "builtin" functions? Why should
somebody use those builtin functions when the normal C operations on the new
vector extension types do the same?
b) We wondered [2] what the currently best way is to access single elements of
one vector. Currently the only solution we saw is to use a union trick like:
typedef struct {
float _1;
float _2;
float _3;
float _4;
} quad_samples;
typedef float v4sf __attribute__ ((vector_size (16)));
typedef union {
quad_samples s;
v4sf v;
} quad_sample_t;
Is there a better way to access single elements of a vector?
c) What I'm missing a lot (especially for digital signal processing) are (bit)
shifting operations on the new vector types. Are those planned or already in
work?
[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Vector-Extensions.html#Vector-Extensions
[2] https://bugs.linuxsampler.org/cgi-bin/show_bug.cgi?id=25
CU
Christian