S/390: Vector base support - testcases
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / vector / vec-init-1.c
blob4deb6b8db52088045c33b7607e317fdeeb0867ce
1 /* Check that the vec_init expander does its job. */
3 /* { dg-do compile } */
4 /* { dg-options "-O3 -mzarch -march=z13" } */
10 typedef __attribute__((vector_size(16))) signed int v4si;
12 extern v4si G;
14 v4si
15 f (signed int a)
17 return G == a;
19 /* { dg-final { scan-assembler-times "vrepf" 1 } } */
21 v4si
22 g (signed int *a)
24 return G == *a;
26 /* { dg-final { scan-assembler-times "vlrepf" 1 } } */
28 v4si
29 h ()
31 return G == 1;
33 /* { dg-final { scan-assembler-times "vgmf\t%v.*,31,31" 1 } } */
35 v4si
36 i ()
38 return G == -1;
40 /* { dg-final { scan-assembler-times "vone" 1 } } */
42 v4si
43 j ()
45 return G == 0;
47 /* { dg-final { scan-assembler-times "vzero" 1 } } */
49 v4si
50 k ()
52 return G == (v4si){ 0xff80, 0xff80, 0xff80, 0xff80 };
54 /* { dg-final { scan-assembler-times "vgmf\t%v.*,16,24" 1 } } */
56 v4si
57 l ()
59 return G == (v4si){ 0xf000000f, 0xf000000f, 0xf000000f, 0xf000000f };
61 /* { dg-final { scan-assembler-times "vgmf\t%v.*,28,3" 1 } } */
63 v4si
64 m ()
66 return G == (v4si){ 0x00ff00ff, 0x0000ffff, 0xffff0000, 0xff00ff00 };
68 /* { dg-final { scan-assembler-times "vgbm\t%v.*,21450" 1 } } */