Re: Extracting members of a SIMD type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been playing around with the builtin SIMD support in 3.4, but have
come to one very confusing problem. Given a vector type (V4SI in my case),
how do you extract parts of it? I tried indexing and shift/mask, neither of
which are accepted, and the info pages have no examples of how to do this.
I would sort of presume that you can access them without using a
target-specific builtin, considering everything else gets synthesized on a
machine without hardware SIMD...

Create a union of your vector type and an array of the type of the parts.
Like:


union v4si_conv {
	v4si v;
	int e[4];
};


Store the vector to v, read the elements from e[].



Cheers,


Segher


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux