* config/ia64/ia64.c (ia64_function_arg): For a single element HFA,
do return a parallel if hfa_mode == XFmode and mode == TImode.
+2004-07-09 Jan Beulich <jbeulich@novell.com>
+
+ * c-typeck.c (build_unary_op): include VECTOR_TYPE in set of codes
+ permissible for unary plus.
+
2004-07-09 Jan Beulich <jbeulich@novell.com>
* builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.
is enough to prevent anybody from looking inside for
associativity, but won't generate any code. */
if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE
- || typecode == COMPLEX_TYPE))
+ || typecode == COMPLEX_TYPE
+ || typecode == VECTOR_TYPE))
{
error ("wrong type argument to unary plus");
return error_mark_node;
v8hi e;
uv4si f;
-int foo __attribute__((mode(DI)));
-int foo1 __attribute__((mode(SI)));
+long long foo;
+int foo1;
short foo2 __attribute__((vector_size (8)));
void
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* Purpose: Program to test generic SIMD support. */
+
+typedef int __attribute__((vector_size (16))) v4si;
+typedef int __attribute__((vector_size (8))) v2si;
+
+v4si a, b;
+v2si c, d;
+
+void
+hanneke ()
+{
+ /* Operators on compatible SIMD types. */
+ a %= b; /* { dg-bogus "invalid operands to binary %" "" { xfail *-*-* } } */
+ c &= d;
+ a |= b;
+ c ^= d;
+ a >>= b; /* { dg-bogus "invalid operands to binary >>" "" { xfail *-*-* } } */
+ c <<= d; /* { dg-bogus "invalid operands to binary <<" "" { xfail *-*-* } } */
+ a = +b;
+ c = ~d;
+
+ /* Operators on incompatible SIMD types. */
+/* a = b % c; { dg*error "can't convert between vector values of different size" } */
+ a = b % c; /* { dg-bogus "invalid operands to binary %" "" { xfail *-*-* } } */
+ d = c & b; /* { dg-error "can't convert between vector values of different size" } */
+ a = b | c; /* { dg-error "can't convert between vector values of different size" } */
+ d = c ^ b; /* { dg-error "can't convert between vector values of different size" } */
+/* a = b >> c; { dg*error "can't convert between vector values of different size" } */
+ a = b >> c; /* { dg-bogus "invalid operands to binary >>" "" { xfail *-*-* } } */
+/* d = c << b; { dg*error "can't convert between vector values of different size" } */
+ d = c << b; /* { dg-bogus "invalid operands to binary <<" "" { xfail *-*-* } } */
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* Purpose: Program to test generic SIMD support. */
+
+typedef float __attribute__((vector_size(8))) v2sf;
+typedef float __attribute__((vector_size(16))) v4sf;
+typedef double __attribute__((vector_size(16))) v2df;
+
+v4sf a, b;
+v2sf c, d;
+v2df e;
+
+double foo;
+float foo1;
+v2sf foo2;
+
+void
+hanneke ()
+{
+ /* Assignment. */
+ a = b;
+
+ /* Assignment of different types. */
+ b = c; /* { dg-error "incompatible types in assignment" } */
+ d = a; /* { dg-error "incompatible types in assignment" } */
+
+ /* Casting between SIMDs of the same size. */
+ e = (typeof (e)) a;
+
+ /* Assignment between scalar and SIMD of different size. */
+ foo = a; /* { dg-error "incompatible types in assignment" } */
+
+ /* Casted assignment between scalar and SIMD of same size. */
+ foo = (typeof (foo)) foo2; /* { dg-bogus "aggregate value used where a float was expected" "" { xfail *-*-* } } */
+
+ /* Casted assignment between scalar and SIMD of different size. */
+/* foo1 = (typeof (foo1)) foo2; { dg*error "can't convert between vector values of different size" } */
+ foo1 = (typeof (foo1)) foo2; /* { dg-bogus "aggregate value used where a float was expected" "" { xfail *-*-* } } */
+
+ /* Operators on compatible SIMD types. */
+ a += b + b;
+ a -= b;
+ a *= b;
+ a /= b;
+ a = +b;
+ c = -d;
+
+ /* Operators on incompatible SIMD types. */
+ a = b + c; /* { dg-error "can't convert between vector values of different size" } */
+ a = b - c; /* { dg-error "can't convert between vector values of different size" } */
+ a = b * c; /* { dg-error "can't convert between vector values of different size" } */
+ a = b / c; /* { dg-error "can't convert between vector values of different size" } */
+}