Debian Codegraph @

gcc/testsuite/gdc.dg/torture/simd7414.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=7414
2 // { dg-additional-options "-mavx" { target avx_runtime } }
3 // { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } }
4 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
5 import core.simd;
6 import core.stdc.string;
7
8 immutable ulong2 gulong2 = 0x8000_0000_0000_0000;
9 immutable uint4 guint4 = 0x8000_0000;
10 immutable ushort8 gushort8 = 0x8000;
11 immutable ubyte16 gubyte16 = 0x80;
12
13 immutable long2 glong2 = 0x7000_0000_0000_0000;
14 immutable int4 gint4 = 0x7000_0000;
15 immutable short8 gshort8 = 0x7000;
16 immutable byte16 gbyte16 = 0x70;
17
18 immutable float4 gfloat4 = 4.0;
19 immutable double2 gdouble2 = 8.0;
20
21 void main()
22 {
23 immutable ulong2 lulong2 = 0x8000_0000_0000_0000;
24 assert(memcmp(&lulong2, &gulong2, gulong2.sizeof) == 0);
25
26 immutable uint4 luint4 = 0x8000_0000;
27 assert(memcmp(&luint4, &guint4, guint4.sizeof) == 0);
28
29 immutable ushort8 lushort8 = 0x8000;
30 assert(memcmp(&lushort8, &gushort8, gushort8.sizeof) == 0);
31
32 immutable ubyte16 lubyte16 = 0x80;
33 assert(memcmp(&lubyte16, &gubyte16, gubyte16.sizeof) == 0);
34
35
36 immutable long2 llong2 = 0x7000_0000_0000_0000;
37 assert(memcmp(&llong2, &glong2, glong2.sizeof) == 0);
38
39 immutable int4 lint4 = 0x7000_0000;
40 assert(memcmp(&lint4, &gint4, gint4.sizeof) == 0);
41
42 immutable short8 lshort8 = 0x7000;
43 assert(memcmp(&lshort8, &gshort8, gshort8.sizeof) == 0);
44
45 immutable byte16 lbyte16 = 0x70;
46 assert(memcmp(&lbyte16, &gbyte16, gbyte16.sizeof) == 0);
47
48
49 immutable float4 lfloat4 = 4.0;
50 assert(memcmp(&lfloat4, &gfloat4, gfloat4.sizeof) == 0);
51
52 immutable double2 ldouble2 = 8.0;
53 assert(memcmp(&ldouble2, &gdouble2, gdouble2.sizeof) == 0);
54 }