Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/vgm-hi-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target s390_vx } */
3 /* { dg-options "-O2 -march=z13 -mzarch" } */
4 /* { dg-final { check-function-bodies "**" "" "" } } */
5
6 /* Test loading constants which cannot be loaded via VECTOR GENERATE BYTE MASK
7 nor via VECTOR REPLICATE IMMEDIATE but via VECTOR GENERATE MASK. */
8
9 typedef short v1hi __attribute__ ((vector_size (2)));
10 typedef short v2hi __attribute__ ((vector_size (4)));
11 typedef short v4hi __attribute__ ((vector_size (8)));
12 typedef short v8hi __attribute__ ((vector_size (16)));
13
14 /*
15 ** test_v1hi_via_vgmb:
16 ** vgm %v24,0,2,0
17 ** br %r14
18 */
19
20 v1hi
21 test_v1hi_via_vgmb (void)
22 {
23 return (v1hi){0xe0e0};
24 }
25
26 /*
27 ** test_v2hi_via_vgmb:
28 ** vgm %v24,0,2,0
29 ** br %r14
30 */
31
32 v2hi
33 test_v2hi_via_vgmb (void)
34 {
35 return (v2hi){0xe0e0, 0xe0e0};
36 }
37
38 /*
39 ** test_v4hi_via_vgmb:
40 ** vgm %v24,0,2,0
41 ** br %r14
42 */
43
44 v4hi
45 test_v4hi_via_vgmb (void)
46 {
47 return (v4hi){0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0};
48 }
49
50 /*
51 ** test_v8hi_via_vgmb:
52 ** vgm %v24,0,2,0
53 ** br %r14
54 */
55
56 v8hi
57 test_v8hi_via_vgmb (void)
58 {
59 return (v8hi){0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0, 0xe0e0};
60 }
61
62 /*
63 ** test_v1hi_via_vgmb_wrap:
64 ** vgm %v24,5,2,0
65 ** br %r14
66 */
67
68 v1hi
69 test_v1hi_via_vgmb_wrap (void)
70 {
71 return (v1hi){0xe7e7};
72 }
73
74 /*
75 ** test_v2hi_via_vgmb_wrap:
76 ** vgm %v24,5,2,0
77 ** br %r14
78 */
79
80 v2hi
81 test_v2hi_via_vgmb_wrap (void)
82 {
83 return (v2hi){0xe7e7, 0xe7e7};
84 }
85
86 /*
87 ** test_v4hi_via_vgmb_wrap:
88 ** vgm %v24,5,2,0
89 ** br %r14
90 */
91
92 v4hi
93 test_v4hi_via_vgmb_wrap (void)
94 {
95 return (v4hi){0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7};
96 }
97
98 /*
99 ** test_v8hi_via_vgmb_wrap:
100 ** vgm %v24,5,2,0
101 ** br %r14
102 */
103
104 v8hi
105 test_v8hi_via_vgmb_wrap (void)
106 {
107 return (v8hi){0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7, 0xe7e7};
108 }
109
110 /*
111 ** test_v1hi_via_vgmh:
112 ** vgm %v24,5,10,1
113 ** br %r14
114 */
115
116 v1hi
117 test_v1hi_via_vgmh (void)
118 {
119 return (v1hi){0x7e0};
120 }
121
122 /*
123 ** test_v2hi_via_vgmh:
124 ** vgm %v24,5,10,1
125 ** br %r14
126 */
127
128 v2hi
129 test_v2hi_via_vgmh (void)
130 {
131 return (v2hi){0x7e0, 0x7e0};
132 }
133
134 /*
135 ** test_v4hi_via_vgmh:
136 ** vgm %v24,5,10,1
137 ** br %r14
138 */
139
140 v4hi
141 test_v4hi_via_vgmh (void)
142 {
143 return (v4hi){0x7e0, 0x7e0, 0x7e0, 0x7e0};
144 }
145
146 /*
147 ** test_v8hi_via_vgmh:
148 ** vgm %v24,5,10,1
149 ** br %r14
150 */
151
152 v8hi
153 test_v8hi_via_vgmh (void)
154 {
155 return (v8hi){0x7e0, 0x7e0, 0x7e0, 0x7e0, 0x7e0, 0x7e0, 0x7e0, 0x7e0};
156 }
157
158 /*
159 ** test_v2hi_via_vgmf:
160 ** vgm %v24,1,30,2
161 ** br %r14
162 */
163
164 v2hi
165 test_v2hi_via_vgmf (void)
166 {
167 return (v2hi){0x7fff, 0xfffe};
168 }
169
170 /*
171 ** test_v4hi_via_vgmf:
172 ** vgm %v24,1,30,2
173 ** br %r14
174 */
175
176 v4hi
177 test_v4hi_via_vgmf (void)
178 {
179 return (v4hi){0x7fff, 0xfffe, 0x7fff, 0xfffe};
180 }
181
182 /*
183 ** test_v8hi_via_vgmf:
184 ** vgm %v24,1,30,2
185 ** br %r14
186 */
187
188 v8hi
189 test_v8hi_via_vgmf (void)
190 {
191 return (v8hi){0x7fff, 0xfffe, 0x7fff, 0xfffe, 0x7fff, 0xfffe, 0x7fff, 0xfffe};
192 }
193
194 /*
195 ** test_v4hi_via_vgmg:
196 ** vgm %v24,1,62,3
197 ** br %r14
198 */
199
200 v4hi
201 test_v4hi_via_vgmg (void)
202 {
203 return (v4hi){0x7fff, 0xffff, 0xffff, 0xfffe};
204 }
205
206 /*
207 ** test_v8hi_via_vgmg:
208 ** vgm %v24,1,62,3
209 ** br %r14
210 */
211
212 v8hi
213 test_v8hi_via_vgmg (void)
214 {
215 return (v8hi){0x7fff, 0xffff, 0xffff, 0xfffe, 0x7fff, 0xffff, 0xffff, 0xfffe};
216 }