This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Vector types and type conversions
Gabriel Dos Reis wrote:
> I agree with everything you have said. I suppose I'm a bit unclear
> about this:
>
> already defined. __value_cast<T> would just be an alias for
> static_cast<T> for non-vector types, but for vector types it would do a
> value-preserving conversion, even if C-style and static casts are
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> bit-preserving, for backwards compatibility.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> in particular the last sentence.
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.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713