This is the mail archive of the gcc@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: Vector types and type conversions



The point is that the existing Altivec and SPE cast syntax requires that
  a C-style cast from one vector type to another be bit-preserving.  So,
we can't change that (or static_casts, which are the kind of C++ cast
that are using to implement this kind of C-style cast) without breaking
backwards compatibility.
I suppose, though, that Chris' proposed array-access extension to vector types may make the situation a bit better. A value preserving cast from V4SI to V4SF could be written as:

v4sf fv = { iv[0], iv[1], iv[2], iv[3] };

if the compiler could make sense of it and produce good code -- which is probably all but trivial.

Paolo


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