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: casting "extended vectors"


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]