1 // { dg-additional-options "-mavx" { target avx_runtime } }
2 // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
7 float4 v1
, v2
= 1, v3
= 1;
14 static assert(!__traits(compiles
, v1
% v2
));
15 static assert(!__traits(compiles
, v1
& v2
));
16 static assert(!__traits(compiles
, v1 | v2
));
17 static assert(!__traits(compiles
, v1 ^ v2
));
18 static assert(!__traits(compiles
, v1
~ v2
));
19 static assert(!__traits(compiles
, v1 ^^ v2
));
22 static assert( __traits(compiles
, v1
== v2
));
23 static assert( __traits(compiles
, v1
!= v2
));
24 static assert( __traits(compiles
, v1
< v2
));
25 static assert( __traits(compiles
, v1
> v2
));
26 static assert( __traits(compiles
, v1
<= v2
));
27 static assert( __traits(compiles
, v1
>= v2
));
28 static assert(!__traits(compiles
, v1
<< 1));
29 static assert(!__traits(compiles
, v1
>> 1));
30 static assert(!__traits(compiles
, v1
>>> 1));
31 static assert(!__traits(compiles
, v1
&& v2
));
32 static assert(!__traits(compiles
, v1 || v2
));
33 static assert(!__traits(compiles
, ~v1
));
36 static assert(!__traits(compiles
, !v1
));
42 static assert(!__traits(compiles
, v1
%= v2
));
43 static assert(!__traits(compiles
, v1
&= v2
));
44 static assert(!__traits(compiles
, v1 |
= v2
));
45 static assert(!__traits(compiles
, v1 ^
= v2
));
46 static assert(!__traits(compiles
, v1
~= v2
));
47 static assert(!__traits(compiles
, v1 ^^
= v2
));
48 static assert(!__traits(compiles
, v1
<<= 1));
49 static assert(!__traits(compiles
, v1
>>= 1));
50 static assert(!__traits(compiles
, v1
>>>= 1));
52 // A cast from vector to non-vector is allowed only when the target is same size Tsarray.
53 static assert(!__traits(compiles
, cast(byte)v1
)); // 1byte
54 static assert(!__traits(compiles
, cast(short)v1
)); // 2byte
55 static assert(!__traits(compiles
, cast(int)v1
)); // 4byte
56 static assert(!__traits(compiles
, cast(long)v1
)); // 8byte
57 static assert(!__traits(compiles
, cast(float)v1
)); // 4byte
58 static assert(!__traits(compiles
, cast(double)v1
)); // 8byte
59 static assert(!__traits(compiles
, cast(int[2])v1
)); // 8byte Tsarray
60 static assert( __traits(compiles
, cast(int[4])v1
)); // 16byte Tsarray, OK
61 static assert( __traits(compiles
, cast(long[2])v1
)); // 16byte Tsarray, OK