xref: /openbmc/qemu/target/loongarch/disas.c (revision a158c63b)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * QEMU LoongArch Disassembler
4  *
5  * Copyright (c) 2021 Loongson Technology Corporation Limited.
6  */
7 
8 #include "qemu/osdep.h"
9 #include "disas/dis-asm.h"
10 #include "qemu/bitops.h"
11 #include "cpu-csr.h"
12 
13 typedef struct {
14     disassemble_info *info;
15     uint64_t pc;
16     uint32_t insn;
17 } DisasContext;
18 
19 static inline int plus_1(DisasContext *ctx, int x)
20 {
21     return x + 1;
22 }
23 
24 static inline int shl_1(DisasContext *ctx, int x)
25 {
26     return x << 1;
27 }
28 
29 static inline int shl_2(DisasContext *ctx, int x)
30 {
31     return x << 2;
32 }
33 
34 static inline int shl_3(DisasContext *ctx, int x)
35 {
36     return x << 3;
37 }
38 
39 #define CSR_NAME(REG) \
40     [LOONGARCH_CSR_##REG] = (#REG)
41 
42 static const char * const csr_names[] = {
43     CSR_NAME(CRMD),
44     CSR_NAME(PRMD),
45     CSR_NAME(EUEN),
46     CSR_NAME(MISC),
47     CSR_NAME(ECFG),
48     CSR_NAME(ESTAT),
49     CSR_NAME(ERA),
50     CSR_NAME(BADV),
51     CSR_NAME(BADI),
52     CSR_NAME(EENTRY),
53     CSR_NAME(TLBIDX),
54     CSR_NAME(TLBEHI),
55     CSR_NAME(TLBELO0),
56     CSR_NAME(TLBELO1),
57     CSR_NAME(ASID),
58     CSR_NAME(PGDL),
59     CSR_NAME(PGDH),
60     CSR_NAME(PGD),
61     CSR_NAME(PWCL),
62     CSR_NAME(PWCH),
63     CSR_NAME(STLBPS),
64     CSR_NAME(RVACFG),
65     CSR_NAME(CPUID),
66     CSR_NAME(PRCFG1),
67     CSR_NAME(PRCFG2),
68     CSR_NAME(PRCFG3),
69     CSR_NAME(SAVE(0)),
70     CSR_NAME(SAVE(1)),
71     CSR_NAME(SAVE(2)),
72     CSR_NAME(SAVE(3)),
73     CSR_NAME(SAVE(4)),
74     CSR_NAME(SAVE(5)),
75     CSR_NAME(SAVE(6)),
76     CSR_NAME(SAVE(7)),
77     CSR_NAME(SAVE(8)),
78     CSR_NAME(SAVE(9)),
79     CSR_NAME(SAVE(10)),
80     CSR_NAME(SAVE(11)),
81     CSR_NAME(SAVE(12)),
82     CSR_NAME(SAVE(13)),
83     CSR_NAME(SAVE(14)),
84     CSR_NAME(SAVE(15)),
85     CSR_NAME(TID),
86     CSR_NAME(TCFG),
87     CSR_NAME(TVAL),
88     CSR_NAME(CNTC),
89     CSR_NAME(TICLR),
90     CSR_NAME(LLBCTL),
91     CSR_NAME(IMPCTL1),
92     CSR_NAME(IMPCTL2),
93     CSR_NAME(TLBRENTRY),
94     CSR_NAME(TLBRBADV),
95     CSR_NAME(TLBRERA),
96     CSR_NAME(TLBRSAVE),
97     CSR_NAME(TLBRELO0),
98     CSR_NAME(TLBRELO1),
99     CSR_NAME(TLBREHI),
100     CSR_NAME(TLBRPRMD),
101     CSR_NAME(MERRCTL),
102     CSR_NAME(MERRINFO1),
103     CSR_NAME(MERRINFO2),
104     CSR_NAME(MERRENTRY),
105     CSR_NAME(MERRERA),
106     CSR_NAME(MERRSAVE),
107     CSR_NAME(CTAG),
108     CSR_NAME(DMW(0)),
109     CSR_NAME(DMW(1)),
110     CSR_NAME(DMW(2)),
111     CSR_NAME(DMW(3)),
112     CSR_NAME(DBG),
113     CSR_NAME(DERA),
114     CSR_NAME(DSAVE),
115 };
116 
117 static const char *get_csr_name(unsigned num)
118 {
119     return ((num < ARRAY_SIZE(csr_names)) && (csr_names[num] != NULL)) ?
120            csr_names[num] : "Undefined CSR";
121 }
122 
123 #define output(C, INSN, FMT, ...)                                      \
124  {                                                                     \
125     if ((C)->info->show_opcodes) {                                     \
126         (C)->info->fprintf_func((C)->info->stream, "%08x   %-9s\t" FMT,\
127                             (C)->insn, INSN, ##__VA_ARGS__);           \
128     } else {                                                           \
129         (C)->info->fprintf_func((C)->info->stream, "%-9s\t" FMT,       \
130                             INSN, ##__VA_ARGS__);                      \
131     }                                                                  \
132 }
133 
134 #include "decode-insns.c.inc"
135 
136 int print_insn_loongarch(bfd_vma memaddr, struct disassemble_info *info)
137 {
138     bfd_byte buffer[4];
139     uint32_t insn;
140     int status;
141 
142     status = (*info->read_memory_func)(memaddr, buffer, 4, info);
143     if (status != 0) {
144         (*info->memory_error_func)(status, memaddr, info);
145         return -1;
146     }
147     insn = bfd_getl32(buffer);
148     DisasContext ctx = {
149         .info = info,
150         .pc = memaddr,
151         .insn = insn
152     };
153 
154     if (!decode(&ctx, insn)) {
155         output(&ctx, "illegal", "");
156     }
157     return 4;
158 }
159 
160 static void output_r_i(DisasContext *ctx, arg_r_i *a, const char *mnemonic)
161 {
162     output(ctx, mnemonic, "r%d, %d", a->rd, a->imm);
163 }
164 
165 static void output_rrr(DisasContext *ctx, arg_rrr *a, const char *mnemonic)
166 {
167     output(ctx, mnemonic, "r%d, r%d, r%d", a->rd, a->rj, a->rk);
168 }
169 
170 static void output_rr_i(DisasContext *ctx, arg_rr_i *a, const char *mnemonic)
171 {
172     output(ctx, mnemonic, "r%d, r%d, %d", a->rd, a->rj, a->imm);
173 }
174 
175 static void output_rrr_sa(DisasContext *ctx, arg_rrr_sa *a,
176                           const char *mnemonic)
177 {
178     output(ctx, mnemonic, "r%d, r%d, r%d, %d", a->rd, a->rj, a->rk, a->sa);
179 }
180 
181 static void output_rr(DisasContext *ctx, arg_rr *a, const char *mnemonic)
182 {
183     output(ctx, mnemonic, "r%d, r%d", a->rd, a->rj);
184 }
185 
186 static void output_rr_ms_ls(DisasContext *ctx, arg_rr_ms_ls *a,
187                           const char *mnemonic)
188 {
189     output(ctx, mnemonic, "r%d, r%d, %d, %d", a->rd, a->rj, a->ms, a->ls);
190 }
191 
192 static void output_hint_r_i(DisasContext *ctx, arg_hint_r_i *a,
193                             const char *mnemonic)
194 {
195     output(ctx, mnemonic, "%d, r%d, %d", a->hint, a->rj, a->imm);
196 }
197 
198 static void output_hint_rr(DisasContext *ctx, arg_hint_rr *a,
199                            const char *mnemonic)
200 {
201     output(ctx, mnemonic, "%d, r%d, r%d", a->hint, a->rj, a->rk);
202 }
203 
204 static void output_i(DisasContext *ctx, arg_i *a, const char *mnemonic)
205 {
206     output(ctx, mnemonic, "%d", a->imm);
207 }
208 
209 static void output_rr_jk(DisasContext *ctx, arg_rr_jk *a,
210                          const char *mnemonic)
211 {
212     output(ctx, mnemonic, "r%d, r%d", a->rj, a->rk);
213 }
214 
215 static void output_ff(DisasContext *ctx, arg_ff *a, const char *mnemonic)
216 {
217     output(ctx, mnemonic, "f%d, f%d", a->fd, a->fj);
218 }
219 
220 static void output_fff(DisasContext *ctx, arg_fff *a, const char *mnemonic)
221 {
222     output(ctx, mnemonic, "f%d, f%d, f%d", a->fd, a->fj, a->fk);
223 }
224 
225 static void output_ffff(DisasContext *ctx, arg_ffff *a, const char *mnemonic)
226 {
227     output(ctx, mnemonic, "f%d, f%d, f%d, f%d", a->fd, a->fj, a->fk, a->fa);
228 }
229 
230 static void output_fffc(DisasContext *ctx, arg_fffc *a, const char *mnemonic)
231 {
232     output(ctx, mnemonic, "f%d, f%d, f%d, %d", a->fd, a->fj, a->fk, a->ca);
233 }
234 
235 static void output_fr(DisasContext *ctx, arg_fr *a, const char *mnemonic)
236 {
237     output(ctx, mnemonic, "f%d, r%d", a->fd, a->rj);
238 }
239 
240 static void output_rf(DisasContext *ctx, arg_rf *a, const char *mnemonic)
241 {
242     output(ctx, mnemonic, "r%d, f%d", a->rd, a->fj);
243 }
244 
245 static void output_fcsrd_r(DisasContext *ctx, arg_fcsrd_r *a,
246                            const char *mnemonic)
247 {
248     output(ctx, mnemonic, "fcsr%d, r%d", a->fcsrd, a->rj);
249 }
250 
251 static void output_r_fcsrs(DisasContext *ctx, arg_r_fcsrs *a,
252                            const char *mnemonic)
253 {
254     output(ctx, mnemonic, "r%d, fcsr%d", a->rd, a->fcsrs);
255 }
256 
257 static void output_cf(DisasContext *ctx, arg_cf *a, const char *mnemonic)
258 {
259     output(ctx, mnemonic, "fcc%d, f%d", a->cd, a->fj);
260 }
261 
262 static void output_fc(DisasContext *ctx, arg_fc *a, const char *mnemonic)
263 {
264     output(ctx, mnemonic, "f%d, fcc%d", a->fd, a->cj);
265 }
266 
267 static void output_cr(DisasContext *ctx, arg_cr *a, const char *mnemonic)
268 {
269     output(ctx, mnemonic, "fcc%d, r%d", a->cd, a->rj);
270 }
271 
272 static void output_rc(DisasContext *ctx, arg_rc *a, const char *mnemonic)
273 {
274     output(ctx, mnemonic, "r%d, fcc%d", a->rd, a->cj);
275 }
276 
277 static void output_frr(DisasContext *ctx, arg_frr *a, const char *mnemonic)
278 {
279     output(ctx, mnemonic, "f%d, r%d, r%d", a->fd, a->rj, a->rk);
280 }
281 
282 static void output_fr_i(DisasContext *ctx, arg_fr_i *a, const char *mnemonic)
283 {
284     output(ctx, mnemonic, "f%d, r%d, %d", a->fd, a->rj, a->imm);
285 }
286 
287 static void output_r_offs(DisasContext *ctx, arg_r_offs *a,
288                           const char *mnemonic)
289 {
290     output(ctx, mnemonic, "r%d, %d # 0x%" PRIx64, a->rj, a->offs,
291            ctx->pc + a->offs);
292 }
293 
294 static void output_c_offs(DisasContext *ctx, arg_c_offs *a,
295                           const char *mnemonic)
296 {
297     output(ctx, mnemonic, "fcc%d, %d # 0x%" PRIx64, a->cj, a->offs,
298            ctx->pc + a->offs);
299 }
300 
301 static void output_offs(DisasContext *ctx, arg_offs *a,
302                         const char *mnemonic)
303 {
304     output(ctx, mnemonic, "%d # 0x%" PRIx64, a->offs, ctx->pc + a->offs);
305 }
306 
307 static void output_rr_offs(DisasContext *ctx, arg_rr_offs *a,
308                            const char *mnemonic)
309 {
310     output(ctx, mnemonic, "r%d, r%d, %d # 0x%" PRIx64, a->rj,
311            a->rd, a->offs, ctx->pc + a->offs);
312 }
313 
314 static void output_r_csr(DisasContext *ctx, arg_r_csr *a,
315                          const char *mnemonic)
316 {
317     output(ctx, mnemonic, "r%d, %d # %s", a->rd, a->csr, get_csr_name(a->csr));
318 }
319 
320 static void output_rr_csr(DisasContext *ctx, arg_rr_csr *a,
321                           const char *mnemonic)
322 {
323     output(ctx, mnemonic, "r%d, r%d, %d # %s",
324            a->rd, a->rj, a->csr, get_csr_name(a->csr));
325 }
326 
327 static void output_empty(DisasContext *ctx, arg_empty *a,
328                          const char *mnemonic)
329 {
330     output(ctx, mnemonic, "");
331 }
332 
333 static void output_i_rr(DisasContext *ctx, arg_i_rr *a, const char *mnemonic)
334 {
335     output(ctx, mnemonic, "%d, r%d, r%d", a->imm, a->rj, a->rk);
336 }
337 
338 static void output_cop_r_i(DisasContext *ctx, arg_cop_r_i *a,
339                            const char *mnemonic)
340 {
341     output(ctx, mnemonic, "%d, r%d, %d", a->cop, a->rj, a->imm);
342 }
343 
344 static void output_j_i(DisasContext *ctx, arg_j_i *a, const char *mnemonic)
345 {
346     output(ctx, mnemonic, "r%d, %d", a->rj, a->imm);
347 }
348 
349 #define INSN(insn, type)                                    \
350 static bool trans_##insn(DisasContext *ctx, arg_##type * a) \
351 {                                                           \
352     output_##type(ctx, a, #insn);                           \
353     return true;                                            \
354 }
355 
356 INSN(clo_w,        rr)
357 INSN(clz_w,        rr)
358 INSN(cto_w,        rr)
359 INSN(ctz_w,        rr)
360 INSN(clo_d,        rr)
361 INSN(clz_d,        rr)
362 INSN(cto_d,        rr)
363 INSN(ctz_d,        rr)
364 INSN(revb_2h,      rr)
365 INSN(revb_4h,      rr)
366 INSN(revb_2w,      rr)
367 INSN(revb_d,       rr)
368 INSN(revh_2w,      rr)
369 INSN(revh_d,       rr)
370 INSN(bitrev_4b,    rr)
371 INSN(bitrev_8b,    rr)
372 INSN(bitrev_w,     rr)
373 INSN(bitrev_d,     rr)
374 INSN(ext_w_h,      rr)
375 INSN(ext_w_b,      rr)
376 INSN(rdtimel_w,    rr)
377 INSN(rdtimeh_w,    rr)
378 INSN(rdtime_d,     rr)
379 INSN(cpucfg,       rr)
380 INSN(asrtle_d,     rr_jk)
381 INSN(asrtgt_d,     rr_jk)
382 INSN(alsl_w,       rrr_sa)
383 INSN(alsl_wu,      rrr_sa)
384 INSN(bytepick_w,   rrr_sa)
385 INSN(bytepick_d,   rrr_sa)
386 INSN(add_w,        rrr)
387 INSN(add_d,        rrr)
388 INSN(sub_w,        rrr)
389 INSN(sub_d,        rrr)
390 INSN(slt,          rrr)
391 INSN(sltu,         rrr)
392 INSN(maskeqz,      rrr)
393 INSN(masknez,      rrr)
394 INSN(nor,          rrr)
395 INSN(and,          rrr)
396 INSN(or,           rrr)
397 INSN(xor,          rrr)
398 INSN(orn,          rrr)
399 INSN(andn,         rrr)
400 INSN(sll_w,        rrr)
401 INSN(srl_w,        rrr)
402 INSN(sra_w,        rrr)
403 INSN(sll_d,        rrr)
404 INSN(srl_d,        rrr)
405 INSN(sra_d,        rrr)
406 INSN(rotr_w,       rrr)
407 INSN(rotr_d,       rrr)
408 INSN(mul_w,        rrr)
409 INSN(mulh_w,       rrr)
410 INSN(mulh_wu,      rrr)
411 INSN(mul_d,        rrr)
412 INSN(mulh_d,       rrr)
413 INSN(mulh_du,      rrr)
414 INSN(mulw_d_w,     rrr)
415 INSN(mulw_d_wu,    rrr)
416 INSN(div_w,        rrr)
417 INSN(mod_w,        rrr)
418 INSN(div_wu,       rrr)
419 INSN(mod_wu,       rrr)
420 INSN(div_d,        rrr)
421 INSN(mod_d,        rrr)
422 INSN(div_du,       rrr)
423 INSN(mod_du,       rrr)
424 INSN(crc_w_b_w,    rrr)
425 INSN(crc_w_h_w,    rrr)
426 INSN(crc_w_w_w,    rrr)
427 INSN(crc_w_d_w,    rrr)
428 INSN(crcc_w_b_w,   rrr)
429 INSN(crcc_w_h_w,   rrr)
430 INSN(crcc_w_w_w,   rrr)
431 INSN(crcc_w_d_w,   rrr)
432 INSN(break,        i)
433 INSN(syscall,      i)
434 INSN(alsl_d,       rrr_sa)
435 INSN(slli_w,       rr_i)
436 INSN(slli_d,       rr_i)
437 INSN(srli_w,       rr_i)
438 INSN(srli_d,       rr_i)
439 INSN(srai_w,       rr_i)
440 INSN(srai_d,       rr_i)
441 INSN(rotri_w,      rr_i)
442 INSN(rotri_d,      rr_i)
443 INSN(bstrins_w,    rr_ms_ls)
444 INSN(bstrpick_w,   rr_ms_ls)
445 INSN(bstrins_d,    rr_ms_ls)
446 INSN(bstrpick_d,   rr_ms_ls)
447 INSN(fadd_s,       fff)
448 INSN(fadd_d,       fff)
449 INSN(fsub_s,       fff)
450 INSN(fsub_d,       fff)
451 INSN(fmul_s,       fff)
452 INSN(fmul_d,       fff)
453 INSN(fdiv_s,       fff)
454 INSN(fdiv_d,       fff)
455 INSN(fmax_s,       fff)
456 INSN(fmax_d,       fff)
457 INSN(fmin_s,       fff)
458 INSN(fmin_d,       fff)
459 INSN(fmaxa_s,      fff)
460 INSN(fmaxa_d,      fff)
461 INSN(fmina_s,      fff)
462 INSN(fmina_d,      fff)
463 INSN(fscaleb_s,    fff)
464 INSN(fscaleb_d,    fff)
465 INSN(fcopysign_s,  fff)
466 INSN(fcopysign_d,  fff)
467 INSN(fabs_s,       ff)
468 INSN(fabs_d,       ff)
469 INSN(fneg_s,       ff)
470 INSN(fneg_d,       ff)
471 INSN(flogb_s,      ff)
472 INSN(flogb_d,      ff)
473 INSN(fclass_s,     ff)
474 INSN(fclass_d,     ff)
475 INSN(fsqrt_s,      ff)
476 INSN(fsqrt_d,      ff)
477 INSN(frecip_s,     ff)
478 INSN(frecip_d,     ff)
479 INSN(frsqrt_s,     ff)
480 INSN(frsqrt_d,     ff)
481 INSN(fmov_s,       ff)
482 INSN(fmov_d,       ff)
483 INSN(movgr2fr_w,   fr)
484 INSN(movgr2fr_d,   fr)
485 INSN(movgr2frh_w,  fr)
486 INSN(movfr2gr_s,   rf)
487 INSN(movfr2gr_d,   rf)
488 INSN(movfrh2gr_s,  rf)
489 INSN(movgr2fcsr,   fcsrd_r)
490 INSN(movfcsr2gr,   r_fcsrs)
491 INSN(movfr2cf,     cf)
492 INSN(movcf2fr,     fc)
493 INSN(movgr2cf,     cr)
494 INSN(movcf2gr,     rc)
495 INSN(fcvt_s_d,     ff)
496 INSN(fcvt_d_s,     ff)
497 INSN(ftintrm_w_s,  ff)
498 INSN(ftintrm_w_d,  ff)
499 INSN(ftintrm_l_s,  ff)
500 INSN(ftintrm_l_d,  ff)
501 INSN(ftintrp_w_s,  ff)
502 INSN(ftintrp_w_d,  ff)
503 INSN(ftintrp_l_s,  ff)
504 INSN(ftintrp_l_d,  ff)
505 INSN(ftintrz_w_s,  ff)
506 INSN(ftintrz_w_d,  ff)
507 INSN(ftintrz_l_s,  ff)
508 INSN(ftintrz_l_d,  ff)
509 INSN(ftintrne_w_s, ff)
510 INSN(ftintrne_w_d, ff)
511 INSN(ftintrne_l_s, ff)
512 INSN(ftintrne_l_d, ff)
513 INSN(ftint_w_s,    ff)
514 INSN(ftint_w_d,    ff)
515 INSN(ftint_l_s,    ff)
516 INSN(ftint_l_d,    ff)
517 INSN(ffint_s_w,    ff)
518 INSN(ffint_s_l,    ff)
519 INSN(ffint_d_w,    ff)
520 INSN(ffint_d_l,    ff)
521 INSN(frint_s,      ff)
522 INSN(frint_d,      ff)
523 INSN(slti,         rr_i)
524 INSN(sltui,        rr_i)
525 INSN(addi_w,       rr_i)
526 INSN(addi_d,       rr_i)
527 INSN(lu52i_d,      rr_i)
528 INSN(andi,         rr_i)
529 INSN(ori,          rr_i)
530 INSN(xori,         rr_i)
531 INSN(fmadd_s,      ffff)
532 INSN(fmadd_d,      ffff)
533 INSN(fmsub_s,      ffff)
534 INSN(fmsub_d,      ffff)
535 INSN(fnmadd_s,     ffff)
536 INSN(fnmadd_d,     ffff)
537 INSN(fnmsub_s,     ffff)
538 INSN(fnmsub_d,     ffff)
539 INSN(fsel,         fffc)
540 INSN(addu16i_d,    rr_i)
541 INSN(lu12i_w,      r_i)
542 INSN(lu32i_d,      r_i)
543 INSN(ll_w,         rr_i)
544 INSN(sc_w,         rr_i)
545 INSN(ll_d,         rr_i)
546 INSN(sc_d,         rr_i)
547 INSN(ldptr_w,      rr_i)
548 INSN(stptr_w,      rr_i)
549 INSN(ldptr_d,      rr_i)
550 INSN(stptr_d,      rr_i)
551 INSN(ld_b,         rr_i)
552 INSN(ld_h,         rr_i)
553 INSN(ld_w,         rr_i)
554 INSN(ld_d,         rr_i)
555 INSN(st_b,         rr_i)
556 INSN(st_h,         rr_i)
557 INSN(st_w,         rr_i)
558 INSN(st_d,         rr_i)
559 INSN(ld_bu,        rr_i)
560 INSN(ld_hu,        rr_i)
561 INSN(ld_wu,        rr_i)
562 INSN(preld,        hint_r_i)
563 INSN(preldx,       hint_rr)
564 INSN(fld_s,        fr_i)
565 INSN(fst_s,        fr_i)
566 INSN(fld_d,        fr_i)
567 INSN(fst_d,        fr_i)
568 INSN(ldx_b,        rrr)
569 INSN(ldx_h,        rrr)
570 INSN(ldx_w,        rrr)
571 INSN(ldx_d,        rrr)
572 INSN(stx_b,        rrr)
573 INSN(stx_h,        rrr)
574 INSN(stx_w,        rrr)
575 INSN(stx_d,        rrr)
576 INSN(ldx_bu,       rrr)
577 INSN(ldx_hu,       rrr)
578 INSN(ldx_wu,       rrr)
579 INSN(fldx_s,       frr)
580 INSN(fldx_d,       frr)
581 INSN(fstx_s,       frr)
582 INSN(fstx_d,       frr)
583 INSN(amswap_w,     rrr)
584 INSN(amswap_d,     rrr)
585 INSN(amadd_w,      rrr)
586 INSN(amadd_d,      rrr)
587 INSN(amand_w,      rrr)
588 INSN(amand_d,      rrr)
589 INSN(amor_w,       rrr)
590 INSN(amor_d,       rrr)
591 INSN(amxor_w,      rrr)
592 INSN(amxor_d,      rrr)
593 INSN(ammax_w,      rrr)
594 INSN(ammax_d,      rrr)
595 INSN(ammin_w,      rrr)
596 INSN(ammin_d,      rrr)
597 INSN(ammax_wu,     rrr)
598 INSN(ammax_du,     rrr)
599 INSN(ammin_wu,     rrr)
600 INSN(ammin_du,     rrr)
601 INSN(amswap_db_w,  rrr)
602 INSN(amswap_db_d,  rrr)
603 INSN(amadd_db_w,   rrr)
604 INSN(amadd_db_d,   rrr)
605 INSN(amand_db_w,   rrr)
606 INSN(amand_db_d,   rrr)
607 INSN(amor_db_w,    rrr)
608 INSN(amor_db_d,    rrr)
609 INSN(amxor_db_w,   rrr)
610 INSN(amxor_db_d,   rrr)
611 INSN(ammax_db_w,   rrr)
612 INSN(ammax_db_d,   rrr)
613 INSN(ammin_db_w,   rrr)
614 INSN(ammin_db_d,   rrr)
615 INSN(ammax_db_wu,  rrr)
616 INSN(ammax_db_du,  rrr)
617 INSN(ammin_db_wu,  rrr)
618 INSN(ammin_db_du,  rrr)
619 INSN(dbar,         i)
620 INSN(ibar,         i)
621 INSN(fldgt_s,      frr)
622 INSN(fldgt_d,      frr)
623 INSN(fldle_s,      frr)
624 INSN(fldle_d,      frr)
625 INSN(fstgt_s,      frr)
626 INSN(fstgt_d,      frr)
627 INSN(fstle_s,      frr)
628 INSN(fstle_d,      frr)
629 INSN(ldgt_b,       rrr)
630 INSN(ldgt_h,       rrr)
631 INSN(ldgt_w,       rrr)
632 INSN(ldgt_d,       rrr)
633 INSN(ldle_b,       rrr)
634 INSN(ldle_h,       rrr)
635 INSN(ldle_w,       rrr)
636 INSN(ldle_d,       rrr)
637 INSN(stgt_b,       rrr)
638 INSN(stgt_h,       rrr)
639 INSN(stgt_w,       rrr)
640 INSN(stgt_d,       rrr)
641 INSN(stle_b,       rrr)
642 INSN(stle_h,       rrr)
643 INSN(stle_w,       rrr)
644 INSN(stle_d,       rrr)
645 INSN(beqz,         r_offs)
646 INSN(bnez,         r_offs)
647 INSN(bceqz,        c_offs)
648 INSN(bcnez,        c_offs)
649 INSN(jirl,         rr_i)
650 INSN(b,            offs)
651 INSN(bl,           offs)
652 INSN(beq,          rr_offs)
653 INSN(bne,          rr_offs)
654 INSN(blt,          rr_offs)
655 INSN(bge,          rr_offs)
656 INSN(bltu,         rr_offs)
657 INSN(bgeu,         rr_offs)
658 INSN(csrrd,        r_csr)
659 INSN(csrwr,        r_csr)
660 INSN(csrxchg,      rr_csr)
661 INSN(iocsrrd_b,    rr)
662 INSN(iocsrrd_h,    rr)
663 INSN(iocsrrd_w,    rr)
664 INSN(iocsrrd_d,    rr)
665 INSN(iocsrwr_b,    rr)
666 INSN(iocsrwr_h,    rr)
667 INSN(iocsrwr_w,    rr)
668 INSN(iocsrwr_d,    rr)
669 INSN(tlbsrch,      empty)
670 INSN(tlbrd,        empty)
671 INSN(tlbwr,        empty)
672 INSN(tlbfill,      empty)
673 INSN(tlbclr,       empty)
674 INSN(tlbflush,     empty)
675 INSN(invtlb,       i_rr)
676 INSN(cacop,        cop_r_i)
677 INSN(lddir,        rr_i)
678 INSN(ldpte,        j_i)
679 INSN(ertn,         empty)
680 INSN(idle,         i)
681 INSN(dbcl,         i)
682 
683 #define output_fcmp(C, PREFIX, SUFFIX)                                         \
684 {                                                                              \
685     (C)->info->fprintf_func((C)->info->stream, "%08x   %s%s\tfcc%d, f%d, f%d", \
686                             (C)->insn, PREFIX, SUFFIX, a->cd,                  \
687                             a->fj, a->fk);                                     \
688 }
689 
690 static bool output_cff_fcond(DisasContext *ctx, arg_cff_fcond * a,
691                                const char *suffix)
692 {
693     bool ret = true;
694     switch (a->fcond) {
695     case 0x0:
696         output_fcmp(ctx, "fcmp_caf_", suffix);
697         break;
698     case 0x1:
699         output_fcmp(ctx, "fcmp_saf_", suffix);
700         break;
701     case 0x2:
702         output_fcmp(ctx, "fcmp_clt_", suffix);
703         break;
704     case 0x3:
705         output_fcmp(ctx, "fcmp_slt_", suffix);
706         break;
707     case 0x4:
708         output_fcmp(ctx, "fcmp_ceq_", suffix);
709         break;
710     case 0x5:
711         output_fcmp(ctx, "fcmp_seq_", suffix);
712         break;
713     case 0x6:
714         output_fcmp(ctx, "fcmp_cle_", suffix);
715         break;
716     case 0x7:
717         output_fcmp(ctx, "fcmp_sle_", suffix);
718         break;
719     case 0x8:
720         output_fcmp(ctx, "fcmp_cun_", suffix);
721         break;
722     case 0x9:
723         output_fcmp(ctx, "fcmp_sun_", suffix);
724         break;
725     case 0xA:
726         output_fcmp(ctx, "fcmp_cult_", suffix);
727         break;
728     case 0xB:
729         output_fcmp(ctx, "fcmp_sult_", suffix);
730         break;
731     case 0xC:
732         output_fcmp(ctx, "fcmp_cueq_", suffix);
733         break;
734     case 0xD:
735         output_fcmp(ctx, "fcmp_sueq_", suffix);
736         break;
737     case 0xE:
738         output_fcmp(ctx, "fcmp_cule_", suffix);
739         break;
740     case 0xF:
741         output_fcmp(ctx, "fcmp_sule_", suffix);
742         break;
743     case 0x10:
744         output_fcmp(ctx, "fcmp_cne_", suffix);
745         break;
746     case 0x11:
747         output_fcmp(ctx, "fcmp_sne_", suffix);
748         break;
749     case 0x14:
750         output_fcmp(ctx, "fcmp_cor_", suffix);
751         break;
752     case 0x15:
753         output_fcmp(ctx, "fcmp_sor_", suffix);
754         break;
755     case 0x18:
756         output_fcmp(ctx, "fcmp_cune_", suffix);
757         break;
758     case 0x19:
759         output_fcmp(ctx, "fcmp_sune_", suffix);
760         break;
761     default:
762         ret = false;
763     }
764     return ret;
765 }
766 
767 #define FCMP_INSN(suffix)                               \
768 static bool trans_fcmp_cond_##suffix(DisasContext *ctx, \
769                                      arg_cff_fcond * a) \
770 {                                                       \
771     return output_cff_fcond(ctx, a, #suffix);           \
772 }
773 
774 FCMP_INSN(s)
775 FCMP_INSN(d)
776 
777 #define PCADD_INSN(name)                                        \
778 static bool trans_##name(DisasContext *ctx, arg_##name *a)      \
779 {                                                               \
780     output(ctx, #name, "r%d, %d # 0x%" PRIx64,                  \
781            a->rd, a->imm, gen_##name(ctx->pc, a->imm));         \
782     return true;                                                \
783 }
784 
785 static uint64_t gen_pcaddi(uint64_t pc, int imm)
786 {
787     return pc + (imm << 2);
788 }
789 
790 static uint64_t gen_pcalau12i(uint64_t pc, int imm)
791 {
792     return (pc + (imm << 12)) & ~0xfff;
793 }
794 
795 static uint64_t gen_pcaddu12i(uint64_t pc, int imm)
796 {
797     return pc + (imm << 12);
798 }
799 
800 static uint64_t gen_pcaddu18i(uint64_t pc, int imm)
801 {
802     return pc + ((uint64_t)(imm) << 18);
803 }
804 
805 PCADD_INSN(pcaddi)
806 PCADD_INSN(pcalau12i)
807 PCADD_INSN(pcaddu12i)
808 PCADD_INSN(pcaddu18i)
809 
810 #define INSN_LSX(insn, type)                                \
811 static bool trans_##insn(DisasContext *ctx, arg_##type * a) \
812 {                                                           \
813     output_##type(ctx, a, #insn);                           \
814     return true;                                            \
815 }
816 
817 static void output_cv(DisasContext *ctx, arg_cv *a,
818                         const char *mnemonic)
819 {
820     output(ctx, mnemonic, "fcc%d, v%d", a->cd, a->vj);
821 }
822 
823 static void output_vvv(DisasContext *ctx, arg_vvv *a, const char *mnemonic)
824 {
825     output(ctx, mnemonic, "v%d, v%d, v%d", a->vd, a->vj, a->vk);
826 }
827 
828 static void output_vv_i(DisasContext *ctx, arg_vv_i *a, const char *mnemonic)
829 {
830     output(ctx, mnemonic, "v%d, v%d, 0x%x", a->vd, a->vj, a->imm);
831 }
832 
833 static void output_vv(DisasContext *ctx, arg_vv *a, const char *mnemonic)
834 {
835     output(ctx, mnemonic, "v%d, v%d", a->vd, a->vj);
836 }
837 
838 static void output_vvvv(DisasContext *ctx, arg_vvvv *a, const char *mnemonic)
839 {
840     output(ctx, mnemonic, "v%d, v%d, v%d, v%d", a->vd, a->vj, a->vk, a->va);
841 }
842 
843 static void output_vr_i(DisasContext *ctx, arg_vr_i *a, const char *mnemonic)
844 {
845     output(ctx, mnemonic, "v%d, r%d, 0x%x", a->vd, a->rj, a->imm);
846 }
847 
848 static void output_vr_ii(DisasContext *ctx, arg_vr_ii *a, const char *mnemonic)
849 {
850     output(ctx, mnemonic, "v%d, r%d, 0x%x, 0x%x", a->vd, a->rj, a->imm, a->imm2);
851 }
852 
853 static void output_rv_i(DisasContext *ctx, arg_rv_i *a, const char *mnemonic)
854 {
855     output(ctx, mnemonic, "r%d, v%d, 0x%x", a->rd, a->vj,  a->imm);
856 }
857 
858 static void output_vr(DisasContext *ctx, arg_vr *a, const char *mnemonic)
859 {
860     output(ctx, mnemonic, "v%d, r%d", a->vd, a->rj);
861 }
862 
863 static void output_vvr(DisasContext *ctx, arg_vvr *a, const char *mnemonic)
864 {
865     output(ctx, mnemonic, "v%d, v%d, r%d", a->vd, a->vj, a->rk);
866 }
867 
868 static void output_vrr(DisasContext *ctx, arg_vrr *a, const char *mnemonic)
869 {
870     output(ctx, mnemonic, "v%d, r%d, r%d", a->vd, a->rj, a->rk);
871 }
872 
873 static void output_v_i(DisasContext *ctx, arg_v_i *a, const char *mnemonic)
874 {
875     output(ctx, mnemonic, "v%d, 0x%x", a->vd, a->imm);
876 }
877 
878 INSN_LSX(vadd_b,           vvv)
879 INSN_LSX(vadd_h,           vvv)
880 INSN_LSX(vadd_w,           vvv)
881 INSN_LSX(vadd_d,           vvv)
882 INSN_LSX(vadd_q,           vvv)
883 INSN_LSX(vsub_b,           vvv)
884 INSN_LSX(vsub_h,           vvv)
885 INSN_LSX(vsub_w,           vvv)
886 INSN_LSX(vsub_d,           vvv)
887 INSN_LSX(vsub_q,           vvv)
888 
889 INSN_LSX(vaddi_bu,         vv_i)
890 INSN_LSX(vaddi_hu,         vv_i)
891 INSN_LSX(vaddi_wu,         vv_i)
892 INSN_LSX(vaddi_du,         vv_i)
893 INSN_LSX(vsubi_bu,         vv_i)
894 INSN_LSX(vsubi_hu,         vv_i)
895 INSN_LSX(vsubi_wu,         vv_i)
896 INSN_LSX(vsubi_du,         vv_i)
897 
898 INSN_LSX(vneg_b,           vv)
899 INSN_LSX(vneg_h,           vv)
900 INSN_LSX(vneg_w,           vv)
901 INSN_LSX(vneg_d,           vv)
902 
903 INSN_LSX(vsadd_b,          vvv)
904 INSN_LSX(vsadd_h,          vvv)
905 INSN_LSX(vsadd_w,          vvv)
906 INSN_LSX(vsadd_d,          vvv)
907 INSN_LSX(vsadd_bu,         vvv)
908 INSN_LSX(vsadd_hu,         vvv)
909 INSN_LSX(vsadd_wu,         vvv)
910 INSN_LSX(vsadd_du,         vvv)
911 INSN_LSX(vssub_b,          vvv)
912 INSN_LSX(vssub_h,          vvv)
913 INSN_LSX(vssub_w,          vvv)
914 INSN_LSX(vssub_d,          vvv)
915 INSN_LSX(vssub_bu,         vvv)
916 INSN_LSX(vssub_hu,         vvv)
917 INSN_LSX(vssub_wu,         vvv)
918 INSN_LSX(vssub_du,         vvv)
919 
920 INSN_LSX(vhaddw_h_b,       vvv)
921 INSN_LSX(vhaddw_w_h,       vvv)
922 INSN_LSX(vhaddw_d_w,       vvv)
923 INSN_LSX(vhaddw_q_d,       vvv)
924 INSN_LSX(vhaddw_hu_bu,     vvv)
925 INSN_LSX(vhaddw_wu_hu,     vvv)
926 INSN_LSX(vhaddw_du_wu,     vvv)
927 INSN_LSX(vhaddw_qu_du,     vvv)
928 INSN_LSX(vhsubw_h_b,       vvv)
929 INSN_LSX(vhsubw_w_h,       vvv)
930 INSN_LSX(vhsubw_d_w,       vvv)
931 INSN_LSX(vhsubw_q_d,       vvv)
932 INSN_LSX(vhsubw_hu_bu,     vvv)
933 INSN_LSX(vhsubw_wu_hu,     vvv)
934 INSN_LSX(vhsubw_du_wu,     vvv)
935 INSN_LSX(vhsubw_qu_du,     vvv)
936 
937 INSN_LSX(vaddwev_h_b,      vvv)
938 INSN_LSX(vaddwev_w_h,      vvv)
939 INSN_LSX(vaddwev_d_w,      vvv)
940 INSN_LSX(vaddwev_q_d,      vvv)
941 INSN_LSX(vaddwod_h_b,      vvv)
942 INSN_LSX(vaddwod_w_h,      vvv)
943 INSN_LSX(vaddwod_d_w,      vvv)
944 INSN_LSX(vaddwod_q_d,      vvv)
945 INSN_LSX(vsubwev_h_b,      vvv)
946 INSN_LSX(vsubwev_w_h,      vvv)
947 INSN_LSX(vsubwev_d_w,      vvv)
948 INSN_LSX(vsubwev_q_d,      vvv)
949 INSN_LSX(vsubwod_h_b,      vvv)
950 INSN_LSX(vsubwod_w_h,      vvv)
951 INSN_LSX(vsubwod_d_w,      vvv)
952 INSN_LSX(vsubwod_q_d,      vvv)
953 
954 INSN_LSX(vaddwev_h_bu,     vvv)
955 INSN_LSX(vaddwev_w_hu,     vvv)
956 INSN_LSX(vaddwev_d_wu,     vvv)
957 INSN_LSX(vaddwev_q_du,     vvv)
958 INSN_LSX(vaddwod_h_bu,     vvv)
959 INSN_LSX(vaddwod_w_hu,     vvv)
960 INSN_LSX(vaddwod_d_wu,     vvv)
961 INSN_LSX(vaddwod_q_du,     vvv)
962 INSN_LSX(vsubwev_h_bu,     vvv)
963 INSN_LSX(vsubwev_w_hu,     vvv)
964 INSN_LSX(vsubwev_d_wu,     vvv)
965 INSN_LSX(vsubwev_q_du,     vvv)
966 INSN_LSX(vsubwod_h_bu,     vvv)
967 INSN_LSX(vsubwod_w_hu,     vvv)
968 INSN_LSX(vsubwod_d_wu,     vvv)
969 INSN_LSX(vsubwod_q_du,     vvv)
970 
971 INSN_LSX(vaddwev_h_bu_b,   vvv)
972 INSN_LSX(vaddwev_w_hu_h,   vvv)
973 INSN_LSX(vaddwev_d_wu_w,   vvv)
974 INSN_LSX(vaddwev_q_du_d,   vvv)
975 INSN_LSX(vaddwod_h_bu_b,   vvv)
976 INSN_LSX(vaddwod_w_hu_h,   vvv)
977 INSN_LSX(vaddwod_d_wu_w,   vvv)
978 INSN_LSX(vaddwod_q_du_d,   vvv)
979 
980 INSN_LSX(vavg_b,           vvv)
981 INSN_LSX(vavg_h,           vvv)
982 INSN_LSX(vavg_w,           vvv)
983 INSN_LSX(vavg_d,           vvv)
984 INSN_LSX(vavg_bu,          vvv)
985 INSN_LSX(vavg_hu,          vvv)
986 INSN_LSX(vavg_wu,          vvv)
987 INSN_LSX(vavg_du,          vvv)
988 INSN_LSX(vavgr_b,          vvv)
989 INSN_LSX(vavgr_h,          vvv)
990 INSN_LSX(vavgr_w,          vvv)
991 INSN_LSX(vavgr_d,          vvv)
992 INSN_LSX(vavgr_bu,         vvv)
993 INSN_LSX(vavgr_hu,         vvv)
994 INSN_LSX(vavgr_wu,         vvv)
995 INSN_LSX(vavgr_du,         vvv)
996 
997 INSN_LSX(vabsd_b,          vvv)
998 INSN_LSX(vabsd_h,          vvv)
999 INSN_LSX(vabsd_w,          vvv)
1000 INSN_LSX(vabsd_d,          vvv)
1001 INSN_LSX(vabsd_bu,         vvv)
1002 INSN_LSX(vabsd_hu,         vvv)
1003 INSN_LSX(vabsd_wu,         vvv)
1004 INSN_LSX(vabsd_du,         vvv)
1005 
1006 INSN_LSX(vadda_b,          vvv)
1007 INSN_LSX(vadda_h,          vvv)
1008 INSN_LSX(vadda_w,          vvv)
1009 INSN_LSX(vadda_d,          vvv)
1010 
1011 INSN_LSX(vmax_b,           vvv)
1012 INSN_LSX(vmax_h,           vvv)
1013 INSN_LSX(vmax_w,           vvv)
1014 INSN_LSX(vmax_d,           vvv)
1015 INSN_LSX(vmin_b,           vvv)
1016 INSN_LSX(vmin_h,           vvv)
1017 INSN_LSX(vmin_w,           vvv)
1018 INSN_LSX(vmin_d,           vvv)
1019 INSN_LSX(vmax_bu,          vvv)
1020 INSN_LSX(vmax_hu,          vvv)
1021 INSN_LSX(vmax_wu,          vvv)
1022 INSN_LSX(vmax_du,          vvv)
1023 INSN_LSX(vmin_bu,          vvv)
1024 INSN_LSX(vmin_hu,          vvv)
1025 INSN_LSX(vmin_wu,          vvv)
1026 INSN_LSX(vmin_du,          vvv)
1027 INSN_LSX(vmaxi_b,          vv_i)
1028 INSN_LSX(vmaxi_h,          vv_i)
1029 INSN_LSX(vmaxi_w,          vv_i)
1030 INSN_LSX(vmaxi_d,          vv_i)
1031 INSN_LSX(vmini_b,          vv_i)
1032 INSN_LSX(vmini_h,          vv_i)
1033 INSN_LSX(vmini_w,          vv_i)
1034 INSN_LSX(vmini_d,          vv_i)
1035 INSN_LSX(vmaxi_bu,         vv_i)
1036 INSN_LSX(vmaxi_hu,         vv_i)
1037 INSN_LSX(vmaxi_wu,         vv_i)
1038 INSN_LSX(vmaxi_du,         vv_i)
1039 INSN_LSX(vmini_bu,         vv_i)
1040 INSN_LSX(vmini_hu,         vv_i)
1041 INSN_LSX(vmini_wu,         vv_i)
1042 INSN_LSX(vmini_du,         vv_i)
1043 
1044 INSN_LSX(vmul_b,           vvv)
1045 INSN_LSX(vmul_h,           vvv)
1046 INSN_LSX(vmul_w,           vvv)
1047 INSN_LSX(vmul_d,           vvv)
1048 INSN_LSX(vmuh_b,           vvv)
1049 INSN_LSX(vmuh_h,           vvv)
1050 INSN_LSX(vmuh_w,           vvv)
1051 INSN_LSX(vmuh_d,           vvv)
1052 INSN_LSX(vmuh_bu,          vvv)
1053 INSN_LSX(vmuh_hu,          vvv)
1054 INSN_LSX(vmuh_wu,          vvv)
1055 INSN_LSX(vmuh_du,          vvv)
1056 
1057 INSN_LSX(vmulwev_h_b,      vvv)
1058 INSN_LSX(vmulwev_w_h,      vvv)
1059 INSN_LSX(vmulwev_d_w,      vvv)
1060 INSN_LSX(vmulwev_q_d,      vvv)
1061 INSN_LSX(vmulwod_h_b,      vvv)
1062 INSN_LSX(vmulwod_w_h,      vvv)
1063 INSN_LSX(vmulwod_d_w,      vvv)
1064 INSN_LSX(vmulwod_q_d,      vvv)
1065 INSN_LSX(vmulwev_h_bu,     vvv)
1066 INSN_LSX(vmulwev_w_hu,     vvv)
1067 INSN_LSX(vmulwev_d_wu,     vvv)
1068 INSN_LSX(vmulwev_q_du,     vvv)
1069 INSN_LSX(vmulwod_h_bu,     vvv)
1070 INSN_LSX(vmulwod_w_hu,     vvv)
1071 INSN_LSX(vmulwod_d_wu,     vvv)
1072 INSN_LSX(vmulwod_q_du,     vvv)
1073 INSN_LSX(vmulwev_h_bu_b,   vvv)
1074 INSN_LSX(vmulwev_w_hu_h,   vvv)
1075 INSN_LSX(vmulwev_d_wu_w,   vvv)
1076 INSN_LSX(vmulwev_q_du_d,   vvv)
1077 INSN_LSX(vmulwod_h_bu_b,   vvv)
1078 INSN_LSX(vmulwod_w_hu_h,   vvv)
1079 INSN_LSX(vmulwod_d_wu_w,   vvv)
1080 INSN_LSX(vmulwod_q_du_d,   vvv)
1081 
1082 INSN_LSX(vmadd_b,          vvv)
1083 INSN_LSX(vmadd_h,          vvv)
1084 INSN_LSX(vmadd_w,          vvv)
1085 INSN_LSX(vmadd_d,          vvv)
1086 INSN_LSX(vmsub_b,          vvv)
1087 INSN_LSX(vmsub_h,          vvv)
1088 INSN_LSX(vmsub_w,          vvv)
1089 INSN_LSX(vmsub_d,          vvv)
1090 
1091 INSN_LSX(vmaddwev_h_b,     vvv)
1092 INSN_LSX(vmaddwev_w_h,     vvv)
1093 INSN_LSX(vmaddwev_d_w,     vvv)
1094 INSN_LSX(vmaddwev_q_d,     vvv)
1095 INSN_LSX(vmaddwod_h_b,     vvv)
1096 INSN_LSX(vmaddwod_w_h,     vvv)
1097 INSN_LSX(vmaddwod_d_w,     vvv)
1098 INSN_LSX(vmaddwod_q_d,     vvv)
1099 INSN_LSX(vmaddwev_h_bu,    vvv)
1100 INSN_LSX(vmaddwev_w_hu,    vvv)
1101 INSN_LSX(vmaddwev_d_wu,    vvv)
1102 INSN_LSX(vmaddwev_q_du,    vvv)
1103 INSN_LSX(vmaddwod_h_bu,    vvv)
1104 INSN_LSX(vmaddwod_w_hu,    vvv)
1105 INSN_LSX(vmaddwod_d_wu,    vvv)
1106 INSN_LSX(vmaddwod_q_du,    vvv)
1107 INSN_LSX(vmaddwev_h_bu_b,  vvv)
1108 INSN_LSX(vmaddwev_w_hu_h,  vvv)
1109 INSN_LSX(vmaddwev_d_wu_w,  vvv)
1110 INSN_LSX(vmaddwev_q_du_d,  vvv)
1111 INSN_LSX(vmaddwod_h_bu_b,  vvv)
1112 INSN_LSX(vmaddwod_w_hu_h,  vvv)
1113 INSN_LSX(vmaddwod_d_wu_w,  vvv)
1114 INSN_LSX(vmaddwod_q_du_d,  vvv)
1115 
1116 INSN_LSX(vdiv_b,           vvv)
1117 INSN_LSX(vdiv_h,           vvv)
1118 INSN_LSX(vdiv_w,           vvv)
1119 INSN_LSX(vdiv_d,           vvv)
1120 INSN_LSX(vdiv_bu,          vvv)
1121 INSN_LSX(vdiv_hu,          vvv)
1122 INSN_LSX(vdiv_wu,          vvv)
1123 INSN_LSX(vdiv_du,          vvv)
1124 INSN_LSX(vmod_b,           vvv)
1125 INSN_LSX(vmod_h,           vvv)
1126 INSN_LSX(vmod_w,           vvv)
1127 INSN_LSX(vmod_d,           vvv)
1128 INSN_LSX(vmod_bu,          vvv)
1129 INSN_LSX(vmod_hu,          vvv)
1130 INSN_LSX(vmod_wu,          vvv)
1131 INSN_LSX(vmod_du,          vvv)
1132 
1133 INSN_LSX(vsat_b,           vv_i)
1134 INSN_LSX(vsat_h,           vv_i)
1135 INSN_LSX(vsat_w,           vv_i)
1136 INSN_LSX(vsat_d,           vv_i)
1137 INSN_LSX(vsat_bu,          vv_i)
1138 INSN_LSX(vsat_hu,          vv_i)
1139 INSN_LSX(vsat_wu,          vv_i)
1140 INSN_LSX(vsat_du,          vv_i)
1141 
1142 INSN_LSX(vexth_h_b,        vv)
1143 INSN_LSX(vexth_w_h,        vv)
1144 INSN_LSX(vexth_d_w,        vv)
1145 INSN_LSX(vexth_q_d,        vv)
1146 INSN_LSX(vexth_hu_bu,      vv)
1147 INSN_LSX(vexth_wu_hu,      vv)
1148 INSN_LSX(vexth_du_wu,      vv)
1149 INSN_LSX(vexth_qu_du,      vv)
1150 
1151 INSN_LSX(vsigncov_b,       vvv)
1152 INSN_LSX(vsigncov_h,       vvv)
1153 INSN_LSX(vsigncov_w,       vvv)
1154 INSN_LSX(vsigncov_d,       vvv)
1155 
1156 INSN_LSX(vmskltz_b,        vv)
1157 INSN_LSX(vmskltz_h,        vv)
1158 INSN_LSX(vmskltz_w,        vv)
1159 INSN_LSX(vmskltz_d,        vv)
1160 INSN_LSX(vmskgez_b,        vv)
1161 INSN_LSX(vmsknz_b,         vv)
1162 
1163 INSN_LSX(vldi,             v_i)
1164 
1165 INSN_LSX(vand_v,           vvv)
1166 INSN_LSX(vor_v,            vvv)
1167 INSN_LSX(vxor_v,           vvv)
1168 INSN_LSX(vnor_v,           vvv)
1169 INSN_LSX(vandn_v,          vvv)
1170 INSN_LSX(vorn_v,           vvv)
1171 
1172 INSN_LSX(vandi_b,          vv_i)
1173 INSN_LSX(vori_b,           vv_i)
1174 INSN_LSX(vxori_b,          vv_i)
1175 INSN_LSX(vnori_b,          vv_i)
1176 
1177 INSN_LSX(vsll_b,           vvv)
1178 INSN_LSX(vsll_h,           vvv)
1179 INSN_LSX(vsll_w,           vvv)
1180 INSN_LSX(vsll_d,           vvv)
1181 INSN_LSX(vslli_b,          vv_i)
1182 INSN_LSX(vslli_h,          vv_i)
1183 INSN_LSX(vslli_w,          vv_i)
1184 INSN_LSX(vslli_d,          vv_i)
1185 
1186 INSN_LSX(vsrl_b,           vvv)
1187 INSN_LSX(vsrl_h,           vvv)
1188 INSN_LSX(vsrl_w,           vvv)
1189 INSN_LSX(vsrl_d,           vvv)
1190 INSN_LSX(vsrli_b,          vv_i)
1191 INSN_LSX(vsrli_h,          vv_i)
1192 INSN_LSX(vsrli_w,          vv_i)
1193 INSN_LSX(vsrli_d,          vv_i)
1194 
1195 INSN_LSX(vsra_b,           vvv)
1196 INSN_LSX(vsra_h,           vvv)
1197 INSN_LSX(vsra_w,           vvv)
1198 INSN_LSX(vsra_d,           vvv)
1199 INSN_LSX(vsrai_b,          vv_i)
1200 INSN_LSX(vsrai_h,          vv_i)
1201 INSN_LSX(vsrai_w,          vv_i)
1202 INSN_LSX(vsrai_d,          vv_i)
1203 
1204 INSN_LSX(vrotr_b,          vvv)
1205 INSN_LSX(vrotr_h,          vvv)
1206 INSN_LSX(vrotr_w,          vvv)
1207 INSN_LSX(vrotr_d,          vvv)
1208 INSN_LSX(vrotri_b,         vv_i)
1209 INSN_LSX(vrotri_h,         vv_i)
1210 INSN_LSX(vrotri_w,         vv_i)
1211 INSN_LSX(vrotri_d,         vv_i)
1212 
1213 INSN_LSX(vsllwil_h_b,      vv_i)
1214 INSN_LSX(vsllwil_w_h,      vv_i)
1215 INSN_LSX(vsllwil_d_w,      vv_i)
1216 INSN_LSX(vextl_q_d,        vv)
1217 INSN_LSX(vsllwil_hu_bu,    vv_i)
1218 INSN_LSX(vsllwil_wu_hu,    vv_i)
1219 INSN_LSX(vsllwil_du_wu,    vv_i)
1220 INSN_LSX(vextl_qu_du,      vv)
1221 
1222 INSN_LSX(vsrlr_b,          vvv)
1223 INSN_LSX(vsrlr_h,          vvv)
1224 INSN_LSX(vsrlr_w,          vvv)
1225 INSN_LSX(vsrlr_d,          vvv)
1226 INSN_LSX(vsrlri_b,         vv_i)
1227 INSN_LSX(vsrlri_h,         vv_i)
1228 INSN_LSX(vsrlri_w,         vv_i)
1229 INSN_LSX(vsrlri_d,         vv_i)
1230 
1231 INSN_LSX(vsrar_b,          vvv)
1232 INSN_LSX(vsrar_h,          vvv)
1233 INSN_LSX(vsrar_w,          vvv)
1234 INSN_LSX(vsrar_d,          vvv)
1235 INSN_LSX(vsrari_b,         vv_i)
1236 INSN_LSX(vsrari_h,         vv_i)
1237 INSN_LSX(vsrari_w,         vv_i)
1238 INSN_LSX(vsrari_d,         vv_i)
1239 
1240 INSN_LSX(vsrln_b_h,       vvv)
1241 INSN_LSX(vsrln_h_w,       vvv)
1242 INSN_LSX(vsrln_w_d,       vvv)
1243 INSN_LSX(vsran_b_h,       vvv)
1244 INSN_LSX(vsran_h_w,       vvv)
1245 INSN_LSX(vsran_w_d,       vvv)
1246 
1247 INSN_LSX(vsrlni_b_h,       vv_i)
1248 INSN_LSX(vsrlni_h_w,       vv_i)
1249 INSN_LSX(vsrlni_w_d,       vv_i)
1250 INSN_LSX(vsrlni_d_q,       vv_i)
1251 INSN_LSX(vsrani_b_h,       vv_i)
1252 INSN_LSX(vsrani_h_w,       vv_i)
1253 INSN_LSX(vsrani_w_d,       vv_i)
1254 INSN_LSX(vsrani_d_q,       vv_i)
1255 
1256 INSN_LSX(vsrlrn_b_h,       vvv)
1257 INSN_LSX(vsrlrn_h_w,       vvv)
1258 INSN_LSX(vsrlrn_w_d,       vvv)
1259 INSN_LSX(vsrarn_b_h,       vvv)
1260 INSN_LSX(vsrarn_h_w,       vvv)
1261 INSN_LSX(vsrarn_w_d,       vvv)
1262 
1263 INSN_LSX(vsrlrni_b_h,      vv_i)
1264 INSN_LSX(vsrlrni_h_w,      vv_i)
1265 INSN_LSX(vsrlrni_w_d,      vv_i)
1266 INSN_LSX(vsrlrni_d_q,      vv_i)
1267 INSN_LSX(vsrarni_b_h,      vv_i)
1268 INSN_LSX(vsrarni_h_w,      vv_i)
1269 INSN_LSX(vsrarni_w_d,      vv_i)
1270 INSN_LSX(vsrarni_d_q,      vv_i)
1271 
1272 INSN_LSX(vssrln_b_h,       vvv)
1273 INSN_LSX(vssrln_h_w,       vvv)
1274 INSN_LSX(vssrln_w_d,       vvv)
1275 INSN_LSX(vssran_b_h,       vvv)
1276 INSN_LSX(vssran_h_w,       vvv)
1277 INSN_LSX(vssran_w_d,       vvv)
1278 INSN_LSX(vssrln_bu_h,      vvv)
1279 INSN_LSX(vssrln_hu_w,      vvv)
1280 INSN_LSX(vssrln_wu_d,      vvv)
1281 INSN_LSX(vssran_bu_h,      vvv)
1282 INSN_LSX(vssran_hu_w,      vvv)
1283 INSN_LSX(vssran_wu_d,      vvv)
1284 
1285 INSN_LSX(vssrlni_b_h,      vv_i)
1286 INSN_LSX(vssrlni_h_w,      vv_i)
1287 INSN_LSX(vssrlni_w_d,      vv_i)
1288 INSN_LSX(vssrlni_d_q,      vv_i)
1289 INSN_LSX(vssrani_b_h,      vv_i)
1290 INSN_LSX(vssrani_h_w,      vv_i)
1291 INSN_LSX(vssrani_w_d,      vv_i)
1292 INSN_LSX(vssrani_d_q,      vv_i)
1293 INSN_LSX(vssrlni_bu_h,     vv_i)
1294 INSN_LSX(vssrlni_hu_w,     vv_i)
1295 INSN_LSX(vssrlni_wu_d,     vv_i)
1296 INSN_LSX(vssrlni_du_q,     vv_i)
1297 INSN_LSX(vssrani_bu_h,     vv_i)
1298 INSN_LSX(vssrani_hu_w,     vv_i)
1299 INSN_LSX(vssrani_wu_d,     vv_i)
1300 INSN_LSX(vssrani_du_q,     vv_i)
1301 
1302 INSN_LSX(vssrlrn_b_h,      vvv)
1303 INSN_LSX(vssrlrn_h_w,      vvv)
1304 INSN_LSX(vssrlrn_w_d,      vvv)
1305 INSN_LSX(vssrarn_b_h,      vvv)
1306 INSN_LSX(vssrarn_h_w,      vvv)
1307 INSN_LSX(vssrarn_w_d,      vvv)
1308 INSN_LSX(vssrlrn_bu_h,     vvv)
1309 INSN_LSX(vssrlrn_hu_w,     vvv)
1310 INSN_LSX(vssrlrn_wu_d,     vvv)
1311 INSN_LSX(vssrarn_bu_h,     vvv)
1312 INSN_LSX(vssrarn_hu_w,     vvv)
1313 INSN_LSX(vssrarn_wu_d,     vvv)
1314 
1315 INSN_LSX(vssrlrni_b_h,     vv_i)
1316 INSN_LSX(vssrlrni_h_w,     vv_i)
1317 INSN_LSX(vssrlrni_w_d,     vv_i)
1318 INSN_LSX(vssrlrni_d_q,     vv_i)
1319 INSN_LSX(vssrlrni_bu_h,    vv_i)
1320 INSN_LSX(vssrlrni_hu_w,    vv_i)
1321 INSN_LSX(vssrlrni_wu_d,    vv_i)
1322 INSN_LSX(vssrlrni_du_q,    vv_i)
1323 INSN_LSX(vssrarni_b_h,     vv_i)
1324 INSN_LSX(vssrarni_h_w,     vv_i)
1325 INSN_LSX(vssrarni_w_d,     vv_i)
1326 INSN_LSX(vssrarni_d_q,     vv_i)
1327 INSN_LSX(vssrarni_bu_h,    vv_i)
1328 INSN_LSX(vssrarni_hu_w,    vv_i)
1329 INSN_LSX(vssrarni_wu_d,    vv_i)
1330 INSN_LSX(vssrarni_du_q,    vv_i)
1331 
1332 INSN_LSX(vclo_b,           vv)
1333 INSN_LSX(vclo_h,           vv)
1334 INSN_LSX(vclo_w,           vv)
1335 INSN_LSX(vclo_d,           vv)
1336 INSN_LSX(vclz_b,           vv)
1337 INSN_LSX(vclz_h,           vv)
1338 INSN_LSX(vclz_w,           vv)
1339 INSN_LSX(vclz_d,           vv)
1340 
1341 INSN_LSX(vpcnt_b,          vv)
1342 INSN_LSX(vpcnt_h,          vv)
1343 INSN_LSX(vpcnt_w,          vv)
1344 INSN_LSX(vpcnt_d,          vv)
1345 
1346 INSN_LSX(vbitclr_b,        vvv)
1347 INSN_LSX(vbitclr_h,        vvv)
1348 INSN_LSX(vbitclr_w,        vvv)
1349 INSN_LSX(vbitclr_d,        vvv)
1350 INSN_LSX(vbitclri_b,       vv_i)
1351 INSN_LSX(vbitclri_h,       vv_i)
1352 INSN_LSX(vbitclri_w,       vv_i)
1353 INSN_LSX(vbitclri_d,       vv_i)
1354 INSN_LSX(vbitset_b,        vvv)
1355 INSN_LSX(vbitset_h,        vvv)
1356 INSN_LSX(vbitset_w,        vvv)
1357 INSN_LSX(vbitset_d,        vvv)
1358 INSN_LSX(vbitseti_b,       vv_i)
1359 INSN_LSX(vbitseti_h,       vv_i)
1360 INSN_LSX(vbitseti_w,       vv_i)
1361 INSN_LSX(vbitseti_d,       vv_i)
1362 INSN_LSX(vbitrev_b,        vvv)
1363 INSN_LSX(vbitrev_h,        vvv)
1364 INSN_LSX(vbitrev_w,        vvv)
1365 INSN_LSX(vbitrev_d,        vvv)
1366 INSN_LSX(vbitrevi_b,       vv_i)
1367 INSN_LSX(vbitrevi_h,       vv_i)
1368 INSN_LSX(vbitrevi_w,       vv_i)
1369 INSN_LSX(vbitrevi_d,       vv_i)
1370 
1371 INSN_LSX(vfrstp_b,         vvv)
1372 INSN_LSX(vfrstp_h,         vvv)
1373 INSN_LSX(vfrstpi_b,        vv_i)
1374 INSN_LSX(vfrstpi_h,        vv_i)
1375 
1376 INSN_LSX(vfadd_s,          vvv)
1377 INSN_LSX(vfadd_d,          vvv)
1378 INSN_LSX(vfsub_s,          vvv)
1379 INSN_LSX(vfsub_d,          vvv)
1380 INSN_LSX(vfmul_s,          vvv)
1381 INSN_LSX(vfmul_d,          vvv)
1382 INSN_LSX(vfdiv_s,          vvv)
1383 INSN_LSX(vfdiv_d,          vvv)
1384 
1385 INSN_LSX(vfmadd_s,         vvvv)
1386 INSN_LSX(vfmadd_d,         vvvv)
1387 INSN_LSX(vfmsub_s,         vvvv)
1388 INSN_LSX(vfmsub_d,         vvvv)
1389 INSN_LSX(vfnmadd_s,        vvvv)
1390 INSN_LSX(vfnmadd_d,        vvvv)
1391 INSN_LSX(vfnmsub_s,        vvvv)
1392 INSN_LSX(vfnmsub_d,        vvvv)
1393 
1394 INSN_LSX(vfmax_s,          vvv)
1395 INSN_LSX(vfmax_d,          vvv)
1396 INSN_LSX(vfmin_s,          vvv)
1397 INSN_LSX(vfmin_d,          vvv)
1398 
1399 INSN_LSX(vfmaxa_s,         vvv)
1400 INSN_LSX(vfmaxa_d,         vvv)
1401 INSN_LSX(vfmina_s,         vvv)
1402 INSN_LSX(vfmina_d,         vvv)
1403 
1404 INSN_LSX(vflogb_s,         vv)
1405 INSN_LSX(vflogb_d,         vv)
1406 
1407 INSN_LSX(vfclass_s,        vv)
1408 INSN_LSX(vfclass_d,        vv)
1409 
1410 INSN_LSX(vfsqrt_s,         vv)
1411 INSN_LSX(vfsqrt_d,         vv)
1412 INSN_LSX(vfrecip_s,        vv)
1413 INSN_LSX(vfrecip_d,        vv)
1414 INSN_LSX(vfrsqrt_s,        vv)
1415 INSN_LSX(vfrsqrt_d,        vv)
1416 
1417 INSN_LSX(vfcvtl_s_h,       vv)
1418 INSN_LSX(vfcvth_s_h,       vv)
1419 INSN_LSX(vfcvtl_d_s,       vv)
1420 INSN_LSX(vfcvth_d_s,       vv)
1421 INSN_LSX(vfcvt_h_s,        vvv)
1422 INSN_LSX(vfcvt_s_d,        vvv)
1423 
1424 INSN_LSX(vfrint_s,         vv)
1425 INSN_LSX(vfrint_d,         vv)
1426 INSN_LSX(vfrintrm_s,       vv)
1427 INSN_LSX(vfrintrm_d,       vv)
1428 INSN_LSX(vfrintrp_s,       vv)
1429 INSN_LSX(vfrintrp_d,       vv)
1430 INSN_LSX(vfrintrz_s,       vv)
1431 INSN_LSX(vfrintrz_d,       vv)
1432 INSN_LSX(vfrintrne_s,      vv)
1433 INSN_LSX(vfrintrne_d,      vv)
1434 
1435 INSN_LSX(vftint_w_s,       vv)
1436 INSN_LSX(vftint_l_d,       vv)
1437 INSN_LSX(vftintrm_w_s,     vv)
1438 INSN_LSX(vftintrm_l_d,     vv)
1439 INSN_LSX(vftintrp_w_s,     vv)
1440 INSN_LSX(vftintrp_l_d,     vv)
1441 INSN_LSX(vftintrz_w_s,     vv)
1442 INSN_LSX(vftintrz_l_d,     vv)
1443 INSN_LSX(vftintrne_w_s,    vv)
1444 INSN_LSX(vftintrne_l_d,    vv)
1445 INSN_LSX(vftint_wu_s,      vv)
1446 INSN_LSX(vftint_lu_d,      vv)
1447 INSN_LSX(vftintrz_wu_s,    vv)
1448 INSN_LSX(vftintrz_lu_d,    vv)
1449 INSN_LSX(vftint_w_d,       vvv)
1450 INSN_LSX(vftintrm_w_d,     vvv)
1451 INSN_LSX(vftintrp_w_d,     vvv)
1452 INSN_LSX(vftintrz_w_d,     vvv)
1453 INSN_LSX(vftintrne_w_d,    vvv)
1454 INSN_LSX(vftintl_l_s,      vv)
1455 INSN_LSX(vftinth_l_s,      vv)
1456 INSN_LSX(vftintrml_l_s,    vv)
1457 INSN_LSX(vftintrmh_l_s,    vv)
1458 INSN_LSX(vftintrpl_l_s,    vv)
1459 INSN_LSX(vftintrph_l_s,    vv)
1460 INSN_LSX(vftintrzl_l_s,    vv)
1461 INSN_LSX(vftintrzh_l_s,    vv)
1462 INSN_LSX(vftintrnel_l_s,   vv)
1463 INSN_LSX(vftintrneh_l_s,   vv)
1464 
1465 INSN_LSX(vffint_s_w,       vv)
1466 INSN_LSX(vffint_s_wu,      vv)
1467 INSN_LSX(vffint_d_l,       vv)
1468 INSN_LSX(vffint_d_lu,      vv)
1469 INSN_LSX(vffintl_d_w,      vv)
1470 INSN_LSX(vffinth_d_w,      vv)
1471 INSN_LSX(vffint_s_l,       vvv)
1472 
1473 INSN_LSX(vseq_b,           vvv)
1474 INSN_LSX(vseq_h,           vvv)
1475 INSN_LSX(vseq_w,           vvv)
1476 INSN_LSX(vseq_d,           vvv)
1477 INSN_LSX(vseqi_b,          vv_i)
1478 INSN_LSX(vseqi_h,          vv_i)
1479 INSN_LSX(vseqi_w,          vv_i)
1480 INSN_LSX(vseqi_d,          vv_i)
1481 
1482 INSN_LSX(vsle_b,           vvv)
1483 INSN_LSX(vsle_h,           vvv)
1484 INSN_LSX(vsle_w,           vvv)
1485 INSN_LSX(vsle_d,           vvv)
1486 INSN_LSX(vslei_b,          vv_i)
1487 INSN_LSX(vslei_h,          vv_i)
1488 INSN_LSX(vslei_w,          vv_i)
1489 INSN_LSX(vslei_d,          vv_i)
1490 INSN_LSX(vsle_bu,          vvv)
1491 INSN_LSX(vsle_hu,          vvv)
1492 INSN_LSX(vsle_wu,          vvv)
1493 INSN_LSX(vsle_du,          vvv)
1494 INSN_LSX(vslei_bu,         vv_i)
1495 INSN_LSX(vslei_hu,         vv_i)
1496 INSN_LSX(vslei_wu,         vv_i)
1497 INSN_LSX(vslei_du,         vv_i)
1498 
1499 INSN_LSX(vslt_b,           vvv)
1500 INSN_LSX(vslt_h,           vvv)
1501 INSN_LSX(vslt_w,           vvv)
1502 INSN_LSX(vslt_d,           vvv)
1503 INSN_LSX(vslti_b,          vv_i)
1504 INSN_LSX(vslti_h,          vv_i)
1505 INSN_LSX(vslti_w,          vv_i)
1506 INSN_LSX(vslti_d,          vv_i)
1507 INSN_LSX(vslt_bu,          vvv)
1508 INSN_LSX(vslt_hu,          vvv)
1509 INSN_LSX(vslt_wu,          vvv)
1510 INSN_LSX(vslt_du,          vvv)
1511 INSN_LSX(vslti_bu,         vv_i)
1512 INSN_LSX(vslti_hu,         vv_i)
1513 INSN_LSX(vslti_wu,         vv_i)
1514 INSN_LSX(vslti_du,         vv_i)
1515 
1516 #define output_vfcmp(C, PREFIX, SUFFIX)                                     \
1517 {                                                                           \
1518     (C)->info->fprintf_func((C)->info->stream, "%08x   %s%s\t%d, f%d, f%d", \
1519                             (C)->insn, PREFIX, SUFFIX, a->vd,               \
1520                             a->vj, a->vk);                                  \
1521 }
1522 
1523 static bool output_vvv_fcond(DisasContext *ctx, arg_vvv_fcond * a,
1524                              const char *suffix)
1525 {
1526     bool ret = true;
1527     switch (a->fcond) {
1528     case 0x0:
1529         output_vfcmp(ctx, "vfcmp_caf_", suffix);
1530         break;
1531     case 0x1:
1532         output_vfcmp(ctx, "vfcmp_saf_", suffix);
1533         break;
1534     case 0x2:
1535         output_vfcmp(ctx, "vfcmp_clt_", suffix);
1536         break;
1537     case 0x3:
1538         output_vfcmp(ctx, "vfcmp_slt_", suffix);
1539         break;
1540     case 0x4:
1541         output_vfcmp(ctx, "vfcmp_ceq_", suffix);
1542         break;
1543     case 0x5:
1544         output_vfcmp(ctx, "vfcmp_seq_", suffix);
1545         break;
1546     case 0x6:
1547         output_vfcmp(ctx, "vfcmp_cle_", suffix);
1548         break;
1549     case 0x7:
1550         output_vfcmp(ctx, "vfcmp_sle_", suffix);
1551         break;
1552     case 0x8:
1553         output_vfcmp(ctx, "vfcmp_cun_", suffix);
1554         break;
1555     case 0x9:
1556         output_vfcmp(ctx, "vfcmp_sun_", suffix);
1557         break;
1558     case 0xA:
1559         output_vfcmp(ctx, "vfcmp_cult_", suffix);
1560         break;
1561     case 0xB:
1562         output_vfcmp(ctx, "vfcmp_sult_", suffix);
1563         break;
1564     case 0xC:
1565         output_vfcmp(ctx, "vfcmp_cueq_", suffix);
1566         break;
1567     case 0xD:
1568         output_vfcmp(ctx, "vfcmp_sueq_", suffix);
1569         break;
1570     case 0xE:
1571         output_vfcmp(ctx, "vfcmp_cule_", suffix);
1572         break;
1573     case 0xF:
1574         output_vfcmp(ctx, "vfcmp_sule_", suffix);
1575         break;
1576     case 0x10:
1577         output_vfcmp(ctx, "vfcmp_cne_", suffix);
1578         break;
1579     case 0x11:
1580         output_vfcmp(ctx, "vfcmp_sne_", suffix);
1581         break;
1582     case 0x14:
1583         output_vfcmp(ctx, "vfcmp_cor_", suffix);
1584         break;
1585     case 0x15:
1586         output_vfcmp(ctx, "vfcmp_sor_", suffix);
1587         break;
1588     case 0x18:
1589         output_vfcmp(ctx, "vfcmp_cune_", suffix);
1590         break;
1591     case 0x19:
1592         output_vfcmp(ctx, "vfcmp_sune_", suffix);
1593         break;
1594     default:
1595         ret = false;
1596     }
1597     return ret;
1598 }
1599 
1600 #define LSX_FCMP_INSN(suffix)                            \
1601 static bool trans_vfcmp_cond_##suffix(DisasContext *ctx, \
1602                                      arg_vvv_fcond * a)  \
1603 {                                                        \
1604     return output_vvv_fcond(ctx, a, #suffix);            \
1605 }
1606 
1607 LSX_FCMP_INSN(s)
1608 LSX_FCMP_INSN(d)
1609 
1610 INSN_LSX(vbitsel_v,        vvvv)
1611 INSN_LSX(vbitseli_b,       vv_i)
1612 
1613 INSN_LSX(vseteqz_v,        cv)
1614 INSN_LSX(vsetnez_v,        cv)
1615 INSN_LSX(vsetanyeqz_b,     cv)
1616 INSN_LSX(vsetanyeqz_h,     cv)
1617 INSN_LSX(vsetanyeqz_w,     cv)
1618 INSN_LSX(vsetanyeqz_d,     cv)
1619 INSN_LSX(vsetallnez_b,     cv)
1620 INSN_LSX(vsetallnez_h,     cv)
1621 INSN_LSX(vsetallnez_w,     cv)
1622 INSN_LSX(vsetallnez_d,     cv)
1623 
1624 INSN_LSX(vinsgr2vr_b,      vr_i)
1625 INSN_LSX(vinsgr2vr_h,      vr_i)
1626 INSN_LSX(vinsgr2vr_w,      vr_i)
1627 INSN_LSX(vinsgr2vr_d,      vr_i)
1628 INSN_LSX(vpickve2gr_b,     rv_i)
1629 INSN_LSX(vpickve2gr_h,     rv_i)
1630 INSN_LSX(vpickve2gr_w,     rv_i)
1631 INSN_LSX(vpickve2gr_d,     rv_i)
1632 INSN_LSX(vpickve2gr_bu,    rv_i)
1633 INSN_LSX(vpickve2gr_hu,    rv_i)
1634 INSN_LSX(vpickve2gr_wu,    rv_i)
1635 INSN_LSX(vpickve2gr_du,    rv_i)
1636 
1637 INSN_LSX(vreplgr2vr_b,     vr)
1638 INSN_LSX(vreplgr2vr_h,     vr)
1639 INSN_LSX(vreplgr2vr_w,     vr)
1640 INSN_LSX(vreplgr2vr_d,     vr)
1641 
1642 INSN_LSX(vreplve_b,        vvr)
1643 INSN_LSX(vreplve_h,        vvr)
1644 INSN_LSX(vreplve_w,        vvr)
1645 INSN_LSX(vreplve_d,        vvr)
1646 INSN_LSX(vreplvei_b,       vv_i)
1647 INSN_LSX(vreplvei_h,       vv_i)
1648 INSN_LSX(vreplvei_w,       vv_i)
1649 INSN_LSX(vreplvei_d,       vv_i)
1650 
1651 INSN_LSX(vbsll_v,          vv_i)
1652 INSN_LSX(vbsrl_v,          vv_i)
1653 
1654 INSN_LSX(vpackev_b,        vvv)
1655 INSN_LSX(vpackev_h,        vvv)
1656 INSN_LSX(vpackev_w,        vvv)
1657 INSN_LSX(vpackev_d,        vvv)
1658 INSN_LSX(vpackod_b,        vvv)
1659 INSN_LSX(vpackod_h,        vvv)
1660 INSN_LSX(vpackod_w,        vvv)
1661 INSN_LSX(vpackod_d,        vvv)
1662 
1663 INSN_LSX(vpickev_b,        vvv)
1664 INSN_LSX(vpickev_h,        vvv)
1665 INSN_LSX(vpickev_w,        vvv)
1666 INSN_LSX(vpickev_d,        vvv)
1667 INSN_LSX(vpickod_b,        vvv)
1668 INSN_LSX(vpickod_h,        vvv)
1669 INSN_LSX(vpickod_w,        vvv)
1670 INSN_LSX(vpickod_d,        vvv)
1671 
1672 INSN_LSX(vilvl_b,          vvv)
1673 INSN_LSX(vilvl_h,          vvv)
1674 INSN_LSX(vilvl_w,          vvv)
1675 INSN_LSX(vilvl_d,          vvv)
1676 INSN_LSX(vilvh_b,          vvv)
1677 INSN_LSX(vilvh_h,          vvv)
1678 INSN_LSX(vilvh_w,          vvv)
1679 INSN_LSX(vilvh_d,          vvv)
1680 
1681 INSN_LSX(vshuf_b,          vvvv)
1682 INSN_LSX(vshuf_h,          vvv)
1683 INSN_LSX(vshuf_w,          vvv)
1684 INSN_LSX(vshuf_d,          vvv)
1685 INSN_LSX(vshuf4i_b,        vv_i)
1686 INSN_LSX(vshuf4i_h,        vv_i)
1687 INSN_LSX(vshuf4i_w,        vv_i)
1688 INSN_LSX(vshuf4i_d,        vv_i)
1689 
1690 INSN_LSX(vpermi_w,         vv_i)
1691 
1692 INSN_LSX(vextrins_d,       vv_i)
1693 INSN_LSX(vextrins_w,       vv_i)
1694 INSN_LSX(vextrins_h,       vv_i)
1695 INSN_LSX(vextrins_b,       vv_i)
1696 
1697 INSN_LSX(vld,              vr_i)
1698 INSN_LSX(vst,              vr_i)
1699 INSN_LSX(vldx,             vrr)
1700 INSN_LSX(vstx,             vrr)
1701 
1702 INSN_LSX(vldrepl_d,        vr_i)
1703 INSN_LSX(vldrepl_w,        vr_i)
1704 INSN_LSX(vldrepl_h,        vr_i)
1705 INSN_LSX(vldrepl_b,        vr_i)
1706 INSN_LSX(vstelm_d,         vr_ii)
1707 INSN_LSX(vstelm_w,         vr_ii)
1708 INSN_LSX(vstelm_h,         vr_ii)
1709 INSN_LSX(vstelm_b,         vr_ii)
1710 
1711 #define INSN_LASX(insn, type)                               \
1712 static bool trans_##insn(DisasContext *ctx, arg_##type * a) \
1713 {                                                           \
1714     output_##type ## _x(ctx, a, #insn);                     \
1715     return true;                                            \
1716 }
1717 
1718 static void output_cv_x(DisasContext *ctx, arg_cv *a, const char *mnemonic)
1719 {
1720     output(ctx, mnemonic, "fcc%d, x%d", a->cd, a->vj);
1721 }
1722 
1723 static void output_v_i_x(DisasContext *ctx, arg_v_i *a, const char *mnemonic)
1724 {
1725     output(ctx, mnemonic, "x%d, 0x%x", a->vd, a->imm);
1726 }
1727 
1728 static void output_vvvv_x(DisasContext *ctx, arg_vvvv *a, const char *mnemonic)
1729 {
1730     output(ctx, mnemonic, "x%d, x%d, x%d, x%d", a->vd, a->vj, a->vk, a->va);
1731 }
1732 
1733 static void output_vvv_x(DisasContext *ctx, arg_vvv * a, const char *mnemonic)
1734 {
1735     output(ctx, mnemonic, "x%d, x%d, x%d", a->vd, a->vj, a->vk);
1736 }
1737 
1738 static void output_vr_x(DisasContext *ctx, arg_vr *a, const char *mnemonic)
1739 {
1740     output(ctx, mnemonic, "x%d, r%d", a->vd, a->rj);
1741 }
1742 
1743 static void output_vv_i_x(DisasContext *ctx, arg_vv_i *a, const char *mnemonic)
1744 {
1745     output(ctx, mnemonic, "x%d, x%d, 0x%x", a->vd, a->vj, a->imm);
1746 }
1747 
1748 static void output_vv_x(DisasContext *ctx, arg_vv *a, const char *mnemonic)
1749 {
1750     output(ctx, mnemonic, "x%d, x%d", a->vd, a->vj);
1751 }
1752 
1753 static void output_vr_i_x(DisasContext *ctx, arg_vr_i *a, const char *mnemonic)
1754 {
1755     output(ctx, mnemonic, "x%d, r%d, 0x%x", a->vd, a->rj, a->imm);
1756 }
1757 
1758 static void output_rv_i_x(DisasContext *ctx, arg_rv_i *a, const char *mnemonic)
1759 {
1760     output(ctx, mnemonic, "r%d, x%d, 0x%x", a->rd, a->vj, a->imm);
1761 }
1762 
1763 static void output_vvr_x(DisasContext *ctx, arg_vvr *a, const char *mnemonic)
1764 {
1765     output(ctx, mnemonic, "x%d, x%d, r%d", a->vd, a->vj, a->rk);
1766 }
1767 
1768 static void output_vrr_x(DisasContext *ctx, arg_vrr *a, const char *mnemonic)
1769 {
1770     output(ctx, mnemonic, "x%d, r%d, r%d", a->vd, a->rj, a->rk);
1771 }
1772 
1773 static void output_vr_ii_x(DisasContext *ctx, arg_vr_ii *a, const char *mnemonic)
1774 {
1775     output(ctx, mnemonic, "x%d, r%d, 0x%x, 0x%x", a->vd, a->rj, a->imm, a->imm2);
1776 }
1777 
1778 INSN_LASX(xvadd_b,           vvv)
1779 INSN_LASX(xvadd_h,           vvv)
1780 INSN_LASX(xvadd_w,           vvv)
1781 INSN_LASX(xvadd_d,           vvv)
1782 INSN_LASX(xvadd_q,           vvv)
1783 INSN_LASX(xvsub_b,           vvv)
1784 INSN_LASX(xvsub_h,           vvv)
1785 INSN_LASX(xvsub_w,           vvv)
1786 INSN_LASX(xvsub_d,           vvv)
1787 INSN_LASX(xvsub_q,           vvv)
1788 
1789 INSN_LASX(xvaddi_bu,         vv_i)
1790 INSN_LASX(xvaddi_hu,         vv_i)
1791 INSN_LASX(xvaddi_wu,         vv_i)
1792 INSN_LASX(xvaddi_du,         vv_i)
1793 INSN_LASX(xvsubi_bu,         vv_i)
1794 INSN_LASX(xvsubi_hu,         vv_i)
1795 INSN_LASX(xvsubi_wu,         vv_i)
1796 INSN_LASX(xvsubi_du,         vv_i)
1797 
1798 INSN_LASX(xvneg_b,           vv)
1799 INSN_LASX(xvneg_h,           vv)
1800 INSN_LASX(xvneg_w,           vv)
1801 INSN_LASX(xvneg_d,           vv)
1802 
1803 INSN_LASX(xvsadd_b,          vvv)
1804 INSN_LASX(xvsadd_h,          vvv)
1805 INSN_LASX(xvsadd_w,          vvv)
1806 INSN_LASX(xvsadd_d,          vvv)
1807 INSN_LASX(xvsadd_bu,         vvv)
1808 INSN_LASX(xvsadd_hu,         vvv)
1809 INSN_LASX(xvsadd_wu,         vvv)
1810 INSN_LASX(xvsadd_du,         vvv)
1811 INSN_LASX(xvssub_b,          vvv)
1812 INSN_LASX(xvssub_h,          vvv)
1813 INSN_LASX(xvssub_w,          vvv)
1814 INSN_LASX(xvssub_d,          vvv)
1815 INSN_LASX(xvssub_bu,         vvv)
1816 INSN_LASX(xvssub_hu,         vvv)
1817 INSN_LASX(xvssub_wu,         vvv)
1818 INSN_LASX(xvssub_du,         vvv)
1819 
1820 INSN_LASX(xvhaddw_h_b,       vvv)
1821 INSN_LASX(xvhaddw_w_h,       vvv)
1822 INSN_LASX(xvhaddw_d_w,       vvv)
1823 INSN_LASX(xvhaddw_q_d,       vvv)
1824 INSN_LASX(xvhaddw_hu_bu,     vvv)
1825 INSN_LASX(xvhaddw_wu_hu,     vvv)
1826 INSN_LASX(xvhaddw_du_wu,     vvv)
1827 INSN_LASX(xvhaddw_qu_du,     vvv)
1828 INSN_LASX(xvhsubw_h_b,       vvv)
1829 INSN_LASX(xvhsubw_w_h,       vvv)
1830 INSN_LASX(xvhsubw_d_w,       vvv)
1831 INSN_LASX(xvhsubw_q_d,       vvv)
1832 INSN_LASX(xvhsubw_hu_bu,     vvv)
1833 INSN_LASX(xvhsubw_wu_hu,     vvv)
1834 INSN_LASX(xvhsubw_du_wu,     vvv)
1835 INSN_LASX(xvhsubw_qu_du,     vvv)
1836 
1837 INSN_LASX(xvaddwev_h_b,      vvv)
1838 INSN_LASX(xvaddwev_w_h,      vvv)
1839 INSN_LASX(xvaddwev_d_w,      vvv)
1840 INSN_LASX(xvaddwev_q_d,      vvv)
1841 INSN_LASX(xvaddwod_h_b,      vvv)
1842 INSN_LASX(xvaddwod_w_h,      vvv)
1843 INSN_LASX(xvaddwod_d_w,      vvv)
1844 INSN_LASX(xvaddwod_q_d,      vvv)
1845 INSN_LASX(xvsubwev_h_b,      vvv)
1846 INSN_LASX(xvsubwev_w_h,      vvv)
1847 INSN_LASX(xvsubwev_d_w,      vvv)
1848 INSN_LASX(xvsubwev_q_d,      vvv)
1849 INSN_LASX(xvsubwod_h_b,      vvv)
1850 INSN_LASX(xvsubwod_w_h,      vvv)
1851 INSN_LASX(xvsubwod_d_w,      vvv)
1852 INSN_LASX(xvsubwod_q_d,      vvv)
1853 
1854 INSN_LASX(xvaddwev_h_bu,     vvv)
1855 INSN_LASX(xvaddwev_w_hu,     vvv)
1856 INSN_LASX(xvaddwev_d_wu,     vvv)
1857 INSN_LASX(xvaddwev_q_du,     vvv)
1858 INSN_LASX(xvaddwod_h_bu,     vvv)
1859 INSN_LASX(xvaddwod_w_hu,     vvv)
1860 INSN_LASX(xvaddwod_d_wu,     vvv)
1861 INSN_LASX(xvaddwod_q_du,     vvv)
1862 INSN_LASX(xvsubwev_h_bu,     vvv)
1863 INSN_LASX(xvsubwev_w_hu,     vvv)
1864 INSN_LASX(xvsubwev_d_wu,     vvv)
1865 INSN_LASX(xvsubwev_q_du,     vvv)
1866 INSN_LASX(xvsubwod_h_bu,     vvv)
1867 INSN_LASX(xvsubwod_w_hu,     vvv)
1868 INSN_LASX(xvsubwod_d_wu,     vvv)
1869 INSN_LASX(xvsubwod_q_du,     vvv)
1870 
1871 INSN_LASX(xvaddwev_h_bu_b,   vvv)
1872 INSN_LASX(xvaddwev_w_hu_h,   vvv)
1873 INSN_LASX(xvaddwev_d_wu_w,   vvv)
1874 INSN_LASX(xvaddwev_q_du_d,   vvv)
1875 INSN_LASX(xvaddwod_h_bu_b,   vvv)
1876 INSN_LASX(xvaddwod_w_hu_h,   vvv)
1877 INSN_LASX(xvaddwod_d_wu_w,   vvv)
1878 INSN_LASX(xvaddwod_q_du_d,   vvv)
1879 
1880 INSN_LASX(xvavg_b,           vvv)
1881 INSN_LASX(xvavg_h,           vvv)
1882 INSN_LASX(xvavg_w,           vvv)
1883 INSN_LASX(xvavg_d,           vvv)
1884 INSN_LASX(xvavg_bu,          vvv)
1885 INSN_LASX(xvavg_hu,          vvv)
1886 INSN_LASX(xvavg_wu,          vvv)
1887 INSN_LASX(xvavg_du,          vvv)
1888 INSN_LASX(xvavgr_b,          vvv)
1889 INSN_LASX(xvavgr_h,          vvv)
1890 INSN_LASX(xvavgr_w,          vvv)
1891 INSN_LASX(xvavgr_d,          vvv)
1892 INSN_LASX(xvavgr_bu,         vvv)
1893 INSN_LASX(xvavgr_hu,         vvv)
1894 INSN_LASX(xvavgr_wu,         vvv)
1895 INSN_LASX(xvavgr_du,         vvv)
1896 
1897 INSN_LASX(xvabsd_b,          vvv)
1898 INSN_LASX(xvabsd_h,          vvv)
1899 INSN_LASX(xvabsd_w,          vvv)
1900 INSN_LASX(xvabsd_d,          vvv)
1901 INSN_LASX(xvabsd_bu,         vvv)
1902 INSN_LASX(xvabsd_hu,         vvv)
1903 INSN_LASX(xvabsd_wu,         vvv)
1904 INSN_LASX(xvabsd_du,         vvv)
1905 
1906 INSN_LASX(xvadda_b,          vvv)
1907 INSN_LASX(xvadda_h,          vvv)
1908 INSN_LASX(xvadda_w,          vvv)
1909 INSN_LASX(xvadda_d,          vvv)
1910 
1911 INSN_LASX(xvmax_b,           vvv)
1912 INSN_LASX(xvmax_h,           vvv)
1913 INSN_LASX(xvmax_w,           vvv)
1914 INSN_LASX(xvmax_d,           vvv)
1915 INSN_LASX(xvmin_b,           vvv)
1916 INSN_LASX(xvmin_h,           vvv)
1917 INSN_LASX(xvmin_w,           vvv)
1918 INSN_LASX(xvmin_d,           vvv)
1919 INSN_LASX(xvmax_bu,          vvv)
1920 INSN_LASX(xvmax_hu,          vvv)
1921 INSN_LASX(xvmax_wu,          vvv)
1922 INSN_LASX(xvmax_du,          vvv)
1923 INSN_LASX(xvmin_bu,          vvv)
1924 INSN_LASX(xvmin_hu,          vvv)
1925 INSN_LASX(xvmin_wu,          vvv)
1926 INSN_LASX(xvmin_du,          vvv)
1927 
1928 INSN_LASX(xvmaxi_b,          vv_i)
1929 INSN_LASX(xvmaxi_h,          vv_i)
1930 INSN_LASX(xvmaxi_w,          vv_i)
1931 INSN_LASX(xvmaxi_d,          vv_i)
1932 INSN_LASX(xvmini_b,          vv_i)
1933 INSN_LASX(xvmini_h,          vv_i)
1934 INSN_LASX(xvmini_w,          vv_i)
1935 INSN_LASX(xvmini_d,          vv_i)
1936 INSN_LASX(xvmaxi_bu,         vv_i)
1937 INSN_LASX(xvmaxi_hu,         vv_i)
1938 INSN_LASX(xvmaxi_wu,         vv_i)
1939 INSN_LASX(xvmaxi_du,         vv_i)
1940 INSN_LASX(xvmini_bu,         vv_i)
1941 INSN_LASX(xvmini_hu,         vv_i)
1942 INSN_LASX(xvmini_wu,         vv_i)
1943 INSN_LASX(xvmini_du,         vv_i)
1944 
1945 INSN_LASX(xvmul_b,           vvv)
1946 INSN_LASX(xvmul_h,           vvv)
1947 INSN_LASX(xvmul_w,           vvv)
1948 INSN_LASX(xvmul_d,           vvv)
1949 INSN_LASX(xvmuh_b,           vvv)
1950 INSN_LASX(xvmuh_h,           vvv)
1951 INSN_LASX(xvmuh_w,           vvv)
1952 INSN_LASX(xvmuh_d,           vvv)
1953 INSN_LASX(xvmuh_bu,          vvv)
1954 INSN_LASX(xvmuh_hu,          vvv)
1955 INSN_LASX(xvmuh_wu,          vvv)
1956 INSN_LASX(xvmuh_du,          vvv)
1957 
1958 INSN_LASX(xvmulwev_h_b,      vvv)
1959 INSN_LASX(xvmulwev_w_h,      vvv)
1960 INSN_LASX(xvmulwev_d_w,      vvv)
1961 INSN_LASX(xvmulwev_q_d,      vvv)
1962 INSN_LASX(xvmulwod_h_b,      vvv)
1963 INSN_LASX(xvmulwod_w_h,      vvv)
1964 INSN_LASX(xvmulwod_d_w,      vvv)
1965 INSN_LASX(xvmulwod_q_d,      vvv)
1966 INSN_LASX(xvmulwev_h_bu,     vvv)
1967 INSN_LASX(xvmulwev_w_hu,     vvv)
1968 INSN_LASX(xvmulwev_d_wu,     vvv)
1969 INSN_LASX(xvmulwev_q_du,     vvv)
1970 INSN_LASX(xvmulwod_h_bu,     vvv)
1971 INSN_LASX(xvmulwod_w_hu,     vvv)
1972 INSN_LASX(xvmulwod_d_wu,     vvv)
1973 INSN_LASX(xvmulwod_q_du,     vvv)
1974 INSN_LASX(xvmulwev_h_bu_b,   vvv)
1975 INSN_LASX(xvmulwev_w_hu_h,   vvv)
1976 INSN_LASX(xvmulwev_d_wu_w,   vvv)
1977 INSN_LASX(xvmulwev_q_du_d,   vvv)
1978 INSN_LASX(xvmulwod_h_bu_b,   vvv)
1979 INSN_LASX(xvmulwod_w_hu_h,   vvv)
1980 INSN_LASX(xvmulwod_d_wu_w,   vvv)
1981 INSN_LASX(xvmulwod_q_du_d,   vvv)
1982 
1983 INSN_LASX(xvmadd_b,          vvv)
1984 INSN_LASX(xvmadd_h,          vvv)
1985 INSN_LASX(xvmadd_w,          vvv)
1986 INSN_LASX(xvmadd_d,          vvv)
1987 INSN_LASX(xvmsub_b,          vvv)
1988 INSN_LASX(xvmsub_h,          vvv)
1989 INSN_LASX(xvmsub_w,          vvv)
1990 INSN_LASX(xvmsub_d,          vvv)
1991 
1992 INSN_LASX(xvmaddwev_h_b,     vvv)
1993 INSN_LASX(xvmaddwev_w_h,     vvv)
1994 INSN_LASX(xvmaddwev_d_w,     vvv)
1995 INSN_LASX(xvmaddwev_q_d,     vvv)
1996 INSN_LASX(xvmaddwod_h_b,     vvv)
1997 INSN_LASX(xvmaddwod_w_h,     vvv)
1998 INSN_LASX(xvmaddwod_d_w,     vvv)
1999 INSN_LASX(xvmaddwod_q_d,     vvv)
2000 INSN_LASX(xvmaddwev_h_bu,    vvv)
2001 INSN_LASX(xvmaddwev_w_hu,    vvv)
2002 INSN_LASX(xvmaddwev_d_wu,    vvv)
2003 INSN_LASX(xvmaddwev_q_du,    vvv)
2004 INSN_LASX(xvmaddwod_h_bu,    vvv)
2005 INSN_LASX(xvmaddwod_w_hu,    vvv)
2006 INSN_LASX(xvmaddwod_d_wu,    vvv)
2007 INSN_LASX(xvmaddwod_q_du,    vvv)
2008 INSN_LASX(xvmaddwev_h_bu_b,  vvv)
2009 INSN_LASX(xvmaddwev_w_hu_h,  vvv)
2010 INSN_LASX(xvmaddwev_d_wu_w,  vvv)
2011 INSN_LASX(xvmaddwev_q_du_d,  vvv)
2012 INSN_LASX(xvmaddwod_h_bu_b,  vvv)
2013 INSN_LASX(xvmaddwod_w_hu_h,  vvv)
2014 INSN_LASX(xvmaddwod_d_wu_w,  vvv)
2015 INSN_LASX(xvmaddwod_q_du_d,  vvv)
2016 
2017 INSN_LASX(xvdiv_b,           vvv)
2018 INSN_LASX(xvdiv_h,           vvv)
2019 INSN_LASX(xvdiv_w,           vvv)
2020 INSN_LASX(xvdiv_d,           vvv)
2021 INSN_LASX(xvdiv_bu,          vvv)
2022 INSN_LASX(xvdiv_hu,          vvv)
2023 INSN_LASX(xvdiv_wu,          vvv)
2024 INSN_LASX(xvdiv_du,          vvv)
2025 INSN_LASX(xvmod_b,           vvv)
2026 INSN_LASX(xvmod_h,           vvv)
2027 INSN_LASX(xvmod_w,           vvv)
2028 INSN_LASX(xvmod_d,           vvv)
2029 INSN_LASX(xvmod_bu,          vvv)
2030 INSN_LASX(xvmod_hu,          vvv)
2031 INSN_LASX(xvmod_wu,          vvv)
2032 INSN_LASX(xvmod_du,          vvv)
2033 
2034 INSN_LASX(xvsat_b,           vv_i)
2035 INSN_LASX(xvsat_h,           vv_i)
2036 INSN_LASX(xvsat_w,           vv_i)
2037 INSN_LASX(xvsat_d,           vv_i)
2038 INSN_LASX(xvsat_bu,          vv_i)
2039 INSN_LASX(xvsat_hu,          vv_i)
2040 INSN_LASX(xvsat_wu,          vv_i)
2041 INSN_LASX(xvsat_du,          vv_i)
2042 
2043 INSN_LASX(xvexth_h_b,        vv)
2044 INSN_LASX(xvexth_w_h,        vv)
2045 INSN_LASX(xvexth_d_w,        vv)
2046 INSN_LASX(xvexth_q_d,        vv)
2047 INSN_LASX(xvexth_hu_bu,      vv)
2048 INSN_LASX(xvexth_wu_hu,      vv)
2049 INSN_LASX(xvexth_du_wu,      vv)
2050 INSN_LASX(xvexth_qu_du,      vv)
2051 
2052 INSN_LASX(vext2xv_h_b,       vv)
2053 INSN_LASX(vext2xv_w_b,       vv)
2054 INSN_LASX(vext2xv_d_b,       vv)
2055 INSN_LASX(vext2xv_w_h,       vv)
2056 INSN_LASX(vext2xv_d_h,       vv)
2057 INSN_LASX(vext2xv_d_w,       vv)
2058 INSN_LASX(vext2xv_hu_bu,     vv)
2059 INSN_LASX(vext2xv_wu_bu,     vv)
2060 INSN_LASX(vext2xv_du_bu,     vv)
2061 INSN_LASX(vext2xv_wu_hu,     vv)
2062 INSN_LASX(vext2xv_du_hu,     vv)
2063 INSN_LASX(vext2xv_du_wu,     vv)
2064 
2065 INSN_LASX(xvsigncov_b,       vvv)
2066 INSN_LASX(xvsigncov_h,       vvv)
2067 INSN_LASX(xvsigncov_w,       vvv)
2068 INSN_LASX(xvsigncov_d,       vvv)
2069 
2070 INSN_LASX(xvmskltz_b,        vv)
2071 INSN_LASX(xvmskltz_h,        vv)
2072 INSN_LASX(xvmskltz_w,        vv)
2073 INSN_LASX(xvmskltz_d,        vv)
2074 INSN_LASX(xvmskgez_b,        vv)
2075 INSN_LASX(xvmsknz_b,         vv)
2076 
2077 INSN_LASX(xvldi,             v_i)
2078 
2079 INSN_LASX(xvand_v,           vvv)
2080 INSN_LASX(xvor_v,            vvv)
2081 INSN_LASX(xvxor_v,           vvv)
2082 INSN_LASX(xvnor_v,           vvv)
2083 INSN_LASX(xvandn_v,          vvv)
2084 INSN_LASX(xvorn_v,           vvv)
2085 
2086 INSN_LASX(xvandi_b,          vv_i)
2087 INSN_LASX(xvori_b,           vv_i)
2088 INSN_LASX(xvxori_b,          vv_i)
2089 INSN_LASX(xvnori_b,          vv_i)
2090 
2091 INSN_LASX(xvsll_b,           vvv)
2092 INSN_LASX(xvsll_h,           vvv)
2093 INSN_LASX(xvsll_w,           vvv)
2094 INSN_LASX(xvsll_d,           vvv)
2095 INSN_LASX(xvslli_b,          vv_i)
2096 INSN_LASX(xvslli_h,          vv_i)
2097 INSN_LASX(xvslli_w,          vv_i)
2098 INSN_LASX(xvslli_d,          vv_i)
2099 
2100 INSN_LASX(xvsrl_b,           vvv)
2101 INSN_LASX(xvsrl_h,           vvv)
2102 INSN_LASX(xvsrl_w,           vvv)
2103 INSN_LASX(xvsrl_d,           vvv)
2104 INSN_LASX(xvsrli_b,          vv_i)
2105 INSN_LASX(xvsrli_h,          vv_i)
2106 INSN_LASX(xvsrli_w,          vv_i)
2107 INSN_LASX(xvsrli_d,          vv_i)
2108 
2109 INSN_LASX(xvsra_b,           vvv)
2110 INSN_LASX(xvsra_h,           vvv)
2111 INSN_LASX(xvsra_w,           vvv)
2112 INSN_LASX(xvsra_d,           vvv)
2113 INSN_LASX(xvsrai_b,          vv_i)
2114 INSN_LASX(xvsrai_h,          vv_i)
2115 INSN_LASX(xvsrai_w,          vv_i)
2116 INSN_LASX(xvsrai_d,          vv_i)
2117 
2118 INSN_LASX(xvrotr_b,          vvv)
2119 INSN_LASX(xvrotr_h,          vvv)
2120 INSN_LASX(xvrotr_w,          vvv)
2121 INSN_LASX(xvrotr_d,          vvv)
2122 INSN_LASX(xvrotri_b,         vv_i)
2123 INSN_LASX(xvrotri_h,         vv_i)
2124 INSN_LASX(xvrotri_w,         vv_i)
2125 INSN_LASX(xvrotri_d,         vv_i)
2126 
2127 INSN_LASX(xvsllwil_h_b,      vv_i)
2128 INSN_LASX(xvsllwil_w_h,      vv_i)
2129 INSN_LASX(xvsllwil_d_w,      vv_i)
2130 INSN_LASX(xvextl_q_d,        vv)
2131 INSN_LASX(xvsllwil_hu_bu,    vv_i)
2132 INSN_LASX(xvsllwil_wu_hu,    vv_i)
2133 INSN_LASX(xvsllwil_du_wu,    vv_i)
2134 INSN_LASX(xvextl_qu_du,      vv)
2135 
2136 INSN_LASX(xvsrlr_b,          vvv)
2137 INSN_LASX(xvsrlr_h,          vvv)
2138 INSN_LASX(xvsrlr_w,          vvv)
2139 INSN_LASX(xvsrlr_d,          vvv)
2140 INSN_LASX(xvsrlri_b,         vv_i)
2141 INSN_LASX(xvsrlri_h,         vv_i)
2142 INSN_LASX(xvsrlri_w,         vv_i)
2143 INSN_LASX(xvsrlri_d,         vv_i)
2144 
2145 INSN_LASX(xvsrar_b,          vvv)
2146 INSN_LASX(xvsrar_h,          vvv)
2147 INSN_LASX(xvsrar_w,          vvv)
2148 INSN_LASX(xvsrar_d,          vvv)
2149 INSN_LASX(xvsrari_b,         vv_i)
2150 INSN_LASX(xvsrari_h,         vv_i)
2151 INSN_LASX(xvsrari_w,         vv_i)
2152 INSN_LASX(xvsrari_d,         vv_i)
2153 
2154 INSN_LASX(xvsrln_b_h,        vvv)
2155 INSN_LASX(xvsrln_h_w,        vvv)
2156 INSN_LASX(xvsrln_w_d,        vvv)
2157 INSN_LASX(xvsran_b_h,        vvv)
2158 INSN_LASX(xvsran_h_w,        vvv)
2159 INSN_LASX(xvsran_w_d,        vvv)
2160 
2161 INSN_LASX(xvsrlni_b_h,       vv_i)
2162 INSN_LASX(xvsrlni_h_w,       vv_i)
2163 INSN_LASX(xvsrlni_w_d,       vv_i)
2164 INSN_LASX(xvsrlni_d_q,       vv_i)
2165 INSN_LASX(xvsrani_b_h,       vv_i)
2166 INSN_LASX(xvsrani_h_w,       vv_i)
2167 INSN_LASX(xvsrani_w_d,       vv_i)
2168 INSN_LASX(xvsrani_d_q,       vv_i)
2169 
2170 INSN_LASX(xvsrlrn_b_h,       vvv)
2171 INSN_LASX(xvsrlrn_h_w,       vvv)
2172 INSN_LASX(xvsrlrn_w_d,       vvv)
2173 INSN_LASX(xvsrarn_b_h,       vvv)
2174 INSN_LASX(xvsrarn_h_w,       vvv)
2175 INSN_LASX(xvsrarn_w_d,       vvv)
2176 
2177 INSN_LASX(xvsrlrni_b_h,      vv_i)
2178 INSN_LASX(xvsrlrni_h_w,      vv_i)
2179 INSN_LASX(xvsrlrni_w_d,      vv_i)
2180 INSN_LASX(xvsrlrni_d_q,      vv_i)
2181 INSN_LASX(xvsrarni_b_h,      vv_i)
2182 INSN_LASX(xvsrarni_h_w,      vv_i)
2183 INSN_LASX(xvsrarni_w_d,      vv_i)
2184 INSN_LASX(xvsrarni_d_q,      vv_i)
2185 
2186 INSN_LASX(xvssrln_b_h,       vvv)
2187 INSN_LASX(xvssrln_h_w,       vvv)
2188 INSN_LASX(xvssrln_w_d,       vvv)
2189 INSN_LASX(xvssran_b_h,       vvv)
2190 INSN_LASX(xvssran_h_w,       vvv)
2191 INSN_LASX(xvssran_w_d,       vvv)
2192 INSN_LASX(xvssrln_bu_h,      vvv)
2193 INSN_LASX(xvssrln_hu_w,      vvv)
2194 INSN_LASX(xvssrln_wu_d,      vvv)
2195 INSN_LASX(xvssran_bu_h,      vvv)
2196 INSN_LASX(xvssran_hu_w,      vvv)
2197 INSN_LASX(xvssran_wu_d,      vvv)
2198 
2199 INSN_LASX(xvssrlni_b_h,      vv_i)
2200 INSN_LASX(xvssrlni_h_w,      vv_i)
2201 INSN_LASX(xvssrlni_w_d,      vv_i)
2202 INSN_LASX(xvssrlni_d_q,      vv_i)
2203 INSN_LASX(xvssrani_b_h,      vv_i)
2204 INSN_LASX(xvssrani_h_w,      vv_i)
2205 INSN_LASX(xvssrani_w_d,      vv_i)
2206 INSN_LASX(xvssrani_d_q,      vv_i)
2207 INSN_LASX(xvssrlni_bu_h,     vv_i)
2208 INSN_LASX(xvssrlni_hu_w,     vv_i)
2209 INSN_LASX(xvssrlni_wu_d,     vv_i)
2210 INSN_LASX(xvssrlni_du_q,     vv_i)
2211 INSN_LASX(xvssrani_bu_h,     vv_i)
2212 INSN_LASX(xvssrani_hu_w,     vv_i)
2213 INSN_LASX(xvssrani_wu_d,     vv_i)
2214 INSN_LASX(xvssrani_du_q,     vv_i)
2215 
2216 INSN_LASX(xvssrlrn_b_h,      vvv)
2217 INSN_LASX(xvssrlrn_h_w,      vvv)
2218 INSN_LASX(xvssrlrn_w_d,      vvv)
2219 INSN_LASX(xvssrarn_b_h,      vvv)
2220 INSN_LASX(xvssrarn_h_w,      vvv)
2221 INSN_LASX(xvssrarn_w_d,      vvv)
2222 INSN_LASX(xvssrlrn_bu_h,     vvv)
2223 INSN_LASX(xvssrlrn_hu_w,     vvv)
2224 INSN_LASX(xvssrlrn_wu_d,     vvv)
2225 INSN_LASX(xvssrarn_bu_h,     vvv)
2226 INSN_LASX(xvssrarn_hu_w,     vvv)
2227 INSN_LASX(xvssrarn_wu_d,     vvv)
2228 
2229 INSN_LASX(xvssrlrni_b_h,     vv_i)
2230 INSN_LASX(xvssrlrni_h_w,     vv_i)
2231 INSN_LASX(xvssrlrni_w_d,     vv_i)
2232 INSN_LASX(xvssrlrni_d_q,     vv_i)
2233 INSN_LASX(xvssrlrni_bu_h,    vv_i)
2234 INSN_LASX(xvssrlrni_hu_w,    vv_i)
2235 INSN_LASX(xvssrlrni_wu_d,    vv_i)
2236 INSN_LASX(xvssrlrni_du_q,    vv_i)
2237 INSN_LASX(xvssrarni_b_h,     vv_i)
2238 INSN_LASX(xvssrarni_h_w,     vv_i)
2239 INSN_LASX(xvssrarni_w_d,     vv_i)
2240 INSN_LASX(xvssrarni_d_q,     vv_i)
2241 INSN_LASX(xvssrarni_bu_h,    vv_i)
2242 INSN_LASX(xvssrarni_hu_w,    vv_i)
2243 INSN_LASX(xvssrarni_wu_d,    vv_i)
2244 INSN_LASX(xvssrarni_du_q,    vv_i)
2245 
2246 INSN_LASX(xvclo_b,           vv)
2247 INSN_LASX(xvclo_h,           vv)
2248 INSN_LASX(xvclo_w,           vv)
2249 INSN_LASX(xvclo_d,           vv)
2250 INSN_LASX(xvclz_b,           vv)
2251 INSN_LASX(xvclz_h,           vv)
2252 INSN_LASX(xvclz_w,           vv)
2253 INSN_LASX(xvclz_d,           vv)
2254 
2255 INSN_LASX(xvpcnt_b,          vv)
2256 INSN_LASX(xvpcnt_h,          vv)
2257 INSN_LASX(xvpcnt_w,          vv)
2258 INSN_LASX(xvpcnt_d,          vv)
2259 
2260 INSN_LASX(xvbitclr_b,        vvv)
2261 INSN_LASX(xvbitclr_h,        vvv)
2262 INSN_LASX(xvbitclr_w,        vvv)
2263 INSN_LASX(xvbitclr_d,        vvv)
2264 INSN_LASX(xvbitclri_b,       vv_i)
2265 INSN_LASX(xvbitclri_h,       vv_i)
2266 INSN_LASX(xvbitclri_w,       vv_i)
2267 INSN_LASX(xvbitclri_d,       vv_i)
2268 INSN_LASX(xvbitset_b,        vvv)
2269 INSN_LASX(xvbitset_h,        vvv)
2270 INSN_LASX(xvbitset_w,        vvv)
2271 INSN_LASX(xvbitset_d,        vvv)
2272 INSN_LASX(xvbitseti_b,       vv_i)
2273 INSN_LASX(xvbitseti_h,       vv_i)
2274 INSN_LASX(xvbitseti_w,       vv_i)
2275 INSN_LASX(xvbitseti_d,       vv_i)
2276 INSN_LASX(xvbitrev_b,        vvv)
2277 INSN_LASX(xvbitrev_h,        vvv)
2278 INSN_LASX(xvbitrev_w,        vvv)
2279 INSN_LASX(xvbitrev_d,        vvv)
2280 INSN_LASX(xvbitrevi_b,       vv_i)
2281 INSN_LASX(xvbitrevi_h,       vv_i)
2282 INSN_LASX(xvbitrevi_w,       vv_i)
2283 INSN_LASX(xvbitrevi_d,       vv_i)
2284 
2285 INSN_LASX(xvfrstp_b,         vvv)
2286 INSN_LASX(xvfrstp_h,         vvv)
2287 INSN_LASX(xvfrstpi_b,        vv_i)
2288 INSN_LASX(xvfrstpi_h,        vv_i)
2289 
2290 INSN_LASX(xvfadd_s,          vvv)
2291 INSN_LASX(xvfadd_d,          vvv)
2292 INSN_LASX(xvfsub_s,          vvv)
2293 INSN_LASX(xvfsub_d,          vvv)
2294 INSN_LASX(xvfmul_s,          vvv)
2295 INSN_LASX(xvfmul_d,          vvv)
2296 INSN_LASX(xvfdiv_s,          vvv)
2297 INSN_LASX(xvfdiv_d,          vvv)
2298 
2299 INSN_LASX(xvfmadd_s,         vvvv)
2300 INSN_LASX(xvfmadd_d,         vvvv)
2301 INSN_LASX(xvfmsub_s,         vvvv)
2302 INSN_LASX(xvfmsub_d,         vvvv)
2303 INSN_LASX(xvfnmadd_s,        vvvv)
2304 INSN_LASX(xvfnmadd_d,        vvvv)
2305 INSN_LASX(xvfnmsub_s,        vvvv)
2306 INSN_LASX(xvfnmsub_d,        vvvv)
2307 
2308 INSN_LASX(xvfmax_s,          vvv)
2309 INSN_LASX(xvfmax_d,          vvv)
2310 INSN_LASX(xvfmin_s,          vvv)
2311 INSN_LASX(xvfmin_d,          vvv)
2312 
2313 INSN_LASX(xvfmaxa_s,         vvv)
2314 INSN_LASX(xvfmaxa_d,         vvv)
2315 INSN_LASX(xvfmina_s,         vvv)
2316 INSN_LASX(xvfmina_d,         vvv)
2317 
2318 INSN_LASX(xvflogb_s,         vv)
2319 INSN_LASX(xvflogb_d,         vv)
2320 
2321 INSN_LASX(xvfclass_s,        vv)
2322 INSN_LASX(xvfclass_d,        vv)
2323 
2324 INSN_LASX(xvfsqrt_s,         vv)
2325 INSN_LASX(xvfsqrt_d,         vv)
2326 INSN_LASX(xvfrecip_s,        vv)
2327 INSN_LASX(xvfrecip_d,        vv)
2328 INSN_LASX(xvfrsqrt_s,        vv)
2329 INSN_LASX(xvfrsqrt_d,        vv)
2330 
2331 INSN_LASX(xvfcvtl_s_h,       vv)
2332 INSN_LASX(xvfcvth_s_h,       vv)
2333 INSN_LASX(xvfcvtl_d_s,       vv)
2334 INSN_LASX(xvfcvth_d_s,       vv)
2335 INSN_LASX(xvfcvt_h_s,        vvv)
2336 INSN_LASX(xvfcvt_s_d,        vvv)
2337 
2338 INSN_LASX(xvfrint_s,         vv)
2339 INSN_LASX(xvfrint_d,         vv)
2340 INSN_LASX(xvfrintrm_s,       vv)
2341 INSN_LASX(xvfrintrm_d,       vv)
2342 INSN_LASX(xvfrintrp_s,       vv)
2343 INSN_LASX(xvfrintrp_d,       vv)
2344 INSN_LASX(xvfrintrz_s,       vv)
2345 INSN_LASX(xvfrintrz_d,       vv)
2346 INSN_LASX(xvfrintrne_s,      vv)
2347 INSN_LASX(xvfrintrne_d,      vv)
2348 
2349 INSN_LASX(xvftint_w_s,       vv)
2350 INSN_LASX(xvftint_l_d,       vv)
2351 INSN_LASX(xvftintrm_w_s,     vv)
2352 INSN_LASX(xvftintrm_l_d,     vv)
2353 INSN_LASX(xvftintrp_w_s,     vv)
2354 INSN_LASX(xvftintrp_l_d,     vv)
2355 INSN_LASX(xvftintrz_w_s,     vv)
2356 INSN_LASX(xvftintrz_l_d,     vv)
2357 INSN_LASX(xvftintrne_w_s,    vv)
2358 INSN_LASX(xvftintrne_l_d,    vv)
2359 INSN_LASX(xvftint_wu_s,      vv)
2360 INSN_LASX(xvftint_lu_d,      vv)
2361 INSN_LASX(xvftintrz_wu_s,    vv)
2362 INSN_LASX(xvftintrz_lu_d,    vv)
2363 INSN_LASX(xvftint_w_d,       vvv)
2364 INSN_LASX(xvftintrm_w_d,     vvv)
2365 INSN_LASX(xvftintrp_w_d,     vvv)
2366 INSN_LASX(xvftintrz_w_d,     vvv)
2367 INSN_LASX(xvftintrne_w_d,    vvv)
2368 INSN_LASX(xvftintl_l_s,      vv)
2369 INSN_LASX(xvftinth_l_s,      vv)
2370 INSN_LASX(xvftintrml_l_s,    vv)
2371 INSN_LASX(xvftintrmh_l_s,    vv)
2372 INSN_LASX(xvftintrpl_l_s,    vv)
2373 INSN_LASX(xvftintrph_l_s,    vv)
2374 INSN_LASX(xvftintrzl_l_s,    vv)
2375 INSN_LASX(xvftintrzh_l_s,    vv)
2376 INSN_LASX(xvftintrnel_l_s,   vv)
2377 INSN_LASX(xvftintrneh_l_s,   vv)
2378 
2379 INSN_LASX(xvffint_s_w,       vv)
2380 INSN_LASX(xvffint_s_wu,      vv)
2381 INSN_LASX(xvffint_d_l,       vv)
2382 INSN_LASX(xvffint_d_lu,      vv)
2383 INSN_LASX(xvffintl_d_w,      vv)
2384 INSN_LASX(xvffinth_d_w,      vv)
2385 INSN_LASX(xvffint_s_l,       vvv)
2386 
2387 INSN_LASX(xvseq_b,           vvv)
2388 INSN_LASX(xvseq_h,           vvv)
2389 INSN_LASX(xvseq_w,           vvv)
2390 INSN_LASX(xvseq_d,           vvv)
2391 INSN_LASX(xvseqi_b,          vv_i)
2392 INSN_LASX(xvseqi_h,          vv_i)
2393 INSN_LASX(xvseqi_w,          vv_i)
2394 INSN_LASX(xvseqi_d,          vv_i)
2395 
2396 INSN_LASX(xvsle_b,           vvv)
2397 INSN_LASX(xvsle_h,           vvv)
2398 INSN_LASX(xvsle_w,           vvv)
2399 INSN_LASX(xvsle_d,           vvv)
2400 INSN_LASX(xvslei_b,          vv_i)
2401 INSN_LASX(xvslei_h,          vv_i)
2402 INSN_LASX(xvslei_w,          vv_i)
2403 INSN_LASX(xvslei_d,          vv_i)
2404 INSN_LASX(xvsle_bu,          vvv)
2405 INSN_LASX(xvsle_hu,          vvv)
2406 INSN_LASX(xvsle_wu,          vvv)
2407 INSN_LASX(xvsle_du,          vvv)
2408 INSN_LASX(xvslei_bu,         vv_i)
2409 INSN_LASX(xvslei_hu,         vv_i)
2410 INSN_LASX(xvslei_wu,         vv_i)
2411 INSN_LASX(xvslei_du,         vv_i)
2412 
2413 INSN_LASX(xvslt_b,           vvv)
2414 INSN_LASX(xvslt_h,           vvv)
2415 INSN_LASX(xvslt_w,           vvv)
2416 INSN_LASX(xvslt_d,           vvv)
2417 INSN_LASX(xvslti_b,          vv_i)
2418 INSN_LASX(xvslti_h,          vv_i)
2419 INSN_LASX(xvslti_w,          vv_i)
2420 INSN_LASX(xvslti_d,          vv_i)
2421 INSN_LASX(xvslt_bu,          vvv)
2422 INSN_LASX(xvslt_hu,          vvv)
2423 INSN_LASX(xvslt_wu,          vvv)
2424 INSN_LASX(xvslt_du,          vvv)
2425 INSN_LASX(xvslti_bu,         vv_i)
2426 INSN_LASX(xvslti_hu,         vv_i)
2427 INSN_LASX(xvslti_wu,         vv_i)
2428 INSN_LASX(xvslti_du,         vv_i)
2429 
2430 #define output_xvfcmp(C, PREFIX, SUFFIX)                                    \
2431 {                                                                           \
2432     (C)->info->fprintf_func((C)->info->stream, "%08x  %s%s\tx%d, x%d, x%d", \
2433                             (C)->insn, PREFIX, SUFFIX, a->vd,               \
2434                             a->vj, a->vk);                                  \
2435 }
2436 static bool output_xxx_fcond(DisasContext *ctx, arg_vvv_fcond * a,
2437                              const char *suffix)
2438 {
2439     bool ret = true;
2440     switch (a->fcond) {
2441     case 0x0:
2442         output_xvfcmp(ctx, "xvfcmp_caf_", suffix);
2443         break;
2444     case 0x1:
2445         output_xvfcmp(ctx, "xvfcmp_saf_", suffix);
2446         break;
2447     case 0x2:
2448         output_xvfcmp(ctx, "xvfcmp_clt_", suffix);
2449         break;
2450     case 0x3:
2451         output_xvfcmp(ctx, "xvfcmp_slt_", suffix);
2452         break;
2453     case 0x4:
2454         output_xvfcmp(ctx, "xvfcmp_ceq_", suffix);
2455         break;
2456     case 0x5:
2457         output_xvfcmp(ctx, "xvfcmp_seq_", suffix);
2458         break;
2459     case 0x6:
2460         output_xvfcmp(ctx, "xvfcmp_cle_", suffix);
2461         break;
2462     case 0x7:
2463         output_xvfcmp(ctx, "xvfcmp_sle_", suffix);
2464         break;
2465     case 0x8:
2466         output_xvfcmp(ctx, "xvfcmp_cun_", suffix);
2467         break;
2468     case 0x9:
2469         output_xvfcmp(ctx, "xvfcmp_sun_", suffix);
2470         break;
2471     case 0xA:
2472         output_xvfcmp(ctx, "xvfcmp_cult_", suffix);
2473         break;
2474     case 0xB:
2475         output_xvfcmp(ctx, "xvfcmp_sult_", suffix);
2476         break;
2477     case 0xC:
2478         output_xvfcmp(ctx, "xvfcmp_cueq_", suffix);
2479         break;
2480     case 0xD:
2481         output_xvfcmp(ctx, "xvfcmp_sueq_", suffix);
2482         break;
2483     case 0xE:
2484         output_xvfcmp(ctx, "xvfcmp_cule_", suffix);
2485         break;
2486     case 0xF:
2487         output_xvfcmp(ctx, "xvfcmp_sule_", suffix);
2488         break;
2489     case 0x10:
2490         output_xvfcmp(ctx, "xvfcmp_cne_", suffix);
2491         break;
2492     case 0x11:
2493         output_xvfcmp(ctx, "xvfcmp_sne_", suffix);
2494         break;
2495     case 0x14:
2496         output_xvfcmp(ctx, "xvfcmp_cor_", suffix);
2497         break;
2498     case 0x15:
2499         output_xvfcmp(ctx, "xvfcmp_sor_", suffix);
2500         break;
2501     case 0x18:
2502         output_xvfcmp(ctx, "xvfcmp_cune_", suffix);
2503         break;
2504     case 0x19:
2505         output_xvfcmp(ctx, "xvfcmp_sune_", suffix);
2506         break;
2507     default:
2508         ret = false;
2509     }
2510     return ret;
2511 }
2512 
2513 #define LASX_FCMP_INSN(suffix)                            \
2514 static bool trans_xvfcmp_cond_##suffix(DisasContext *ctx, \
2515                                        arg_vvv_fcond * a) \
2516 {                                                         \
2517     return output_xxx_fcond(ctx, a, #suffix);             \
2518 }
2519 
2520 LASX_FCMP_INSN(s)
2521 LASX_FCMP_INSN(d)
2522 
2523 INSN_LASX(xvbitsel_v,        vvvv)
2524 INSN_LASX(xvbitseli_b,       vv_i)
2525 
2526 INSN_LASX(xvseteqz_v,        cv)
2527 INSN_LASX(xvsetnez_v,        cv)
2528 INSN_LASX(xvsetanyeqz_b,     cv)
2529 INSN_LASX(xvsetanyeqz_h,     cv)
2530 INSN_LASX(xvsetanyeqz_w,     cv)
2531 INSN_LASX(xvsetanyeqz_d,     cv)
2532 INSN_LASX(xvsetallnez_b,     cv)
2533 INSN_LASX(xvsetallnez_h,     cv)
2534 INSN_LASX(xvsetallnez_w,     cv)
2535 INSN_LASX(xvsetallnez_d,     cv)
2536 
2537 INSN_LASX(xvinsgr2vr_w,      vr_i)
2538 INSN_LASX(xvinsgr2vr_d,      vr_i)
2539 INSN_LASX(xvpickve2gr_w,     rv_i)
2540 INSN_LASX(xvpickve2gr_d,     rv_i)
2541 INSN_LASX(xvpickve2gr_wu,    rv_i)
2542 INSN_LASX(xvpickve2gr_du,    rv_i)
2543 
2544 INSN_LASX(xvreplgr2vr_b,     vr)
2545 INSN_LASX(xvreplgr2vr_h,     vr)
2546 INSN_LASX(xvreplgr2vr_w,     vr)
2547 INSN_LASX(xvreplgr2vr_d,     vr)
2548 
2549 INSN_LASX(xvreplve_b,        vvr)
2550 INSN_LASX(xvreplve_h,        vvr)
2551 INSN_LASX(xvreplve_w,        vvr)
2552 INSN_LASX(xvreplve_d,        vvr)
2553 INSN_LASX(xvrepl128vei_b,    vv_i)
2554 INSN_LASX(xvrepl128vei_h,    vv_i)
2555 INSN_LASX(xvrepl128vei_w,    vv_i)
2556 INSN_LASX(xvrepl128vei_d,    vv_i)
2557 
2558 INSN_LASX(xvreplve0_b,       vv)
2559 INSN_LASX(xvreplve0_h,       vv)
2560 INSN_LASX(xvreplve0_w,       vv)
2561 INSN_LASX(xvreplve0_d,       vv)
2562 INSN_LASX(xvreplve0_q,       vv)
2563 
2564 INSN_LASX(xvinsve0_w,        vv_i)
2565 INSN_LASX(xvinsve0_d,        vv_i)
2566 
2567 INSN_LASX(xvpickve_w,        vv_i)
2568 INSN_LASX(xvpickve_d,        vv_i)
2569 
2570 INSN_LASX(xvbsll_v,          vv_i)
2571 INSN_LASX(xvbsrl_v,          vv_i)
2572 
2573 INSN_LASX(xvpackev_b,        vvv)
2574 INSN_LASX(xvpackev_h,        vvv)
2575 INSN_LASX(xvpackev_w,        vvv)
2576 INSN_LASX(xvpackev_d,        vvv)
2577 INSN_LASX(xvpackod_b,        vvv)
2578 INSN_LASX(xvpackod_h,        vvv)
2579 INSN_LASX(xvpackod_w,        vvv)
2580 INSN_LASX(xvpackod_d,        vvv)
2581 
2582 INSN_LASX(xvpickev_b,        vvv)
2583 INSN_LASX(xvpickev_h,        vvv)
2584 INSN_LASX(xvpickev_w,        vvv)
2585 INSN_LASX(xvpickev_d,        vvv)
2586 INSN_LASX(xvpickod_b,        vvv)
2587 INSN_LASX(xvpickod_h,        vvv)
2588 INSN_LASX(xvpickod_w,        vvv)
2589 INSN_LASX(xvpickod_d,        vvv)
2590 
2591 INSN_LASX(xvilvl_b,          vvv)
2592 INSN_LASX(xvilvl_h,          vvv)
2593 INSN_LASX(xvilvl_w,          vvv)
2594 INSN_LASX(xvilvl_d,          vvv)
2595 INSN_LASX(xvilvh_b,          vvv)
2596 INSN_LASX(xvilvh_h,          vvv)
2597 INSN_LASX(xvilvh_w,          vvv)
2598 INSN_LASX(xvilvh_d,          vvv)
2599 
2600 INSN_LASX(xvshuf_b,          vvvv)
2601 INSN_LASX(xvshuf_h,          vvv)
2602 INSN_LASX(xvshuf_w,          vvv)
2603 INSN_LASX(xvshuf_d,          vvv)
2604 
2605 INSN_LASX(xvperm_w,          vvv)
2606 
2607 INSN_LASX(xvshuf4i_b,        vv_i)
2608 INSN_LASX(xvshuf4i_h,        vv_i)
2609 INSN_LASX(xvshuf4i_w,        vv_i)
2610 INSN_LASX(xvshuf4i_d,        vv_i)
2611 
2612 INSN_LASX(xvpermi_w,         vv_i)
2613 INSN_LASX(xvpermi_d,         vv_i)
2614 INSN_LASX(xvpermi_q,         vv_i)
2615 
2616 INSN_LASX(xvextrins_d,       vv_i)
2617 INSN_LASX(xvextrins_w,       vv_i)
2618 INSN_LASX(xvextrins_h,       vv_i)
2619 INSN_LASX(xvextrins_b,       vv_i)
2620 
2621 INSN_LASX(xvld,              vr_i)
2622 INSN_LASX(xvst,              vr_i)
2623 INSN_LASX(xvldx,             vrr)
2624 INSN_LASX(xvstx,             vrr)
2625 
2626 INSN_LASX(xvldrepl_d,        vr_i)
2627 INSN_LASX(xvldrepl_w,        vr_i)
2628 INSN_LASX(xvldrepl_h,        vr_i)
2629 INSN_LASX(xvldrepl_b,        vr_i)
2630 INSN_LASX(xvstelm_d,         vr_ii)
2631 INSN_LASX(xvstelm_w,         vr_ii)
2632 INSN_LASX(xvstelm_h,         vr_ii)
2633 INSN_LASX(xvstelm_b,         vr_ii)
2634