This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Vector types and type conversions
- From: Ian Lance Taylor <ian at airs dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 19 Apr 2006 06:41:00 -0700
- Subject: Re: Vector types and type conversions
- References: <17478.12537.51193.943633@zapata.pink>
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