1 /* Check that the vec_init expander does its job. */
2
3 /* { dg-do compile } */
4 /* { dg-options "-O3 -mzarch -march=z13" } */
5
6
7
8
9
10 typedef __attribute__((vector_size(16))) signed int v4si;
11
12 extern v4si G;
13
14 v4si
f(signed int a)15 f (signed int a)
16 {
17 return G == a;
18 }
19 /* { dg-final { scan-assembler-times "vrepf" 1 } } */
20
21 v4si
g(signed int * a)22 g (signed int *a)
23 {
24 return G == *a;
25 }
26 /* { dg-final { scan-assembler-times "vlrepf" 1 } } */
27
28 v4si
h()29 h ()
30 {
31 return G == 1;
32 }
33 /* { dg-final { scan-assembler-times "vgmf\t%v.*,31,31" 1 } } */
34
35 v4si
i()36 i ()
37 {
38 return G == -1;
39 }
40 /* { dg-final { scan-assembler-times "vone" 1 } } */
41
42 v4si
j()43 j ()
44 {
45 return G == 0;
46 }
47 /* { dg-final { scan-assembler-times "vzero" 1 } } */
48
49 v4si
k()50 k ()
51 {
52 return G == (v4si){ 0xff80, 0xff80, 0xff80, 0xff80 };
53 }
54 /* { dg-final { scan-assembler-times "vgmf\t%v.*,16,24" 1 } } */
55
56 v4si
l()57 l ()
58 {
59 return G == (v4si){ 0xf000000f, 0xf000000f, 0xf000000f, 0xf000000f };
60 }
61 /* { dg-final { scan-assembler-times "vgmf\t%v.*,28,3" 1 } } */
62
63 v4si
m()64 m ()
65 {
66 return G == (v4si){ 0x00ff00ff, 0x0000ffff, 0xffff0000, 0xff00ff00 };
67 }
68 /* { dg-final { scan-assembler-times "vgbm\t%v.*,21450" 1 } } */
69