1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef TCG_TCG_OP_GVEC_H
21#define TCG_TCG_OP_GVEC_H
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36typedef void gen_helper_gvec_2(TCGv_ptr, TCGv_ptr, TCGv_i32);
37void tcg_gen_gvec_2_ool(uint32_t dofs, uint32_t aofs,
38 uint32_t oprsz, uint32_t maxsz, int32_t data,
39 gen_helper_gvec_2 *fn);
40
41
42typedef void gen_helper_gvec_2i(TCGv_ptr, TCGv_ptr, TCGv_i64, TCGv_i32);
43void tcg_gen_gvec_2i_ool(uint32_t dofs, uint32_t aofs, TCGv_i64 c,
44 uint32_t oprsz, uint32_t maxsz, int32_t data,
45 gen_helper_gvec_2i *fn);
46
47
48typedef void gen_helper_gvec_2_ptr(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_i32);
49void tcg_gen_gvec_2_ptr(uint32_t dofs, uint32_t aofs,
50 TCGv_ptr ptr, uint32_t oprsz, uint32_t maxsz,
51 int32_t data, gen_helper_gvec_2_ptr *fn);
52
53
54typedef void gen_helper_gvec_3(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_i32);
55void tcg_gen_gvec_3_ool(uint32_t dofs, uint32_t aofs, uint32_t bofs,
56 uint32_t oprsz, uint32_t maxsz, int32_t data,
57 gen_helper_gvec_3 *fn);
58
59
60typedef void gen_helper_gvec_4(TCGv_ptr, TCGv_ptr, TCGv_ptr,
61 TCGv_ptr, TCGv_i32);
62void tcg_gen_gvec_4_ool(uint32_t dofs, uint32_t aofs, uint32_t bofs,
63 uint32_t cofs, uint32_t oprsz, uint32_t maxsz,
64 int32_t data, gen_helper_gvec_4 *fn);
65
66
67typedef void gen_helper_gvec_5(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr,
68 TCGv_ptr, TCGv_i32);
69void tcg_gen_gvec_5_ool(uint32_t dofs, uint32_t aofs, uint32_t bofs,
70 uint32_t cofs, uint32_t xofs, uint32_t oprsz,
71 uint32_t maxsz, int32_t data, gen_helper_gvec_5 *fn);
72
73typedef void gen_helper_gvec_3_ptr(TCGv_ptr, TCGv_ptr, TCGv_ptr,
74 TCGv_ptr, TCGv_i32);
75void tcg_gen_gvec_3_ptr(uint32_t dofs, uint32_t aofs, uint32_t bofs,
76 TCGv_ptr ptr, uint32_t oprsz, uint32_t maxsz,
77 int32_t data, gen_helper_gvec_3_ptr *fn);
78
79typedef void gen_helper_gvec_4_ptr(TCGv_ptr, TCGv_ptr, TCGv_ptr,
80 TCGv_ptr, TCGv_ptr, TCGv_i32);
81void tcg_gen_gvec_4_ptr(uint32_t dofs, uint32_t aofs, uint32_t bofs,
82 uint32_t cofs, TCGv_ptr ptr, uint32_t oprsz,
83 uint32_t maxsz, int32_t data,
84 gen_helper_gvec_4_ptr *fn);
85
86typedef void gen_helper_gvec_5_ptr(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr,
87 TCGv_ptr, TCGv_ptr, TCGv_i32);
88void tcg_gen_gvec_5_ptr(uint32_t dofs, uint32_t aofs, uint32_t bofs,
89 uint32_t cofs, uint32_t eofs, TCGv_ptr ptr,
90 uint32_t oprsz, uint32_t maxsz, int32_t data,
91 gen_helper_gvec_5_ptr *fn);
92
93
94
95typedef struct {
96
97
98 void (*fni8)(TCGv_i64, TCGv_i64);
99 void (*fni4)(TCGv_i32, TCGv_i32);
100
101 void (*fniv)(unsigned, TCGv_vec, TCGv_vec);
102
103 gen_helper_gvec_2 *fno;
104
105 const TCGOpcode *opt_opc;
106
107 int32_t data;
108
109 uint8_t vece;
110
111 bool prefer_i64;
112
113 bool load_dest;
114} GVecGen2;
115
116typedef struct {
117
118
119 void (*fni8)(TCGv_i64, TCGv_i64, int64_t);
120 void (*fni4)(TCGv_i32, TCGv_i32, int32_t);
121
122 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, int64_t);
123
124 gen_helper_gvec_2 *fno;
125
126 gen_helper_gvec_2i *fnoi;
127
128 const TCGOpcode *opt_opc;
129
130 uint8_t vece;
131
132 bool prefer_i64;
133
134 bool load_dest;
135} GVecGen2i;
136
137typedef struct {
138
139
140 void (*fni8)(TCGv_i64, TCGv_i64, TCGv_i64);
141 void (*fni4)(TCGv_i32, TCGv_i32, TCGv_i32);
142
143 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec);
144
145 gen_helper_gvec_2i *fno;
146
147 const TCGOpcode *opt_opc;
148
149 uint32_t data;
150
151 uint8_t vece;
152
153 bool prefer_i64;
154
155 bool scalar_first;
156} GVecGen2s;
157
158typedef struct {
159
160
161 void (*fni8)(TCGv_i64, TCGv_i64, TCGv_i64);
162 void (*fni4)(TCGv_i32, TCGv_i32, TCGv_i32);
163
164 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec);
165
166 gen_helper_gvec_3 *fno;
167
168 const TCGOpcode *opt_opc;
169
170 int32_t data;
171
172 uint8_t vece;
173
174 bool prefer_i64;
175
176 bool load_dest;
177} GVecGen3;
178
179typedef struct {
180
181
182
183
184 void (*fni8)(TCGv_i64, TCGv_i64, TCGv_i64, int64_t);
185 void (*fni4)(TCGv_i32, TCGv_i32, TCGv_i32, int32_t);
186
187 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec, int64_t);
188
189 gen_helper_gvec_3 *fno;
190
191 const TCGOpcode *opt_opc;
192
193 uint8_t vece;
194
195 bool prefer_i64;
196
197 bool load_dest;
198} GVecGen3i;
199
200typedef struct {
201
202
203 void (*fni8)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64);
204 void (*fni4)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32);
205
206 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec, TCGv_vec);
207
208 gen_helper_gvec_4 *fno;
209
210 const TCGOpcode *opt_opc;
211
212 int32_t data;
213
214 uint8_t vece;
215
216 bool prefer_i64;
217
218 bool write_aofs;
219} GVecGen4;
220
221typedef struct {
222
223
224
225
226 void (*fni8)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64, int64_t);
227 void (*fni4)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32, int32_t);
228
229 void (*fniv)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec, TCGv_vec, int64_t);
230
231 gen_helper_gvec_4 *fno;
232
233 const TCGOpcode *opt_opc;
234
235 uint8_t vece;
236
237 bool prefer_i64;
238} GVecGen4i;
239
240void tcg_gen_gvec_2(uint32_t dofs, uint32_t aofs,
241 uint32_t oprsz, uint32_t maxsz, const GVecGen2 *);
242void tcg_gen_gvec_2i(uint32_t dofs, uint32_t aofs, uint32_t oprsz,
243 uint32_t maxsz, int64_t c, const GVecGen2i *);
244void tcg_gen_gvec_2s(uint32_t dofs, uint32_t aofs, uint32_t oprsz,
245 uint32_t maxsz, TCGv_i64 c, const GVecGen2s *);
246void tcg_gen_gvec_3(uint32_t dofs, uint32_t aofs, uint32_t bofs,
247 uint32_t oprsz, uint32_t maxsz, const GVecGen3 *);
248void tcg_gen_gvec_3i(uint32_t dofs, uint32_t aofs, uint32_t bofs,
249 uint32_t oprsz, uint32_t maxsz, int64_t c,
250 const GVecGen3i *);
251void tcg_gen_gvec_4(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs,
252 uint32_t oprsz, uint32_t maxsz, const GVecGen4 *);
253void tcg_gen_gvec_4i(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs,
254 uint32_t oprsz, uint32_t maxsz, int64_t c,
255 const GVecGen4i *);
256
257
258
259void tcg_gen_gvec_mov(unsigned vece, uint32_t dofs, uint32_t aofs,
260 uint32_t oprsz, uint32_t maxsz);
261void tcg_gen_gvec_not(unsigned vece, uint32_t dofs, uint32_t aofs,
262 uint32_t oprsz, uint32_t maxsz);
263void tcg_gen_gvec_neg(unsigned vece, uint32_t dofs, uint32_t aofs,
264 uint32_t oprsz, uint32_t maxsz);
265void tcg_gen_gvec_abs(unsigned vece, uint32_t dofs, uint32_t aofs,
266 uint32_t oprsz, uint32_t maxsz);
267
268void tcg_gen_gvec_add(unsigned vece, uint32_t dofs, uint32_t aofs,
269 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
270void tcg_gen_gvec_sub(unsigned vece, uint32_t dofs, uint32_t aofs,
271 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
272void tcg_gen_gvec_mul(unsigned vece, uint32_t dofs, uint32_t aofs,
273 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
274
275void tcg_gen_gvec_addi(unsigned vece, uint32_t dofs, uint32_t aofs,
276 int64_t c, uint32_t oprsz, uint32_t maxsz);
277void tcg_gen_gvec_muli(unsigned vece, uint32_t dofs, uint32_t aofs,
278 int64_t c, uint32_t oprsz, uint32_t maxsz);
279
280void tcg_gen_gvec_adds(unsigned vece, uint32_t dofs, uint32_t aofs,
281 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
282void tcg_gen_gvec_subs(unsigned vece, uint32_t dofs, uint32_t aofs,
283 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
284void tcg_gen_gvec_muls(unsigned vece, uint32_t dofs, uint32_t aofs,
285 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
286
287
288void tcg_gen_gvec_ssadd(unsigned vece, uint32_t dofs, uint32_t aofs,
289 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
290void tcg_gen_gvec_sssub(unsigned vece, uint32_t dofs, uint32_t aofs,
291 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
292void tcg_gen_gvec_usadd(unsigned vece, uint32_t dofs, uint32_t aofs,
293 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
294void tcg_gen_gvec_ussub(unsigned vece, uint32_t dofs, uint32_t aofs,
295 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
296
297
298void tcg_gen_gvec_smin(unsigned vece, uint32_t dofs, uint32_t aofs,
299 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
300void tcg_gen_gvec_umin(unsigned vece, uint32_t dofs, uint32_t aofs,
301 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
302void tcg_gen_gvec_smax(unsigned vece, uint32_t dofs, uint32_t aofs,
303 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
304void tcg_gen_gvec_umax(unsigned vece, uint32_t dofs, uint32_t aofs,
305 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
306
307void tcg_gen_gvec_and(unsigned vece, uint32_t dofs, uint32_t aofs,
308 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
309void tcg_gen_gvec_or(unsigned vece, uint32_t dofs, uint32_t aofs,
310 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
311void tcg_gen_gvec_xor(unsigned vece, uint32_t dofs, uint32_t aofs,
312 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
313void tcg_gen_gvec_andc(unsigned vece, uint32_t dofs, uint32_t aofs,
314 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
315void tcg_gen_gvec_orc(unsigned vece, uint32_t dofs, uint32_t aofs,
316 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
317void tcg_gen_gvec_nand(unsigned vece, uint32_t dofs, uint32_t aofs,
318 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
319void tcg_gen_gvec_nor(unsigned vece, uint32_t dofs, uint32_t aofs,
320 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
321void tcg_gen_gvec_eqv(unsigned vece, uint32_t dofs, uint32_t aofs,
322 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
323
324void tcg_gen_gvec_andi(unsigned vece, uint32_t dofs, uint32_t aofs,
325 int64_t c, uint32_t oprsz, uint32_t maxsz);
326void tcg_gen_gvec_xori(unsigned vece, uint32_t dofs, uint32_t aofs,
327 int64_t c, uint32_t oprsz, uint32_t maxsz);
328void tcg_gen_gvec_ori(unsigned vece, uint32_t dofs, uint32_t aofs,
329 int64_t c, uint32_t oprsz, uint32_t maxsz);
330
331void tcg_gen_gvec_ands(unsigned vece, uint32_t dofs, uint32_t aofs,
332 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
333void tcg_gen_gvec_xors(unsigned vece, uint32_t dofs, uint32_t aofs,
334 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
335void tcg_gen_gvec_ors(unsigned vece, uint32_t dofs, uint32_t aofs,
336 TCGv_i64 c, uint32_t oprsz, uint32_t maxsz);
337
338void tcg_gen_gvec_dup_mem(unsigned vece, uint32_t dofs, uint32_t aofs,
339 uint32_t s, uint32_t m);
340void tcg_gen_gvec_dup_imm(unsigned vece, uint32_t dofs, uint32_t s,
341 uint32_t m, uint64_t imm);
342void tcg_gen_gvec_dup_i32(unsigned vece, uint32_t dofs, uint32_t s,
343 uint32_t m, TCGv_i32);
344void tcg_gen_gvec_dup_i64(unsigned vece, uint32_t dofs, uint32_t s,
345 uint32_t m, TCGv_i64);
346
347#if TARGET_LONG_BITS == 64
348# define tcg_gen_gvec_dup_tl tcg_gen_gvec_dup_i64
349#else
350# define tcg_gen_gvec_dup_tl tcg_gen_gvec_dup_i32
351#endif
352
353void tcg_gen_gvec_shli(unsigned vece, uint32_t dofs, uint32_t aofs,
354 int64_t shift, uint32_t oprsz, uint32_t maxsz);
355void tcg_gen_gvec_shri(unsigned vece, uint32_t dofs, uint32_t aofs,
356 int64_t shift, uint32_t oprsz, uint32_t maxsz);
357void tcg_gen_gvec_sari(unsigned vece, uint32_t dofs, uint32_t aofs,
358 int64_t shift, uint32_t oprsz, uint32_t maxsz);
359void tcg_gen_gvec_rotli(unsigned vece, uint32_t dofs, uint32_t aofs,
360 int64_t shift, uint32_t oprsz, uint32_t maxsz);
361void tcg_gen_gvec_rotri(unsigned vece, uint32_t dofs, uint32_t aofs,
362 int64_t shift, uint32_t oprsz, uint32_t maxsz);
363
364void tcg_gen_gvec_shls(unsigned vece, uint32_t dofs, uint32_t aofs,
365 TCGv_i32 shift, uint32_t oprsz, uint32_t maxsz);
366void tcg_gen_gvec_shrs(unsigned vece, uint32_t dofs, uint32_t aofs,
367 TCGv_i32 shift, uint32_t oprsz, uint32_t maxsz);
368void tcg_gen_gvec_sars(unsigned vece, uint32_t dofs, uint32_t aofs,
369 TCGv_i32 shift, uint32_t oprsz, uint32_t maxsz);
370void tcg_gen_gvec_rotls(unsigned vece, uint32_t dofs, uint32_t aofs,
371 TCGv_i32 shift, uint32_t oprsz, uint32_t maxsz);
372
373
374
375
376
377void tcg_gen_gvec_shlv(unsigned vece, uint32_t dofs, uint32_t aofs,
378 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
379void tcg_gen_gvec_shrv(unsigned vece, uint32_t dofs, uint32_t aofs,
380 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
381void tcg_gen_gvec_sarv(unsigned vece, uint32_t dofs, uint32_t aofs,
382 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
383void tcg_gen_gvec_rotlv(unsigned vece, uint32_t dofs, uint32_t aofs,
384 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
385void tcg_gen_gvec_rotrv(unsigned vece, uint32_t dofs, uint32_t aofs,
386 uint32_t bofs, uint32_t oprsz, uint32_t maxsz);
387
388void tcg_gen_gvec_cmp(TCGCond cond, unsigned vece, uint32_t dofs,
389 uint32_t aofs, uint32_t bofs,
390 uint32_t oprsz, uint32_t maxsz);
391
392
393
394
395void tcg_gen_gvec_bitsel(unsigned vece, uint32_t dofs, uint32_t aofs,
396 uint32_t bofs, uint32_t cofs,
397 uint32_t oprsz, uint32_t maxsz);
398
399
400
401
402
403
404
405void tcg_gen_vec_neg8_i64(TCGv_i64 d, TCGv_i64 a);
406void tcg_gen_vec_neg16_i64(TCGv_i64 d, TCGv_i64 a);
407void tcg_gen_vec_neg32_i64(TCGv_i64 d, TCGv_i64 a);
408
409void tcg_gen_vec_add8_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
410void tcg_gen_vec_add16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
411void tcg_gen_vec_add32_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
412
413void tcg_gen_vec_sub8_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
414void tcg_gen_vec_sub16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
415void tcg_gen_vec_sub32_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);
416
417void tcg_gen_vec_shl8i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
418void tcg_gen_vec_shl16i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
419void tcg_gen_vec_shr8i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
420void tcg_gen_vec_shr16i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
421void tcg_gen_vec_sar8i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
422void tcg_gen_vec_sar16i_i64(TCGv_i64 d, TCGv_i64 a, int64_t);
423void tcg_gen_vec_rotl8i_i64(TCGv_i64 d, TCGv_i64 a, int64_t c);
424void tcg_gen_vec_rotl16i_i64(TCGv_i64 d, TCGv_i64 a, int64_t c);
425
426
427void tcg_gen_vec_add8_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
428void tcg_gen_vec_add16_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
429
430void tcg_gen_vec_sub8_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
431void tcg_gen_vec_sub16_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);
432
433void tcg_gen_vec_shl8i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
434void tcg_gen_vec_shl16i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
435void tcg_gen_vec_shr8i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
436void tcg_gen_vec_shr16i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
437void tcg_gen_vec_sar8i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
438void tcg_gen_vec_sar16i_i32(TCGv_i32 d, TCGv_i32 a, int32_t);
439
440#if TARGET_LONG_BITS == 64
441#define tcg_gen_vec_add8_tl tcg_gen_vec_add8_i64
442#define tcg_gen_vec_sub8_tl tcg_gen_vec_sub8_i64
443#define tcg_gen_vec_add16_tl tcg_gen_vec_add16_i64
444#define tcg_gen_vec_sub16_tl tcg_gen_vec_sub16_i64
445#define tcg_gen_vec_add32_tl tcg_gen_vec_add32_i64
446#define tcg_gen_vec_sub32_tl tcg_gen_vec_sub32_i64
447#define tcg_gen_vec_shl8i_tl tcg_gen_vec_shl8i_i64
448#define tcg_gen_vec_shr8i_tl tcg_gen_vec_shr8i_i64
449#define tcg_gen_vec_sar8i_tl tcg_gen_vec_sar8i_i64
450#define tcg_gen_vec_shl16i_tl tcg_gen_vec_shl16i_i64
451#define tcg_gen_vec_shr16i_tl tcg_gen_vec_shr16i_i64
452#define tcg_gen_vec_sar16i_tl tcg_gen_vec_sar16i_i64
453
454#else
455#define tcg_gen_vec_add8_tl tcg_gen_vec_add8_i32
456#define tcg_gen_vec_sub8_tl tcg_gen_vec_sub8_i32
457#define tcg_gen_vec_add16_tl tcg_gen_vec_add16_i32
458#define tcg_gen_vec_sub16_tl tcg_gen_vec_sub16_i32
459#define tcg_gen_vec_add32_tl tcg_gen_add_i32
460#define tcg_gen_vec_sub32_tl tcg_gen_sub_i32
461#define tcg_gen_vec_shl8i_tl tcg_gen_vec_shl8i_i32
462#define tcg_gen_vec_shr8i_tl tcg_gen_vec_shr8i_i32
463#define tcg_gen_vec_sar8i_tl tcg_gen_vec_sar8i_i32
464#define tcg_gen_vec_shl16i_tl tcg_gen_vec_shl16i_i32
465#define tcg_gen_vec_shr16i_tl tcg_gen_vec_shr16i_i32
466#define tcg_gen_vec_sar16i_tl tcg_gen_vec_sar16i_i32
467#endif
468
469#endif
470