annotate gcc/testsuite/gcc.dg/vmx/stl.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 #include "harness.h"
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 static unsigned char svuc[16] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
4 static signed char svsc[16] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
5 static unsigned char svbc[16] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
6 static unsigned short svus[8] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
7 static signed short svss[8] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
8 static unsigned short svbs[8] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
9 static unsigned short svp[8] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
10 static unsigned int svui[4] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
11 static signed int svsi[4] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
12 static unsigned int svbi[4] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
13 static float svf[4] __attribute__ ((aligned (16)));
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 static void check_arrays ()
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 unsigned int i;
kono
parents:
diff changeset
18 for (i = 0; i < 16; ++i)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 check (svuc[i] == i, "svuc");
kono
parents:
diff changeset
21 check (svsc[i] == i - 8, "svsc");
kono
parents:
diff changeset
22 check (svbc[i] == ((i % 2) ? 0xff : 0), "svbc");
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24 for (i = 0; i < 8; ++i)
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 check (svus[i] == i, "svus");
kono
parents:
diff changeset
27 check (svss[i] == i - 4, "svss");
kono
parents:
diff changeset
28 check (svbs[i] == ((i % 2) ? 0xffff : 0), "svbs");
kono
parents:
diff changeset
29 check (svp[i] == i, "svp");
kono
parents:
diff changeset
30 }
kono
parents:
diff changeset
31 for (i = 0; i < 4; ++i)
kono
parents:
diff changeset
32 {
kono
parents:
diff changeset
33 check (svui[i] == i, "svui");
kono
parents:
diff changeset
34 check (svsi[i] == i - 2, "svsi");
kono
parents:
diff changeset
35 check (svbi[i] == ((i % 2) ? 0xffffffff : 0), "svbi");
kono
parents:
diff changeset
36 check (svf[i] == i * 1.0f, "svf");
kono
parents:
diff changeset
37 }
kono
parents:
diff changeset
38 }
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 static void test ()
kono
parents:
diff changeset
41 {
kono
parents:
diff changeset
42 vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
kono
parents:
diff changeset
43 vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
kono
parents:
diff changeset
44 vector bool char vbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
kono
parents:
diff changeset
45 vector unsigned short vus = {0,1,2,3,4,5,6,7};
kono
parents:
diff changeset
46 vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
kono
parents:
diff changeset
47 vector bool short vbs = {0,65535,0,65535,0,65535,0,65535};
kono
parents:
diff changeset
48 vector pixel vp = {0,1,2,3,4,5,6,7};
kono
parents:
diff changeset
49 vector unsigned int vui = {0,1,2,3};
kono
parents:
diff changeset
50 vector signed int vsi = {-2,-1,0,1};
kono
parents:
diff changeset
51 vector bool int vbi = {0,0xffffffff,0,0xffffffff};
kono
parents:
diff changeset
52 vector float vf = {0.0,1.0,2.0,3.0};
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 vec_stl (vuc, 0, (vector unsigned char *)svuc);
kono
parents:
diff changeset
55 vec_stl (vsc, 0, (vector signed char *)svsc);
kono
parents:
diff changeset
56 vec_stl (vbc, 0, (vector bool char *)svbc);
kono
parents:
diff changeset
57 vec_stl (vus, 0, (vector unsigned short *)svus);
kono
parents:
diff changeset
58 vec_stl (vss, 0, (vector signed short *)svss);
kono
parents:
diff changeset
59 vec_stl (vbs, 0, (vector bool short *)svbs);
kono
parents:
diff changeset
60 vec_stl (vp, 0, (vector pixel *)svp);
kono
parents:
diff changeset
61 vec_stl (vui, 0, (vector unsigned int *)svui);
kono
parents:
diff changeset
62 vec_stl (vsi, 0, (vector signed int *)svsi);
kono
parents:
diff changeset
63 vec_stl (vbi, 0, (vector bool int *)svbi);
kono
parents:
diff changeset
64 vec_stl (vf, 0, (vector float *)svf);
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 check_arrays ();
kono
parents:
diff changeset
67 }