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


Andrew Haley <aph@redhat.com> writes:

> Converting a vector of floats (via a cast) to a vector of ints of the
> same size uses a VIEW_CONVERT_EXPR, so the data are simply copied, not
> converted.  This is different from a cast from scalar float to int,
> where a conversion is performed.

In general there is a conflict within gcc between treating vectors as
unitary types and treating them as collections.  In this case we are
treating them as unary.  However, I think that by analogy to the way
we handle arithmetic, and given the existence of instructions like
cvtdq2ps in real vector processors, I think it would be better to
handle converstions on an element by element basis.

That is, I think this is a bug.

Ian


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