On Wednesday 19 April 2006 14:41, Ian Lance Taylor wrote: > Andrew Haley <[EMAIL PROTECTED]> 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.
In that case I'd expect to be able to convert between eg. V2SF and V2DF. It also raises the question of what should be done in cases where there is no obvious conversion. eg. V4SF to V2DF. Presumably this should be an error. It seems like straight bit-copy "conversion" is a useful feature, so I guess we'd want to invent some syntax for this. What do other compilers do? Paul