Vector types and type conversions
Janis Johnson
janis187@us.ibm.com
Wed Apr 19 16:46:00 GMT 2006
On Wed, Apr 19, 2006 at 05:30:54PM +0200, Paolo Bonzini wrote:
>
> The C spec for Altivec (not the ISA) is a horrible spec that set a
> horrible de facto standard. To some extent, gcc already departed from
> Altivec, for example by disallowing the (vector int) (1, 2, 3, 4) syntax
> -- notice the parentheses instead of the braces -- because it was
> extremely hackish to implement in a Bison parser.
The Motorola AltiVec PIM (sorry, I'm looking at a hard copy and don't
have the link handy) says:
2.4.2 Assignment
If either the left hand side or right hand side of an expression has
a vector type, then both sides of the expression must be of the same
vector type. Thus, the expression a = b is valid and represents
assignment if a and b are of the same vector type (or if neither is
a vector type). Otherwise, the expression is invalid and must be
signaled as an error by the compiler.
We can't blame this admittedly horrible spec for this one.
Janis
More information about the Gcc
mailing list