Re: casting "extended vectors"

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

 



On Sat, 5 Jul 2014, Vincenzo Innocente wrote:

at the end of
https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html
I read
"It is possible to cast from one vector type to another, provided they are of the same size"

when I try, it looks to me that it is actually more a type-punning rather than a C-style cast.

Indeed, I am not happy about that, but it seems hard to change that now. If you could send a patch to gcc-patches improving the documentation, it would be welcome.

Is it possible to cast “vectors”  as in C one casts intrinsic types?

Not directly, no. You can cast element by element and hope gcc will vectorize it, but I don't even think that is likely.

From a language point of view, clang recently introduced
__builtin_convertvector. It takes a type as second parameter, that may be an issue if we try to implement the same in gcc.

From an implementation point of view, we seem to have most (all?) pieces
(float_expr, vec_unpack_hi_expr, etc) to represent those in the middle-end.

--
Marc Glisse




[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