1 // https://issues.dlang.org/show_bug.cgi?id=17720
2 // { dg-additional-options "-mavx" { target avx_runtime } }
3 // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
6 alias TypeTuple(T
...) = T
;
10 alias Vector16s
= TypeTuple
!(
11 void16
, byte16
, short8
, int4
, long2
,
12 ubyte16
, ushort8
, uint4
, ulong2
, float4
, double2
);
14 // OK: __vector(T) -> __vector(void[]) of same size.
15 // NG: __vector(T) -> __vector(void[]) of different size.
16 // NG: explicit cast __vector(T) -> __vector(void[]) of different size.
17 foreach (V
; Vector16s
)
19 static assert( __traits(compiles
, { void16 v
= V
.init
; }));
20 static assert(!__traits(compiles
, { void32 v
= V
.init
; }));
21 static assert(!__traits(compiles
, { void32 v
= cast(void32
)V
.init
; }));
24 // NG: __vector(T) -> __vector(T) of same size.
25 // OK: explicit cast __vector(T) -> __vector(T) of same size.
26 // NG: __vector(T) -> __vector(T) of different size.
27 // NG: explicit cast __vector(T) -> __vector(T) of different size.
28 foreach (V
; Vector16s
)
30 static if (is(V
== double2
))
32 static assert(!__traits(compiles
, { long2 v
= V
.init
; }));
33 static assert( __traits(compiles
, { long2 v
= cast(long2
)V
.init
; }));
37 static assert(!__traits(compiles
, { double2 v
= V
.init
; }));
38 static assert( __traits(compiles
, { double2 v
= cast(double2
)V
.init
; }));
40 static assert(!__traits(compiles
, { double4 v
= V
.init
; }));
41 static assert(!__traits(compiles
, { double4 v
= cast(double4
)V
.init
; }));