196c5ddc4Srjs#include "util/macros.h"
296c5ddc4Srjs#include "disassemble.h"
396c5ddc4Srjs#define _BITS(bits, pos, width) (((bits) >> (pos)) & ((1 << (width)) - 1))
496c5ddc4Srjsstatic void
596c5ddc4Srjsbi_disasm_fma_arshift_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
696c5ddc4Srjs{
796c5ddc4Srjs    static const char *lane2_table[] = {
896c5ddc4Srjs        "", ".b1", ".b2", ".b3"
996c5ddc4Srjs    };
1096c5ddc4Srjs
1196c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
1296c5ddc4Srjs
1396c5ddc4Srjs    fputs("*ARSHIFT.i32", fp);
1496c5ddc4Srjs    fputs(" ", fp);
1596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
1696c5ddc4Srjs    fputs(", ", fp);
1796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
1896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
1996c5ddc4Srjs    fputs(", ", fp);
2096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
2196c5ddc4Srjs    if (!(0x8 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
2296c5ddc4Srjs    fputs(", ", fp);
2396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
2496c5ddc4Srjs    fputs(lane2, fp);
2596c5ddc4Srjs}
2696c5ddc4Srjs
2796c5ddc4Srjsstatic void
2896c5ddc4Srjsbi_disasm_fma_arshift_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
2996c5ddc4Srjs{
3096c5ddc4Srjs    static const char *lanes2_table[] = {
3196c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
3296c5ddc4Srjs    };
3396c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
3496c5ddc4Srjs    fputs("*ARSHIFT.v2i16", fp);
3596c5ddc4Srjs    fputs(" ", fp);
3696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
3796c5ddc4Srjs    fputs(", ", fp);
3896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
3996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
4096c5ddc4Srjs    fputs(", ", fp);
4196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
4296c5ddc4Srjs    if (!(0x8 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
4396c5ddc4Srjs    fputs(", ", fp);
4496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
4596c5ddc4Srjs    fputs(lanes2, fp);
4696c5ddc4Srjs}
4796c5ddc4Srjs
4896c5ddc4Srjsstatic void
4996c5ddc4Srjsbi_disasm_fma_arshift_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
5096c5ddc4Srjs{
5196c5ddc4Srjs    static const char *lanes2_table[] = {
5296c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
5396c5ddc4Srjs    };
5496c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
5596c5ddc4Srjs    fputs("*ARSHIFT.v2i16", fp);
5696c5ddc4Srjs    fputs(" ", fp);
5796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
5896c5ddc4Srjs    fputs(", ", fp);
5996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
6096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
6196c5ddc4Srjs    fputs(", ", fp);
6296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
6396c5ddc4Srjs    if (!(0x8 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
6496c5ddc4Srjs    fputs(", ", fp);
6596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
6696c5ddc4Srjs    fputs(lanes2, fp);
6796c5ddc4Srjs}
6896c5ddc4Srjs
6996c5ddc4Srjsstatic void
7096c5ddc4Srjsbi_disasm_fma_arshift_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
7196c5ddc4Srjs{
7296c5ddc4Srjs    static const char *lanes2_table[] = {
7396c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
7496c5ddc4Srjs    };
7596c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
7696c5ddc4Srjs    fputs("*ARSHIFT.v4i8", fp);
7796c5ddc4Srjs    fputs(" ", fp);
7896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
7996c5ddc4Srjs    fputs(", ", fp);
8096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
8196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
8296c5ddc4Srjs    fputs(", ", fp);
8396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
8496c5ddc4Srjs    if (!(0x8 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
8596c5ddc4Srjs    fputs(", ", fp);
8696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
8796c5ddc4Srjs    fputs(lanes2, fp);
8896c5ddc4Srjs}
8996c5ddc4Srjs
9096c5ddc4Srjsstatic void
9196c5ddc4Srjsbi_disasm_fma_arshift_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
9296c5ddc4Srjs{
9396c5ddc4Srjs    static const char *lanes2_table[] = {
9496c5ddc4Srjs        ""
9596c5ddc4Srjs    };
9696c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
9796c5ddc4Srjs    fputs("*ARSHIFT.v4i8", fp);
9896c5ddc4Srjs    fputs(" ", fp);
9996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
10096c5ddc4Srjs    fputs(", ", fp);
10196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
10296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
10396c5ddc4Srjs    fputs(", ", fp);
10496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
10596c5ddc4Srjs    if (!(0x8 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
10696c5ddc4Srjs    fputs(", ", fp);
10796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
10896c5ddc4Srjs    fputs(lanes2, fp);
10996c5ddc4Srjs}
11096c5ddc4Srjs
11196c5ddc4Srjsstatic void
11296c5ddc4Srjsbi_disasm_fma_arshift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
11396c5ddc4Srjs{
11496c5ddc4Srjs    static const char *bytes2_table[] = {
11596c5ddc4Srjs        "", ".bytes2"
11696c5ddc4Srjs    };
11796c5ddc4Srjs
11896c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
11996c5ddc4Srjs
12096c5ddc4Srjs    static const char *lane2_table[] = {
12196c5ddc4Srjs        "", ".b2"
12296c5ddc4Srjs    };
12396c5ddc4Srjs
12496c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
12596c5ddc4Srjs
12696c5ddc4Srjs    static const char *result_word_table[] = {
12796c5ddc4Srjs        "", ".w1"
12896c5ddc4Srjs    };
12996c5ddc4Srjs
13096c5ddc4Srjs    const char *result_word = result_word_table[_BITS(bits, 11, 1)];
13196c5ddc4Srjs
13296c5ddc4Srjs    fputs("*ARSHIFT_DOUBLE.i32", fp);
13396c5ddc4Srjs    fputs(result_word, fp);
13496c5ddc4Srjs    fputs(" ", fp);
13596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
13696c5ddc4Srjs    fputs(", ", fp);
13796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
13896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
13996c5ddc4Srjs    fputs(", ", fp);
14096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
14196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
14296c5ddc4Srjs    fputs(", ", fp);
14396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
14496c5ddc4Srjs    fputs(bytes2, fp);
14596c5ddc4Srjs    fputs(lane2, fp);
14696c5ddc4Srjs}
14796c5ddc4Srjs
14896c5ddc4Srjsstatic void
14996c5ddc4Srjsbi_disasm_fma_atom_c_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
15096c5ddc4Srjs{
15196c5ddc4Srjs    static const char *atom_opc_table[] = {
15296c5ddc4Srjs        ".reserved", ".reserved", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
15396c5ddc4Srjs    };
15496c5ddc4Srjs
15596c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 9, 4)];
15696c5ddc4Srjs
15796c5ddc4Srjs    fputs("*ATOM_C.i32", fp);
15896c5ddc4Srjs    fputs(atom_opc, fp);
15996c5ddc4Srjs    fputs(" ", fp);
16096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
16196c5ddc4Srjs    fputs(", ", fp);
16296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
16396c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
16496c5ddc4Srjs    fputs(", ", fp);
16596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
16696c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
16796c5ddc4Srjs    fputs(", ", fp);
16896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
16996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
17096c5ddc4Srjs}
17196c5ddc4Srjs
17296c5ddc4Srjsstatic void
17396c5ddc4Srjsbi_disasm_fma_atom_c_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
17496c5ddc4Srjs{
17596c5ddc4Srjs    static const char *atom_opc_table[] = {
17696c5ddc4Srjs        ".aaddu", ".aadds", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
17796c5ddc4Srjs    };
17896c5ddc4Srjs
17996c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 9, 4)];
18096c5ddc4Srjs
18196c5ddc4Srjs    fputs("*ATOM_C.i64", fp);
18296c5ddc4Srjs    fputs(atom_opc, fp);
18396c5ddc4Srjs    fputs(" ", fp);
18496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
18596c5ddc4Srjs    fputs(", ", fp);
18696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
18796c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
18896c5ddc4Srjs    fputs(", ", fp);
18996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
19096c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
19196c5ddc4Srjs    fputs(", ", fp);
19296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
19396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
19496c5ddc4Srjs}
19596c5ddc4Srjs
19696c5ddc4Srjsstatic void
19796c5ddc4Srjsbi_disasm_fma_atom_c1_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
19896c5ddc4Srjs{
19996c5ddc4Srjs    static const char *atom_opc_table[] = {
20096c5ddc4Srjs        ".ainc", ".adec", ".aumax1", ".asmax1", ".aor1", ".reserved", ".reserved", ".reserved"
20196c5ddc4Srjs    };
20296c5ddc4Srjs
20396c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 3)];
20496c5ddc4Srjs
20596c5ddc4Srjs    fputs("*ATOM_C1.i32", fp);
20696c5ddc4Srjs    fputs(atom_opc, fp);
20796c5ddc4Srjs    fputs(" ", fp);
20896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
20996c5ddc4Srjs    fputs(", ", fp);
21096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
21196c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
21296c5ddc4Srjs    fputs(", ", fp);
21396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
21496c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
21596c5ddc4Srjs}
21696c5ddc4Srjs
21796c5ddc4Srjsstatic void
21896c5ddc4Srjsbi_disasm_fma_atom_c1_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
21996c5ddc4Srjs{
22096c5ddc4Srjs    static const char *atom_opc_table[] = {
22196c5ddc4Srjs        ".ainc", ".adec", ".aumax1", ".asmax1", ".aor1", ".reserved", ".reserved", ".reserved"
22296c5ddc4Srjs    };
22396c5ddc4Srjs
22496c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 3)];
22596c5ddc4Srjs
22696c5ddc4Srjs    fputs("*ATOM_C1.i64", fp);
22796c5ddc4Srjs    fputs(atom_opc, fp);
22896c5ddc4Srjs    fputs(" ", fp);
22996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
23096c5ddc4Srjs    fputs(", ", fp);
23196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
23296c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
23396c5ddc4Srjs    fputs(", ", fp);
23496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
23596c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
23696c5ddc4Srjs}
23796c5ddc4Srjs
23896c5ddc4Srjsstatic void
23996c5ddc4Srjsbi_disasm_fma_atom_c1_return_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
24096c5ddc4Srjs{
24196c5ddc4Srjs    static const char *atom_opc_table[] = {
24296c5ddc4Srjs        ".ainc", ".adec", ".aumax1", ".asmax1", ".aor1", ".reserved", ".reserved", ".reserved"
24396c5ddc4Srjs    };
24496c5ddc4Srjs
24596c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 3)];
24696c5ddc4Srjs
24796c5ddc4Srjs    fputs("*ATOM_C1_RETURN.i32", fp);
24896c5ddc4Srjs    fputs(atom_opc, fp);
24996c5ddc4Srjs    fputs(" ", fp);
25096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
25196c5ddc4Srjs    fputs(", ", fp);
25296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
25396c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
25496c5ddc4Srjs    fputs(", ", fp);
25596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
25696c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
25796c5ddc4Srjs}
25896c5ddc4Srjs
25996c5ddc4Srjsstatic void
26096c5ddc4Srjsbi_disasm_fma_atom_c1_return_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
26196c5ddc4Srjs{
26296c5ddc4Srjs    static const char *atom_opc_table[] = {
26396c5ddc4Srjs        ".ainc", ".adec", ".aumax1", ".asmax1", ".aor1", ".reserved", ".reserved", ".reserved"
26496c5ddc4Srjs    };
26596c5ddc4Srjs
26696c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 3)];
26796c5ddc4Srjs
26896c5ddc4Srjs    fputs("*ATOM_C1_RETURN.i64", fp);
26996c5ddc4Srjs    fputs(atom_opc, fp);
27096c5ddc4Srjs    fputs(" ", fp);
27196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
27296c5ddc4Srjs    fputs(", ", fp);
27396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
27496c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
27596c5ddc4Srjs    fputs(", ", fp);
27696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
27796c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
27896c5ddc4Srjs}
27996c5ddc4Srjs
28096c5ddc4Srjsstatic void
28196c5ddc4Srjsbi_disasm_fma_atom_c_return_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
28296c5ddc4Srjs{
28396c5ddc4Srjs    static const char *atom_opc_table[] = {
28496c5ddc4Srjs        ".reserved", ".reserved", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
28596c5ddc4Srjs    };
28696c5ddc4Srjs
28796c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 9, 4)];
28896c5ddc4Srjs
28996c5ddc4Srjs    fputs("*ATOM_C_RETURN.i32", fp);
29096c5ddc4Srjs    fputs(atom_opc, fp);
29196c5ddc4Srjs    fputs(" ", fp);
29296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
29396c5ddc4Srjs    fputs(", ", fp);
29496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
29596c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
29696c5ddc4Srjs    fputs(", ", fp);
29796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
29896c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
29996c5ddc4Srjs    fputs(", ", fp);
30096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
30196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
30296c5ddc4Srjs}
30396c5ddc4Srjs
30496c5ddc4Srjsstatic void
30596c5ddc4Srjsbi_disasm_fma_atom_c_return_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
30696c5ddc4Srjs{
30796c5ddc4Srjs    static const char *atom_opc_table[] = {
30896c5ddc4Srjs        ".aaddu", ".aadds", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
30996c5ddc4Srjs    };
31096c5ddc4Srjs
31196c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 9, 4)];
31296c5ddc4Srjs
31396c5ddc4Srjs    fputs("*ATOM_C_RETURN.i64", fp);
31496c5ddc4Srjs    fputs(atom_opc, fp);
31596c5ddc4Srjs    fputs(" ", fp);
31696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
31796c5ddc4Srjs    fputs(", ", fp);
31896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
31996c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
32096c5ddc4Srjs    fputs(", ", fp);
32196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
32296c5ddc4Srjs    if (!(0xf3 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
32396c5ddc4Srjs    fputs(", ", fp);
32496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
32596c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
32696c5ddc4Srjs}
32796c5ddc4Srjs
32896c5ddc4Srjsstatic void
32996c5ddc4Srjsbi_disasm_fma_atom_post_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
33096c5ddc4Srjs{
33196c5ddc4Srjs    static const char *atom_opc_table[] = {
33296c5ddc4Srjs        ".reserved", ".reserved", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
33396c5ddc4Srjs    };
33496c5ddc4Srjs
33596c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 4)];
33696c5ddc4Srjs
33796c5ddc4Srjs    fputs("*ATOM_POST.i32", fp);
33896c5ddc4Srjs    fputs(atom_opc, fp);
33996c5ddc4Srjs    fputs(" ", fp);
34096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
34196c5ddc4Srjs    fputs(", ", fp);
34296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
34396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
34496c5ddc4Srjs    fputs(", ", fp);
34596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
34696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
34796c5ddc4Srjs}
34896c5ddc4Srjs
34996c5ddc4Srjsstatic void
35096c5ddc4Srjsbi_disasm_fma_atom_post_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
35196c5ddc4Srjs{
35296c5ddc4Srjs    static const char *atom_opc_table[] = {
35396c5ddc4Srjs        ".aaddu", ".aadds", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
35496c5ddc4Srjs    };
35596c5ddc4Srjs
35696c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 6, 4)];
35796c5ddc4Srjs
35896c5ddc4Srjs    fputs("*ATOM_POST.i64", fp);
35996c5ddc4Srjs    fputs(atom_opc, fp);
36096c5ddc4Srjs    fputs(" ", fp);
36196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
36296c5ddc4Srjs    fputs(", ", fp);
36396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
36496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
36596c5ddc4Srjs    fputs(", ", fp);
36696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
36796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
36896c5ddc4Srjs}
36996c5ddc4Srjs
37096c5ddc4Srjsstatic void
37196c5ddc4Srjsbi_disasm_fma_atom_pre_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
37296c5ddc4Srjs{
37396c5ddc4Srjs    static const char *atom_opc_table[] = {
37496c5ddc4Srjs        ".aaddu", ".aadds", ".aadd", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".asmin", ".asmax", ".aumin", ".aumax", ".aand", ".aor", ".axor", ".reserved"
37596c5ddc4Srjs    };
37696c5ddc4Srjs
37796c5ddc4Srjs    const char *atom_opc = atom_opc_table[_BITS(bits, 9, 4)];
37896c5ddc4Srjs
37996c5ddc4Srjs    fputs("*ATOM_PRE.i64", fp);
38096c5ddc4Srjs    fputs(atom_opc, fp);
38196c5ddc4Srjs    fputs(" ", fp);
38296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
38396c5ddc4Srjs    fputs(", ", fp);
38496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
38596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
38696c5ddc4Srjs    fputs(", ", fp);
38796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
38896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
38996c5ddc4Srjs    fputs(", ", fp);
39096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
39196c5ddc4Srjs}
39296c5ddc4Srjs
39396c5ddc4Srjsstatic void
39496c5ddc4Srjsbi_disasm_fma_bitrev_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
39596c5ddc4Srjs{
39696c5ddc4Srjs    fputs("*BITREV.i32", fp);
39796c5ddc4Srjs    fputs(" ", fp);
39896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
39996c5ddc4Srjs    fputs(", ", fp);
40096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
40196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
40296c5ddc4Srjs}
40396c5ddc4Srjs
40496c5ddc4Srjsstatic void
40596c5ddc4Srjsbi_disasm_fma_clz_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
40696c5ddc4Srjs{
40796c5ddc4Srjs    static const char *mask_table[] = {
40896c5ddc4Srjs        "", ".mask"
40996c5ddc4Srjs    };
41096c5ddc4Srjs
41196c5ddc4Srjs    const char *mask = mask_table[_BITS(bits, 3, 1)];
41296c5ddc4Srjs
41396c5ddc4Srjs    fputs("*CLZ.u32", fp);
41496c5ddc4Srjs    fputs(mask, fp);
41596c5ddc4Srjs    fputs(" ", fp);
41696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
41796c5ddc4Srjs    fputs(", ", fp);
41896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
41996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
42096c5ddc4Srjs}
42196c5ddc4Srjs
42296c5ddc4Srjsstatic void
42396c5ddc4Srjsbi_disasm_fma_clz_v2u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
42496c5ddc4Srjs{
42596c5ddc4Srjs    static const char *mask_table[] = {
42696c5ddc4Srjs        "", ".mask"
42796c5ddc4Srjs    };
42896c5ddc4Srjs
42996c5ddc4Srjs    const char *mask = mask_table[_BITS(bits, 3, 1)];
43096c5ddc4Srjs
43196c5ddc4Srjs    static const char *swz0_table[] = {
43296c5ddc4Srjs        ".h00", ".h10", "", ".h11"
43396c5ddc4Srjs    };
43496c5ddc4Srjs
43596c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
43696c5ddc4Srjs
43796c5ddc4Srjs    fputs("*CLZ.v2u16", fp);
43896c5ddc4Srjs    fputs(mask, fp);
43996c5ddc4Srjs    fputs(" ", fp);
44096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
44196c5ddc4Srjs    fputs(", ", fp);
44296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
44396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
44496c5ddc4Srjs    fputs(swz0, fp);
44596c5ddc4Srjs}
44696c5ddc4Srjs
44796c5ddc4Srjsstatic void
44896c5ddc4Srjsbi_disasm_fma_clz_v4u8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
44996c5ddc4Srjs{
45096c5ddc4Srjs    static const char *mask_table[] = {
45196c5ddc4Srjs        "", ".mask"
45296c5ddc4Srjs    };
45396c5ddc4Srjs
45496c5ddc4Srjs    const char *mask = mask_table[_BITS(bits, 3, 1)];
45596c5ddc4Srjs
45696c5ddc4Srjs    fputs("*CLZ.v4u8", fp);
45796c5ddc4Srjs    fputs(mask, fp);
45896c5ddc4Srjs    fputs(" ", fp);
45996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
46096c5ddc4Srjs    fputs(", ", fp);
46196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
46296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
46396c5ddc4Srjs}
46496c5ddc4Srjs
46596c5ddc4Srjsstatic void
46696c5ddc4Srjsbi_disasm_fma_csel_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
46796c5ddc4Srjs{
46896c5ddc4Srjs    static const char *cmpf_table[] = {
46996c5ddc4Srjs        ".eq", ".gt", ".ge", ".reserved"
47096c5ddc4Srjs    };
47196c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 2) << 0)];
47296c5ddc4Srjs    fputs("*CSEL.f32", fp);
47396c5ddc4Srjs    fputs(cmpf, fp);
47496c5ddc4Srjs    fputs(" ", fp);
47596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
47696c5ddc4Srjs    fputs(", ", fp);
47796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
47896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
47996c5ddc4Srjs    fputs(", ", fp);
48096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
48196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
48296c5ddc4Srjs    fputs(", ", fp);
48396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
48496c5ddc4Srjs    fputs(", ", fp);
48596c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
48696c5ddc4Srjs}
48796c5ddc4Srjs
48896c5ddc4Srjsstatic void
48996c5ddc4Srjsbi_disasm_fma_csel_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
49096c5ddc4Srjs{
49196c5ddc4Srjs    static const char *cmpf_table[] = {
49296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".eq", ".reserved", ".reserved", ".reserved", ".reserved"
49396c5ddc4Srjs    };
49496c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 3) << 0)];
49596c5ddc4Srjs    fputs("*CSEL.i32", fp);
49696c5ddc4Srjs    fputs(cmpf, fp);
49796c5ddc4Srjs    fputs(" ", fp);
49896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
49996c5ddc4Srjs    fputs(", ", fp);
50096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
50196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
50296c5ddc4Srjs    fputs(", ", fp);
50396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
50496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
50596c5ddc4Srjs    fputs(", ", fp);
50696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
50796c5ddc4Srjs    fputs(", ", fp);
50896c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
50996c5ddc4Srjs}
51096c5ddc4Srjs
51196c5ddc4Srjsstatic void
51296c5ddc4Srjsbi_disasm_fma_csel_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
51396c5ddc4Srjs{
51496c5ddc4Srjs    static const char *cmpf_table[] = {
51596c5ddc4Srjs        ".gt", ".ge"
51696c5ddc4Srjs    };
51796c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
51896c5ddc4Srjs    fputs("*CSEL.s32", fp);
51996c5ddc4Srjs    fputs(cmpf, fp);
52096c5ddc4Srjs    fputs(" ", fp);
52196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
52296c5ddc4Srjs    fputs(", ", fp);
52396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
52496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
52596c5ddc4Srjs    fputs(", ", fp);
52696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
52796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
52896c5ddc4Srjs    fputs(", ", fp);
52996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
53096c5ddc4Srjs    fputs(", ", fp);
53196c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
53296c5ddc4Srjs}
53396c5ddc4Srjs
53496c5ddc4Srjsstatic void
53596c5ddc4Srjsbi_disasm_fma_csel_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
53696c5ddc4Srjs{
53796c5ddc4Srjs    static const char *cmpf_table[] = {
53896c5ddc4Srjs        ".gt", ".ge"
53996c5ddc4Srjs    };
54096c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
54196c5ddc4Srjs    fputs("*CSEL.u32", fp);
54296c5ddc4Srjs    fputs(cmpf, fp);
54396c5ddc4Srjs    fputs(" ", fp);
54496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
54596c5ddc4Srjs    fputs(", ", fp);
54696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
54796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
54896c5ddc4Srjs    fputs(", ", fp);
54996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
55096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
55196c5ddc4Srjs    fputs(", ", fp);
55296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
55396c5ddc4Srjs    fputs(", ", fp);
55496c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
55596c5ddc4Srjs}
55696c5ddc4Srjs
55796c5ddc4Srjsstatic void
55896c5ddc4Srjsbi_disasm_fma_csel_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
55996c5ddc4Srjs{
56096c5ddc4Srjs    static const char *cmpf_table[] = {
56196c5ddc4Srjs        ".eq", ".gt", ".ge", ".reserved"
56296c5ddc4Srjs    };
56396c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 2) << 0)];
56496c5ddc4Srjs    fputs("*CSEL.v2f16", fp);
56596c5ddc4Srjs    fputs(cmpf, fp);
56696c5ddc4Srjs    fputs(" ", fp);
56796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
56896c5ddc4Srjs    fputs(", ", fp);
56996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
57096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
57196c5ddc4Srjs    fputs(", ", fp);
57296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
57396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
57496c5ddc4Srjs    fputs(", ", fp);
57596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
57696c5ddc4Srjs    fputs(", ", fp);
57796c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
57896c5ddc4Srjs}
57996c5ddc4Srjs
58096c5ddc4Srjsstatic void
58196c5ddc4Srjsbi_disasm_fma_csel_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
58296c5ddc4Srjs{
58396c5ddc4Srjs    static const char *cmpf_table[] = {
58496c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".eq", ".reserved", ".reserved", ".reserved", ".reserved"
58596c5ddc4Srjs    };
58696c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 3) << 0)];
58796c5ddc4Srjs    fputs("*CSEL.v2i16", fp);
58896c5ddc4Srjs    fputs(cmpf, fp);
58996c5ddc4Srjs    fputs(" ", fp);
59096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
59196c5ddc4Srjs    fputs(", ", fp);
59296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
59396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
59496c5ddc4Srjs    fputs(", ", fp);
59596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
59696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
59796c5ddc4Srjs    fputs(", ", fp);
59896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
59996c5ddc4Srjs    fputs(", ", fp);
60096c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
60196c5ddc4Srjs}
60296c5ddc4Srjs
60396c5ddc4Srjsstatic void
60496c5ddc4Srjsbi_disasm_fma_csel_v2s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
60596c5ddc4Srjs{
60696c5ddc4Srjs    static const char *cmpf_table[] = {
60796c5ddc4Srjs        ".gt", ".ge"
60896c5ddc4Srjs    };
60996c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
61096c5ddc4Srjs    fputs("*CSEL.v2s16", fp);
61196c5ddc4Srjs    fputs(cmpf, fp);
61296c5ddc4Srjs    fputs(" ", fp);
61396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
61496c5ddc4Srjs    fputs(", ", fp);
61596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
61696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
61796c5ddc4Srjs    fputs(", ", fp);
61896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
61996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
62096c5ddc4Srjs    fputs(", ", fp);
62196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
62296c5ddc4Srjs    fputs(", ", fp);
62396c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
62496c5ddc4Srjs}
62596c5ddc4Srjs
62696c5ddc4Srjsstatic void
62796c5ddc4Srjsbi_disasm_fma_csel_v2u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
62896c5ddc4Srjs{
62996c5ddc4Srjs    static const char *cmpf_table[] = {
63096c5ddc4Srjs        ".gt", ".ge"
63196c5ddc4Srjs    };
63296c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
63396c5ddc4Srjs    fputs("*CSEL.v2u16", fp);
63496c5ddc4Srjs    fputs(cmpf, fp);
63596c5ddc4Srjs    fputs(" ", fp);
63696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
63796c5ddc4Srjs    fputs(", ", fp);
63896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
63996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
64096c5ddc4Srjs    fputs(", ", fp);
64196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
64296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
64396c5ddc4Srjs    fputs(", ", fp);
64496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
64596c5ddc4Srjs    fputs(", ", fp);
64696c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
64796c5ddc4Srjs}
64896c5ddc4Srjs
64996c5ddc4Srjsstatic void
65096c5ddc4Srjsbi_disasm_fma_cubeface1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
65196c5ddc4Srjs{
65296c5ddc4Srjs    static const char *neg1_table[] = {
65396c5ddc4Srjs        "", ".neg"
65496c5ddc4Srjs    };
65596c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 9, 1) << 0)];
65696c5ddc4Srjs    static const char *neg0_table[] = {
65796c5ddc4Srjs        "", ".neg"
65896c5ddc4Srjs    };
65996c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 9, 1) << 0)];
66096c5ddc4Srjs    static const char *neg2_table[] = {
66196c5ddc4Srjs        "", ".neg"
66296c5ddc4Srjs    };
66396c5ddc4Srjs    const char *neg2 = neg2_table[(_BITS(bits, 9, 1) << 0)];
66496c5ddc4Srjs    fputs("*CUBEFACE1", fp);
66596c5ddc4Srjs    fputs(" ", fp);
66696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
66796c5ddc4Srjs    fputs(", ", fp);
66896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
66996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
67096c5ddc4Srjs    fputs(neg0, fp);
67196c5ddc4Srjs    fputs(", ", fp);
67296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
67396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
67496c5ddc4Srjs    fputs(neg1, fp);
67596c5ddc4Srjs    fputs(", ", fp);
67696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
67796c5ddc4Srjs    fputs(neg2, fp);
67896c5ddc4Srjs}
67996c5ddc4Srjs
68096c5ddc4Srjsstatic void
68196c5ddc4Srjsbi_disasm_fma_dtsel_imm(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
68296c5ddc4Srjs{
68396c5ddc4Srjs    static const char *table_table[] = {
68496c5ddc4Srjs        ".attribute_1", ".attribute_2", "", ".flat"
68596c5ddc4Srjs    };
68696c5ddc4Srjs
68796c5ddc4Srjs    const char *table = table_table[_BITS(bits, 3, 2)];
68896c5ddc4Srjs
68996c5ddc4Srjs    fputs("*DTSEL_IMM", fp);
69096c5ddc4Srjs    fputs(table, fp);
69196c5ddc4Srjs    fputs(" ", fp);
69296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
69396c5ddc4Srjs    fputs(", ", fp);
69496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
69596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
69696c5ddc4Srjs}
69796c5ddc4Srjs
69896c5ddc4Srjsstatic void
69996c5ddc4Srjsbi_disasm_fma_f16_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
70096c5ddc4Srjs{
70196c5ddc4Srjs    static const char *lane0_table[] = {
70296c5ddc4Srjs        "", ".h1"
70396c5ddc4Srjs    };
70496c5ddc4Srjs
70596c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 3, 1)];
70696c5ddc4Srjs
70796c5ddc4Srjs    fputs("*F16_TO_F32", fp);
70896c5ddc4Srjs    fputs(" ", fp);
70996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
71096c5ddc4Srjs    fputs(", ", fp);
71196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
71296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
71396c5ddc4Srjs    fputs(lane0, fp);
71496c5ddc4Srjs}
71596c5ddc4Srjs
71696c5ddc4Srjsstatic void
71796c5ddc4Srjsbi_disasm_fma_fadd_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
71896c5ddc4Srjs{
71996c5ddc4Srjs    static const char *widen1_table[] = {
72096c5ddc4Srjs        "", ".h0", ".h1", ".h0", ".h1", ".h1", "", ""
72196c5ddc4Srjs    };
72296c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 3) << 0)];
72396c5ddc4Srjs    static const char *widen0_table[] = {
72496c5ddc4Srjs        "", "", "", ".h0", ".h0", ".h1", ".h0", ".h1"
72596c5ddc4Srjs    };
72696c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 9, 3) << 0)];
72796c5ddc4Srjs    static const char *abs1_table[] = {
72896c5ddc4Srjs        "", ".abs"
72996c5ddc4Srjs    };
73096c5ddc4Srjs
73196c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
73296c5ddc4Srjs
73396c5ddc4Srjs    static const char *neg0_table[] = {
73496c5ddc4Srjs        "", ".neg"
73596c5ddc4Srjs    };
73696c5ddc4Srjs
73796c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
73896c5ddc4Srjs
73996c5ddc4Srjs    static const char *neg1_table[] = {
74096c5ddc4Srjs        "", ".neg"
74196c5ddc4Srjs    };
74296c5ddc4Srjs
74396c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
74496c5ddc4Srjs
74596c5ddc4Srjs    static const char *abs0_table[] = {
74696c5ddc4Srjs        "", ".abs"
74796c5ddc4Srjs    };
74896c5ddc4Srjs
74996c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 12, 1)];
75096c5ddc4Srjs
75196c5ddc4Srjs    static const char *round_table[] = {
75296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
75396c5ddc4Srjs    };
75496c5ddc4Srjs
75596c5ddc4Srjs    const char *round = round_table[_BITS(bits, 13, 2)];
75696c5ddc4Srjs
75796c5ddc4Srjs    static const char *clamp_table[] = {
75896c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
75996c5ddc4Srjs    };
76096c5ddc4Srjs
76196c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 15, 2)];
76296c5ddc4Srjs
76396c5ddc4Srjs    fputs("*FADD.f32", fp);
76496c5ddc4Srjs    fputs(round, fp);
76596c5ddc4Srjs    fputs(clamp, fp);
76696c5ddc4Srjs    fputs(" ", fp);
76796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
76896c5ddc4Srjs    fputs(", ", fp);
76996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
77096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
77196c5ddc4Srjs    fputs(neg0, fp);
77296c5ddc4Srjs    fputs(abs0, fp);
77396c5ddc4Srjs    fputs(widen0, fp);
77496c5ddc4Srjs    fputs(", ", fp);
77596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
77696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
77796c5ddc4Srjs    fputs(abs1, fp);
77896c5ddc4Srjs    fputs(neg1, fp);
77996c5ddc4Srjs    fputs(widen1, fp);
78096c5ddc4Srjs}
78196c5ddc4Srjs
78296c5ddc4Srjsstatic void
78396c5ddc4Srjsbi_disasm_fma_fadd_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
78496c5ddc4Srjs{
78596c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
78696c5ddc4Srjs    static const char *abs0_0[] = {
78796c5ddc4Srjs        "", ".abs"
78896c5ddc4Srjs    };
78996c5ddc4Srjs    static const char *abs0_1[] = {
79096c5ddc4Srjs        ".abs", ".abs"
79196c5ddc4Srjs    };
79296c5ddc4Srjs    const char *abs0 = ordering ? abs0_1[(_BITS(bits, 6, 1) << 0)] : abs0_0[(_BITS(bits, 6, 1) << 0)];
79396c5ddc4Srjs    static const char *abs1_0[] = {
79496c5ddc4Srjs        "", ""
79596c5ddc4Srjs    };
79696c5ddc4Srjs    static const char *abs1_1[] = {
79796c5ddc4Srjs        "", ".abs"
79896c5ddc4Srjs    };
79996c5ddc4Srjs    const char *abs1 = ordering ? abs1_1[(_BITS(bits, 6, 1) << 0)] : abs1_0[(_BITS(bits, 6, 1) << 0)];
80096c5ddc4Srjs    static const char *neg0_table[] = {
80196c5ddc4Srjs        "", ".neg"
80296c5ddc4Srjs    };
80396c5ddc4Srjs
80496c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
80596c5ddc4Srjs
80696c5ddc4Srjs    static const char *neg1_table[] = {
80796c5ddc4Srjs        "", ".neg"
80896c5ddc4Srjs    };
80996c5ddc4Srjs
81096c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
81196c5ddc4Srjs
81296c5ddc4Srjs    static const char *swz0_table[] = {
81396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
81496c5ddc4Srjs    };
81596c5ddc4Srjs
81696c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
81796c5ddc4Srjs
81896c5ddc4Srjs    static const char *swz1_table[] = {
81996c5ddc4Srjs        ".h00", ".h10", "", ".h11"
82096c5ddc4Srjs    };
82196c5ddc4Srjs
82296c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
82396c5ddc4Srjs
82496c5ddc4Srjs    static const char *round_table[] = {
82596c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
82696c5ddc4Srjs    };
82796c5ddc4Srjs
82896c5ddc4Srjs    const char *round = round_table[_BITS(bits, 13, 2)];
82996c5ddc4Srjs
83096c5ddc4Srjs    static const char *clamp_table[] = {
83196c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
83296c5ddc4Srjs    };
83396c5ddc4Srjs
83496c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 15, 2)];
83596c5ddc4Srjs
83696c5ddc4Srjs    fputs("*FADD.v2f16", fp);
83796c5ddc4Srjs    fputs(round, fp);
83896c5ddc4Srjs    fputs(clamp, fp);
83996c5ddc4Srjs    fputs(" ", fp);
84096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
84196c5ddc4Srjs    fputs(", ", fp);
84296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
84396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
84496c5ddc4Srjs    fputs(abs0, fp);
84596c5ddc4Srjs    fputs(neg0, fp);
84696c5ddc4Srjs    fputs(swz0, fp);
84796c5ddc4Srjs    fputs(", ", fp);
84896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
84996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
85096c5ddc4Srjs    fputs(abs1, fp);
85196c5ddc4Srjs    fputs(neg1, fp);
85296c5ddc4Srjs    fputs(swz1, fp);
85396c5ddc4Srjs}
85496c5ddc4Srjs
85596c5ddc4Srjsstatic void
85696c5ddc4Srjsbi_disasm_fma_fadd_lscale_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
85796c5ddc4Srjs{
85896c5ddc4Srjs    static const char *abs0_table[] = {
85996c5ddc4Srjs        "", ".abs"
86096c5ddc4Srjs    };
86196c5ddc4Srjs
86296c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
86396c5ddc4Srjs
86496c5ddc4Srjs    static const char *neg0_table[] = {
86596c5ddc4Srjs        "", ".neg"
86696c5ddc4Srjs    };
86796c5ddc4Srjs
86896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
86996c5ddc4Srjs
87096c5ddc4Srjs    static const char *abs1_table[] = {
87196c5ddc4Srjs        "", ".abs"
87296c5ddc4Srjs    };
87396c5ddc4Srjs
87496c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 8, 1)];
87596c5ddc4Srjs
87696c5ddc4Srjs    static const char *neg1_table[] = {
87796c5ddc4Srjs        "", ".neg"
87896c5ddc4Srjs    };
87996c5ddc4Srjs
88096c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 9, 1)];
88196c5ddc4Srjs
88296c5ddc4Srjs    fputs("*FADD_LSCALE.f32", fp);
88396c5ddc4Srjs    fputs(" ", fp);
88496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
88596c5ddc4Srjs    fputs(", ", fp);
88696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
88796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
88896c5ddc4Srjs    fputs(abs0, fp);
88996c5ddc4Srjs    fputs(neg0, fp);
89096c5ddc4Srjs    fputs(", ", fp);
89196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
89296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
89396c5ddc4Srjs    fputs(abs1, fp);
89496c5ddc4Srjs    fputs(neg1, fp);
89596c5ddc4Srjs}
89696c5ddc4Srjs
89796c5ddc4Srjsstatic void
89896c5ddc4Srjsbi_disasm_fma_fcmp_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
89996c5ddc4Srjs{
90096c5ddc4Srjs    static const char *widen1_table[] = {
90196c5ddc4Srjs        "", ".h0", ".h1", ".h0", ".h1", ".h1", "", ""
90296c5ddc4Srjs    };
90396c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 3) << 0)];
90496c5ddc4Srjs    static const char *widen0_table[] = {
90596c5ddc4Srjs        "", "", "", ".h0", ".h0", ".h1", ".h0", ".h1"
90696c5ddc4Srjs    };
90796c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 9, 3) << 0)];
90896c5ddc4Srjs    static const char *abs1_table[] = {
90996c5ddc4Srjs        "", ".abs"
91096c5ddc4Srjs    };
91196c5ddc4Srjs
91296c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
91396c5ddc4Srjs
91496c5ddc4Srjs    static const char *neg0_table[] = {
91596c5ddc4Srjs        "", ".neg"
91696c5ddc4Srjs    };
91796c5ddc4Srjs
91896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
91996c5ddc4Srjs
92096c5ddc4Srjs    static const char *neg1_table[] = {
92196c5ddc4Srjs        "", ".neg"
92296c5ddc4Srjs    };
92396c5ddc4Srjs
92496c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
92596c5ddc4Srjs
92696c5ddc4Srjs    static const char *abs0_table[] = {
92796c5ddc4Srjs        "", ".abs"
92896c5ddc4Srjs    };
92996c5ddc4Srjs
93096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 12, 1)];
93196c5ddc4Srjs
93296c5ddc4Srjs    static const char *cmpf_table[] = {
93396c5ddc4Srjs        ".eq", ".gt", ".ge", ".ne", ".lt", ".le", ".gtlt", ".total"
93496c5ddc4Srjs    };
93596c5ddc4Srjs
93696c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 13, 3)];
93796c5ddc4Srjs
93896c5ddc4Srjs    static const char *result_type_table[] = {
93996c5ddc4Srjs        "", ".f1", ".m1", ".reserved"
94096c5ddc4Srjs    };
94196c5ddc4Srjs
94296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 16, 2)];
94396c5ddc4Srjs
94496c5ddc4Srjs    fputs("*FCMP.f32", fp);
94596c5ddc4Srjs    fputs(cmpf, fp);
94696c5ddc4Srjs    fputs(result_type, fp);
94796c5ddc4Srjs    fputs(" ", fp);
94896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
94996c5ddc4Srjs    fputs(", ", fp);
95096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
95196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
95296c5ddc4Srjs    fputs(widen0, fp);
95396c5ddc4Srjs    fputs(neg0, fp);
95496c5ddc4Srjs    fputs(abs0, fp);
95596c5ddc4Srjs    fputs(", ", fp);
95696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
95796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
95896c5ddc4Srjs    fputs(widen1, fp);
95996c5ddc4Srjs    fputs(abs1, fp);
96096c5ddc4Srjs    fputs(neg1, fp);
96196c5ddc4Srjs}
96296c5ddc4Srjs
96396c5ddc4Srjsstatic void
96496c5ddc4Srjsbi_disasm_fma_fcmp_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
96596c5ddc4Srjs{
96696c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
96796c5ddc4Srjs    static const char *abs0_0[] = {
96896c5ddc4Srjs        "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".reserved"
96996c5ddc4Srjs    };
97096c5ddc4Srjs    static const char *abs0_1[] = {
97196c5ddc4Srjs        ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".abs", ".reserved", ".reserved"
97296c5ddc4Srjs    };
97396c5ddc4Srjs    const char *abs0 = ordering ? abs0_1[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)] : abs0_0[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)];
97496c5ddc4Srjs    static const char *cmpf_0[] = {
97596c5ddc4Srjs        ".eq", ".eq", ".gt", ".gt", ".ge", ".ge", ".ne", ".ne", ".lt", ".lt", ".le", ".le", ".gtlt", ".gtlt", ".total", ".reserved"
97696c5ddc4Srjs    };
97796c5ddc4Srjs    static const char *cmpf_1[] = {
97896c5ddc4Srjs        ".eq", ".eq", ".gt", ".gt", ".ge", ".ge", ".ne", ".ne", ".lt", ".lt", ".le", ".le", ".gtlt", ".gtlt", ".reserved", ".reserved"
97996c5ddc4Srjs    };
98096c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)] : cmpf_0[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)];
98196c5ddc4Srjs    static const char *abs1_0[] = {
98296c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ".reserved"
98396c5ddc4Srjs    };
98496c5ddc4Srjs    static const char *abs1_1[] = {
98596c5ddc4Srjs        "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", "", ".abs", ".reserved", ".reserved"
98696c5ddc4Srjs    };
98796c5ddc4Srjs    const char *abs1 = ordering ? abs1_1[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)] : abs1_0[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 13, 3) << 1)];
98896c5ddc4Srjs    static const char *neg0_table[] = {
98996c5ddc4Srjs        "", ".neg"
99096c5ddc4Srjs    };
99196c5ddc4Srjs
99296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
99396c5ddc4Srjs
99496c5ddc4Srjs    static const char *neg1_table[] = {
99596c5ddc4Srjs        "", ".neg"
99696c5ddc4Srjs    };
99796c5ddc4Srjs
99896c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
99996c5ddc4Srjs
100096c5ddc4Srjs    static const char *swz0_table[] = {
100196c5ddc4Srjs        ".h00", ".h10", "", ".h11"
100296c5ddc4Srjs    };
100396c5ddc4Srjs
100496c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
100596c5ddc4Srjs
100696c5ddc4Srjs    static const char *swz1_table[] = {
100796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
100896c5ddc4Srjs    };
100996c5ddc4Srjs
101096c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
101196c5ddc4Srjs
101296c5ddc4Srjs    static const char *result_type_table[] = {
101396c5ddc4Srjs        "", ".f1", ".m1", ".reserved"
101496c5ddc4Srjs    };
101596c5ddc4Srjs
101696c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 16, 2)];
101796c5ddc4Srjs
101896c5ddc4Srjs    fputs("*FCMP.v2f16", fp);
101996c5ddc4Srjs    fputs(cmpf, fp);
102096c5ddc4Srjs    fputs(result_type, fp);
102196c5ddc4Srjs    fputs(" ", fp);
102296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
102396c5ddc4Srjs    fputs(", ", fp);
102496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
102596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
102696c5ddc4Srjs    fputs(abs0, fp);
102796c5ddc4Srjs    fputs(neg0, fp);
102896c5ddc4Srjs    fputs(swz0, fp);
102996c5ddc4Srjs    fputs(", ", fp);
103096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
103196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
103296c5ddc4Srjs    fputs(abs1, fp);
103396c5ddc4Srjs    fputs(neg1, fp);
103496c5ddc4Srjs    fputs(swz1, fp);
103596c5ddc4Srjs}
103696c5ddc4Srjs
103796c5ddc4Srjsstatic void
103896c5ddc4Srjsbi_disasm_fma_flshift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
103996c5ddc4Srjs{
104096c5ddc4Srjs    static const char *bytes2_table[] = {
104196c5ddc4Srjs        "", ".bytes2"
104296c5ddc4Srjs    };
104396c5ddc4Srjs
104496c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
104596c5ddc4Srjs
104696c5ddc4Srjs    static const char *lane2_table[] = {
104796c5ddc4Srjs        "", ".b2"
104896c5ddc4Srjs    };
104996c5ddc4Srjs
105096c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
105196c5ddc4Srjs
105296c5ddc4Srjs    fputs("*FLSHIFT_DOUBLE.i32", fp);
105396c5ddc4Srjs    fputs(" ", fp);
105496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
105596c5ddc4Srjs    fputs(", ", fp);
105696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
105796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
105896c5ddc4Srjs    fputs(", ", fp);
105996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
106096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
106196c5ddc4Srjs    fputs(", ", fp);
106296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
106396c5ddc4Srjs    fputs(bytes2, fp);
106496c5ddc4Srjs    fputs(lane2, fp);
106596c5ddc4Srjs}
106696c5ddc4Srjs
106796c5ddc4Srjsstatic void
106896c5ddc4Srjsbi_disasm_fma_fma_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
106996c5ddc4Srjs{
107096c5ddc4Srjs    static const char *neg1_table[] = {
107196c5ddc4Srjs        "", "", "", "", "", "", "", "", ".neg", ".neg", ".neg", ".neg", ".neg", ".neg", ".neg", ".neg"
107296c5ddc4Srjs    };
107396c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 9, 3) << 0) | (_BITS(bits, 17, 1) << 3)];
107496c5ddc4Srjs    static const char *neg0_table[] = {
107596c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
107696c5ddc4Srjs    };
107796c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 9, 3) << 0) | (_BITS(bits, 17, 1) << 3)];
107896c5ddc4Srjs    static const char *widen1_table[] = {
107996c5ddc4Srjs        "", ".h0", ".h1", ".h0", ".h1", ".h1", "", "", "", ".h0", ".h1", ".h0", ".h1", ".h1", "", ""
108096c5ddc4Srjs    };
108196c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 3) << 0) | (_BITS(bits, 17, 1) << 3)];
108296c5ddc4Srjs    static const char *widen0_table[] = {
108396c5ddc4Srjs        "", "", "", ".h0", ".h0", ".h1", ".h0", ".h1", "", "", "", ".h0", ".h0", ".h1", ".h0", ".h1"
108496c5ddc4Srjs    };
108596c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 9, 3) << 0) | (_BITS(bits, 17, 1) << 3)];
108696c5ddc4Srjs    static const char *abs0_table[] = {
108796c5ddc4Srjs        "", ".abs"
108896c5ddc4Srjs    };
108996c5ddc4Srjs
109096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 12, 1)];
109196c5ddc4Srjs
109296c5ddc4Srjs    static const char *round_table[] = {
109396c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
109496c5ddc4Srjs    };
109596c5ddc4Srjs
109696c5ddc4Srjs    const char *round = round_table[_BITS(bits, 13, 2)];
109796c5ddc4Srjs
109896c5ddc4Srjs    static const char *clamp_table[] = {
109996c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
110096c5ddc4Srjs    };
110196c5ddc4Srjs
110296c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 15, 2)];
110396c5ddc4Srjs
110496c5ddc4Srjs    static const char *abs1_table[] = {
110596c5ddc4Srjs        "", ".abs"
110696c5ddc4Srjs    };
110796c5ddc4Srjs
110896c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 19, 1)];
110996c5ddc4Srjs
111096c5ddc4Srjs    static const char *neg2_table[] = {
111196c5ddc4Srjs        "", ".neg"
111296c5ddc4Srjs    };
111396c5ddc4Srjs
111496c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 18, 1)];
111596c5ddc4Srjs
111696c5ddc4Srjs    static const char *abs2_table[] = {
111796c5ddc4Srjs        "", ".abs"
111896c5ddc4Srjs    };
111996c5ddc4Srjs
112096c5ddc4Srjs    const char *abs2 = abs2_table[_BITS(bits, 20, 1)];
112196c5ddc4Srjs
112296c5ddc4Srjs    fputs("*FMA.f32", fp);
112396c5ddc4Srjs    fputs(round, fp);
112496c5ddc4Srjs    fputs(clamp, fp);
112596c5ddc4Srjs    fputs(" ", fp);
112696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
112796c5ddc4Srjs    fputs(", ", fp);
112896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
112996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
113096c5ddc4Srjs    fputs(widen0, fp);
113196c5ddc4Srjs    fputs(neg0, fp);
113296c5ddc4Srjs    fputs(abs0, fp);
113396c5ddc4Srjs    fputs(", ", fp);
113496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
113596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
113696c5ddc4Srjs    fputs(widen1, fp);
113796c5ddc4Srjs    fputs(neg1, fp);
113896c5ddc4Srjs    fputs(abs1, fp);
113996c5ddc4Srjs    fputs(", ", fp);
114096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
114196c5ddc4Srjs    fputs(neg2, fp);
114296c5ddc4Srjs    fputs(abs2, fp);
114396c5ddc4Srjs}
114496c5ddc4Srjs
114596c5ddc4Srjsstatic void
114696c5ddc4Srjsbi_disasm_fma_fma_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
114796c5ddc4Srjs{
114896c5ddc4Srjs    static const char *neg1_table[] = {
114996c5ddc4Srjs        "", ".neg"
115096c5ddc4Srjs    };
115196c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 17, 1) << 0)];
115296c5ddc4Srjs    static const char *neg0_table[] = {
115396c5ddc4Srjs        "", ""
115496c5ddc4Srjs    };
115596c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 17, 1) << 0)];
115696c5ddc4Srjs    static const char *swz0_table[] = {
115796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
115896c5ddc4Srjs    };
115996c5ddc4Srjs
116096c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
116196c5ddc4Srjs
116296c5ddc4Srjs    static const char *swz1_table[] = {
116396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
116496c5ddc4Srjs    };
116596c5ddc4Srjs
116696c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
116796c5ddc4Srjs
116896c5ddc4Srjs    static const char *round_table[] = {
116996c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
117096c5ddc4Srjs    };
117196c5ddc4Srjs
117296c5ddc4Srjs    const char *round = round_table[_BITS(bits, 13, 2)];
117396c5ddc4Srjs
117496c5ddc4Srjs    static const char *clamp_table[] = {
117596c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
117696c5ddc4Srjs    };
117796c5ddc4Srjs
117896c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 15, 2)];
117996c5ddc4Srjs
118096c5ddc4Srjs    static const char *neg2_table[] = {
118196c5ddc4Srjs        "", ".neg"
118296c5ddc4Srjs    };
118396c5ddc4Srjs
118496c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 18, 1)];
118596c5ddc4Srjs
118696c5ddc4Srjs    static const char *swz2_table[] = {
118796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
118896c5ddc4Srjs    };
118996c5ddc4Srjs
119096c5ddc4Srjs    const char *swz2 = swz2_table[_BITS(bits, 19, 2)];
119196c5ddc4Srjs
119296c5ddc4Srjs    fputs("*FMA.v2f16", fp);
119396c5ddc4Srjs    fputs(round, fp);
119496c5ddc4Srjs    fputs(clamp, fp);
119596c5ddc4Srjs    fputs(" ", fp);
119696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
119796c5ddc4Srjs    fputs(", ", fp);
119896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
119996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
120096c5ddc4Srjs    fputs(neg0, fp);
120196c5ddc4Srjs    fputs(swz0, fp);
120296c5ddc4Srjs    fputs(", ", fp);
120396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
120496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
120596c5ddc4Srjs    fputs(neg1, fp);
120696c5ddc4Srjs    fputs(swz1, fp);
120796c5ddc4Srjs    fputs(", ", fp);
120896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
120996c5ddc4Srjs    fputs(neg2, fp);
121096c5ddc4Srjs    fputs(swz2, fp);
121196c5ddc4Srjs}
121296c5ddc4Srjs
121396c5ddc4Srjsstatic void
121496c5ddc4Srjsbi_disasm_fma_fma_rscale_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
121596c5ddc4Srjs{
121696c5ddc4Srjs    static const char *neg1_table[] = {
121796c5ddc4Srjs        "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg"
121896c5ddc4Srjs    };
121996c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
122096c5ddc4Srjs    static const char *neg0_table[] = {
122196c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
122296c5ddc4Srjs    };
122396c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
122496c5ddc4Srjs    static const char *round_table[] = {
122596c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", ".rtz", ".rtz", "", "", "", ""
122696c5ddc4Srjs    };
122796c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
122896c5ddc4Srjs    static const char *special_table[] = {
122996c5ddc4Srjs        "", "", "", "", "", "", "", "", ".n", ".n", ".n", ".n", ".scale16", ".scale16", ".left", ".left"
123096c5ddc4Srjs    };
123196c5ddc4Srjs    const char *special = special_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
123296c5ddc4Srjs    static const char *clamp_table[] = {
123396c5ddc4Srjs        "", "", ".clamp_0_inf", ".clamp_0_inf", ".clamp_m1_1", ".clamp_m1_1", ".clamp_0_1", ".clamp_0_1", "", "", "", "", "", "", "", ""
123496c5ddc4Srjs    };
123596c5ddc4Srjs    const char *clamp = clamp_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
123696c5ddc4Srjs    static const char *abs0_table[] = {
123796c5ddc4Srjs        "", ".abs"
123896c5ddc4Srjs    };
123996c5ddc4Srjs
124096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
124196c5ddc4Srjs
124296c5ddc4Srjs    static const char *neg2_table[] = {
124396c5ddc4Srjs        "", ".neg"
124496c5ddc4Srjs    };
124596c5ddc4Srjs
124696c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 17, 1)];
124796c5ddc4Srjs
124896c5ddc4Srjs    fputs("*FMA_RSCALE.f32", fp);
124996c5ddc4Srjs    fputs(round, fp);
125096c5ddc4Srjs    fputs(clamp, fp);
125196c5ddc4Srjs    fputs(special, fp);
125296c5ddc4Srjs    fputs(" ", fp);
125396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
125496c5ddc4Srjs    fputs(", ", fp);
125596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
125696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
125796c5ddc4Srjs    fputs(neg0, fp);
125896c5ddc4Srjs    fputs(abs0, fp);
125996c5ddc4Srjs    fputs(", ", fp);
126096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
126196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
126296c5ddc4Srjs    fputs(neg1, fp);
126396c5ddc4Srjs    fputs(", ", fp);
126496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
126596c5ddc4Srjs    fputs(neg2, fp);
126696c5ddc4Srjs    fputs(", ", fp);
126796c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
126896c5ddc4Srjs}
126996c5ddc4Srjs
127096c5ddc4Srjsstatic void
127196c5ddc4Srjsbi_disasm_fma_fma_rscale_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
127296c5ddc4Srjs{
127396c5ddc4Srjs    static const char *neg1_table[] = {
127496c5ddc4Srjs        "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg", "", ".neg", ".reserved", ".reserved", "", ".neg"
127596c5ddc4Srjs    };
127696c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
127796c5ddc4Srjs    static const char *neg0_table[] = {
127896c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", "", "", ".reserved", ".reserved", "", ""
127996c5ddc4Srjs    };
128096c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
128196c5ddc4Srjs    static const char *round_table[] = {
128296c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", ".rtz", ".rtz", ".reserved", ".reserved", "", ""
128396c5ddc4Srjs    };
128496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
128596c5ddc4Srjs    static const char *special_table[] = {
128696c5ddc4Srjs        "", "", "", "", "", "", "", "", ".n", ".n", ".n", ".n", ".reserved", ".reserved", ".left", ".left"
128796c5ddc4Srjs    };
128896c5ddc4Srjs    const char *special = special_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
128996c5ddc4Srjs    static const char *clamp_table[] = {
129096c5ddc4Srjs        "", "", ".clamp_0_inf", ".clamp_0_inf", ".clamp_m1_1", ".clamp_m1_1", ".clamp_0_1", ".clamp_0_1", "", "", "", "", ".reserved", ".reserved", "", ""
129196c5ddc4Srjs    };
129296c5ddc4Srjs    const char *clamp = clamp_table[(_BITS(bits, 16, 1) << 0) | (_BITS(bits, 12, 3) << 1)];
129396c5ddc4Srjs    static const char *abs0_table[] = {
129496c5ddc4Srjs        "", ".abs"
129596c5ddc4Srjs    };
129696c5ddc4Srjs
129796c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
129896c5ddc4Srjs
129996c5ddc4Srjs    static const char *neg2_table[] = {
130096c5ddc4Srjs        "", ".neg"
130196c5ddc4Srjs    };
130296c5ddc4Srjs
130396c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 17, 1)];
130496c5ddc4Srjs
130596c5ddc4Srjs    fputs("*FMA_RSCALE.v2f16", fp);
130696c5ddc4Srjs    fputs(round, fp);
130796c5ddc4Srjs    fputs(clamp, fp);
130896c5ddc4Srjs    fputs(special, fp);
130996c5ddc4Srjs    fputs(" ", fp);
131096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
131196c5ddc4Srjs    fputs(", ", fp);
131296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
131396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
131496c5ddc4Srjs    fputs(neg0, fp);
131596c5ddc4Srjs    fputs(abs0, fp);
131696c5ddc4Srjs    fputs(", ", fp);
131796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
131896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
131996c5ddc4Srjs    fputs(neg1, fp);
132096c5ddc4Srjs    fputs(", ", fp);
132196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
132296c5ddc4Srjs    fputs(neg2, fp);
132396c5ddc4Srjs    fputs(", ", fp);
132496c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
132596c5ddc4Srjs}
132696c5ddc4Srjs
132796c5ddc4Srjsstatic void
132896c5ddc4Srjsbi_disasm_fma_fmul_cslice(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
132996c5ddc4Srjs{
133096c5ddc4Srjs    static const char *lane0_table[] = {
133196c5ddc4Srjs        "", ".h1"
133296c5ddc4Srjs    };
133396c5ddc4Srjs
133496c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 6, 1)];
133596c5ddc4Srjs
133696c5ddc4Srjs    static const char *abs0_table[] = {
133796c5ddc4Srjs        "", ".abs"
133896c5ddc4Srjs    };
133996c5ddc4Srjs
134096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
134196c5ddc4Srjs
134296c5ddc4Srjs    static const char *neg0_table[] = {
134396c5ddc4Srjs        "", ".neg"
134496c5ddc4Srjs    };
134596c5ddc4Srjs
134696c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
134796c5ddc4Srjs
134896c5ddc4Srjs    fputs("*FMUL_CSLICE", fp);
134996c5ddc4Srjs    fputs(" ", fp);
135096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
135196c5ddc4Srjs    fputs(", ", fp);
135296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
135396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
135496c5ddc4Srjs    fputs(lane0, fp);
135596c5ddc4Srjs    fputs(abs0, fp);
135696c5ddc4Srjs    fputs(neg0, fp);
135796c5ddc4Srjs    fputs(", ", fp);
135896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
135996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
136096c5ddc4Srjs}
136196c5ddc4Srjs
136296c5ddc4Srjsstatic void
136396c5ddc4Srjsbi_disasm_fma_fmul_slice_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
136496c5ddc4Srjs{
136596c5ddc4Srjs    fputs("*FMUL_SLICE.f32", fp);
136696c5ddc4Srjs    fputs(" ", fp);
136796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
136896c5ddc4Srjs    fputs(", ", fp);
136996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
137096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
137196c5ddc4Srjs    fputs(", ", fp);
137296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
137396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
137496c5ddc4Srjs}
137596c5ddc4Srjs
137696c5ddc4Srjsstatic void
137796c5ddc4Srjsbi_disasm_fma_frexpe_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
137896c5ddc4Srjs{
137996c5ddc4Srjs    static const char *log_table[] = {
138096c5ddc4Srjs        ""
138196c5ddc4Srjs    };
138296c5ddc4Srjs    const char *log = log_table[0];
138396c5ddc4Srjs    static const char *neg0_table[] = {
138496c5ddc4Srjs        "", ".neg"
138596c5ddc4Srjs    };
138696c5ddc4Srjs
138796c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 6, 1)];
138896c5ddc4Srjs
138996c5ddc4Srjs    static const char *sqrt_table[] = {
139096c5ddc4Srjs        "", ".sqrt"
139196c5ddc4Srjs    };
139296c5ddc4Srjs
139396c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 8, 1)];
139496c5ddc4Srjs
139596c5ddc4Srjs    static const char *widen0_table[] = {
139696c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
139796c5ddc4Srjs    };
139896c5ddc4Srjs
139996c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
140096c5ddc4Srjs
140196c5ddc4Srjs    fputs("*FREXPE.f32", fp);
140296c5ddc4Srjs    fputs(sqrt, fp);
140396c5ddc4Srjs    fputs(log, fp);
140496c5ddc4Srjs    fputs(" ", fp);
140596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
140696c5ddc4Srjs    fputs(", ", fp);
140796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
140896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
140996c5ddc4Srjs    fputs(neg0, fp);
141096c5ddc4Srjs    fputs(widen0, fp);
141196c5ddc4Srjs}
141296c5ddc4Srjs
141396c5ddc4Srjsstatic void
141496c5ddc4Srjsbi_disasm_fma_frexpe_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
141596c5ddc4Srjs{
141696c5ddc4Srjs    static const char *log_table[] = {
141796c5ddc4Srjs        ".log"
141896c5ddc4Srjs    };
141996c5ddc4Srjs    const char *log = log_table[0];
142096c5ddc4Srjs    static const char *neg0_table[] = {
142196c5ddc4Srjs        ""
142296c5ddc4Srjs    };
142396c5ddc4Srjs    const char *neg0 = neg0_table[0];
142496c5ddc4Srjs    static const char *sqrt_table[] = {
142596c5ddc4Srjs        ""
142696c5ddc4Srjs    };
142796c5ddc4Srjs    const char *sqrt = sqrt_table[0];
142896c5ddc4Srjs    static const char *widen0_table[] = {
142996c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
143096c5ddc4Srjs    };
143196c5ddc4Srjs
143296c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
143396c5ddc4Srjs
143496c5ddc4Srjs    fputs("*FREXPE.f32", fp);
143596c5ddc4Srjs    fputs(sqrt, fp);
143696c5ddc4Srjs    fputs(log, fp);
143796c5ddc4Srjs    fputs(" ", fp);
143896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
143996c5ddc4Srjs    fputs(", ", fp);
144096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
144196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
144296c5ddc4Srjs    fputs(neg0, fp);
144396c5ddc4Srjs    fputs(widen0, fp);
144496c5ddc4Srjs}
144596c5ddc4Srjs
144696c5ddc4Srjsstatic void
144796c5ddc4Srjsbi_disasm_fma_frexpe_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
144896c5ddc4Srjs{
144996c5ddc4Srjs    static const char *log_table[] = {
145096c5ddc4Srjs        ""
145196c5ddc4Srjs    };
145296c5ddc4Srjs    const char *log = log_table[0];
145396c5ddc4Srjs    static const char *neg0_table[] = {
145496c5ddc4Srjs        "", ".neg"
145596c5ddc4Srjs    };
145696c5ddc4Srjs
145796c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 6, 1)];
145896c5ddc4Srjs
145996c5ddc4Srjs    static const char *sqrt_table[] = {
146096c5ddc4Srjs        "", ".sqrt"
146196c5ddc4Srjs    };
146296c5ddc4Srjs
146396c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 8, 1)];
146496c5ddc4Srjs
146596c5ddc4Srjs    static const char *swz0_table[] = {
146696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
146796c5ddc4Srjs    };
146896c5ddc4Srjs
146996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
147096c5ddc4Srjs
147196c5ddc4Srjs    fputs("*FREXPE.v2f16", fp);
147296c5ddc4Srjs    fputs(sqrt, fp);
147396c5ddc4Srjs    fputs(log, fp);
147496c5ddc4Srjs    fputs(" ", fp);
147596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
147696c5ddc4Srjs    fputs(", ", fp);
147796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
147896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
147996c5ddc4Srjs    fputs(neg0, fp);
148096c5ddc4Srjs    fputs(swz0, fp);
148196c5ddc4Srjs}
148296c5ddc4Srjs
148396c5ddc4Srjsstatic void
148496c5ddc4Srjsbi_disasm_fma_frexpe_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
148596c5ddc4Srjs{
148696c5ddc4Srjs    static const char *log_table[] = {
148796c5ddc4Srjs        ".log"
148896c5ddc4Srjs    };
148996c5ddc4Srjs    const char *log = log_table[0];
149096c5ddc4Srjs    static const char *neg0_table[] = {
149196c5ddc4Srjs        ""
149296c5ddc4Srjs    };
149396c5ddc4Srjs    const char *neg0 = neg0_table[0];
149496c5ddc4Srjs    static const char *sqrt_table[] = {
149596c5ddc4Srjs        ""
149696c5ddc4Srjs    };
149796c5ddc4Srjs    const char *sqrt = sqrt_table[0];
149896c5ddc4Srjs    static const char *swz0_table[] = {
149996c5ddc4Srjs        ".h00", ".h10", "", ".h11"
150096c5ddc4Srjs    };
150196c5ddc4Srjs
150296c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
150396c5ddc4Srjs
150496c5ddc4Srjs    fputs("*FREXPE.v2f16", fp);
150596c5ddc4Srjs    fputs(sqrt, fp);
150696c5ddc4Srjs    fputs(log, fp);
150796c5ddc4Srjs    fputs(" ", fp);
150896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
150996c5ddc4Srjs    fputs(", ", fp);
151096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
151196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
151296c5ddc4Srjs    fputs(neg0, fp);
151396c5ddc4Srjs    fputs(swz0, fp);
151496c5ddc4Srjs}
151596c5ddc4Srjs
151696c5ddc4Srjsstatic void
151796c5ddc4Srjsbi_disasm_fma_frexpm_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
151896c5ddc4Srjs{
151996c5ddc4Srjs    static const char *log_table[] = {
152096c5ddc4Srjs        ""
152196c5ddc4Srjs    };
152296c5ddc4Srjs    const char *log = log_table[0];
152396c5ddc4Srjs    static const char *neg0_table[] = {
152496c5ddc4Srjs        ""
152596c5ddc4Srjs    };
152696c5ddc4Srjs    const char *neg0 = neg0_table[0];
152796c5ddc4Srjs    static const char *abs0_table[] = {
152896c5ddc4Srjs        "", ".abs"
152996c5ddc4Srjs    };
153096c5ddc4Srjs
153196c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
153296c5ddc4Srjs
153396c5ddc4Srjs    static const char *sqrt_table[] = {
153496c5ddc4Srjs        "", ".sqrt"
153596c5ddc4Srjs    };
153696c5ddc4Srjs
153796c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 7, 1)];
153896c5ddc4Srjs
153996c5ddc4Srjs    static const char *widen0_table[] = {
154096c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
154196c5ddc4Srjs    };
154296c5ddc4Srjs
154396c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
154496c5ddc4Srjs
154596c5ddc4Srjs    fputs("*FREXPM.f32", fp);
154696c5ddc4Srjs    fputs(sqrt, fp);
154796c5ddc4Srjs    fputs(log, fp);
154896c5ddc4Srjs    fputs(" ", fp);
154996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
155096c5ddc4Srjs    fputs(", ", fp);
155196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
155296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
155396c5ddc4Srjs    fputs(abs0, fp);
155496c5ddc4Srjs    fputs(widen0, fp);
155596c5ddc4Srjs    fputs(neg0, fp);
155696c5ddc4Srjs}
155796c5ddc4Srjs
155896c5ddc4Srjsstatic void
155996c5ddc4Srjsbi_disasm_fma_frexpm_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
156096c5ddc4Srjs{
156196c5ddc4Srjs    static const char *log_table[] = {
156296c5ddc4Srjs        ".log"
156396c5ddc4Srjs    };
156496c5ddc4Srjs    const char *log = log_table[0];
156596c5ddc4Srjs    static const char *sqrt_table[] = {
156696c5ddc4Srjs        ""
156796c5ddc4Srjs    };
156896c5ddc4Srjs    const char *sqrt = sqrt_table[0];
156996c5ddc4Srjs    static const char *abs0_table[] = {
157096c5ddc4Srjs        "", ".abs"
157196c5ddc4Srjs    };
157296c5ddc4Srjs
157396c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
157496c5ddc4Srjs
157596c5ddc4Srjs    static const char *widen0_table[] = {
157696c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
157796c5ddc4Srjs    };
157896c5ddc4Srjs
157996c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
158096c5ddc4Srjs
158196c5ddc4Srjs    static const char *neg0_table[] = {
158296c5ddc4Srjs        "", ".neg"
158396c5ddc4Srjs    };
158496c5ddc4Srjs
158596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
158696c5ddc4Srjs
158796c5ddc4Srjs    fputs("*FREXPM.f32", fp);
158896c5ddc4Srjs    fputs(sqrt, fp);
158996c5ddc4Srjs    fputs(log, fp);
159096c5ddc4Srjs    fputs(" ", fp);
159196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
159296c5ddc4Srjs    fputs(", ", fp);
159396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
159496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
159596c5ddc4Srjs    fputs(abs0, fp);
159696c5ddc4Srjs    fputs(widen0, fp);
159796c5ddc4Srjs    fputs(neg0, fp);
159896c5ddc4Srjs}
159996c5ddc4Srjs
160096c5ddc4Srjsstatic void
160196c5ddc4Srjsbi_disasm_fma_frexpm_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
160296c5ddc4Srjs{
160396c5ddc4Srjs    static const char *log_table[] = {
160496c5ddc4Srjs        ""
160596c5ddc4Srjs    };
160696c5ddc4Srjs    const char *log = log_table[0];
160796c5ddc4Srjs    static const char *neg0_table[] = {
160896c5ddc4Srjs        ""
160996c5ddc4Srjs    };
161096c5ddc4Srjs    const char *neg0 = neg0_table[0];
161196c5ddc4Srjs    static const char *abs0_table[] = {
161296c5ddc4Srjs        "", ".abs"
161396c5ddc4Srjs    };
161496c5ddc4Srjs
161596c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
161696c5ddc4Srjs
161796c5ddc4Srjs    static const char *sqrt_table[] = {
161896c5ddc4Srjs        "", ".sqrt"
161996c5ddc4Srjs    };
162096c5ddc4Srjs
162196c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 7, 1)];
162296c5ddc4Srjs
162396c5ddc4Srjs    static const char *swz0_table[] = {
162496c5ddc4Srjs        ".h00", ".h10", "", ".h11"
162596c5ddc4Srjs    };
162696c5ddc4Srjs
162796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
162896c5ddc4Srjs
162996c5ddc4Srjs    fputs("*FREXPM.v2f16", fp);
163096c5ddc4Srjs    fputs(sqrt, fp);
163196c5ddc4Srjs    fputs(log, fp);
163296c5ddc4Srjs    fputs(" ", fp);
163396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
163496c5ddc4Srjs    fputs(", ", fp);
163596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
163696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
163796c5ddc4Srjs    fputs(abs0, fp);
163896c5ddc4Srjs    fputs(swz0, fp);
163996c5ddc4Srjs    fputs(neg0, fp);
164096c5ddc4Srjs}
164196c5ddc4Srjs
164296c5ddc4Srjsstatic void
164396c5ddc4Srjsbi_disasm_fma_frexpm_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
164496c5ddc4Srjs{
164596c5ddc4Srjs    static const char *log_table[] = {
164696c5ddc4Srjs        ".log"
164796c5ddc4Srjs    };
164896c5ddc4Srjs    const char *log = log_table[0];
164996c5ddc4Srjs    static const char *sqrt_table[] = {
165096c5ddc4Srjs        ""
165196c5ddc4Srjs    };
165296c5ddc4Srjs    const char *sqrt = sqrt_table[0];
165396c5ddc4Srjs    static const char *abs0_table[] = {
165496c5ddc4Srjs        "", ".abs"
165596c5ddc4Srjs    };
165696c5ddc4Srjs
165796c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
165896c5ddc4Srjs
165996c5ddc4Srjs    static const char *swz0_table[] = {
166096c5ddc4Srjs        ".h00", ".h10", "", ".h11"
166196c5ddc4Srjs    };
166296c5ddc4Srjs
166396c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
166496c5ddc4Srjs
166596c5ddc4Srjs    static const char *neg0_table[] = {
166696c5ddc4Srjs        "", ".neg"
166796c5ddc4Srjs    };
166896c5ddc4Srjs
166996c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
167096c5ddc4Srjs
167196c5ddc4Srjs    fputs("*FREXPM.v2f16", fp);
167296c5ddc4Srjs    fputs(sqrt, fp);
167396c5ddc4Srjs    fputs(log, fp);
167496c5ddc4Srjs    fputs(" ", fp);
167596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
167696c5ddc4Srjs    fputs(", ", fp);
167796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
167896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
167996c5ddc4Srjs    fputs(abs0, fp);
168096c5ddc4Srjs    fputs(swz0, fp);
168196c5ddc4Srjs    fputs(neg0, fp);
168296c5ddc4Srjs}
168396c5ddc4Srjs
168496c5ddc4Srjsstatic void
168596c5ddc4Srjsbi_disasm_fma_fround_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
168696c5ddc4Srjs{
168796c5ddc4Srjs    static const char *round_table[] = {
168896c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
168996c5ddc4Srjs    };
169096c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 9, 2) << 0)];
169196c5ddc4Srjs    static const char *abs0_table[] = {
169296c5ddc4Srjs        "", ".abs"
169396c5ddc4Srjs    };
169496c5ddc4Srjs
169596c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
169696c5ddc4Srjs
169796c5ddc4Srjs    static const char *neg0_table[] = {
169896c5ddc4Srjs        "", ".neg"
169996c5ddc4Srjs    };
170096c5ddc4Srjs
170196c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
170296c5ddc4Srjs
170396c5ddc4Srjs    static const char *widen0_table[] = {
170496c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
170596c5ddc4Srjs    };
170696c5ddc4Srjs
170796c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
170896c5ddc4Srjs
170996c5ddc4Srjs    fputs("*FROUND.f32", fp);
171096c5ddc4Srjs    fputs(round, fp);
171196c5ddc4Srjs    fputs(" ", fp);
171296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
171396c5ddc4Srjs    fputs(", ", fp);
171496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
171596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
171696c5ddc4Srjs    fputs(abs0, fp);
171796c5ddc4Srjs    fputs(neg0, fp);
171896c5ddc4Srjs    fputs(widen0, fp);
171996c5ddc4Srjs}
172096c5ddc4Srjs
172196c5ddc4Srjsstatic void
172296c5ddc4Srjsbi_disasm_fma_fround_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
172396c5ddc4Srjs{
172496c5ddc4Srjs    static const char *round_table[] = {
172596c5ddc4Srjs        ".rtna"
172696c5ddc4Srjs    };
172796c5ddc4Srjs    const char *round = round_table[0];
172896c5ddc4Srjs    static const char *abs0_table[] = {
172996c5ddc4Srjs        "", ".abs"
173096c5ddc4Srjs    };
173196c5ddc4Srjs
173296c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
173396c5ddc4Srjs
173496c5ddc4Srjs    static const char *neg0_table[] = {
173596c5ddc4Srjs        "", ".neg"
173696c5ddc4Srjs    };
173796c5ddc4Srjs
173896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
173996c5ddc4Srjs
174096c5ddc4Srjs    static const char *widen0_table[] = {
174196c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
174296c5ddc4Srjs    };
174396c5ddc4Srjs
174496c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
174596c5ddc4Srjs
174696c5ddc4Srjs    fputs("*FROUND.f32", fp);
174796c5ddc4Srjs    fputs(round, fp);
174896c5ddc4Srjs    fputs(" ", fp);
174996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
175096c5ddc4Srjs    fputs(", ", fp);
175196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
175296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
175396c5ddc4Srjs    fputs(abs0, fp);
175496c5ddc4Srjs    fputs(neg0, fp);
175596c5ddc4Srjs    fputs(widen0, fp);
175696c5ddc4Srjs}
175796c5ddc4Srjs
175896c5ddc4Srjsstatic void
175996c5ddc4Srjsbi_disasm_fma_fround_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
176096c5ddc4Srjs{
176196c5ddc4Srjs    static const char *round_table[] = {
176296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
176396c5ddc4Srjs    };
176496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 9, 2) << 0)];
176596c5ddc4Srjs    static const char *abs0_table[] = {
176696c5ddc4Srjs        "", ".abs"
176796c5ddc4Srjs    };
176896c5ddc4Srjs
176996c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
177096c5ddc4Srjs
177196c5ddc4Srjs    static const char *neg0_table[] = {
177296c5ddc4Srjs        "", ".neg"
177396c5ddc4Srjs    };
177496c5ddc4Srjs
177596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
177696c5ddc4Srjs
177796c5ddc4Srjs    static const char *swz0_table[] = {
177896c5ddc4Srjs        ".h00", ".h10", "", ".h11"
177996c5ddc4Srjs    };
178096c5ddc4Srjs
178196c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
178296c5ddc4Srjs
178396c5ddc4Srjs    fputs("*FROUND.v2f16", fp);
178496c5ddc4Srjs    fputs(round, fp);
178596c5ddc4Srjs    fputs(" ", fp);
178696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
178796c5ddc4Srjs    fputs(", ", fp);
178896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
178996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
179096c5ddc4Srjs    fputs(abs0, fp);
179196c5ddc4Srjs    fputs(neg0, fp);
179296c5ddc4Srjs    fputs(swz0, fp);
179396c5ddc4Srjs}
179496c5ddc4Srjs
179596c5ddc4Srjsstatic void
179696c5ddc4Srjsbi_disasm_fma_fround_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
179796c5ddc4Srjs{
179896c5ddc4Srjs    static const char *round_table[] = {
179996c5ddc4Srjs        ".rtna"
180096c5ddc4Srjs    };
180196c5ddc4Srjs    const char *round = round_table[0];
180296c5ddc4Srjs    static const char *abs0_table[] = {
180396c5ddc4Srjs        "", ".abs"
180496c5ddc4Srjs    };
180596c5ddc4Srjs
180696c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
180796c5ddc4Srjs
180896c5ddc4Srjs    static const char *neg0_table[] = {
180996c5ddc4Srjs        "", ".neg"
181096c5ddc4Srjs    };
181196c5ddc4Srjs
181296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
181396c5ddc4Srjs
181496c5ddc4Srjs    static const char *swz0_table[] = {
181596c5ddc4Srjs        ".h00", ".h10", "", ".h11"
181696c5ddc4Srjs    };
181796c5ddc4Srjs
181896c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
181996c5ddc4Srjs
182096c5ddc4Srjs    fputs("*FROUND.v2f16", fp);
182196c5ddc4Srjs    fputs(round, fp);
182296c5ddc4Srjs    fputs(" ", fp);
182396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
182496c5ddc4Srjs    fputs(", ", fp);
182596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
182696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
182796c5ddc4Srjs    fputs(abs0, fp);
182896c5ddc4Srjs    fputs(neg0, fp);
182996c5ddc4Srjs    fputs(swz0, fp);
183096c5ddc4Srjs}
183196c5ddc4Srjs
183296c5ddc4Srjsstatic void
183396c5ddc4Srjsbi_disasm_fma_frshift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
183496c5ddc4Srjs{
183596c5ddc4Srjs    static const char *bytes2_table[] = {
183696c5ddc4Srjs        "", ".bytes2"
183796c5ddc4Srjs    };
183896c5ddc4Srjs
183996c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
184096c5ddc4Srjs
184196c5ddc4Srjs    static const char *lane2_table[] = {
184296c5ddc4Srjs        "", ".b2"
184396c5ddc4Srjs    };
184496c5ddc4Srjs
184596c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
184696c5ddc4Srjs
184796c5ddc4Srjs    fputs("*FRSHIFT_DOUBLE.i32", fp);
184896c5ddc4Srjs    fputs(" ", fp);
184996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
185096c5ddc4Srjs    fputs(", ", fp);
185196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
185296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
185396c5ddc4Srjs    fputs(", ", fp);
185496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
185596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
185696c5ddc4Srjs    fputs(", ", fp);
185796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
185896c5ddc4Srjs    fputs(bytes2, fp);
185996c5ddc4Srjs    fputs(lane2, fp);
186096c5ddc4Srjs}
186196c5ddc4Srjs
186296c5ddc4Srjsstatic void
186396c5ddc4Srjsbi_disasm_fma_iaddc_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
186496c5ddc4Srjs{
186596c5ddc4Srjs    fputs("*IADDC.i32", fp);
186696c5ddc4Srjs    fputs(" ", fp);
186796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
186896c5ddc4Srjs    fputs(", ", fp);
186996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
187096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
187196c5ddc4Srjs    fputs(", ", fp);
187296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
187396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
187496c5ddc4Srjs    fputs(", ", fp);
187596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
187696c5ddc4Srjs}
187796c5ddc4Srjs
187896c5ddc4Srjsstatic void
187996c5ddc4Srjsbi_disasm_fma_idp_v4i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
188096c5ddc4Srjs{
188196c5ddc4Srjs    static const char *sign0_table[] = {
188296c5ddc4Srjs        ".zext", ".sext"
188396c5ddc4Srjs    };
188496c5ddc4Srjs
188596c5ddc4Srjs    const char *sign0 = sign0_table[_BITS(bits, 9, 1)];
188696c5ddc4Srjs
188796c5ddc4Srjs    static const char *sign1_table[] = {
188896c5ddc4Srjs        ".zext", ".sext"
188996c5ddc4Srjs    };
189096c5ddc4Srjs
189196c5ddc4Srjs    const char *sign1 = sign1_table[_BITS(bits, 10, 1)];
189296c5ddc4Srjs
189396c5ddc4Srjs    fputs("*IDP.v4i8", fp);
189496c5ddc4Srjs    fputs(" ", fp);
189596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
189696c5ddc4Srjs    fputs(", ", fp);
189796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
189896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
189996c5ddc4Srjs    fputs(sign0, fp);
190096c5ddc4Srjs    fputs(", ", fp);
190196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
190296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
190396c5ddc4Srjs    fputs(sign1, fp);
190496c5ddc4Srjs}
190596c5ddc4Srjs
190696c5ddc4Srjsstatic void
190796c5ddc4Srjsbi_disasm_fma_imul_i32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
190896c5ddc4Srjs{
190996c5ddc4Srjs    static const char *extend_table[] = {
191096c5ddc4Srjs        ""
191196c5ddc4Srjs    };
191296c5ddc4Srjs    const char *extend = extend_table[0];
191396c5ddc4Srjs    static const char *widen1_table[] = {
191496c5ddc4Srjs        ""
191596c5ddc4Srjs    };
191696c5ddc4Srjs    const char *widen1 = widen1_table[0];
191796c5ddc4Srjs    fputs("*IMUL.i32", fp);
191896c5ddc4Srjs    fputs(extend, fp);
191996c5ddc4Srjs    fputs(" ", fp);
192096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
192196c5ddc4Srjs    fputs(", ", fp);
192296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
192396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
192496c5ddc4Srjs    fputs(", ", fp);
192596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
192696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
192796c5ddc4Srjs    fputs(widen1, fp);
192896c5ddc4Srjs}
192996c5ddc4Srjs
193096c5ddc4Srjsstatic void
193196c5ddc4Srjsbi_disasm_fma_imul_i32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
193296c5ddc4Srjs{
193396c5ddc4Srjs    static const char *extend_table[] = {
193496c5ddc4Srjs        ".zext", ".zext", ".sext", ".sext"
193596c5ddc4Srjs    };
193696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
193796c5ddc4Srjs    static const char *widen1_table[] = {
193896c5ddc4Srjs        ".h0", ".h1", ".h0", ".h1"
193996c5ddc4Srjs    };
194096c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
194196c5ddc4Srjs    fputs("*IMUL.i32", fp);
194296c5ddc4Srjs    fputs(extend, fp);
194396c5ddc4Srjs    fputs(" ", fp);
194496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
194596c5ddc4Srjs    fputs(", ", fp);
194696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
194796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
194896c5ddc4Srjs    fputs(", ", fp);
194996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
195096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
195196c5ddc4Srjs    fputs(widen1, fp);
195296c5ddc4Srjs}
195396c5ddc4Srjs
195496c5ddc4Srjsstatic void
195596c5ddc4Srjsbi_disasm_fma_imul_i32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
195696c5ddc4Srjs{
195796c5ddc4Srjs    static const char *extend_table[] = {
195896c5ddc4Srjs        ".zext", ".zext", ".zext", ".zext", ".sext", ".sext", ".sext", ".sext"
195996c5ddc4Srjs    };
196096c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 11, 1) << 2)];
196196c5ddc4Srjs    static const char *widen1_table[] = {
196296c5ddc4Srjs        ".b0", ".b1", ".b2", ".b3", ".b0", ".b1", ".b2", ".b3"
196396c5ddc4Srjs    };
196496c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 11, 1) << 2)];
196596c5ddc4Srjs    fputs("*IMUL.i32", fp);
196696c5ddc4Srjs    fputs(extend, fp);
196796c5ddc4Srjs    fputs(" ", fp);
196896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
196996c5ddc4Srjs    fputs(", ", fp);
197096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
197196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
197296c5ddc4Srjs    fputs(", ", fp);
197396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
197496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
197596c5ddc4Srjs    fputs(widen1, fp);
197696c5ddc4Srjs}
197796c5ddc4Srjs
197896c5ddc4Srjsstatic void
197996c5ddc4Srjsbi_disasm_fma_imul_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
198096c5ddc4Srjs{
198196c5ddc4Srjs    static const char *swz0_table[] = {
198296c5ddc4Srjs        ".h00", ".h10", "", ".h11"
198396c5ddc4Srjs    };
198496c5ddc4Srjs
198596c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
198696c5ddc4Srjs
198796c5ddc4Srjs    static const char *swz1_table[] = {
198896c5ddc4Srjs        ".h00", ".h10", "", ".h11"
198996c5ddc4Srjs    };
199096c5ddc4Srjs
199196c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
199296c5ddc4Srjs
199396c5ddc4Srjs    fputs("*IMUL.v2i16", fp);
199496c5ddc4Srjs    fputs(" ", fp);
199596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
199696c5ddc4Srjs    fputs(", ", fp);
199796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
199896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
199996c5ddc4Srjs    fputs(swz0, fp);
200096c5ddc4Srjs    fputs(", ", fp);
200196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
200296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
200396c5ddc4Srjs    fputs(swz1, fp);
200496c5ddc4Srjs}
200596c5ddc4Srjs
200696c5ddc4Srjsstatic void
200796c5ddc4Srjsbi_disasm_fma_imul_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
200896c5ddc4Srjs{
200996c5ddc4Srjs    static const char *replicate0_table[] = {
201096c5ddc4Srjs        ""
201196c5ddc4Srjs    };
201296c5ddc4Srjs    const char *replicate0 = replicate0_table[0];
201396c5ddc4Srjs    static const char *replicate1_table[] = {
201496c5ddc4Srjs        ""
201596c5ddc4Srjs    };
201696c5ddc4Srjs    const char *replicate1 = replicate1_table[0];
201796c5ddc4Srjs    fputs("*IMUL.v4i8", fp);
201896c5ddc4Srjs    fputs(" ", fp);
201996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
202096c5ddc4Srjs    fputs(", ", fp);
202196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
202296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
202396c5ddc4Srjs    fputs(replicate0, fp);
202496c5ddc4Srjs    fputs(", ", fp);
202596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
202696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
202796c5ddc4Srjs    fputs(replicate1, fp);
202896c5ddc4Srjs}
202996c5ddc4Srjs
203096c5ddc4Srjsstatic void
203196c5ddc4Srjsbi_disasm_fma_imul_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
203296c5ddc4Srjs{
203396c5ddc4Srjs    static const char *replicate0_table[] = {
203496c5ddc4Srjs        "", "", "", ""
203596c5ddc4Srjs    };
203696c5ddc4Srjs    const char *replicate0 = replicate0_table[(_BITS(bits, 9, 2) << 0)];
203796c5ddc4Srjs    static const char *replicate1_table[] = {
203896c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
203996c5ddc4Srjs    };
204096c5ddc4Srjs    const char *replicate1 = replicate1_table[(_BITS(bits, 9, 2) << 0)];
204196c5ddc4Srjs    fputs("*IMUL.v4i8", fp);
204296c5ddc4Srjs    fputs(" ", fp);
204396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
204496c5ddc4Srjs    fputs(", ", fp);
204596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
204696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
204796c5ddc4Srjs    fputs(replicate0, fp);
204896c5ddc4Srjs    fputs(", ", fp);
204996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
205096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
205196c5ddc4Srjs    fputs(replicate1, fp);
205296c5ddc4Srjs}
205396c5ddc4Srjs
205496c5ddc4Srjsstatic void
205596c5ddc4Srjsbi_disasm_fma_imuld(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
205696c5ddc4Srjs{
205796c5ddc4Srjs    static const char *threads_table[] = {
205896c5ddc4Srjs        ".even", ""
205996c5ddc4Srjs    };
206096c5ddc4Srjs
206196c5ddc4Srjs    const char *threads = threads_table[_BITS(bits, 6, 1)];
206296c5ddc4Srjs
206396c5ddc4Srjs    fputs("*IMULD", fp);
206496c5ddc4Srjs    fputs(threads, fp);
206596c5ddc4Srjs    fputs(" ", fp);
206696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
206796c5ddc4Srjs    fputs(", ", fp);
206896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
206996c5ddc4Srjs    if (!(0x33 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
207096c5ddc4Srjs    fputs(", ", fp);
207196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
207296c5ddc4Srjs    if (!(0x33 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
207396c5ddc4Srjs}
207496c5ddc4Srjs
207596c5ddc4Srjsstatic void
207696c5ddc4Srjsbi_disasm_fma_isubb_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
207796c5ddc4Srjs{
207896c5ddc4Srjs    fputs("*ISUBB.i32", fp);
207996c5ddc4Srjs    fputs(" ", fp);
208096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
208196c5ddc4Srjs    fputs(", ", fp);
208296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
208396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
208496c5ddc4Srjs    fputs(", ", fp);
208596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
208696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
208796c5ddc4Srjs    fputs(", ", fp);
208896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
208996c5ddc4Srjs}
209096c5ddc4Srjs
209196c5ddc4Srjsstatic void
209296c5ddc4Srjsbi_disasm_fma_jump_ex(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
209396c5ddc4Srjs{
209496c5ddc4Srjs    static const char *test_mode_table[] = {
209596c5ddc4Srjs        "", ".nz"
209696c5ddc4Srjs    };
209796c5ddc4Srjs
209896c5ddc4Srjs    const char *test_mode = test_mode_table[_BITS(bits, 9, 1)];
209996c5ddc4Srjs
210096c5ddc4Srjs    static const char *stack_mode_table[] = {
210196c5ddc4Srjs        ".return", ".call", "", ".replace"
210296c5ddc4Srjs    };
210396c5ddc4Srjs
210496c5ddc4Srjs    const char *stack_mode = stack_mode_table[_BITS(bits, 10, 2)];
210596c5ddc4Srjs
210696c5ddc4Srjs    fputs("*JUMP_EX", fp);
210796c5ddc4Srjs    fputs(test_mode, fp);
210896c5ddc4Srjs    fputs(stack_mode, fp);
210996c5ddc4Srjs    fputs(" ", fp);
211096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
211196c5ddc4Srjs    fputs(", ", fp);
211296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
211396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
211496c5ddc4Srjs    fputs(", ", fp);
211596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
211696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
211796c5ddc4Srjs    fputs(", ", fp);
211896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
211996c5ddc4Srjs}
212096c5ddc4Srjs
212196c5ddc4Srjsstatic void
212296c5ddc4Srjsbi_disasm_fma_lrot_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
212396c5ddc4Srjs{
212496c5ddc4Srjs    static const char *bytes2_table[] = {
212596c5ddc4Srjs        "", ".bytes2"
212696c5ddc4Srjs    };
212796c5ddc4Srjs
212896c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
212996c5ddc4Srjs
213096c5ddc4Srjs    static const char *lane2_table[] = {
213196c5ddc4Srjs        "", ".b2"
213296c5ddc4Srjs    };
213396c5ddc4Srjs
213496c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
213596c5ddc4Srjs
213696c5ddc4Srjs    static const char *result_word_table[] = {
213796c5ddc4Srjs        "", ".w1"
213896c5ddc4Srjs    };
213996c5ddc4Srjs
214096c5ddc4Srjs    const char *result_word = result_word_table[_BITS(bits, 11, 1)];
214196c5ddc4Srjs
214296c5ddc4Srjs    fputs("*LROT_DOUBLE.i32", fp);
214396c5ddc4Srjs    fputs(result_word, fp);
214496c5ddc4Srjs    fputs(" ", fp);
214596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
214696c5ddc4Srjs    fputs(", ", fp);
214796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
214896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
214996c5ddc4Srjs    fputs(", ", fp);
215096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
215196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
215296c5ddc4Srjs    fputs(", ", fp);
215396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
215496c5ddc4Srjs    fputs(bytes2, fp);
215596c5ddc4Srjs    fputs(lane2, fp);
215696c5ddc4Srjs}
215796c5ddc4Srjs
215896c5ddc4Srjsstatic void
215996c5ddc4Srjsbi_disasm_fma_lshift_and_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
216096c5ddc4Srjs{
216196c5ddc4Srjs    static const char *lane2_table[] = {
216296c5ddc4Srjs        "", ".b1", ".b2", ".b3"
216396c5ddc4Srjs    };
216496c5ddc4Srjs
216596c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
216696c5ddc4Srjs
216796c5ddc4Srjs    static const char *not1_table[] = {
216896c5ddc4Srjs        "", ".not"
216996c5ddc4Srjs    };
217096c5ddc4Srjs
217196c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
217296c5ddc4Srjs
217396c5ddc4Srjs    static const char *not_result_table[] = {
217496c5ddc4Srjs        ".not", ""
217596c5ddc4Srjs    };
217696c5ddc4Srjs
217796c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
217896c5ddc4Srjs
217996c5ddc4Srjs    fputs("*LSHIFT_AND.i32", fp);
218096c5ddc4Srjs    fputs(not_result, fp);
218196c5ddc4Srjs    fputs(" ", fp);
218296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
218396c5ddc4Srjs    fputs(", ", fp);
218496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
218596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
218696c5ddc4Srjs    fputs(", ", fp);
218796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
218896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
218996c5ddc4Srjs    fputs(not1, fp);
219096c5ddc4Srjs    fputs(", ", fp);
219196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
219296c5ddc4Srjs    fputs(lane2, fp);
219396c5ddc4Srjs}
219496c5ddc4Srjs
219596c5ddc4Srjsstatic void
219696c5ddc4Srjsbi_disasm_fma_lshift_and_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
219796c5ddc4Srjs{
219896c5ddc4Srjs    static const char *lanes2_table[] = {
219996c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
220096c5ddc4Srjs    };
220196c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
220296c5ddc4Srjs    static const char *not1_table[] = {
220396c5ddc4Srjs        "", ".not"
220496c5ddc4Srjs    };
220596c5ddc4Srjs
220696c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
220796c5ddc4Srjs
220896c5ddc4Srjs    static const char *not_result_table[] = {
220996c5ddc4Srjs        ".not", ""
221096c5ddc4Srjs    };
221196c5ddc4Srjs
221296c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
221396c5ddc4Srjs
221496c5ddc4Srjs    fputs("*LSHIFT_AND.v2i16", fp);
221596c5ddc4Srjs    fputs(not_result, fp);
221696c5ddc4Srjs    fputs(" ", fp);
221796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
221896c5ddc4Srjs    fputs(", ", fp);
221996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
222096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
222196c5ddc4Srjs    fputs(", ", fp);
222296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
222396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
222496c5ddc4Srjs    fputs(not1, fp);
222596c5ddc4Srjs    fputs(", ", fp);
222696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
222796c5ddc4Srjs    fputs(lanes2, fp);
222896c5ddc4Srjs}
222996c5ddc4Srjs
223096c5ddc4Srjsstatic void
223196c5ddc4Srjsbi_disasm_fma_lshift_and_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
223296c5ddc4Srjs{
223396c5ddc4Srjs    static const char *lanes2_table[] = {
223496c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
223596c5ddc4Srjs    };
223696c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
223796c5ddc4Srjs    static const char *not1_table[] = {
223896c5ddc4Srjs        "", ".not"
223996c5ddc4Srjs    };
224096c5ddc4Srjs
224196c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
224296c5ddc4Srjs
224396c5ddc4Srjs    static const char *not_result_table[] = {
224496c5ddc4Srjs        ".not", ""
224596c5ddc4Srjs    };
224696c5ddc4Srjs
224796c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
224896c5ddc4Srjs
224996c5ddc4Srjs    fputs("*LSHIFT_AND.v2i16", fp);
225096c5ddc4Srjs    fputs(not_result, fp);
225196c5ddc4Srjs    fputs(" ", fp);
225296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
225396c5ddc4Srjs    fputs(", ", fp);
225496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
225596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
225696c5ddc4Srjs    fputs(", ", fp);
225796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
225896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
225996c5ddc4Srjs    fputs(not1, fp);
226096c5ddc4Srjs    fputs(", ", fp);
226196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
226296c5ddc4Srjs    fputs(lanes2, fp);
226396c5ddc4Srjs}
226496c5ddc4Srjs
226596c5ddc4Srjsstatic void
226696c5ddc4Srjsbi_disasm_fma_lshift_and_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
226796c5ddc4Srjs{
226896c5ddc4Srjs    static const char *lanes2_table[] = {
226996c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
227096c5ddc4Srjs    };
227196c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
227296c5ddc4Srjs    static const char *not1_table[] = {
227396c5ddc4Srjs        "", ".not"
227496c5ddc4Srjs    };
227596c5ddc4Srjs
227696c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
227796c5ddc4Srjs
227896c5ddc4Srjs    static const char *not_result_table[] = {
227996c5ddc4Srjs        ".not", ""
228096c5ddc4Srjs    };
228196c5ddc4Srjs
228296c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
228396c5ddc4Srjs
228496c5ddc4Srjs    fputs("*LSHIFT_AND.v4i8", fp);
228596c5ddc4Srjs    fputs(not_result, fp);
228696c5ddc4Srjs    fputs(" ", fp);
228796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
228896c5ddc4Srjs    fputs(", ", fp);
228996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
229096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
229196c5ddc4Srjs    fputs(", ", fp);
229296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
229396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
229496c5ddc4Srjs    fputs(not1, fp);
229596c5ddc4Srjs    fputs(", ", fp);
229696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
229796c5ddc4Srjs    fputs(lanes2, fp);
229896c5ddc4Srjs}
229996c5ddc4Srjs
230096c5ddc4Srjsstatic void
230196c5ddc4Srjsbi_disasm_fma_lshift_and_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
230296c5ddc4Srjs{
230396c5ddc4Srjs    static const char *lanes2_table[] = {
230496c5ddc4Srjs        ""
230596c5ddc4Srjs    };
230696c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
230796c5ddc4Srjs    static const char *not1_table[] = {
230896c5ddc4Srjs        "", ".not"
230996c5ddc4Srjs    };
231096c5ddc4Srjs
231196c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
231296c5ddc4Srjs
231396c5ddc4Srjs    static const char *not_result_table[] = {
231496c5ddc4Srjs        ".not", ""
231596c5ddc4Srjs    };
231696c5ddc4Srjs
231796c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
231896c5ddc4Srjs
231996c5ddc4Srjs    fputs("*LSHIFT_AND.v4i8", fp);
232096c5ddc4Srjs    fputs(not_result, fp);
232196c5ddc4Srjs    fputs(" ", fp);
232296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
232396c5ddc4Srjs    fputs(", ", fp);
232496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
232596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
232696c5ddc4Srjs    fputs(", ", fp);
232796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
232896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
232996c5ddc4Srjs    fputs(not1, fp);
233096c5ddc4Srjs    fputs(", ", fp);
233196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
233296c5ddc4Srjs    fputs(lanes2, fp);
233396c5ddc4Srjs}
233496c5ddc4Srjs
233596c5ddc4Srjsstatic void
233696c5ddc4Srjsbi_disasm_fma_lshift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
233796c5ddc4Srjs{
233896c5ddc4Srjs    static const char *bytes2_table[] = {
233996c5ddc4Srjs        "", ".bytes2"
234096c5ddc4Srjs    };
234196c5ddc4Srjs
234296c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
234396c5ddc4Srjs
234496c5ddc4Srjs    static const char *lane2_table[] = {
234596c5ddc4Srjs        "", ".b2"
234696c5ddc4Srjs    };
234796c5ddc4Srjs
234896c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
234996c5ddc4Srjs
235096c5ddc4Srjs    static const char *result_word_table[] = {
235196c5ddc4Srjs        "", ".w1"
235296c5ddc4Srjs    };
235396c5ddc4Srjs
235496c5ddc4Srjs    const char *result_word = result_word_table[_BITS(bits, 11, 1)];
235596c5ddc4Srjs
235696c5ddc4Srjs    fputs("*LSHIFT_DOUBLE.i32", fp);
235796c5ddc4Srjs    fputs(result_word, fp);
235896c5ddc4Srjs    fputs(" ", fp);
235996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
236096c5ddc4Srjs    fputs(", ", fp);
236196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
236296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
236396c5ddc4Srjs    fputs(", ", fp);
236496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
236596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
236696c5ddc4Srjs    fputs(", ", fp);
236796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
236896c5ddc4Srjs    fputs(bytes2, fp);
236996c5ddc4Srjs    fputs(lane2, fp);
237096c5ddc4Srjs}
237196c5ddc4Srjs
237296c5ddc4Srjsstatic void
237396c5ddc4Srjsbi_disasm_fma_lshift_or_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
237496c5ddc4Srjs{
237596c5ddc4Srjs    static const char *lane2_table[] = {
237696c5ddc4Srjs        "", ".b1", ".b2", ".b3"
237796c5ddc4Srjs    };
237896c5ddc4Srjs
237996c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
238096c5ddc4Srjs
238196c5ddc4Srjs    static const char *not1_table[] = {
238296c5ddc4Srjs        ".not", ""
238396c5ddc4Srjs    };
238496c5ddc4Srjs
238596c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
238696c5ddc4Srjs
238796c5ddc4Srjs    static const char *not_result_table[] = {
238896c5ddc4Srjs        "", ".not"
238996c5ddc4Srjs    };
239096c5ddc4Srjs
239196c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
239296c5ddc4Srjs
239396c5ddc4Srjs    fputs("*LSHIFT_OR.i32", fp);
239496c5ddc4Srjs    fputs(not_result, fp);
239596c5ddc4Srjs    fputs(" ", fp);
239696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
239796c5ddc4Srjs    fputs(", ", fp);
239896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
239996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
240096c5ddc4Srjs    fputs(", ", fp);
240196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
240296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
240396c5ddc4Srjs    fputs(not1, fp);
240496c5ddc4Srjs    fputs(", ", fp);
240596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
240696c5ddc4Srjs    fputs(lane2, fp);
240796c5ddc4Srjs}
240896c5ddc4Srjs
240996c5ddc4Srjsstatic void
241096c5ddc4Srjsbi_disasm_fma_lshift_or_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
241196c5ddc4Srjs{
241296c5ddc4Srjs    static const char *lanes2_table[] = {
241396c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
241496c5ddc4Srjs    };
241596c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
241696c5ddc4Srjs    static const char *not1_table[] = {
241796c5ddc4Srjs        ".not", ""
241896c5ddc4Srjs    };
241996c5ddc4Srjs
242096c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
242196c5ddc4Srjs
242296c5ddc4Srjs    static const char *not_result_table[] = {
242396c5ddc4Srjs        "", ".not"
242496c5ddc4Srjs    };
242596c5ddc4Srjs
242696c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
242796c5ddc4Srjs
242896c5ddc4Srjs    fputs("*LSHIFT_OR.v2i16", fp);
242996c5ddc4Srjs    fputs(not_result, fp);
243096c5ddc4Srjs    fputs(" ", fp);
243196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
243296c5ddc4Srjs    fputs(", ", fp);
243396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
243496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
243596c5ddc4Srjs    fputs(", ", fp);
243696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
243796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
243896c5ddc4Srjs    fputs(not1, fp);
243996c5ddc4Srjs    fputs(", ", fp);
244096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
244196c5ddc4Srjs    fputs(lanes2, fp);
244296c5ddc4Srjs}
244396c5ddc4Srjs
244496c5ddc4Srjsstatic void
244596c5ddc4Srjsbi_disasm_fma_lshift_or_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
244696c5ddc4Srjs{
244796c5ddc4Srjs    static const char *lanes2_table[] = {
244896c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
244996c5ddc4Srjs    };
245096c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
245196c5ddc4Srjs    static const char *not1_table[] = {
245296c5ddc4Srjs        ".not", ""
245396c5ddc4Srjs    };
245496c5ddc4Srjs
245596c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
245696c5ddc4Srjs
245796c5ddc4Srjs    static const char *not_result_table[] = {
245896c5ddc4Srjs        "", ".not"
245996c5ddc4Srjs    };
246096c5ddc4Srjs
246196c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
246296c5ddc4Srjs
246396c5ddc4Srjs    fputs("*LSHIFT_OR.v2i16", fp);
246496c5ddc4Srjs    fputs(not_result, fp);
246596c5ddc4Srjs    fputs(" ", fp);
246696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
246796c5ddc4Srjs    fputs(", ", fp);
246896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
246996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
247096c5ddc4Srjs    fputs(", ", fp);
247196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
247296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
247396c5ddc4Srjs    fputs(not1, fp);
247496c5ddc4Srjs    fputs(", ", fp);
247596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
247696c5ddc4Srjs    fputs(lanes2, fp);
247796c5ddc4Srjs}
247896c5ddc4Srjs
247996c5ddc4Srjsstatic void
248096c5ddc4Srjsbi_disasm_fma_lshift_or_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
248196c5ddc4Srjs{
248296c5ddc4Srjs    static const char *lanes2_table[] = {
248396c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
248496c5ddc4Srjs    };
248596c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
248696c5ddc4Srjs    static const char *not1_table[] = {
248796c5ddc4Srjs        ".not", ""
248896c5ddc4Srjs    };
248996c5ddc4Srjs
249096c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
249196c5ddc4Srjs
249296c5ddc4Srjs    static const char *not_result_table[] = {
249396c5ddc4Srjs        "", ".not"
249496c5ddc4Srjs    };
249596c5ddc4Srjs
249696c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
249796c5ddc4Srjs
249896c5ddc4Srjs    fputs("*LSHIFT_OR.v4i8", fp);
249996c5ddc4Srjs    fputs(not_result, fp);
250096c5ddc4Srjs    fputs(" ", fp);
250196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
250296c5ddc4Srjs    fputs(", ", fp);
250396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
250496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
250596c5ddc4Srjs    fputs(", ", fp);
250696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
250796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
250896c5ddc4Srjs    fputs(not1, fp);
250996c5ddc4Srjs    fputs(", ", fp);
251096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
251196c5ddc4Srjs    fputs(lanes2, fp);
251296c5ddc4Srjs}
251396c5ddc4Srjs
251496c5ddc4Srjsstatic void
251596c5ddc4Srjsbi_disasm_fma_lshift_or_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
251696c5ddc4Srjs{
251796c5ddc4Srjs    static const char *lanes2_table[] = {
251896c5ddc4Srjs        ""
251996c5ddc4Srjs    };
252096c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
252196c5ddc4Srjs    static const char *not1_table[] = {
252296c5ddc4Srjs        ".not", ""
252396c5ddc4Srjs    };
252496c5ddc4Srjs
252596c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
252696c5ddc4Srjs
252796c5ddc4Srjs    static const char *not_result_table[] = {
252896c5ddc4Srjs        "", ".not"
252996c5ddc4Srjs    };
253096c5ddc4Srjs
253196c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
253296c5ddc4Srjs
253396c5ddc4Srjs    fputs("*LSHIFT_OR.v4i8", fp);
253496c5ddc4Srjs    fputs(not_result, fp);
253596c5ddc4Srjs    fputs(" ", fp);
253696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
253796c5ddc4Srjs    fputs(", ", fp);
253896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
253996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
254096c5ddc4Srjs    fputs(", ", fp);
254196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
254296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
254396c5ddc4Srjs    fputs(not1, fp);
254496c5ddc4Srjs    fputs(", ", fp);
254596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
254696c5ddc4Srjs    fputs(lanes2, fp);
254796c5ddc4Srjs}
254896c5ddc4Srjs
254996c5ddc4Srjsstatic void
255096c5ddc4Srjsbi_disasm_fma_lshift_xor_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
255196c5ddc4Srjs{
255296c5ddc4Srjs    static const char *lane2_table[] = {
255396c5ddc4Srjs        "", ".b1", ".b2", ".b3"
255496c5ddc4Srjs    };
255596c5ddc4Srjs
255696c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
255796c5ddc4Srjs
255896c5ddc4Srjs    static const char *not_result_table[] = {
255996c5ddc4Srjs        "", ".not"
256096c5ddc4Srjs    };
256196c5ddc4Srjs
256296c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
256396c5ddc4Srjs
256496c5ddc4Srjs    fputs("*LSHIFT_XOR.i32", fp);
256596c5ddc4Srjs    fputs(not_result, fp);
256696c5ddc4Srjs    fputs(" ", fp);
256796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
256896c5ddc4Srjs    fputs(", ", fp);
256996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
257096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
257196c5ddc4Srjs    fputs(", ", fp);
257296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
257396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
257496c5ddc4Srjs    fputs(", ", fp);
257596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
257696c5ddc4Srjs    fputs(lane2, fp);
257796c5ddc4Srjs}
257896c5ddc4Srjs
257996c5ddc4Srjsstatic void
258096c5ddc4Srjsbi_disasm_fma_lshift_xor_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
258196c5ddc4Srjs{
258296c5ddc4Srjs    static const char *lanes2_table[] = {
258396c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
258496c5ddc4Srjs    };
258596c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
258696c5ddc4Srjs    static const char *not_result_table[] = {
258796c5ddc4Srjs        "", ".not"
258896c5ddc4Srjs    };
258996c5ddc4Srjs
259096c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
259196c5ddc4Srjs
259296c5ddc4Srjs    fputs("*LSHIFT_XOR.v2i16", fp);
259396c5ddc4Srjs    fputs(not_result, fp);
259496c5ddc4Srjs    fputs(" ", fp);
259596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
259696c5ddc4Srjs    fputs(", ", fp);
259796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
259896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
259996c5ddc4Srjs    fputs(", ", fp);
260096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
260196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
260296c5ddc4Srjs    fputs(", ", fp);
260396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
260496c5ddc4Srjs    fputs(lanes2, fp);
260596c5ddc4Srjs}
260696c5ddc4Srjs
260796c5ddc4Srjsstatic void
260896c5ddc4Srjsbi_disasm_fma_lshift_xor_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
260996c5ddc4Srjs{
261096c5ddc4Srjs    static const char *lanes2_table[] = {
261196c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
261296c5ddc4Srjs    };
261396c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
261496c5ddc4Srjs    static const char *not_result_table[] = {
261596c5ddc4Srjs        "", ".not"
261696c5ddc4Srjs    };
261796c5ddc4Srjs
261896c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
261996c5ddc4Srjs
262096c5ddc4Srjs    fputs("*LSHIFT_XOR.v2i16", fp);
262196c5ddc4Srjs    fputs(not_result, fp);
262296c5ddc4Srjs    fputs(" ", fp);
262396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
262496c5ddc4Srjs    fputs(", ", fp);
262596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
262696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
262796c5ddc4Srjs    fputs(", ", fp);
262896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
262996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
263096c5ddc4Srjs    fputs(", ", fp);
263196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
263296c5ddc4Srjs    fputs(lanes2, fp);
263396c5ddc4Srjs}
263496c5ddc4Srjs
263596c5ddc4Srjsstatic void
263696c5ddc4Srjsbi_disasm_fma_lshift_xor_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
263796c5ddc4Srjs{
263896c5ddc4Srjs    static const char *lanes2_table[] = {
263996c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
264096c5ddc4Srjs    };
264196c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
264296c5ddc4Srjs    static const char *not_result_table[] = {
264396c5ddc4Srjs        "", ".not"
264496c5ddc4Srjs    };
264596c5ddc4Srjs
264696c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
264796c5ddc4Srjs
264896c5ddc4Srjs    fputs("*LSHIFT_XOR.v4i8", fp);
264996c5ddc4Srjs    fputs(not_result, fp);
265096c5ddc4Srjs    fputs(" ", fp);
265196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
265296c5ddc4Srjs    fputs(", ", fp);
265396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
265496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
265596c5ddc4Srjs    fputs(", ", fp);
265696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
265796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
265896c5ddc4Srjs    fputs(", ", fp);
265996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
266096c5ddc4Srjs    fputs(lanes2, fp);
266196c5ddc4Srjs}
266296c5ddc4Srjs
266396c5ddc4Srjsstatic void
266496c5ddc4Srjsbi_disasm_fma_lshift_xor_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
266596c5ddc4Srjs{
266696c5ddc4Srjs    static const char *lanes2_table[] = {
266796c5ddc4Srjs        ""
266896c5ddc4Srjs    };
266996c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
267096c5ddc4Srjs    static const char *not_result_table[] = {
267196c5ddc4Srjs        "", ".not"
267296c5ddc4Srjs    };
267396c5ddc4Srjs
267496c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
267596c5ddc4Srjs
267696c5ddc4Srjs    fputs("*LSHIFT_XOR.v4i8", fp);
267796c5ddc4Srjs    fputs(not_result, fp);
267896c5ddc4Srjs    fputs(" ", fp);
267996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
268096c5ddc4Srjs    fputs(", ", fp);
268196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
268296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
268396c5ddc4Srjs    fputs(", ", fp);
268496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
268596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
268696c5ddc4Srjs    fputs(", ", fp);
268796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
268896c5ddc4Srjs    fputs(lanes2, fp);
268996c5ddc4Srjs}
269096c5ddc4Srjs
269196c5ddc4Srjsstatic void
269296c5ddc4Srjsbi_disasm_fma_mkvec_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
269396c5ddc4Srjs{
269496c5ddc4Srjs    static const char *lane0_table[] = {
269596c5ddc4Srjs        "", ".h1"
269696c5ddc4Srjs    };
269796c5ddc4Srjs
269896c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 6, 1)];
269996c5ddc4Srjs
270096c5ddc4Srjs    static const char *lane1_table[] = {
270196c5ddc4Srjs        "", ".h1"
270296c5ddc4Srjs    };
270396c5ddc4Srjs
270496c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 7, 1)];
270596c5ddc4Srjs
270696c5ddc4Srjs    fputs("*MKVEC.v2i16", fp);
270796c5ddc4Srjs    fputs(" ", fp);
270896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
270996c5ddc4Srjs    fputs(", ", fp);
271096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
271196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
271296c5ddc4Srjs    fputs(lane0, fp);
271396c5ddc4Srjs    fputs(", ", fp);
271496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
271596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
271696c5ddc4Srjs    fputs(lane1, fp);
271796c5ddc4Srjs}
271896c5ddc4Srjs
271996c5ddc4Srjsstatic void
272096c5ddc4Srjsbi_disasm_fma_mkvec_v4i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
272196c5ddc4Srjs{
272296c5ddc4Srjs    static const char *lane0_table[] = {
272396c5ddc4Srjs        "", ".b2"
272496c5ddc4Srjs    };
272596c5ddc4Srjs
272696c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 12, 1)];
272796c5ddc4Srjs
272896c5ddc4Srjs    static const char *lane1_table[] = {
272996c5ddc4Srjs        "", ".b2"
273096c5ddc4Srjs    };
273196c5ddc4Srjs
273296c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 13, 1)];
273396c5ddc4Srjs
273496c5ddc4Srjs    static const char *lane2_table[] = {
273596c5ddc4Srjs        "", ".b2"
273696c5ddc4Srjs    };
273796c5ddc4Srjs
273896c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 14, 1)];
273996c5ddc4Srjs
274096c5ddc4Srjs    static const char *lane3_table[] = {
274196c5ddc4Srjs        "", ".b2"
274296c5ddc4Srjs    };
274396c5ddc4Srjs
274496c5ddc4Srjs    const char *lane3 = lane3_table[_BITS(bits, 15, 1)];
274596c5ddc4Srjs
274696c5ddc4Srjs    fputs("*MKVEC.v4i8", fp);
274796c5ddc4Srjs    fputs(" ", fp);
274896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
274996c5ddc4Srjs    fputs(", ", fp);
275096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
275196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
275296c5ddc4Srjs    fputs(lane0, fp);
275396c5ddc4Srjs    fputs(", ", fp);
275496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
275596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
275696c5ddc4Srjs    fputs(lane1, fp);
275796c5ddc4Srjs    fputs(", ", fp);
275896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
275996c5ddc4Srjs    fputs(lane2, fp);
276096c5ddc4Srjs    fputs(", ", fp);
276196c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
276296c5ddc4Srjs    fputs(lane3, fp);
276396c5ddc4Srjs}
276496c5ddc4Srjs
276596c5ddc4Srjsstatic void
276696c5ddc4Srjsbi_disasm_fma_mov_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
276796c5ddc4Srjs{
276896c5ddc4Srjs    fputs("*MOV.i32", fp);
276996c5ddc4Srjs    fputs(" ", fp);
277096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
277196c5ddc4Srjs    fputs(", ", fp);
277296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
277396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
277496c5ddc4Srjs}
277596c5ddc4Srjs
277696c5ddc4Srjsstatic void
277796c5ddc4Srjsbi_disasm_fma_nop(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
277896c5ddc4Srjs{
277996c5ddc4Srjs    fputs("*NOP", fp);
278096c5ddc4Srjs    fputs(" ", fp);
278196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
278296c5ddc4Srjs}
278396c5ddc4Srjs
278496c5ddc4Srjsstatic void
278596c5ddc4Srjsbi_disasm_fma_popcount_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
278696c5ddc4Srjs{
278796c5ddc4Srjs    fputs("*POPCOUNT.i32", fp);
278896c5ddc4Srjs    fputs(" ", fp);
278996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
279096c5ddc4Srjs    fputs(", ", fp);
279196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
279296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
279396c5ddc4Srjs}
279496c5ddc4Srjs
279596c5ddc4Srjsstatic void
279696c5ddc4Srjsbi_disasm_fma_quiet_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
279796c5ddc4Srjs{
279896c5ddc4Srjs    fputs("*QUIET.f32", fp);
279996c5ddc4Srjs    fputs(" ", fp);
280096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
280196c5ddc4Srjs    fputs(", ", fp);
280296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
280396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
280496c5ddc4Srjs}
280596c5ddc4Srjs
280696c5ddc4Srjsstatic void
280796c5ddc4Srjsbi_disasm_fma_quiet_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
280896c5ddc4Srjs{
280996c5ddc4Srjs    static const char *swz0_table[] = {
281096c5ddc4Srjs        ".h00", ".h10", "", ".h11"
281196c5ddc4Srjs    };
281296c5ddc4Srjs
281396c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
281496c5ddc4Srjs
281596c5ddc4Srjs    fputs("*QUIET.v2f16", fp);
281696c5ddc4Srjs    fputs(" ", fp);
281796c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
281896c5ddc4Srjs    fputs(", ", fp);
281996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
282096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
282196c5ddc4Srjs    fputs(swz0, fp);
282296c5ddc4Srjs}
282396c5ddc4Srjs
282496c5ddc4Srjsstatic void
282596c5ddc4Srjsbi_disasm_fma_rrot_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
282696c5ddc4Srjs{
282796c5ddc4Srjs    static const char *bytes2_table[] = {
282896c5ddc4Srjs        "", ".bytes2"
282996c5ddc4Srjs    };
283096c5ddc4Srjs
283196c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
283296c5ddc4Srjs
283396c5ddc4Srjs    static const char *lane2_table[] = {
283496c5ddc4Srjs        "", ".b2"
283596c5ddc4Srjs    };
283696c5ddc4Srjs
283796c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
283896c5ddc4Srjs
283996c5ddc4Srjs    static const char *result_word_table[] = {
284096c5ddc4Srjs        "", ".w1"
284196c5ddc4Srjs    };
284296c5ddc4Srjs
284396c5ddc4Srjs    const char *result_word = result_word_table[_BITS(bits, 11, 1)];
284496c5ddc4Srjs
284596c5ddc4Srjs    fputs("*RROT_DOUBLE.i32", fp);
284696c5ddc4Srjs    fputs(result_word, fp);
284796c5ddc4Srjs    fputs(" ", fp);
284896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
284996c5ddc4Srjs    fputs(", ", fp);
285096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
285196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
285296c5ddc4Srjs    fputs(", ", fp);
285396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
285496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
285596c5ddc4Srjs    fputs(", ", fp);
285696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
285796c5ddc4Srjs    fputs(bytes2, fp);
285896c5ddc4Srjs    fputs(lane2, fp);
285996c5ddc4Srjs}
286096c5ddc4Srjs
286196c5ddc4Srjsstatic void
286296c5ddc4Srjsbi_disasm_fma_rshift_and_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
286396c5ddc4Srjs{
286496c5ddc4Srjs    static const char *lane2_table[] = {
286596c5ddc4Srjs        "", ".b1", ".b2", ".b3"
286696c5ddc4Srjs    };
286796c5ddc4Srjs
286896c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
286996c5ddc4Srjs
287096c5ddc4Srjs    static const char *not1_table[] = {
287196c5ddc4Srjs        "", ".not"
287296c5ddc4Srjs    };
287396c5ddc4Srjs
287496c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
287596c5ddc4Srjs
287696c5ddc4Srjs    static const char *not_result_table[] = {
287796c5ddc4Srjs        ".not", ""
287896c5ddc4Srjs    };
287996c5ddc4Srjs
288096c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
288196c5ddc4Srjs
288296c5ddc4Srjs    fputs("*RSHIFT_AND.i32", fp);
288396c5ddc4Srjs    fputs(not_result, fp);
288496c5ddc4Srjs    fputs(" ", fp);
288596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
288696c5ddc4Srjs    fputs(", ", fp);
288796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
288896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
288996c5ddc4Srjs    fputs(", ", fp);
289096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
289196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
289296c5ddc4Srjs    fputs(not1, fp);
289396c5ddc4Srjs    fputs(", ", fp);
289496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
289596c5ddc4Srjs    fputs(lane2, fp);
289696c5ddc4Srjs}
289796c5ddc4Srjs
289896c5ddc4Srjsstatic void
289996c5ddc4Srjsbi_disasm_fma_rshift_and_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
290096c5ddc4Srjs{
290196c5ddc4Srjs    static const char *lanes2_table[] = {
290296c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
290396c5ddc4Srjs    };
290496c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
290596c5ddc4Srjs    static const char *not1_table[] = {
290696c5ddc4Srjs        "", ".not"
290796c5ddc4Srjs    };
290896c5ddc4Srjs
290996c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
291096c5ddc4Srjs
291196c5ddc4Srjs    static const char *not_result_table[] = {
291296c5ddc4Srjs        ".not", ""
291396c5ddc4Srjs    };
291496c5ddc4Srjs
291596c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
291696c5ddc4Srjs
291796c5ddc4Srjs    fputs("*RSHIFT_AND.v2i16", fp);
291896c5ddc4Srjs    fputs(not_result, fp);
291996c5ddc4Srjs    fputs(" ", fp);
292096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
292196c5ddc4Srjs    fputs(", ", fp);
292296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
292396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
292496c5ddc4Srjs    fputs(", ", fp);
292596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
292696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
292796c5ddc4Srjs    fputs(not1, fp);
292896c5ddc4Srjs    fputs(", ", fp);
292996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
293096c5ddc4Srjs    fputs(lanes2, fp);
293196c5ddc4Srjs}
293296c5ddc4Srjs
293396c5ddc4Srjsstatic void
293496c5ddc4Srjsbi_disasm_fma_rshift_and_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
293596c5ddc4Srjs{
293696c5ddc4Srjs    static const char *lanes2_table[] = {
293796c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
293896c5ddc4Srjs    };
293996c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
294096c5ddc4Srjs    static const char *not1_table[] = {
294196c5ddc4Srjs        "", ".not"
294296c5ddc4Srjs    };
294396c5ddc4Srjs
294496c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
294596c5ddc4Srjs
294696c5ddc4Srjs    static const char *not_result_table[] = {
294796c5ddc4Srjs        ".not", ""
294896c5ddc4Srjs    };
294996c5ddc4Srjs
295096c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
295196c5ddc4Srjs
295296c5ddc4Srjs    fputs("*RSHIFT_AND.v2i16", fp);
295396c5ddc4Srjs    fputs(not_result, fp);
295496c5ddc4Srjs    fputs(" ", fp);
295596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
295696c5ddc4Srjs    fputs(", ", fp);
295796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
295896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
295996c5ddc4Srjs    fputs(", ", fp);
296096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
296196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
296296c5ddc4Srjs    fputs(not1, fp);
296396c5ddc4Srjs    fputs(", ", fp);
296496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
296596c5ddc4Srjs    fputs(lanes2, fp);
296696c5ddc4Srjs}
296796c5ddc4Srjs
296896c5ddc4Srjsstatic void
296996c5ddc4Srjsbi_disasm_fma_rshift_and_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
297096c5ddc4Srjs{
297196c5ddc4Srjs    static const char *lanes2_table[] = {
297296c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
297396c5ddc4Srjs    };
297496c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
297596c5ddc4Srjs    static const char *not1_table[] = {
297696c5ddc4Srjs        "", ".not"
297796c5ddc4Srjs    };
297896c5ddc4Srjs
297996c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
298096c5ddc4Srjs
298196c5ddc4Srjs    static const char *not_result_table[] = {
298296c5ddc4Srjs        ".not", ""
298396c5ddc4Srjs    };
298496c5ddc4Srjs
298596c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
298696c5ddc4Srjs
298796c5ddc4Srjs    fputs("*RSHIFT_AND.v4i8", fp);
298896c5ddc4Srjs    fputs(not_result, fp);
298996c5ddc4Srjs    fputs(" ", fp);
299096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
299196c5ddc4Srjs    fputs(", ", fp);
299296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
299396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
299496c5ddc4Srjs    fputs(", ", fp);
299596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
299696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
299796c5ddc4Srjs    fputs(not1, fp);
299896c5ddc4Srjs    fputs(", ", fp);
299996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
300096c5ddc4Srjs    fputs(lanes2, fp);
300196c5ddc4Srjs}
300296c5ddc4Srjs
300396c5ddc4Srjsstatic void
300496c5ddc4Srjsbi_disasm_fma_rshift_and_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
300596c5ddc4Srjs{
300696c5ddc4Srjs    static const char *lanes2_table[] = {
300796c5ddc4Srjs        ""
300896c5ddc4Srjs    };
300996c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
301096c5ddc4Srjs    static const char *not1_table[] = {
301196c5ddc4Srjs        "", ".not"
301296c5ddc4Srjs    };
301396c5ddc4Srjs
301496c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
301596c5ddc4Srjs
301696c5ddc4Srjs    static const char *not_result_table[] = {
301796c5ddc4Srjs        ".not", ""
301896c5ddc4Srjs    };
301996c5ddc4Srjs
302096c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
302196c5ddc4Srjs
302296c5ddc4Srjs    fputs("*RSHIFT_AND.v4i8", fp);
302396c5ddc4Srjs    fputs(not_result, fp);
302496c5ddc4Srjs    fputs(" ", fp);
302596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
302696c5ddc4Srjs    fputs(", ", fp);
302796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
302896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
302996c5ddc4Srjs    fputs(", ", fp);
303096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
303196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
303296c5ddc4Srjs    fputs(not1, fp);
303396c5ddc4Srjs    fputs(", ", fp);
303496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
303596c5ddc4Srjs    fputs(lanes2, fp);
303696c5ddc4Srjs}
303796c5ddc4Srjs
303896c5ddc4Srjsstatic void
303996c5ddc4Srjsbi_disasm_fma_rshift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
304096c5ddc4Srjs{
304196c5ddc4Srjs    static const char *bytes2_table[] = {
304296c5ddc4Srjs        "", ".bytes2"
304396c5ddc4Srjs    };
304496c5ddc4Srjs
304596c5ddc4Srjs    const char *bytes2 = bytes2_table[_BITS(bits, 9, 1)];
304696c5ddc4Srjs
304796c5ddc4Srjs    static const char *lane2_table[] = {
304896c5ddc4Srjs        "", ".b2"
304996c5ddc4Srjs    };
305096c5ddc4Srjs
305196c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 10, 1)];
305296c5ddc4Srjs
305396c5ddc4Srjs    static const char *result_word_table[] = {
305496c5ddc4Srjs        "", ".w1"
305596c5ddc4Srjs    };
305696c5ddc4Srjs
305796c5ddc4Srjs    const char *result_word = result_word_table[_BITS(bits, 11, 1)];
305896c5ddc4Srjs
305996c5ddc4Srjs    fputs("*RSHIFT_DOUBLE.i32", fp);
306096c5ddc4Srjs    fputs(result_word, fp);
306196c5ddc4Srjs    fputs(" ", fp);
306296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
306396c5ddc4Srjs    fputs(", ", fp);
306496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
306596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
306696c5ddc4Srjs    fputs(", ", fp);
306796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
306896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
306996c5ddc4Srjs    fputs(", ", fp);
307096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
307196c5ddc4Srjs    fputs(bytes2, fp);
307296c5ddc4Srjs    fputs(lane2, fp);
307396c5ddc4Srjs}
307496c5ddc4Srjs
307596c5ddc4Srjsstatic void
307696c5ddc4Srjsbi_disasm_fma_rshift_or_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
307796c5ddc4Srjs{
307896c5ddc4Srjs    static const char *lane2_table[] = {
307996c5ddc4Srjs        "", ".b1", ".b2", ".b3"
308096c5ddc4Srjs    };
308196c5ddc4Srjs
308296c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
308396c5ddc4Srjs
308496c5ddc4Srjs    static const char *not1_table[] = {
308596c5ddc4Srjs        ".not", ""
308696c5ddc4Srjs    };
308796c5ddc4Srjs
308896c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
308996c5ddc4Srjs
309096c5ddc4Srjs    static const char *not_result_table[] = {
309196c5ddc4Srjs        "", ".not"
309296c5ddc4Srjs    };
309396c5ddc4Srjs
309496c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
309596c5ddc4Srjs
309696c5ddc4Srjs    fputs("*RSHIFT_OR.i32", fp);
309796c5ddc4Srjs    fputs(not_result, fp);
309896c5ddc4Srjs    fputs(" ", fp);
309996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
310096c5ddc4Srjs    fputs(", ", fp);
310196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
310296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
310396c5ddc4Srjs    fputs(", ", fp);
310496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
310596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
310696c5ddc4Srjs    fputs(not1, fp);
310796c5ddc4Srjs    fputs(", ", fp);
310896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
310996c5ddc4Srjs    fputs(lane2, fp);
311096c5ddc4Srjs}
311196c5ddc4Srjs
311296c5ddc4Srjsstatic void
311396c5ddc4Srjsbi_disasm_fma_rshift_or_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
311496c5ddc4Srjs{
311596c5ddc4Srjs    static const char *lanes2_table[] = {
311696c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
311796c5ddc4Srjs    };
311896c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
311996c5ddc4Srjs    static const char *not1_table[] = {
312096c5ddc4Srjs        ".not", ""
312196c5ddc4Srjs    };
312296c5ddc4Srjs
312396c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
312496c5ddc4Srjs
312596c5ddc4Srjs    static const char *not_result_table[] = {
312696c5ddc4Srjs        "", ".not"
312796c5ddc4Srjs    };
312896c5ddc4Srjs
312996c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
313096c5ddc4Srjs
313196c5ddc4Srjs    fputs("*RSHIFT_OR.v2i16", fp);
313296c5ddc4Srjs    fputs(not_result, fp);
313396c5ddc4Srjs    fputs(" ", fp);
313496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
313596c5ddc4Srjs    fputs(", ", fp);
313696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
313796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
313896c5ddc4Srjs    fputs(", ", fp);
313996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
314096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
314196c5ddc4Srjs    fputs(not1, fp);
314296c5ddc4Srjs    fputs(", ", fp);
314396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
314496c5ddc4Srjs    fputs(lanes2, fp);
314596c5ddc4Srjs}
314696c5ddc4Srjs
314796c5ddc4Srjsstatic void
314896c5ddc4Srjsbi_disasm_fma_rshift_or_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
314996c5ddc4Srjs{
315096c5ddc4Srjs    static const char *lanes2_table[] = {
315196c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
315296c5ddc4Srjs    };
315396c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
315496c5ddc4Srjs    static const char *not1_table[] = {
315596c5ddc4Srjs        ".not", ""
315696c5ddc4Srjs    };
315796c5ddc4Srjs
315896c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
315996c5ddc4Srjs
316096c5ddc4Srjs    static const char *not_result_table[] = {
316196c5ddc4Srjs        "", ".not"
316296c5ddc4Srjs    };
316396c5ddc4Srjs
316496c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
316596c5ddc4Srjs
316696c5ddc4Srjs    fputs("*RSHIFT_OR.v2i16", fp);
316796c5ddc4Srjs    fputs(not_result, fp);
316896c5ddc4Srjs    fputs(" ", fp);
316996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
317096c5ddc4Srjs    fputs(", ", fp);
317196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
317296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
317396c5ddc4Srjs    fputs(", ", fp);
317496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
317596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
317696c5ddc4Srjs    fputs(not1, fp);
317796c5ddc4Srjs    fputs(", ", fp);
317896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
317996c5ddc4Srjs    fputs(lanes2, fp);
318096c5ddc4Srjs}
318196c5ddc4Srjs
318296c5ddc4Srjsstatic void
318396c5ddc4Srjsbi_disasm_fma_rshift_or_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
318496c5ddc4Srjs{
318596c5ddc4Srjs    static const char *lanes2_table[] = {
318696c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
318796c5ddc4Srjs    };
318896c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
318996c5ddc4Srjs    static const char *not1_table[] = {
319096c5ddc4Srjs        ".not", ""
319196c5ddc4Srjs    };
319296c5ddc4Srjs
319396c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
319496c5ddc4Srjs
319596c5ddc4Srjs    static const char *not_result_table[] = {
319696c5ddc4Srjs        "", ".not"
319796c5ddc4Srjs    };
319896c5ddc4Srjs
319996c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
320096c5ddc4Srjs
320196c5ddc4Srjs    fputs("*RSHIFT_OR.v4i8", fp);
320296c5ddc4Srjs    fputs(not_result, fp);
320396c5ddc4Srjs    fputs(" ", fp);
320496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
320596c5ddc4Srjs    fputs(", ", fp);
320696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
320796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
320896c5ddc4Srjs    fputs(", ", fp);
320996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
321096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
321196c5ddc4Srjs    fputs(not1, fp);
321296c5ddc4Srjs    fputs(", ", fp);
321396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
321496c5ddc4Srjs    fputs(lanes2, fp);
321596c5ddc4Srjs}
321696c5ddc4Srjs
321796c5ddc4Srjsstatic void
321896c5ddc4Srjsbi_disasm_fma_rshift_or_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
321996c5ddc4Srjs{
322096c5ddc4Srjs    static const char *lanes2_table[] = {
322196c5ddc4Srjs        ""
322296c5ddc4Srjs    };
322396c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
322496c5ddc4Srjs    static const char *not1_table[] = {
322596c5ddc4Srjs        ".not", ""
322696c5ddc4Srjs    };
322796c5ddc4Srjs
322896c5ddc4Srjs    const char *not1 = not1_table[_BITS(bits, 14, 1)];
322996c5ddc4Srjs
323096c5ddc4Srjs    static const char *not_result_table[] = {
323196c5ddc4Srjs        "", ".not"
323296c5ddc4Srjs    };
323396c5ddc4Srjs
323496c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 15, 1)];
323596c5ddc4Srjs
323696c5ddc4Srjs    fputs("*RSHIFT_OR.v4i8", fp);
323796c5ddc4Srjs    fputs(not_result, fp);
323896c5ddc4Srjs    fputs(" ", fp);
323996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
324096c5ddc4Srjs    fputs(", ", fp);
324196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
324296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
324396c5ddc4Srjs    fputs(", ", fp);
324496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
324596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
324696c5ddc4Srjs    fputs(not1, fp);
324796c5ddc4Srjs    fputs(", ", fp);
324896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
324996c5ddc4Srjs    fputs(lanes2, fp);
325096c5ddc4Srjs}
325196c5ddc4Srjs
325296c5ddc4Srjsstatic void
325396c5ddc4Srjsbi_disasm_fma_rshift_xor_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
325496c5ddc4Srjs{
325596c5ddc4Srjs    static const char *lane2_table[] = {
325696c5ddc4Srjs        "", ".b1", ".b2", ".b3"
325796c5ddc4Srjs    };
325896c5ddc4Srjs
325996c5ddc4Srjs    const char *lane2 = lane2_table[_BITS(bits, 9, 2)];
326096c5ddc4Srjs
326196c5ddc4Srjs    static const char *not_result_table[] = {
326296c5ddc4Srjs        "", ".not"
326396c5ddc4Srjs    };
326496c5ddc4Srjs
326596c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
326696c5ddc4Srjs
326796c5ddc4Srjs    fputs("*RSHIFT_XOR.i32", fp);
326896c5ddc4Srjs    fputs(not_result, fp);
326996c5ddc4Srjs    fputs(" ", fp);
327096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
327196c5ddc4Srjs    fputs(", ", fp);
327296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
327396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
327496c5ddc4Srjs    fputs(", ", fp);
327596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
327696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
327796c5ddc4Srjs    fputs(", ", fp);
327896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
327996c5ddc4Srjs    fputs(lane2, fp);
328096c5ddc4Srjs}
328196c5ddc4Srjs
328296c5ddc4Srjsstatic void
328396c5ddc4Srjsbi_disasm_fma_rshift_xor_v2i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
328496c5ddc4Srjs{
328596c5ddc4Srjs    static const char *lanes2_table[] = {
328696c5ddc4Srjs        ".b00", ".b11", ".b22", ".b33"
328796c5ddc4Srjs    };
328896c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
328996c5ddc4Srjs    static const char *not_result_table[] = {
329096c5ddc4Srjs        "", ".not"
329196c5ddc4Srjs    };
329296c5ddc4Srjs
329396c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
329496c5ddc4Srjs
329596c5ddc4Srjs    fputs("*RSHIFT_XOR.v2i16", fp);
329696c5ddc4Srjs    fputs(not_result, fp);
329796c5ddc4Srjs    fputs(" ", fp);
329896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
329996c5ddc4Srjs    fputs(", ", fp);
330096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
330196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
330296c5ddc4Srjs    fputs(", ", fp);
330396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
330496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
330596c5ddc4Srjs    fputs(", ", fp);
330696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
330796c5ddc4Srjs    fputs(lanes2, fp);
330896c5ddc4Srjs}
330996c5ddc4Srjs
331096c5ddc4Srjsstatic void
331196c5ddc4Srjsbi_disasm_fma_rshift_xor_v2i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
331296c5ddc4Srjs{
331396c5ddc4Srjs    static const char *lanes2_table[] = {
331496c5ddc4Srjs        ".reserved", ".b01", ".b23", ""
331596c5ddc4Srjs    };
331696c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
331796c5ddc4Srjs    static const char *not_result_table[] = {
331896c5ddc4Srjs        "", ".not"
331996c5ddc4Srjs    };
332096c5ddc4Srjs
332196c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
332296c5ddc4Srjs
332396c5ddc4Srjs    fputs("*RSHIFT_XOR.v2i16", fp);
332496c5ddc4Srjs    fputs(not_result, fp);
332596c5ddc4Srjs    fputs(" ", fp);
332696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
332796c5ddc4Srjs    fputs(", ", fp);
332896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
332996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
333096c5ddc4Srjs    fputs(", ", fp);
333196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
333296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
333396c5ddc4Srjs    fputs(", ", fp);
333496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
333596c5ddc4Srjs    fputs(lanes2, fp);
333696c5ddc4Srjs}
333796c5ddc4Srjs
333896c5ddc4Srjsstatic void
333996c5ddc4Srjsbi_disasm_fma_rshift_xor_v4i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
334096c5ddc4Srjs{
334196c5ddc4Srjs    static const char *lanes2_table[] = {
334296c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
334396c5ddc4Srjs    };
334496c5ddc4Srjs    const char *lanes2 = lanes2_table[(_BITS(bits, 9, 2) << 0)];
334596c5ddc4Srjs    static const char *not_result_table[] = {
334696c5ddc4Srjs        "", ".not"
334796c5ddc4Srjs    };
334896c5ddc4Srjs
334996c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
335096c5ddc4Srjs
335196c5ddc4Srjs    fputs("*RSHIFT_XOR.v4i8", fp);
335296c5ddc4Srjs    fputs(not_result, fp);
335396c5ddc4Srjs    fputs(" ", fp);
335496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
335596c5ddc4Srjs    fputs(", ", fp);
335696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
335796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
335896c5ddc4Srjs    fputs(", ", fp);
335996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
336096c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
336196c5ddc4Srjs    fputs(", ", fp);
336296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
336396c5ddc4Srjs    fputs(lanes2, fp);
336496c5ddc4Srjs}
336596c5ddc4Srjs
336696c5ddc4Srjsstatic void
336796c5ddc4Srjsbi_disasm_fma_rshift_xor_v4i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
336896c5ddc4Srjs{
336996c5ddc4Srjs    static const char *lanes2_table[] = {
337096c5ddc4Srjs        ""
337196c5ddc4Srjs    };
337296c5ddc4Srjs    const char *lanes2 = lanes2_table[0];
337396c5ddc4Srjs    static const char *not_result_table[] = {
337496c5ddc4Srjs        "", ".not"
337596c5ddc4Srjs    };
337696c5ddc4Srjs
337796c5ddc4Srjs    const char *not_result = not_result_table[_BITS(bits, 13, 1)];
337896c5ddc4Srjs
337996c5ddc4Srjs    fputs("*RSHIFT_XOR.v4i8", fp);
338096c5ddc4Srjs    fputs(not_result, fp);
338196c5ddc4Srjs    fputs(" ", fp);
338296c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
338396c5ddc4Srjs    fputs(", ", fp);
338496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
338596c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
338696c5ddc4Srjs    fputs(", ", fp);
338796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
338896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
338996c5ddc4Srjs    fputs(", ", fp);
339096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
339196c5ddc4Srjs    fputs(lanes2, fp);
339296c5ddc4Srjs}
339396c5ddc4Srjs
339496c5ddc4Srjsstatic void
339596c5ddc4Srjsbi_disasm_fma_s16_to_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
339696c5ddc4Srjs{
339796c5ddc4Srjs    static const char *lane0_table[] = {
339896c5ddc4Srjs        "", ".h1"
339996c5ddc4Srjs    };
340096c5ddc4Srjs
340196c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
340296c5ddc4Srjs
340396c5ddc4Srjs    fputs("*S16_TO_S32", fp);
340496c5ddc4Srjs    fputs(" ", fp);
340596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
340696c5ddc4Srjs    fputs(", ", fp);
340796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
340896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
340996c5ddc4Srjs    fputs(lane0, fp);
341096c5ddc4Srjs}
341196c5ddc4Srjs
341296c5ddc4Srjsstatic void
341396c5ddc4Srjsbi_disasm_fma_s8_to_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
341496c5ddc4Srjs{
341596c5ddc4Srjs    static const char *lane0_table[] = {
341696c5ddc4Srjs        "", ".b1", ".b2", ".b3"
341796c5ddc4Srjs    };
341896c5ddc4Srjs
341996c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
342096c5ddc4Srjs
342196c5ddc4Srjs    fputs("*S8_TO_S32", fp);
342296c5ddc4Srjs    fputs(" ", fp);
342396c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
342496c5ddc4Srjs    fputs(", ", fp);
342596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
342696c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
342796c5ddc4Srjs    fputs(lane0, fp);
342896c5ddc4Srjs}
342996c5ddc4Srjs
343096c5ddc4Srjsstatic void
343196c5ddc4Srjsbi_disasm_fma_seg_add(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
343296c5ddc4Srjs{
343396c5ddc4Srjs    static const char *seg_table[] = {
343496c5ddc4Srjs        ".reserved", ".reserved", ".wls", ".reserved", ".reserved", ".reserved", ".reserved", ".tl"
343596c5ddc4Srjs    };
343696c5ddc4Srjs
343796c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 3, 3)];
343896c5ddc4Srjs
343996c5ddc4Srjs    static const char *preserve_null_table[] = {
344096c5ddc4Srjs        "", ".preserve_null"
344196c5ddc4Srjs    };
344296c5ddc4Srjs
344396c5ddc4Srjs    const char *preserve_null = preserve_null_table[_BITS(bits, 7, 1)];
344496c5ddc4Srjs
344596c5ddc4Srjs    fputs("*SEG_ADD", fp);
344696c5ddc4Srjs    fputs(seg, fp);
344796c5ddc4Srjs    fputs(preserve_null, fp);
344896c5ddc4Srjs    fputs(" ", fp);
344996c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
345096c5ddc4Srjs    fputs(", ", fp);
345196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
345296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
345396c5ddc4Srjs}
345496c5ddc4Srjs
345596c5ddc4Srjsstatic void
345696c5ddc4Srjsbi_disasm_fma_seg_sub(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
345796c5ddc4Srjs{
345896c5ddc4Srjs    static const char *seg_table[] = {
345996c5ddc4Srjs        ".reserved", ".reserved", ".wls", ".reserved", ".reserved", ".reserved", ".reserved", ".tl"
346096c5ddc4Srjs    };
346196c5ddc4Srjs
346296c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 3, 3)];
346396c5ddc4Srjs
346496c5ddc4Srjs    static const char *preserve_null_table[] = {
346596c5ddc4Srjs        "", ".preserve_null"
346696c5ddc4Srjs    };
346796c5ddc4Srjs
346896c5ddc4Srjs    const char *preserve_null = preserve_null_table[_BITS(bits, 7, 1)];
346996c5ddc4Srjs
347096c5ddc4Srjs    fputs("*SEG_SUB", fp);
347196c5ddc4Srjs    fputs(seg, fp);
347296c5ddc4Srjs    fputs(preserve_null, fp);
347396c5ddc4Srjs    fputs(" ", fp);
347496c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
347596c5ddc4Srjs    fputs(", ", fp);
347696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
347796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
347896c5ddc4Srjs}
347996c5ddc4Srjs
348096c5ddc4Srjsstatic void
348196c5ddc4Srjsbi_disasm_fma_shaddxl_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
348296c5ddc4Srjs{
348396c5ddc4Srjs    fputs("*SHADDXL.i64", fp);
348496c5ddc4Srjs    fputs(" ", fp);
348596c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
348696c5ddc4Srjs    fputs(", ", fp);
348796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
348896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
348996c5ddc4Srjs    fputs(", ", fp);
349096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
349196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
349296c5ddc4Srjs    fprintf(fp, ", shift:%u", _BITS(bits, 6, 3));
349396c5ddc4Srjs}
349496c5ddc4Srjs
349596c5ddc4Srjsstatic void
349696c5ddc4Srjsbi_disasm_fma_shaddxl_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
349796c5ddc4Srjs{
349896c5ddc4Srjs    static const char *lane1_table[] = {
349996c5ddc4Srjs        ".h0", ".h1", "", ".reserved"
350096c5ddc4Srjs    };
350196c5ddc4Srjs
350296c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 9, 2)];
350396c5ddc4Srjs
350496c5ddc4Srjs    fputs("*SHADDXL.s32", fp);
350596c5ddc4Srjs    fputs(" ", fp);
350696c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
350796c5ddc4Srjs    fputs(", ", fp);
350896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
350996c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
351096c5ddc4Srjs    fputs(", ", fp);
351196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
351296c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
351396c5ddc4Srjs    fputs(lane1, fp);
351496c5ddc4Srjs    fprintf(fp, ", shift:%u", _BITS(bits, 6, 3));
351596c5ddc4Srjs}
351696c5ddc4Srjs
351796c5ddc4Srjsstatic void
351896c5ddc4Srjsbi_disasm_fma_shaddxl_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
351996c5ddc4Srjs{
352096c5ddc4Srjs    static const char *lane1_table[] = {
352196c5ddc4Srjs        ".h0", ".h1", "", ".reserved"
352296c5ddc4Srjs    };
352396c5ddc4Srjs
352496c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 9, 2)];
352596c5ddc4Srjs
352696c5ddc4Srjs    fputs("*SHADDXL.u32", fp);
352796c5ddc4Srjs    fputs(" ", fp);
352896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
352996c5ddc4Srjs    fputs(", ", fp);
353096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
353196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
353296c5ddc4Srjs    fputs(", ", fp);
353396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
353496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
353596c5ddc4Srjs    fputs(lane1, fp);
353696c5ddc4Srjs    fprintf(fp, ", shift:%u", _BITS(bits, 6, 3));
353796c5ddc4Srjs}
353896c5ddc4Srjs
353996c5ddc4Srjsstatic void
354096c5ddc4Srjsbi_disasm_fma_u16_to_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
354196c5ddc4Srjs{
354296c5ddc4Srjs    static const char *lane0_table[] = {
354396c5ddc4Srjs        "", ".h1"
354496c5ddc4Srjs    };
354596c5ddc4Srjs
354696c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
354796c5ddc4Srjs
354896c5ddc4Srjs    fputs("*U16_TO_U32", fp);
354996c5ddc4Srjs    fputs(" ", fp);
355096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
355196c5ddc4Srjs    fputs(", ", fp);
355296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
355396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
355496c5ddc4Srjs    fputs(lane0, fp);
355596c5ddc4Srjs}
355696c5ddc4Srjs
355796c5ddc4Srjsstatic void
355896c5ddc4Srjsbi_disasm_fma_u8_to_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
355996c5ddc4Srjs{
356096c5ddc4Srjs    static const char *lane0_table[] = {
356196c5ddc4Srjs        "", ".b1", ".b2", ".b3"
356296c5ddc4Srjs    };
356396c5ddc4Srjs
356496c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
356596c5ddc4Srjs
356696c5ddc4Srjs    fputs("*U8_TO_U32", fp);
356796c5ddc4Srjs    fputs(" ", fp);
356896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
356996c5ddc4Srjs    fputs(", ", fp);
357096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
357196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
357296c5ddc4Srjs    fputs(lane0, fp);
357396c5ddc4Srjs}
357496c5ddc4Srjs
357596c5ddc4Srjsstatic void
357696c5ddc4Srjsbi_disasm_fma_v2f32_to_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
357796c5ddc4Srjs{
357896c5ddc4Srjs    static const char *neg1_table[] = {
357996c5ddc4Srjs        "", "", ".neg", ".neg"
358096c5ddc4Srjs    };
358196c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
358296c5ddc4Srjs    static const char *abs0_table[] = {
358396c5ddc4Srjs        "", ".abs", "", ".abs"
358496c5ddc4Srjs    };
358596c5ddc4Srjs    const char *abs0 = abs0_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
358696c5ddc4Srjs    static const char *neg0_table[] = {
358796c5ddc4Srjs        "", "", ".neg", ".neg"
358896c5ddc4Srjs    };
358996c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
359096c5ddc4Srjs    static const char *abs1_table[] = {
359196c5ddc4Srjs        "", ".abs", "", ".abs"
359296c5ddc4Srjs    };
359396c5ddc4Srjs    const char *abs1 = abs1_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
359496c5ddc4Srjs    static const char *clamp_table[] = {
359596c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
359696c5ddc4Srjs    };
359796c5ddc4Srjs
359896c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 8, 2)];
359996c5ddc4Srjs
360096c5ddc4Srjs    static const char *round_table[] = {
360196c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz", ".rtna", ".reserved", ".reserved", ".reserved"
360296c5ddc4Srjs    };
360396c5ddc4Srjs
360496c5ddc4Srjs    const char *round = round_table[_BITS(bits, 10, 3)];
360596c5ddc4Srjs
360696c5ddc4Srjs    fputs("*V2F32_TO_V2F16", fp);
360796c5ddc4Srjs    fputs(clamp, fp);
360896c5ddc4Srjs    fputs(round, fp);
360996c5ddc4Srjs    fputs(" ", fp);
361096c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
361196c5ddc4Srjs    fputs(", ", fp);
361296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
361396c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
361496c5ddc4Srjs    fputs(abs0, fp);
361596c5ddc4Srjs    fputs(neg0, fp);
361696c5ddc4Srjs    fputs(", ", fp);
361796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
361896c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
361996c5ddc4Srjs    fputs(abs1, fp);
362096c5ddc4Srjs    fputs(neg1, fp);
362196c5ddc4Srjs}
362296c5ddc4Srjs
362396c5ddc4Srjsstatic void
362496c5ddc4Srjsbi_disasm_fma_vn_asst1_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
362596c5ddc4Srjs{
362696c5ddc4Srjs    static const char *h_table[] = {
362796c5ddc4Srjs        "", ".h"
362896c5ddc4Srjs    };
362996c5ddc4Srjs
363096c5ddc4Srjs    const char *h = h_table[_BITS(bits, 9, 1)];
363196c5ddc4Srjs
363296c5ddc4Srjs    static const char *l_table[] = {
363396c5ddc4Srjs        "", ".l"
363496c5ddc4Srjs    };
363596c5ddc4Srjs
363696c5ddc4Srjs    const char *l = l_table[_BITS(bits, 10, 1)];
363796c5ddc4Srjs
363896c5ddc4Srjs    static const char *neg2_table[] = {
363996c5ddc4Srjs        "", ".neg"
364096c5ddc4Srjs    };
364196c5ddc4Srjs
364296c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 11, 1)];
364396c5ddc4Srjs
364496c5ddc4Srjs    fputs("*VN_ASST1.f16", fp);
364596c5ddc4Srjs    fputs(h, fp);
364696c5ddc4Srjs    fputs(l, fp);
364796c5ddc4Srjs    fputs(" ", fp);
364896c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
364996c5ddc4Srjs    fputs(", ", fp);
365096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
365196c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
365296c5ddc4Srjs    fputs(", ", fp);
365396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
365496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
365596c5ddc4Srjs    fputs(", ", fp);
365696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
365796c5ddc4Srjs    fputs(neg2, fp);
365896c5ddc4Srjs}
365996c5ddc4Srjs
366096c5ddc4Srjsstatic void
366196c5ddc4Srjsbi_disasm_fma_vn_asst1_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
366296c5ddc4Srjs{
366396c5ddc4Srjs    static const char *neg2_table[] = {
366496c5ddc4Srjs        "", ".neg"
366596c5ddc4Srjs    };
366696c5ddc4Srjs
366796c5ddc4Srjs    const char *neg2 = neg2_table[_BITS(bits, 12, 1)];
366896c5ddc4Srjs
366996c5ddc4Srjs    fputs("*VN_ASST1.f32", fp);
367096c5ddc4Srjs    fputs(" ", fp);
367196c5ddc4Srjs    bi_disasm_dest_fma(fp, next_regs, last);
367296c5ddc4Srjs    fputs(", ", fp);
367396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, true);
367496c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
367596c5ddc4Srjs    fputs(", ", fp);
367696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, true);
367796c5ddc4Srjs    if (!(0xfb & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
367896c5ddc4Srjs    fputs(", ", fp);
367996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, true);
368096c5ddc4Srjs    fputs(neg2, fp);
368196c5ddc4Srjs    fputs(", ", fp);
368296c5ddc4Srjs    dump_src(fp, _BITS(bits, 9, 3), *srcs, branch_offset, consts, true);
368396c5ddc4Srjs}
368496c5ddc4Srjs
368596c5ddc4Srjsstatic void
368696c5ddc4Srjsbi_disasm_add_acmpstore_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
368796c5ddc4Srjs{
368896c5ddc4Srjs    static const char *seg_table[] = {
368996c5ddc4Srjs        "", ".wls"
369096c5ddc4Srjs    };
369196c5ddc4Srjs
369296c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
369396c5ddc4Srjs
369496c5ddc4Srjs    fputs("+ACMPSTORE.i32", fp);
369596c5ddc4Srjs    fputs(seg, fp);
369696c5ddc4Srjs    fputs(" ", fp);
369796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
369896c5ddc4Srjs    fputs(", ", fp);
369996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
370096c5ddc4Srjs    fputs(", ", fp);
370196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
370296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
370396c5ddc4Srjs}
370496c5ddc4Srjs
370596c5ddc4Srjsstatic void
370696c5ddc4Srjsbi_disasm_add_acmpstore_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
370796c5ddc4Srjs{
370896c5ddc4Srjs    static const char *seg_table[] = {
370996c5ddc4Srjs        "", ".wls"
371096c5ddc4Srjs    };
371196c5ddc4Srjs
371296c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
371396c5ddc4Srjs
371496c5ddc4Srjs    fputs("+ACMPSTORE.i64", fp);
371596c5ddc4Srjs    fputs(seg, fp);
371696c5ddc4Srjs    fputs(" ", fp);
371796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
371896c5ddc4Srjs    fputs(", ", fp);
371996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
372096c5ddc4Srjs    fputs(", ", fp);
372196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
372296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
372396c5ddc4Srjs}
372496c5ddc4Srjs
372596c5ddc4Srjsstatic void
372696c5ddc4Srjsbi_disasm_add_acmpxchg_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
372796c5ddc4Srjs{
372896c5ddc4Srjs    static const char *seg_table[] = {
372996c5ddc4Srjs        "", ".wls"
373096c5ddc4Srjs    };
373196c5ddc4Srjs
373296c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
373396c5ddc4Srjs
373496c5ddc4Srjs    fputs("+ACMPXCHG.i32", fp);
373596c5ddc4Srjs    fputs(seg, fp);
373696c5ddc4Srjs    fputs(" ", fp);
373796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
373896c5ddc4Srjs    fputs(", ", fp);
373996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
374096c5ddc4Srjs    fputs(", ", fp);
374196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
374296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
374396c5ddc4Srjs}
374496c5ddc4Srjs
374596c5ddc4Srjsstatic void
374696c5ddc4Srjsbi_disasm_add_acmpxchg_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
374796c5ddc4Srjs{
374896c5ddc4Srjs    static const char *seg_table[] = {
374996c5ddc4Srjs        "", ".wls"
375096c5ddc4Srjs    };
375196c5ddc4Srjs
375296c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
375396c5ddc4Srjs
375496c5ddc4Srjs    fputs("+ACMPXCHG.i64", fp);
375596c5ddc4Srjs    fputs(seg, fp);
375696c5ddc4Srjs    fputs(" ", fp);
375796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
375896c5ddc4Srjs    fputs(", ", fp);
375996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
376096c5ddc4Srjs    fputs(", ", fp);
376196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
376296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
376396c5ddc4Srjs}
376496c5ddc4Srjs
376596c5ddc4Srjsstatic void
376696c5ddc4Srjsbi_disasm_add_atest(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
376796c5ddc4Srjs{
376896c5ddc4Srjs    static const char *widen1_table[] = {
376996c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
377096c5ddc4Srjs    };
377196c5ddc4Srjs
377296c5ddc4Srjs    const char *widen1 = widen1_table[_BITS(bits, 6, 2)];
377396c5ddc4Srjs
377496c5ddc4Srjs    fputs("+ATEST", fp);
377596c5ddc4Srjs    fputs(" ", fp);
377696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
377796c5ddc4Srjs    fputs(", ", fp);
377896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
377996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
378096c5ddc4Srjs    fputs(", ", fp);
378196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
378296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
378396c5ddc4Srjs    fputs(widen1, fp);
378496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
378596c5ddc4Srjs}
378696c5ddc4Srjs
378796c5ddc4Srjsstatic void
378896c5ddc4Srjsbi_disasm_add_atom_cx(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
378996c5ddc4Srjs{
379096c5ddc4Srjs    fputs("+ATOM_CX", fp);
379196c5ddc4Srjs    fputs(" ", fp);
379296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
379396c5ddc4Srjs    fputs(", ", fp);
379496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
379596c5ddc4Srjs    fputs(", ", fp);
379696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
379796c5ddc4Srjs    fputs(", ", fp);
379896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
379996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
380096c5ddc4Srjs}
380196c5ddc4Srjs
380296c5ddc4Srjsstatic void
380396c5ddc4Srjsbi_disasm_add_axchg_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
380496c5ddc4Srjs{
380596c5ddc4Srjs    static const char *seg_table[] = {
380696c5ddc4Srjs        "", ".wls"
380796c5ddc4Srjs    };
380896c5ddc4Srjs
380996c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
381096c5ddc4Srjs
381196c5ddc4Srjs    fputs("+AXCHG.i32", fp);
381296c5ddc4Srjs    fputs(seg, fp);
381396c5ddc4Srjs    fputs(" ", fp);
381496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
381596c5ddc4Srjs    fputs(", ", fp);
381696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
381796c5ddc4Srjs    fputs(", ", fp);
381896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
381996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
382096c5ddc4Srjs}
382196c5ddc4Srjs
382296c5ddc4Srjsstatic void
382396c5ddc4Srjsbi_disasm_add_axchg_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
382496c5ddc4Srjs{
382596c5ddc4Srjs    static const char *seg_table[] = {
382696c5ddc4Srjs        "", ".wls"
382796c5ddc4Srjs    };
382896c5ddc4Srjs
382996c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 9, 1)];
383096c5ddc4Srjs
383196c5ddc4Srjs    fputs("+AXCHG.i64", fp);
383296c5ddc4Srjs    fputs(seg, fp);
383396c5ddc4Srjs    fputs(" ", fp);
383496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
383596c5ddc4Srjs    fputs(", ", fp);
383696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
383796c5ddc4Srjs    fputs(", ", fp);
383896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
383996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
384096c5ddc4Srjs}
384196c5ddc4Srjs
384296c5ddc4Srjsstatic void
384396c5ddc4Srjsbi_disasm_add_barrier(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
384496c5ddc4Srjs{
384596c5ddc4Srjs    fputs("+BARRIER", fp);
384696c5ddc4Srjs    fputs(" ", fp);
384796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
384896c5ddc4Srjs}
384996c5ddc4Srjs
385096c5ddc4Srjsstatic void
385196c5ddc4Srjsbi_disasm_add_blend(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
385296c5ddc4Srjs{
385396c5ddc4Srjs    fputs("+BLEND", fp);
385496c5ddc4Srjs    fputs(" ", fp);
385596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
385696c5ddc4Srjs    fputs(", ", fp);
385796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
385896c5ddc4Srjs    fputs(", ", fp);
385996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
386096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
386196c5ddc4Srjs    fputs(", ", fp);
386296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
386396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
386496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
386596c5ddc4Srjs}
386696c5ddc4Srjs
386796c5ddc4Srjsstatic void
386896c5ddc4Srjsbi_disasm_add_branch_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
386996c5ddc4Srjs{
387096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
387196c5ddc4Srjs    static const char *cmpf_0[] = {
387296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".eq", ".ne", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".gt", ".ge", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".lt", ".lt", ".le", ".lt", ".reserved", ".reserved", ".reserved"
387396c5ddc4Srjs    };
387496c5ddc4Srjs    static const char *cmpf_1[] = {
387596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".ne", ".ne", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".ge", ".ge", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".le", ".le", ".lt", ".reserved", ".reserved", ".reserved"
387696c5ddc4Srjs    };
387796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
387896c5ddc4Srjs    static const char *widen1_0[] = {
387996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved"
388096c5ddc4Srjs    };
388196c5ddc4Srjs    static const char *widen1_1[] = {
388296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved"
388396c5ddc4Srjs    };
388496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
388596c5ddc4Srjs    static const char *widen0_0[] = {
388696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved"
388796c5ddc4Srjs    };
388896c5ddc4Srjs    static const char *widen0_1[] = {
388996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved"
389096c5ddc4Srjs    };
389196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
389296c5ddc4Srjs    fputs("+BRANCH.f16", fp);
389396c5ddc4Srjs    fputs(cmpf, fp);
389496c5ddc4Srjs    fputs(" ", fp);
389596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
389696c5ddc4Srjs    fputs(", ", fp);
389796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
389896c5ddc4Srjs    fputs(widen0, fp);
389996c5ddc4Srjs    fputs(", ", fp);
390096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
390196c5ddc4Srjs    fputs(widen1, fp);
390296c5ddc4Srjs    fputs(", ", fp);
390396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
390496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
390596c5ddc4Srjs}
390696c5ddc4Srjs
390796c5ddc4Srjsstatic void
390896c5ddc4Srjsbi_disasm_add_branch_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
390996c5ddc4Srjs{
391096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
391196c5ddc4Srjs    static const char *cmpf_0[] = {
391296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".ne", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".eq", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".lt", ".lt", ".reserved"
391396c5ddc4Srjs    };
391496c5ddc4Srjs    static const char *cmpf_1[] = {
391596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".ne", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".eq", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".lt", ".lt", ".reserved"
391696c5ddc4Srjs    };
391796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
391896c5ddc4Srjs    static const char *widen1_0[] = {
391996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved"
392096c5ddc4Srjs    };
392196c5ddc4Srjs    static const char *widen1_1[] = {
392296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved"
392396c5ddc4Srjs    };
392496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
392596c5ddc4Srjs    static const char *widen0_0[] = {
392696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved"
392796c5ddc4Srjs    };
392896c5ddc4Srjs    static const char *widen0_1[] = {
392996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", "", "", ".reserved"
393096c5ddc4Srjs    };
393196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
393296c5ddc4Srjs    fputs("+BRANCH.f32", fp);
393396c5ddc4Srjs    fputs(cmpf, fp);
393496c5ddc4Srjs    fputs(" ", fp);
393596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
393696c5ddc4Srjs    fputs(", ", fp);
393796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
393896c5ddc4Srjs    fputs(widen0, fp);
393996c5ddc4Srjs    fputs(", ", fp);
394096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
394196c5ddc4Srjs    fputs(widen1, fp);
394296c5ddc4Srjs    fputs(", ", fp);
394396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
394496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
394596c5ddc4Srjs}
394696c5ddc4Srjs
394796c5ddc4Srjsstatic void
394896c5ddc4Srjsbi_disasm_add_branch_i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
394996c5ddc4Srjs{
395096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
395196c5ddc4Srjs    static const char *cmpf_0[] = {
395296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".eq", ".ne", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
395396c5ddc4Srjs    };
395496c5ddc4Srjs    static const char *cmpf_1[] = {
395596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".ne", ".ne", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
395696c5ddc4Srjs    };
395796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
395896c5ddc4Srjs    static const char *widen1_0[] = {
395996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
396096c5ddc4Srjs    };
396196c5ddc4Srjs    static const char *widen1_1[] = {
396296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
396396c5ddc4Srjs    };
396496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
396596c5ddc4Srjs    static const char *widen0_0[] = {
396696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
396796c5ddc4Srjs    };
396896c5ddc4Srjs    static const char *widen0_1[] = {
396996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
397096c5ddc4Srjs    };
397196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
397296c5ddc4Srjs    fputs("+BRANCH.i16", fp);
397396c5ddc4Srjs    fputs(cmpf, fp);
397496c5ddc4Srjs    fputs(" ", fp);
397596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
397696c5ddc4Srjs    fputs(", ", fp);
397796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
397896c5ddc4Srjs    fputs(widen0, fp);
397996c5ddc4Srjs    fputs(", ", fp);
398096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
398196c5ddc4Srjs    fputs(widen1, fp);
398296c5ddc4Srjs    fputs(", ", fp);
398396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
398496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
398596c5ddc4Srjs}
398696c5ddc4Srjs
398796c5ddc4Srjsstatic void
398896c5ddc4Srjsbi_disasm_add_branch_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
398996c5ddc4Srjs{
399096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
399196c5ddc4Srjs    static const char *cmpf_0[] = {
399296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".eq", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
399396c5ddc4Srjs    };
399496c5ddc4Srjs    static const char *cmpf_1[] = {
399596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
399696c5ddc4Srjs    };
399796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
399896c5ddc4Srjs    static const char *widen1_0[] = {
399996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
400096c5ddc4Srjs    };
400196c5ddc4Srjs    static const char *widen1_1[] = {
400296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
400396c5ddc4Srjs    };
400496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
400596c5ddc4Srjs    static const char *widen0_0[] = {
400696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
400796c5ddc4Srjs    };
400896c5ddc4Srjs    static const char *widen0_1[] = {
400996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
401096c5ddc4Srjs    };
401196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
401296c5ddc4Srjs    fputs("+BRANCH.i32", fp);
401396c5ddc4Srjs    fputs(cmpf, fp);
401496c5ddc4Srjs    fputs(" ", fp);
401596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
401696c5ddc4Srjs    fputs(", ", fp);
401796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
401896c5ddc4Srjs    fputs(widen0, fp);
401996c5ddc4Srjs    fputs(", ", fp);
402096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
402196c5ddc4Srjs    fputs(widen1, fp);
402296c5ddc4Srjs    fputs(", ", fp);
402396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
402496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
402596c5ddc4Srjs}
402696c5ddc4Srjs
402796c5ddc4Srjsstatic void
402896c5ddc4Srjsbi_disasm_add_branch_s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
402996c5ddc4Srjs{
403096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
403196c5ddc4Srjs    static const char *cmpf_0[] = {
403296c5ddc4Srjs        ".reserved", ".lt", ".lt", ".reserved", ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".le", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
403396c5ddc4Srjs    };
403496c5ddc4Srjs    static const char *cmpf_1[] = {
403596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
403696c5ddc4Srjs    };
403796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
403896c5ddc4Srjs    static const char *widen1_0[] = {
403996c5ddc4Srjs        ".reserved", ".h0", ".h1", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
404096c5ddc4Srjs    };
404196c5ddc4Srjs    static const char *widen1_1[] = {
404296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
404396c5ddc4Srjs    };
404496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
404596c5ddc4Srjs    static const char *widen0_0[] = {
404696c5ddc4Srjs        ".reserved", ".h0", ".h1", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
404796c5ddc4Srjs    };
404896c5ddc4Srjs    static const char *widen0_1[] = {
404996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
405096c5ddc4Srjs    };
405196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
405296c5ddc4Srjs    fputs("+BRANCH.s16", fp);
405396c5ddc4Srjs    fputs(cmpf, fp);
405496c5ddc4Srjs    fputs(" ", fp);
405596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
405696c5ddc4Srjs    fputs(", ", fp);
405796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
405896c5ddc4Srjs    fputs(widen0, fp);
405996c5ddc4Srjs    fputs(", ", fp);
406096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
406196c5ddc4Srjs    fputs(widen1, fp);
406296c5ddc4Srjs    fputs(", ", fp);
406396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
406496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
406596c5ddc4Srjs}
406696c5ddc4Srjs
406796c5ddc4Srjsstatic void
406896c5ddc4Srjsbi_disasm_add_branch_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
406996c5ddc4Srjs{
407096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
407196c5ddc4Srjs    static const char *cmpf_0[] = {
407296c5ddc4Srjs        ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
407396c5ddc4Srjs    };
407496c5ddc4Srjs    static const char *cmpf_1[] = {
407596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
407696c5ddc4Srjs    };
407796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
407896c5ddc4Srjs    static const char *widen1_0[] = {
407996c5ddc4Srjs        "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
408096c5ddc4Srjs    };
408196c5ddc4Srjs    static const char *widen1_1[] = {
408296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
408396c5ddc4Srjs    };
408496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
408596c5ddc4Srjs    static const char *widen0_0[] = {
408696c5ddc4Srjs        "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
408796c5ddc4Srjs    };
408896c5ddc4Srjs    static const char *widen0_1[] = {
408996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
409096c5ddc4Srjs    };
409196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
409296c5ddc4Srjs    fputs("+BRANCH.s32", fp);
409396c5ddc4Srjs    fputs(cmpf, fp);
409496c5ddc4Srjs    fputs(" ", fp);
409596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
409696c5ddc4Srjs    fputs(", ", fp);
409796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
409896c5ddc4Srjs    fputs(widen0, fp);
409996c5ddc4Srjs    fputs(", ", fp);
410096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
410196c5ddc4Srjs    fputs(widen1, fp);
410296c5ddc4Srjs    fputs(", ", fp);
410396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
410496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
410596c5ddc4Srjs}
410696c5ddc4Srjs
410796c5ddc4Srjsstatic void
410896c5ddc4Srjsbi_disasm_add_branch_u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
410996c5ddc4Srjs{
411096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
411196c5ddc4Srjs    static const char *cmpf_0[] = {
411296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
411396c5ddc4Srjs    };
411496c5ddc4Srjs    static const char *cmpf_1[] = {
411596c5ddc4Srjs        ".reserved", ".lt", ".lt", ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".le", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".ge", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".gt", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
411696c5ddc4Srjs    };
411796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
411896c5ddc4Srjs    static const char *widen1_0[] = {
411996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
412096c5ddc4Srjs    };
412196c5ddc4Srjs    static const char *widen1_1[] = {
412296c5ddc4Srjs        ".reserved", ".h0", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
412396c5ddc4Srjs    };
412496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
412596c5ddc4Srjs    static const char *widen0_0[] = {
412696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
412796c5ddc4Srjs    };
412896c5ddc4Srjs    static const char *widen0_1[] = {
412996c5ddc4Srjs        ".reserved", ".h0", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h0", ".h1", ".h1", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
413096c5ddc4Srjs    };
413196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
413296c5ddc4Srjs    fputs("+BRANCH.u16", fp);
413396c5ddc4Srjs    fputs(cmpf, fp);
413496c5ddc4Srjs    fputs(" ", fp);
413596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
413696c5ddc4Srjs    fputs(", ", fp);
413796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
413896c5ddc4Srjs    fputs(widen0, fp);
413996c5ddc4Srjs    fputs(", ", fp);
414096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
414196c5ddc4Srjs    fputs(widen1, fp);
414296c5ddc4Srjs    fputs(", ", fp);
414396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
414496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
414596c5ddc4Srjs}
414696c5ddc4Srjs
414796c5ddc4Srjsstatic void
414896c5ddc4Srjsbi_disasm_add_branch_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
414996c5ddc4Srjs{
415096c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
415196c5ddc4Srjs    static const char *cmpf_0[] = {
415296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
415396c5ddc4Srjs    };
415496c5ddc4Srjs    static const char *cmpf_1[] = {
415596c5ddc4Srjs        ".lt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ge", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
415696c5ddc4Srjs    };
415796c5ddc4Srjs    const char *cmpf = ordering ? cmpf_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : cmpf_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
415896c5ddc4Srjs    static const char *widen1_0[] = {
415996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
416096c5ddc4Srjs    };
416196c5ddc4Srjs    static const char *widen1_1[] = {
416296c5ddc4Srjs        "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
416396c5ddc4Srjs    };
416496c5ddc4Srjs    const char *widen1 = ordering ? widen1_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen1_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
416596c5ddc4Srjs    static const char *widen0_0[] = {
416696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
416796c5ddc4Srjs    };
416896c5ddc4Srjs    static const char *widen0_1[] = {
416996c5ddc4Srjs        "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
417096c5ddc4Srjs    };
417196c5ddc4Srjs    const char *widen0 = ordering ? widen0_1[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)] : widen0_0[(_BITS(bits, 12, 3) << 0) | (_BITS(bits, 9, 3) << 3)];
417296c5ddc4Srjs    fputs("+BRANCH.u32", fp);
417396c5ddc4Srjs    fputs(cmpf, fp);
417496c5ddc4Srjs    fputs(" ", fp);
417596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
417696c5ddc4Srjs    fputs(", ", fp);
417796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
417896c5ddc4Srjs    fputs(widen0, fp);
417996c5ddc4Srjs    fputs(", ", fp);
418096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
418196c5ddc4Srjs    fputs(widen1, fp);
418296c5ddc4Srjs    fputs(", ", fp);
418396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
418496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
418596c5ddc4Srjs}
418696c5ddc4Srjs
418796c5ddc4Srjsstatic void
418896c5ddc4Srjsbi_disasm_add_branchc_i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
418996c5ddc4Srjs{
419096c5ddc4Srjs    static const char *lane0_table[] = {
419196c5ddc4Srjs        ".reserved", ".h1", "", ".reserved"
419296c5ddc4Srjs    };
419396c5ddc4Srjs    const char *lane0 = lane0_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 3, 1) << 1)];
419496c5ddc4Srjs    static const char *combine_table[] = {
419596c5ddc4Srjs        ".any", ".all"
419696c5ddc4Srjs    };
419796c5ddc4Srjs
419896c5ddc4Srjs    const char *combine = combine_table[_BITS(bits, 10, 1)];
419996c5ddc4Srjs
420096c5ddc4Srjs    fputs("+BRANCHC.i16", fp);
420196c5ddc4Srjs    fputs(combine, fp);
420296c5ddc4Srjs    fputs(" ", fp);
420396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
420496c5ddc4Srjs    fputs(", ", fp);
420596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
420696c5ddc4Srjs    fputs(lane0, fp);
420796c5ddc4Srjs    fputs(", ", fp);
420896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
420996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
421096c5ddc4Srjs}
421196c5ddc4Srjs
421296c5ddc4Srjsstatic void
421396c5ddc4Srjsbi_disasm_add_branchc_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
421496c5ddc4Srjs{
421596c5ddc4Srjs    static const char *combine_table[] = {
421696c5ddc4Srjs        ".any", ".all"
421796c5ddc4Srjs    };
421896c5ddc4Srjs
421996c5ddc4Srjs    const char *combine = combine_table[_BITS(bits, 10, 1)];
422096c5ddc4Srjs
422196c5ddc4Srjs    fputs("+BRANCHC.i32", fp);
422296c5ddc4Srjs    fputs(combine, fp);
422396c5ddc4Srjs    fputs(" ", fp);
422496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
422596c5ddc4Srjs    fputs(", ", fp);
422696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
422796c5ddc4Srjs    fputs(", ", fp);
422896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
422996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
423096c5ddc4Srjs}
423196c5ddc4Srjs
423296c5ddc4Srjsstatic void
423396c5ddc4Srjsbi_disasm_add_branchz_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
423496c5ddc4Srjs{
423596c5ddc4Srjs    static const char *cmpf_table[] = {
423696c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".ne", ".reserved", ".reserved", ".eq", ".eq", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".reserved", ".le", ".le", ".reserved", ".reserved", ".lt", ".lt", ".reserved"
423796c5ddc4Srjs    };
423896c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 3, 1) << 2) | (_BITS(bits, 9, 3) << 3)];
423996c5ddc4Srjs    static const char *widen0_table[] = {
424096c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved"
424196c5ddc4Srjs    };
424296c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 3, 1) << 2) | (_BITS(bits, 9, 3) << 3)];
424396c5ddc4Srjs    fputs("+BRANCHZ.f16", fp);
424496c5ddc4Srjs    fputs(cmpf, fp);
424596c5ddc4Srjs    fputs(" ", fp);
424696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
424796c5ddc4Srjs    fputs(", ", fp);
424896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
424996c5ddc4Srjs    fputs(widen0, fp);
425096c5ddc4Srjs    fputs(", ", fp);
425196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
425296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
425396c5ddc4Srjs}
425496c5ddc4Srjs
425596c5ddc4Srjsstatic void
425696c5ddc4Srjsbi_disasm_add_branchz_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
425796c5ddc4Srjs{
425896c5ddc4Srjs    static const char *cmpf_table[] = {
425996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".ne", ".eq", ".ge", ".gt", ".le", ".lt"
426096c5ddc4Srjs    };
426196c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 9, 3) << 1)];
426296c5ddc4Srjs    fputs("+BRANCHZ.f32", fp);
426396c5ddc4Srjs    fputs(cmpf, fp);
426496c5ddc4Srjs    fputs(" ", fp);
426596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
426696c5ddc4Srjs    fputs(", ", fp);
426796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
426896c5ddc4Srjs    fputs(", ", fp);
426996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
427096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
427196c5ddc4Srjs}
427296c5ddc4Srjs
427396c5ddc4Srjsstatic void
427496c5ddc4Srjsbi_disasm_add_branchz_i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
427596c5ddc4Srjs{
427696c5ddc4Srjs    static const char *cmpf_table[] = {
427796c5ddc4Srjs        ".reserved", ".ne", ".ne", ".reserved", ".reserved", ".eq", ".eq", ".reserved"
427896c5ddc4Srjs    };
427996c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 3, 1) << 2)];
428096c5ddc4Srjs    static const char *widen0_table[] = {
428196c5ddc4Srjs        ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved"
428296c5ddc4Srjs    };
428396c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 3, 1) << 2)];
428496c5ddc4Srjs    fputs("+BRANCHZ.i16", fp);
428596c5ddc4Srjs    fputs(cmpf, fp);
428696c5ddc4Srjs    fputs(" ", fp);
428796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
428896c5ddc4Srjs    fputs(", ", fp);
428996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
429096c5ddc4Srjs    fputs(widen0, fp);
429196c5ddc4Srjs    fputs(", ", fp);
429296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
429396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
429496c5ddc4Srjs}
429596c5ddc4Srjs
429696c5ddc4Srjsstatic void
429796c5ddc4Srjsbi_disasm_add_branchz_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
429896c5ddc4Srjs{
429996c5ddc4Srjs    static const char *cmpf_table[] = {
430096c5ddc4Srjs        ".ne", ".eq"
430196c5ddc4Srjs    };
430296c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 3, 1) << 0)];
430396c5ddc4Srjs    fputs("+BRANCHZ.i32", fp);
430496c5ddc4Srjs    fputs(cmpf, fp);
430596c5ddc4Srjs    fputs(" ", fp);
430696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
430796c5ddc4Srjs    fputs(", ", fp);
430896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
430996c5ddc4Srjs    fputs(", ", fp);
431096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
431196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
431296c5ddc4Srjs}
431396c5ddc4Srjs
431496c5ddc4Srjsstatic void
431596c5ddc4Srjsbi_disasm_add_branchz_s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
431696c5ddc4Srjs{
431796c5ddc4Srjs    static const char *cmpf_table[] = {
431896c5ddc4Srjs        ".reserved", ".lt", ".lt", ".reserved", ".reserved", ".le", ".le", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
431996c5ddc4Srjs    };
432096c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 9, 3) << 2)];
432196c5ddc4Srjs    static const char *widen0_table[] = {
432296c5ddc4Srjs        ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
432396c5ddc4Srjs    };
432496c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 9, 3) << 2)];
432596c5ddc4Srjs    fputs("+BRANCHZ.s16", fp);
432696c5ddc4Srjs    fputs(cmpf, fp);
432796c5ddc4Srjs    fputs(" ", fp);
432896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
432996c5ddc4Srjs    fputs(", ", fp);
433096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
433196c5ddc4Srjs    fputs(widen0, fp);
433296c5ddc4Srjs    fputs(", ", fp);
433396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
433496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
433596c5ddc4Srjs}
433696c5ddc4Srjs
433796c5ddc4Srjsstatic void
433896c5ddc4Srjsbi_disasm_add_branchz_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
433996c5ddc4Srjs{
434096c5ddc4Srjs    static const char *cmpf_table[] = {
434196c5ddc4Srjs        ".lt", ".le", ".ge", ".gt", ".reserved", ".reserved", ".reserved", ".reserved"
434296c5ddc4Srjs    };
434396c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 9, 3) << 0)];
434496c5ddc4Srjs    fputs("+BRANCHZ.s32", fp);
434596c5ddc4Srjs    fputs(cmpf, fp);
434696c5ddc4Srjs    fputs(" ", fp);
434796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
434896c5ddc4Srjs    fputs(", ", fp);
434996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
435096c5ddc4Srjs    fputs(", ", fp);
435196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
435296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
435396c5ddc4Srjs}
435496c5ddc4Srjs
435596c5ddc4Srjsstatic void
435696c5ddc4Srjsbi_disasm_add_branchz_u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
435796c5ddc4Srjs{
435896c5ddc4Srjs    static const char *cmpf_table[] = {
435996c5ddc4Srjs        ".reserved", ".lt", ".lt", ".reserved", ".reserved", ".le", ".le", ".reserved", ".reserved", ".ge", ".ge", ".reserved", ".reserved", ".gt", ".gt", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
436096c5ddc4Srjs    };
436196c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 9, 3) << 2)];
436296c5ddc4Srjs    static const char *widen0_table[] = {
436396c5ddc4Srjs        ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".h1", ".h0", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
436496c5ddc4Srjs    };
436596c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 4, 2) << 0) | (_BITS(bits, 9, 3) << 2)];
436696c5ddc4Srjs    fputs("+BRANCHZ.u16", fp);
436796c5ddc4Srjs    fputs(cmpf, fp);
436896c5ddc4Srjs    fputs(" ", fp);
436996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
437096c5ddc4Srjs    fputs(", ", fp);
437196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
437296c5ddc4Srjs    fputs(widen0, fp);
437396c5ddc4Srjs    fputs(", ", fp);
437496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
437596c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
437696c5ddc4Srjs}
437796c5ddc4Srjs
437896c5ddc4Srjsstatic void
437996c5ddc4Srjsbi_disasm_add_branchz_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
438096c5ddc4Srjs{
438196c5ddc4Srjs    static const char *cmpf_table[] = {
438296c5ddc4Srjs        ".lt", ".le", ".ge", ".gt", ".reserved", ".reserved", ".reserved", ".reserved"
438396c5ddc4Srjs    };
438496c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 9, 3) << 0)];
438596c5ddc4Srjs    fputs("+BRANCHZ.u32", fp);
438696c5ddc4Srjs    fputs(cmpf, fp);
438796c5ddc4Srjs    fputs(" ", fp);
438896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
438996c5ddc4Srjs    fputs(", ", fp);
439096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
439196c5ddc4Srjs    fputs(", ", fp);
439296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
439396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
439496c5ddc4Srjs}
439596c5ddc4Srjs
439696c5ddc4Srjsstatic void
439796c5ddc4Srjsbi_disasm_add_branch_diverg(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
439896c5ddc4Srjs{
439996c5ddc4Srjs    fputs("+BRANCH_DIVERG", fp);
440096c5ddc4Srjs    fputs(" ", fp);
440196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
440296c5ddc4Srjs    fputs(", ", fp);
440396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
440496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
440596c5ddc4Srjs}
440696c5ddc4Srjs
440796c5ddc4Srjsstatic void
440896c5ddc4Srjsbi_disasm_add_branch_lowbits_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
440996c5ddc4Srjs{
441096c5ddc4Srjs    fputs("+BRANCH_LOWBITS.f32", fp);
441196c5ddc4Srjs    fputs(" ", fp);
441296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
441396c5ddc4Srjs    fputs(", ", fp);
441496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
441596c5ddc4Srjs    fputs(", ", fp);
441696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
441796c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
441896c5ddc4Srjs}
441996c5ddc4Srjs
442096c5ddc4Srjsstatic void
442196c5ddc4Srjsbi_disasm_add_branch_no_diverg(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
442296c5ddc4Srjs{
442396c5ddc4Srjs    fputs("+BRANCH_NO_DIVERG", fp);
442496c5ddc4Srjs    fputs(" ", fp);
442596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
442696c5ddc4Srjs    fputs(", ", fp);
442796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
442896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
442996c5ddc4Srjs}
443096c5ddc4Srjs
443196c5ddc4Srjsstatic void
443296c5ddc4Srjsbi_disasm_add_clper_v6_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
443396c5ddc4Srjs{
443496c5ddc4Srjs    fputs("+CLPER_V6.i32", fp);
443596c5ddc4Srjs    fputs(" ", fp);
443696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
443796c5ddc4Srjs    fputs(", ", fp);
443896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
443996c5ddc4Srjs    if (!(0x7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
444096c5ddc4Srjs    fputs(", ", fp);
444196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
444296c5ddc4Srjs}
444396c5ddc4Srjs
444496c5ddc4Srjsstatic void
444596c5ddc4Srjsbi_disasm_add_clper_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
444696c5ddc4Srjs{
444796c5ddc4Srjs    static const char *lane_op_table[] = {
444896c5ddc4Srjs        "", ".xor", ".accumulate", ".shift"
444996c5ddc4Srjs    };
445096c5ddc4Srjs
445196c5ddc4Srjs    const char *lane_op = lane_op_table[_BITS(bits, 6, 2)];
445296c5ddc4Srjs
445396c5ddc4Srjs    static const char *subgroup_table[] = {
445496c5ddc4Srjs        ".subgroup2", ".subgroup4", ".subgroup8", ".reserved"
445596c5ddc4Srjs    };
445696c5ddc4Srjs
445796c5ddc4Srjs    const char *subgroup = subgroup_table[_BITS(bits, 8, 2)];
445896c5ddc4Srjs
445996c5ddc4Srjs    static const char *inactive_result_table[] = {
446096c5ddc4Srjs        ".zero", ".umax", ".i1", ".v2i1", ".smin", ".smax", ".v2smin", ".v2smax", ".v4smin", ".v4smax", ".f1", ".v2f1", ".infn", ".inf", ".v2infn", ".v2inf"
446196c5ddc4Srjs    };
446296c5ddc4Srjs
446396c5ddc4Srjs    const char *inactive_result = inactive_result_table[_BITS(bits, 10, 4)];
446496c5ddc4Srjs
446596c5ddc4Srjs    fputs("+CLPER.i32", fp);
446696c5ddc4Srjs    fputs(lane_op, fp);
446796c5ddc4Srjs    fputs(subgroup, fp);
446896c5ddc4Srjs    fputs(inactive_result, fp);
446996c5ddc4Srjs    fputs(" ", fp);
447096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
447196c5ddc4Srjs    fputs(", ", fp);
447296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
447396c5ddc4Srjs    if (!(0x7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
447496c5ddc4Srjs    fputs(", ", fp);
447596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
447696c5ddc4Srjs}
447796c5ddc4Srjs
447896c5ddc4Srjsstatic void
447996c5ddc4Srjsbi_disasm_add_cubeface2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
448096c5ddc4Srjs{
448196c5ddc4Srjs    fputs("+CUBEFACE2", fp);
448296c5ddc4Srjs    fputs(" ", fp);
448396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
448496c5ddc4Srjs    fputs(", ", fp);
448596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
448696c5ddc4Srjs}
448796c5ddc4Srjs
448896c5ddc4Srjsstatic void
448996c5ddc4Srjsbi_disasm_add_cube_ssel(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
449096c5ddc4Srjs{
449196c5ddc4Srjs    static const char *neg1_table[] = {
449296c5ddc4Srjs        "", ".neg"
449396c5ddc4Srjs    };
449496c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 9, 1) << 0)];
449596c5ddc4Srjs    static const char *neg0_table[] = {
449696c5ddc4Srjs        "", ".neg"
449796c5ddc4Srjs    };
449896c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 9, 1) << 0)];
449996c5ddc4Srjs    fputs("+CUBE_SSEL", fp);
450096c5ddc4Srjs    fputs(" ", fp);
450196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
450296c5ddc4Srjs    fputs(", ", fp);
450396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
450496c5ddc4Srjs    fputs(neg0, fp);
450596c5ddc4Srjs    fputs(", ", fp);
450696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
450796c5ddc4Srjs    fputs(neg1, fp);
450896c5ddc4Srjs    fputs(", ", fp);
450996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
451096c5ddc4Srjs}
451196c5ddc4Srjs
451296c5ddc4Srjsstatic void
451396c5ddc4Srjsbi_disasm_add_cube_tsel(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
451496c5ddc4Srjs{
451596c5ddc4Srjs    static const char *neg1_table[] = {
451696c5ddc4Srjs        "", ".neg"
451796c5ddc4Srjs    };
451896c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 9, 1) << 0)];
451996c5ddc4Srjs    static const char *neg0_table[] = {
452096c5ddc4Srjs        "", ".neg"
452196c5ddc4Srjs    };
452296c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 9, 1) << 0)];
452396c5ddc4Srjs    fputs("+CUBE_TSEL", fp);
452496c5ddc4Srjs    fputs(" ", fp);
452596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
452696c5ddc4Srjs    fputs(", ", fp);
452796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
452896c5ddc4Srjs    fputs(neg0, fp);
452996c5ddc4Srjs    fputs(", ", fp);
453096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
453196c5ddc4Srjs    fputs(neg1, fp);
453296c5ddc4Srjs    fputs(", ", fp);
453396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
453496c5ddc4Srjs}
453596c5ddc4Srjs
453696c5ddc4Srjsstatic void
453796c5ddc4Srjsbi_disasm_add_discard_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
453896c5ddc4Srjs{
453996c5ddc4Srjs    static const char *cmpf_table[] = {
454096c5ddc4Srjs        ".eq", ".ne", ".lt", ".le", ".eq", ".ne", ".lt", ".le", ".eq", ".ne", ".lt", ".le", ".eq", ".ne", ".lt", ".le", ".eq", ".ne", ".lt", ".le", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
454196c5ddc4Srjs    };
454296c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 6, 2) << 0) | (_BITS(bits, 8, 3) << 2)];
454396c5ddc4Srjs    static const char *widen1_table[] = {
454496c5ddc4Srjs        ".h0", ".h0", ".h0", ".h0", ".h0", ".h0", ".h0", ".h0", ".h1", ".h1", ".h1", ".h1", ".h1", ".h1", ".h1", ".h1", "", "", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
454596c5ddc4Srjs    };
454696c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 6, 2) << 0) | (_BITS(bits, 8, 3) << 2)];
454796c5ddc4Srjs    static const char *widen0_table[] = {
454896c5ddc4Srjs        ".h0", ".h0", ".h0", ".h0", ".h1", ".h1", ".h1", ".h1", ".h0", ".h0", ".h0", ".h0", ".h1", ".h1", ".h1", ".h1", "", "", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
454996c5ddc4Srjs    };
455096c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 6, 2) << 0) | (_BITS(bits, 8, 3) << 2)];
455196c5ddc4Srjs    fputs("+DISCARD.f32", fp);
455296c5ddc4Srjs    fputs(cmpf, fp);
455396c5ddc4Srjs    fputs(" ", fp);
455496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
455596c5ddc4Srjs    fputs(", ", fp);
455696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
455796c5ddc4Srjs    fputs(widen0, fp);
455896c5ddc4Srjs    fputs(", ", fp);
455996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
456096c5ddc4Srjs    fputs(widen1, fp);
456196c5ddc4Srjs}
456296c5ddc4Srjs
456396c5ddc4Srjsstatic void
456496c5ddc4Srjsbi_disasm_add_doorbell(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
456596c5ddc4Srjs{
456696c5ddc4Srjs    fputs("+DOORBELL", fp);
456796c5ddc4Srjs    fputs(" ", fp);
456896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
456996c5ddc4Srjs    fputs(", ", fp);
457096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
457196c5ddc4Srjs}
457296c5ddc4Srjs
457396c5ddc4Srjsstatic void
457496c5ddc4Srjsbi_disasm_add_eureka(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
457596c5ddc4Srjs{
457696c5ddc4Srjs    fputs("+EUREKA", fp);
457796c5ddc4Srjs    fputs(" ", fp);
457896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
457996c5ddc4Srjs    fputs(", ", fp);
458096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
458196c5ddc4Srjs}
458296c5ddc4Srjs
458396c5ddc4Srjsstatic void
458496c5ddc4Srjsbi_disasm_add_f16_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
458596c5ddc4Srjs{
458696c5ddc4Srjs    static const char *lane0_table[] = {
458796c5ddc4Srjs        "", ".h1"
458896c5ddc4Srjs    };
458996c5ddc4Srjs
459096c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 3, 1)];
459196c5ddc4Srjs
459296c5ddc4Srjs    fputs("+F16_TO_F32", fp);
459396c5ddc4Srjs    fputs(" ", fp);
459496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
459596c5ddc4Srjs    fputs(", ", fp);
459696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
459796c5ddc4Srjs    fputs(lane0, fp);
459896c5ddc4Srjs}
459996c5ddc4Srjs
460096c5ddc4Srjsstatic void
460196c5ddc4Srjsbi_disasm_add_f16_to_s32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
460296c5ddc4Srjs{
460396c5ddc4Srjs    static const char *round_table[] = {
460496c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
460596c5ddc4Srjs    };
460696c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
460796c5ddc4Srjs    static const char *lane0_table[] = {
460896c5ddc4Srjs        "", ".h1"
460996c5ddc4Srjs    };
461096c5ddc4Srjs
461196c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
461296c5ddc4Srjs
461396c5ddc4Srjs    fputs("+F16_TO_S32", fp);
461496c5ddc4Srjs    fputs(round, fp);
461596c5ddc4Srjs    fputs(" ", fp);
461696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
461796c5ddc4Srjs    fputs(", ", fp);
461896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
461996c5ddc4Srjs    fputs(lane0, fp);
462096c5ddc4Srjs}
462196c5ddc4Srjs
462296c5ddc4Srjsstatic void
462396c5ddc4Srjsbi_disasm_add_f16_to_s32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
462496c5ddc4Srjs{
462596c5ddc4Srjs    static const char *round_table[] = {
462696c5ddc4Srjs        ".rtna"
462796c5ddc4Srjs    };
462896c5ddc4Srjs    const char *round = round_table[0];
462996c5ddc4Srjs    static const char *lane0_table[] = {
463096c5ddc4Srjs        "", ".h1"
463196c5ddc4Srjs    };
463296c5ddc4Srjs
463396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 5, 1)];
463496c5ddc4Srjs
463596c5ddc4Srjs    fputs("+F16_TO_S32", fp);
463696c5ddc4Srjs    fputs(round, fp);
463796c5ddc4Srjs    fputs(" ", fp);
463896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
463996c5ddc4Srjs    fputs(", ", fp);
464096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
464196c5ddc4Srjs    fputs(lane0, fp);
464296c5ddc4Srjs}
464396c5ddc4Srjs
464496c5ddc4Srjsstatic void
464596c5ddc4Srjsbi_disasm_add_f16_to_u32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
464696c5ddc4Srjs{
464796c5ddc4Srjs    static const char *round_table[] = {
464896c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
464996c5ddc4Srjs    };
465096c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
465196c5ddc4Srjs    static const char *lane0_table[] = {
465296c5ddc4Srjs        "", ".h1"
465396c5ddc4Srjs    };
465496c5ddc4Srjs
465596c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
465696c5ddc4Srjs
465796c5ddc4Srjs    fputs("+F16_TO_U32", fp);
465896c5ddc4Srjs    fputs(round, fp);
465996c5ddc4Srjs    fputs(" ", fp);
466096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
466196c5ddc4Srjs    fputs(", ", fp);
466296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
466396c5ddc4Srjs    fputs(lane0, fp);
466496c5ddc4Srjs}
466596c5ddc4Srjs
466696c5ddc4Srjsstatic void
466796c5ddc4Srjsbi_disasm_add_f16_to_u32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
466896c5ddc4Srjs{
466996c5ddc4Srjs    static const char *round_table[] = {
467096c5ddc4Srjs        ".rtna"
467196c5ddc4Srjs    };
467296c5ddc4Srjs    const char *round = round_table[0];
467396c5ddc4Srjs    static const char *lane0_table[] = {
467496c5ddc4Srjs        "", ".h1"
467596c5ddc4Srjs    };
467696c5ddc4Srjs
467796c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 5, 1)];
467896c5ddc4Srjs
467996c5ddc4Srjs    fputs("+F16_TO_U32", fp);
468096c5ddc4Srjs    fputs(round, fp);
468196c5ddc4Srjs    fputs(" ", fp);
468296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
468396c5ddc4Srjs    fputs(", ", fp);
468496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
468596c5ddc4Srjs    fputs(lane0, fp);
468696c5ddc4Srjs}
468796c5ddc4Srjs
468896c5ddc4Srjsstatic void
468996c5ddc4Srjsbi_disasm_add_f32_to_s32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
469096c5ddc4Srjs{
469196c5ddc4Srjs    static const char *round_table[] = {
469296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
469396c5ddc4Srjs    };
469496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
469596c5ddc4Srjs    fputs("+F32_TO_S32", fp);
469696c5ddc4Srjs    fputs(round, fp);
469796c5ddc4Srjs    fputs(" ", fp);
469896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
469996c5ddc4Srjs    fputs(", ", fp);
470096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
470196c5ddc4Srjs}
470296c5ddc4Srjs
470396c5ddc4Srjsstatic void
470496c5ddc4Srjsbi_disasm_add_f32_to_s32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
470596c5ddc4Srjs{
470696c5ddc4Srjs    static const char *round_table[] = {
470796c5ddc4Srjs        ".rtna"
470896c5ddc4Srjs    };
470996c5ddc4Srjs    const char *round = round_table[0];
471096c5ddc4Srjs    fputs("+F32_TO_S32", fp);
471196c5ddc4Srjs    fputs(round, fp);
471296c5ddc4Srjs    fputs(" ", fp);
471396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
471496c5ddc4Srjs    fputs(", ", fp);
471596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
471696c5ddc4Srjs}
471796c5ddc4Srjs
471896c5ddc4Srjsstatic void
471996c5ddc4Srjsbi_disasm_add_f32_to_u32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
472096c5ddc4Srjs{
472196c5ddc4Srjs    static const char *round_table[] = {
472296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
472396c5ddc4Srjs    };
472496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
472596c5ddc4Srjs    fputs("+F32_TO_U32", fp);
472696c5ddc4Srjs    fputs(round, fp);
472796c5ddc4Srjs    fputs(" ", fp);
472896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
472996c5ddc4Srjs    fputs(", ", fp);
473096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
473196c5ddc4Srjs}
473296c5ddc4Srjs
473396c5ddc4Srjsstatic void
473496c5ddc4Srjsbi_disasm_add_f32_to_u32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
473596c5ddc4Srjs{
473696c5ddc4Srjs    static const char *round_table[] = {
473796c5ddc4Srjs        ".rtna"
473896c5ddc4Srjs    };
473996c5ddc4Srjs    const char *round = round_table[0];
474096c5ddc4Srjs    fputs("+F32_TO_U32", fp);
474196c5ddc4Srjs    fputs(round, fp);
474296c5ddc4Srjs    fputs(" ", fp);
474396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
474496c5ddc4Srjs    fputs(", ", fp);
474596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
474696c5ddc4Srjs}
474796c5ddc4Srjs
474896c5ddc4Srjsstatic void
474996c5ddc4Srjsbi_disasm_add_fadd_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
475096c5ddc4Srjs{
475196c5ddc4Srjs    static const char *round_table[] = {
475296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz", "", ".rtp", ".rtn", ".rtz", "", ".rtp", ".rtn", ".rtz", "", ".rtp", ".rtn", ".rtz"
475396c5ddc4Srjs    };
475496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 13, 2) << 0) | (_BITS(bits, 9, 2) << 2)];
475596c5ddc4Srjs    static const char *widen1_table[] = {
475696c5ddc4Srjs        "", "", "", "", ".h0", ".h0", ".h0", ".h0", ".h1", ".h1", ".h1", ".h1", ".h0", ".h0", ".h0", ".h0"
475796c5ddc4Srjs    };
475896c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 13, 2) << 0) | (_BITS(bits, 9, 2) << 2)];
475996c5ddc4Srjs    static const char *widen0_table[] = {
476096c5ddc4Srjs        "", "", "", "", "", "", "", "", "", "", "", "", ".h0", ".h0", ".h0", ".h0"
476196c5ddc4Srjs    };
476296c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 13, 2) << 0) | (_BITS(bits, 9, 2) << 2)];
476396c5ddc4Srjs    static const char *abs1_table[] = {
476496c5ddc4Srjs        "", ".abs"
476596c5ddc4Srjs    };
476696c5ddc4Srjs
476796c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
476896c5ddc4Srjs
476996c5ddc4Srjs    static const char *neg0_table[] = {
477096c5ddc4Srjs        "", ".neg"
477196c5ddc4Srjs    };
477296c5ddc4Srjs
477396c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
477496c5ddc4Srjs
477596c5ddc4Srjs    static const char *neg1_table[] = {
477696c5ddc4Srjs        "", ".neg"
477796c5ddc4Srjs    };
477896c5ddc4Srjs
477996c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
478096c5ddc4Srjs
478196c5ddc4Srjs    static const char *clamp_table[] = {
478296c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
478396c5ddc4Srjs    };
478496c5ddc4Srjs
478596c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 11, 2)];
478696c5ddc4Srjs
478796c5ddc4Srjs    static const char *abs0_table[] = {
478896c5ddc4Srjs        "", ".abs"
478996c5ddc4Srjs    };
479096c5ddc4Srjs
479196c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
479296c5ddc4Srjs
479396c5ddc4Srjs    fputs("+FADD.f32", fp);
479496c5ddc4Srjs    fputs(round, fp);
479596c5ddc4Srjs    fputs(clamp, fp);
479696c5ddc4Srjs    fputs(" ", fp);
479796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
479896c5ddc4Srjs    fputs(", ", fp);
479996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
480096c5ddc4Srjs    fputs(neg0, fp);
480196c5ddc4Srjs    fputs(abs0, fp);
480296c5ddc4Srjs    fputs(widen0, fp);
480396c5ddc4Srjs    fputs(", ", fp);
480496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
480596c5ddc4Srjs    fputs(abs1, fp);
480696c5ddc4Srjs    fputs(neg1, fp);
480796c5ddc4Srjs    fputs(widen1, fp);
480896c5ddc4Srjs}
480996c5ddc4Srjs
481096c5ddc4Srjsstatic void
481196c5ddc4Srjsbi_disasm_add_fadd_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
481296c5ddc4Srjs{
481396c5ddc4Srjs    static const char *abs0_table[] = {
481496c5ddc4Srjs        ""
481596c5ddc4Srjs    };
481696c5ddc4Srjs    const char *abs0 = abs0_table[0];
481796c5ddc4Srjs    static const char *round_table[] = {
481896c5ddc4Srjs        ".rto"
481996c5ddc4Srjs    };
482096c5ddc4Srjs    const char *round = round_table[0];
482196c5ddc4Srjs    static const char *clamp_table[] = {
482296c5ddc4Srjs        ""
482396c5ddc4Srjs    };
482496c5ddc4Srjs    const char *clamp = clamp_table[0];
482596c5ddc4Srjs    static const char *widen1_table[] = {
482696c5ddc4Srjs        ""
482796c5ddc4Srjs    };
482896c5ddc4Srjs    const char *widen1 = widen1_table[0];
482996c5ddc4Srjs    static const char *neg1_table[] = {
483096c5ddc4Srjs        ""
483196c5ddc4Srjs    };
483296c5ddc4Srjs    const char *neg1 = neg1_table[0];
483396c5ddc4Srjs    static const char *neg0_table[] = {
483496c5ddc4Srjs        ""
483596c5ddc4Srjs    };
483696c5ddc4Srjs    const char *neg0 = neg0_table[0];
483796c5ddc4Srjs    static const char *abs1_table[] = {
483896c5ddc4Srjs        ""
483996c5ddc4Srjs    };
484096c5ddc4Srjs    const char *abs1 = abs1_table[0];
484196c5ddc4Srjs    static const char *widen0_table[] = {
484296c5ddc4Srjs        ""
484396c5ddc4Srjs    };
484496c5ddc4Srjs    const char *widen0 = widen0_table[0];
484596c5ddc4Srjs    fputs("+FADD.f32", fp);
484696c5ddc4Srjs    fputs(round, fp);
484796c5ddc4Srjs    fputs(clamp, fp);
484896c5ddc4Srjs    fputs(" ", fp);
484996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
485096c5ddc4Srjs    fputs(", ", fp);
485196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
485296c5ddc4Srjs    fputs(neg0, fp);
485396c5ddc4Srjs    fputs(abs0, fp);
485496c5ddc4Srjs    fputs(widen0, fp);
485596c5ddc4Srjs    fputs(", ", fp);
485696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
485796c5ddc4Srjs    fputs(abs1, fp);
485896c5ddc4Srjs    fputs(neg1, fp);
485996c5ddc4Srjs    fputs(widen1, fp);
486096c5ddc4Srjs}
486196c5ddc4Srjs
486296c5ddc4Srjsstatic void
486396c5ddc4Srjsbi_disasm_add_fadd_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
486496c5ddc4Srjs{
486596c5ddc4Srjs    static const char *abs1_table[] = {
486696c5ddc4Srjs        "", ".abs"
486796c5ddc4Srjs    };
486896c5ddc4Srjs
486996c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
487096c5ddc4Srjs
487196c5ddc4Srjs    static const char *neg0_table[] = {
487296c5ddc4Srjs        "", ".neg"
487396c5ddc4Srjs    };
487496c5ddc4Srjs
487596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
487696c5ddc4Srjs
487796c5ddc4Srjs    static const char *neg1_table[] = {
487896c5ddc4Srjs        "", ".neg"
487996c5ddc4Srjs    };
488096c5ddc4Srjs
488196c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
488296c5ddc4Srjs
488396c5ddc4Srjs    static const char *swz0_table[] = {
488496c5ddc4Srjs        ".h00", ".h10", "", ".h11"
488596c5ddc4Srjs    };
488696c5ddc4Srjs
488796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
488896c5ddc4Srjs
488996c5ddc4Srjs    static const char *swz1_table[] = {
489096c5ddc4Srjs        ".h00", ".h10", "", ".h11"
489196c5ddc4Srjs    };
489296c5ddc4Srjs
489396c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
489496c5ddc4Srjs
489596c5ddc4Srjs    static const char *round_table[] = {
489696c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
489796c5ddc4Srjs    };
489896c5ddc4Srjs
489996c5ddc4Srjs    const char *round = round_table[_BITS(bits, 13, 2)];
490096c5ddc4Srjs
490196c5ddc4Srjs    static const char *abs0_table[] = {
490296c5ddc4Srjs        "", ".abs"
490396c5ddc4Srjs    };
490496c5ddc4Srjs
490596c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
490696c5ddc4Srjs
490796c5ddc4Srjs    fputs("+FADD.v2f16", fp);
490896c5ddc4Srjs    fputs(round, fp);
490996c5ddc4Srjs    fputs(" ", fp);
491096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
491196c5ddc4Srjs    fputs(", ", fp);
491296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
491396c5ddc4Srjs    fputs(neg0, fp);
491496c5ddc4Srjs    fputs(swz0, fp);
491596c5ddc4Srjs    fputs(abs0, fp);
491696c5ddc4Srjs    fputs(", ", fp);
491796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
491896c5ddc4Srjs    fputs(abs1, fp);
491996c5ddc4Srjs    fputs(neg1, fp);
492096c5ddc4Srjs    fputs(swz1, fp);
492196c5ddc4Srjs}
492296c5ddc4Srjs
492396c5ddc4Srjsstatic void
492496c5ddc4Srjsbi_disasm_add_fadd_rscale_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
492596c5ddc4Srjs{
492696c5ddc4Srjs    static const char *round_table[] = {
492796c5ddc4Srjs        "", ".reserved", "", ".rtna", "", ".rtp", ".rtn", ".rtz"
492896c5ddc4Srjs    };
492996c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 9, 3) << 0)];
493096c5ddc4Srjs    static const char *special_table[] = {
493196c5ddc4Srjs        "", ".reserved", "", ".n", ".n", ".n", ".n", ".n"
493296c5ddc4Srjs    };
493396c5ddc4Srjs    const char *special = special_table[(_BITS(bits, 9, 3) << 0)];
493496c5ddc4Srjs    static const char *clamp_table[] = {
493596c5ddc4Srjs        "", ".reserved", ".clamp_0_1", "", "", "", "", ""
493696c5ddc4Srjs    };
493796c5ddc4Srjs    const char *clamp = clamp_table[(_BITS(bits, 9, 3) << 0)];
493896c5ddc4Srjs    static const char *abs1_table[] = {
493996c5ddc4Srjs        "", ".abs"
494096c5ddc4Srjs    };
494196c5ddc4Srjs
494296c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 12, 1)];
494396c5ddc4Srjs
494496c5ddc4Srjs    static const char *neg0_table[] = {
494596c5ddc4Srjs        "", ".neg"
494696c5ddc4Srjs    };
494796c5ddc4Srjs
494896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 13, 1)];
494996c5ddc4Srjs
495096c5ddc4Srjs    static const char *neg1_table[] = {
495196c5ddc4Srjs        "", ".neg"
495296c5ddc4Srjs    };
495396c5ddc4Srjs
495496c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 14, 1)];
495596c5ddc4Srjs
495696c5ddc4Srjs    static const char *abs0_table[] = {
495796c5ddc4Srjs        "", ".abs"
495896c5ddc4Srjs    };
495996c5ddc4Srjs
496096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 16, 1)];
496196c5ddc4Srjs
496296c5ddc4Srjs    fputs("+FADD_RSCALE.f32", fp);
496396c5ddc4Srjs    fputs(clamp, fp);
496496c5ddc4Srjs    fputs(special, fp);
496596c5ddc4Srjs    fputs(round, fp);
496696c5ddc4Srjs    fputs(" ", fp);
496796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
496896c5ddc4Srjs    fputs(", ", fp);
496996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
497096c5ddc4Srjs    fputs(neg0, fp);
497196c5ddc4Srjs    fputs(abs0, fp);
497296c5ddc4Srjs    fputs(", ", fp);
497396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
497496c5ddc4Srjs    fputs(abs1, fp);
497596c5ddc4Srjs    fputs(neg1, fp);
497696c5ddc4Srjs    fputs(", ", fp);
497796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
497896c5ddc4Srjs}
497996c5ddc4Srjs
498096c5ddc4Srjsstatic void
498196c5ddc4Srjsbi_disasm_add_fatan_assist_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
498296c5ddc4Srjs{
498396c5ddc4Srjs    static const char *lane1_table[] = {
498496c5ddc4Srjs        "", ".h1"
498596c5ddc4Srjs    };
498696c5ddc4Srjs
498796c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 6, 1)];
498896c5ddc4Srjs
498996c5ddc4Srjs    static const char *lane0_table[] = {
499096c5ddc4Srjs        "", ".h1"
499196c5ddc4Srjs    };
499296c5ddc4Srjs
499396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
499496c5ddc4Srjs
499596c5ddc4Srjs    fputs("+FATAN_ASSIST.f16", fp);
499696c5ddc4Srjs    fputs(" ", fp);
499796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
499896c5ddc4Srjs    fputs(", ", fp);
499996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
500096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
500196c5ddc4Srjs    fputs(lane0, fp);
500296c5ddc4Srjs    fputs(", ", fp);
500396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
500496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
500596c5ddc4Srjs    fputs(lane1, fp);
500696c5ddc4Srjs}
500796c5ddc4Srjs
500896c5ddc4Srjsstatic void
500996c5ddc4Srjsbi_disasm_add_fatan_assist_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
501096c5ddc4Srjs{
501196c5ddc4Srjs    fputs("+FATAN_ASSIST.f32", fp);
501296c5ddc4Srjs    fputs(" ", fp);
501396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
501496c5ddc4Srjs    fputs(", ", fp);
501596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
501696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
501796c5ddc4Srjs    fputs(", ", fp);
501896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
501996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
502096c5ddc4Srjs}
502196c5ddc4Srjs
502296c5ddc4Srjsstatic void
502396c5ddc4Srjsbi_disasm_add_fatan_table_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
502496c5ddc4Srjs{
502596c5ddc4Srjs    static const char *lane1_table[] = {
502696c5ddc4Srjs        "", ".h1"
502796c5ddc4Srjs    };
502896c5ddc4Srjs
502996c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 6, 1)];
503096c5ddc4Srjs
503196c5ddc4Srjs    static const char *lane0_table[] = {
503296c5ddc4Srjs        "", ".h1"
503396c5ddc4Srjs    };
503496c5ddc4Srjs
503596c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
503696c5ddc4Srjs
503796c5ddc4Srjs    fputs("+FATAN_TABLE.f16", fp);
503896c5ddc4Srjs    fputs(" ", fp);
503996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
504096c5ddc4Srjs    fputs(", ", fp);
504196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
504296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
504396c5ddc4Srjs    fputs(lane0, fp);
504496c5ddc4Srjs    fputs(", ", fp);
504596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
504696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
504796c5ddc4Srjs    fputs(lane1, fp);
504896c5ddc4Srjs}
504996c5ddc4Srjs
505096c5ddc4Srjsstatic void
505196c5ddc4Srjsbi_disasm_add_fatan_table_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
505296c5ddc4Srjs{
505396c5ddc4Srjs    fputs("+FATAN_TABLE.f32", fp);
505496c5ddc4Srjs    fputs(" ", fp);
505596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
505696c5ddc4Srjs    fputs(", ", fp);
505796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
505896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
505996c5ddc4Srjs    fputs(", ", fp);
506096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
506196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
506296c5ddc4Srjs}
506396c5ddc4Srjs
506496c5ddc4Srjsstatic void
506596c5ddc4Srjsbi_disasm_add_fcmp_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
506696c5ddc4Srjs{
506796c5ddc4Srjs    static const char *neg1_table[] = {
506896c5ddc4Srjs        "", "", "", "", "", "", "", ""
506996c5ddc4Srjs    };
507096c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 13, 1) << 2)];
507196c5ddc4Srjs    static const char *neg0_table[] = {
507296c5ddc4Srjs        "", "", "", "", ".neg", ".neg", ".neg", ".neg"
507396c5ddc4Srjs    };
507496c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 13, 1) << 2)];
507596c5ddc4Srjs    static const char *widen1_table[] = {
507696c5ddc4Srjs        "", ".h0", ".h1", ".h0", "", ".h0", ".h1", ".h0"
507796c5ddc4Srjs    };
507896c5ddc4Srjs    const char *widen1 = widen1_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 13, 1) << 2)];
507996c5ddc4Srjs    static const char *widen0_table[] = {
508096c5ddc4Srjs        "", "", "", ".h0", "", "", "", ".h0"
508196c5ddc4Srjs    };
508296c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 9, 2) << 0) | (_BITS(bits, 13, 1) << 2)];
508396c5ddc4Srjs    static const char *cmpf_table[] = {
508496c5ddc4Srjs        ".eq", ".gt", ".ge", ".ne", ".lt", ".le", ".gtlt", ".total"
508596c5ddc4Srjs    };
508696c5ddc4Srjs
508796c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 3)];
508896c5ddc4Srjs
508996c5ddc4Srjs    static const char *abs0_table[] = {
509096c5ddc4Srjs        "", ".abs"
509196c5ddc4Srjs    };
509296c5ddc4Srjs
509396c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 11, 1)];
509496c5ddc4Srjs
509596c5ddc4Srjs    static const char *abs1_table[] = {
509696c5ddc4Srjs        "", ".abs"
509796c5ddc4Srjs    };
509896c5ddc4Srjs
509996c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 12, 1)];
510096c5ddc4Srjs
510196c5ddc4Srjs    static const char *result_type_table[] = {
510296c5ddc4Srjs        "", ".f1", ".m1", ".reserved"
510396c5ddc4Srjs    };
510496c5ddc4Srjs
510596c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 14, 2)];
510696c5ddc4Srjs
510796c5ddc4Srjs    fputs("+FCMP.f32", fp);
510896c5ddc4Srjs    fputs(cmpf, fp);
510996c5ddc4Srjs    fputs(result_type, fp);
511096c5ddc4Srjs    fputs(" ", fp);
511196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
511296c5ddc4Srjs    fputs(", ", fp);
511396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
511496c5ddc4Srjs    fputs(widen0, fp);
511596c5ddc4Srjs    fputs(neg0, fp);
511696c5ddc4Srjs    fputs(abs0, fp);
511796c5ddc4Srjs    fputs(", ", fp);
511896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
511996c5ddc4Srjs    fputs(widen1, fp);
512096c5ddc4Srjs    fputs(neg1, fp);
512196c5ddc4Srjs    fputs(abs1, fp);
512296c5ddc4Srjs}
512396c5ddc4Srjs
512496c5ddc4Srjsstatic void
512596c5ddc4Srjsbi_disasm_add_fcmp_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
512696c5ddc4Srjs{
512796c5ddc4Srjs    static const char *neg1_table[] = {
512896c5ddc4Srjs        "", ""
512996c5ddc4Srjs    };
513096c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 13, 1) << 0)];
513196c5ddc4Srjs    static const char *neg0_table[] = {
513296c5ddc4Srjs        "", ".neg"
513396c5ddc4Srjs    };
513496c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 13, 1) << 0)];
513596c5ddc4Srjs    static const char *cmpf_table[] = {
513696c5ddc4Srjs        ".eq", ".gt", ".ge", ".ne", ".lt", ".le", ".gtlt", ".total"
513796c5ddc4Srjs    };
513896c5ddc4Srjs
513996c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 3)];
514096c5ddc4Srjs
514196c5ddc4Srjs    static const char *swz0_table[] = {
514296c5ddc4Srjs        ".h00", ".h10", "", ".h11"
514396c5ddc4Srjs    };
514496c5ddc4Srjs
514596c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
514696c5ddc4Srjs
514796c5ddc4Srjs    static const char *swz1_table[] = {
514896c5ddc4Srjs        ".h00", ".h10", "", ".h11"
514996c5ddc4Srjs    };
515096c5ddc4Srjs
515196c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
515296c5ddc4Srjs
515396c5ddc4Srjs    static const char *result_type_table[] = {
515496c5ddc4Srjs        "", ".f1", ".m1", ".reserved"
515596c5ddc4Srjs    };
515696c5ddc4Srjs
515796c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 14, 2)];
515896c5ddc4Srjs
515996c5ddc4Srjs    fputs("+FCMP.v2f16", fp);
516096c5ddc4Srjs    fputs(cmpf, fp);
516196c5ddc4Srjs    fputs(result_type, fp);
516296c5ddc4Srjs    fputs(" ", fp);
516396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
516496c5ddc4Srjs    fputs(", ", fp);
516596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
516696c5ddc4Srjs    fputs(neg0, fp);
516796c5ddc4Srjs    fputs(swz0, fp);
516896c5ddc4Srjs    fputs(", ", fp);
516996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
517096c5ddc4Srjs    fputs(neg1, fp);
517196c5ddc4Srjs    fputs(swz1, fp);
517296c5ddc4Srjs}
517396c5ddc4Srjs
517496c5ddc4Srjsstatic void
517596c5ddc4Srjsbi_disasm_add_fcos_table_u6(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
517696c5ddc4Srjs{
517796c5ddc4Srjs    static const char *offset_table[] = {
517896c5ddc4Srjs        "", ".offset"
517996c5ddc4Srjs    };
518096c5ddc4Srjs
518196c5ddc4Srjs    const char *offset = offset_table[_BITS(bits, 4, 1)];
518296c5ddc4Srjs
518396c5ddc4Srjs    fputs("+FCOS_TABLE.u6", fp);
518496c5ddc4Srjs    fputs(offset, fp);
518596c5ddc4Srjs    fputs(" ", fp);
518696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
518796c5ddc4Srjs    fputs(", ", fp);
518896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
518996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
519096c5ddc4Srjs}
519196c5ddc4Srjs
519296c5ddc4Srjsstatic void
519396c5ddc4Srjsbi_disasm_add_fexp_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
519496c5ddc4Srjs{
519596c5ddc4Srjs    fputs("+FEXP.f32", fp);
519696c5ddc4Srjs    fputs(" ", fp);
519796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
519896c5ddc4Srjs    fputs(", ", fp);
519996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
520096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
520196c5ddc4Srjs    fputs(", ", fp);
520296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
520396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
520496c5ddc4Srjs}
520596c5ddc4Srjs
520696c5ddc4Srjsstatic void
520796c5ddc4Srjsbi_disasm_add_fexp_table_u4(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
520896c5ddc4Srjs{
520996c5ddc4Srjs    static const char *adj_table[] = {
521096c5ddc4Srjs        "", ".small", ".low", ".reserved"
521196c5ddc4Srjs    };
521296c5ddc4Srjs
521396c5ddc4Srjs    const char *adj = adj_table[_BITS(bits, 3, 2)];
521496c5ddc4Srjs
521596c5ddc4Srjs    fputs("+FEXP_TABLE.u4", fp);
521696c5ddc4Srjs    fputs(adj, fp);
521796c5ddc4Srjs    fputs(" ", fp);
521896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
521996c5ddc4Srjs    fputs(", ", fp);
522096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
522196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
522296c5ddc4Srjs}
522396c5ddc4Srjs
522496c5ddc4Srjsstatic void
522596c5ddc4Srjsbi_disasm_add_flogd_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
522696c5ddc4Srjs{
522796c5ddc4Srjs    fputs("+FLOGD.f32", fp);
522896c5ddc4Srjs    fputs(" ", fp);
522996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
523096c5ddc4Srjs    fputs(", ", fp);
523196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
523296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
523396c5ddc4Srjs}
523496c5ddc4Srjs
523596c5ddc4Srjsstatic void
523696c5ddc4Srjsbi_disasm_add_flog_table_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
523796c5ddc4Srjs{
523896c5ddc4Srjs    static const char *precision_table[] = {
523996c5ddc4Srjs        ""
524096c5ddc4Srjs    };
524196c5ddc4Srjs    const char *precision = precision_table[0];
524296c5ddc4Srjs    static const char *mode_table[] = {
524396c5ddc4Srjs        ".red"
524496c5ddc4Srjs    };
524596c5ddc4Srjs    const char *mode = mode_table[0];
524696c5ddc4Srjs    static const char *widen0_table[] = {
524796c5ddc4Srjs        ""
524896c5ddc4Srjs    };
524996c5ddc4Srjs    const char *widen0 = widen0_table[0];
525096c5ddc4Srjs    static const char *neg0_table[] = {
525196c5ddc4Srjs        "", ".neg"
525296c5ddc4Srjs    };
525396c5ddc4Srjs
525496c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
525596c5ddc4Srjs
525696c5ddc4Srjs    static const char *abs0_table[] = {
525796c5ddc4Srjs        "", ".abs"
525896c5ddc4Srjs    };
525996c5ddc4Srjs
526096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
526196c5ddc4Srjs
526296c5ddc4Srjs    static const char *divzero_table[] = {
526396c5ddc4Srjs        "", ".divzero"
526496c5ddc4Srjs    };
526596c5ddc4Srjs
526696c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
526796c5ddc4Srjs
526896c5ddc4Srjs    fputs("+FLOG_TABLE.f32", fp);
526996c5ddc4Srjs    fputs(mode, fp);
527096c5ddc4Srjs    fputs(precision, fp);
527196c5ddc4Srjs    fputs(divzero, fp);
527296c5ddc4Srjs    fputs(" ", fp);
527396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
527496c5ddc4Srjs    fputs(", ", fp);
527596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
527696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
527796c5ddc4Srjs    fputs(widen0, fp);
527896c5ddc4Srjs    fputs(neg0, fp);
527996c5ddc4Srjs    fputs(abs0, fp);
528096c5ddc4Srjs}
528196c5ddc4Srjs
528296c5ddc4Srjsstatic void
528396c5ddc4Srjsbi_disasm_add_flog_table_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
528496c5ddc4Srjs{
528596c5ddc4Srjs    static const char *precision_table[] = {
528696c5ddc4Srjs        "", ""
528796c5ddc4Srjs    };
528896c5ddc4Srjs    const char *precision = precision_table[(_BITS(bits, 7, 1) << 0)];
528996c5ddc4Srjs    static const char *mode_table[] = {
529096c5ddc4Srjs        ".red", ".red"
529196c5ddc4Srjs    };
529296c5ddc4Srjs    const char *mode = mode_table[(_BITS(bits, 7, 1) << 0)];
529396c5ddc4Srjs    static const char *widen0_table[] = {
529496c5ddc4Srjs        ".h0", ".h1"
529596c5ddc4Srjs    };
529696c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 7, 1) << 0)];
529796c5ddc4Srjs    static const char *neg0_table[] = {
529896c5ddc4Srjs        "", ".neg"
529996c5ddc4Srjs    };
530096c5ddc4Srjs
530196c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
530296c5ddc4Srjs
530396c5ddc4Srjs    static const char *abs0_table[] = {
530496c5ddc4Srjs        "", ".abs"
530596c5ddc4Srjs    };
530696c5ddc4Srjs
530796c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
530896c5ddc4Srjs
530996c5ddc4Srjs    static const char *divzero_table[] = {
531096c5ddc4Srjs        "", ".divzero"
531196c5ddc4Srjs    };
531296c5ddc4Srjs
531396c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
531496c5ddc4Srjs
531596c5ddc4Srjs    fputs("+FLOG_TABLE.f32", fp);
531696c5ddc4Srjs    fputs(mode, fp);
531796c5ddc4Srjs    fputs(precision, fp);
531896c5ddc4Srjs    fputs(divzero, fp);
531996c5ddc4Srjs    fputs(" ", fp);
532096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
532196c5ddc4Srjs    fputs(", ", fp);
532296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
532396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
532496c5ddc4Srjs    fputs(widen0, fp);
532596c5ddc4Srjs    fputs(neg0, fp);
532696c5ddc4Srjs    fputs(abs0, fp);
532796c5ddc4Srjs}
532896c5ddc4Srjs
532996c5ddc4Srjsstatic void
533096c5ddc4Srjsbi_disasm_add_flog_table_f32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
533196c5ddc4Srjs{
533296c5ddc4Srjs    static const char *divzero_table[] = {
533396c5ddc4Srjs        "", ""
533496c5ddc4Srjs    };
533596c5ddc4Srjs    const char *divzero = divzero_table[(_BITS(bits, 5, 1) << 0)];
533696c5ddc4Srjs    static const char *mode_table[] = {
533796c5ddc4Srjs        ".base2", ".natural"
533896c5ddc4Srjs    };
533996c5ddc4Srjs    const char *mode = mode_table[(_BITS(bits, 5, 1) << 0)];
534096c5ddc4Srjs    static const char *precision_table[] = {
534196c5ddc4Srjs        "", ""
534296c5ddc4Srjs    };
534396c5ddc4Srjs    const char *precision = precision_table[(_BITS(bits, 5, 1) << 0)];
534496c5ddc4Srjs    static const char *widen0_table[] = {
534596c5ddc4Srjs        "", ""
534696c5ddc4Srjs    };
534796c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 5, 1) << 0)];
534896c5ddc4Srjs    static const char *neg0_table[] = {
534996c5ddc4Srjs        "", ".neg"
535096c5ddc4Srjs    };
535196c5ddc4Srjs
535296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
535396c5ddc4Srjs
535496c5ddc4Srjs    static const char *abs0_table[] = {
535596c5ddc4Srjs        "", ".abs"
535696c5ddc4Srjs    };
535796c5ddc4Srjs
535896c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
535996c5ddc4Srjs
536096c5ddc4Srjs    fputs("+FLOG_TABLE.f32", fp);
536196c5ddc4Srjs    fputs(mode, fp);
536296c5ddc4Srjs    fputs(precision, fp);
536396c5ddc4Srjs    fputs(divzero, fp);
536496c5ddc4Srjs    fputs(" ", fp);
536596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
536696c5ddc4Srjs    fputs(", ", fp);
536796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
536896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
536996c5ddc4Srjs    fputs(widen0, fp);
537096c5ddc4Srjs    fputs(neg0, fp);
537196c5ddc4Srjs    fputs(abs0, fp);
537296c5ddc4Srjs}
537396c5ddc4Srjs
537496c5ddc4Srjsstatic void
537596c5ddc4Srjsbi_disasm_add_flog_table_f32_3(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
537696c5ddc4Srjs{
537796c5ddc4Srjs    static const char *divzero_table[] = {
537896c5ddc4Srjs        "", "", "", ""
537996c5ddc4Srjs    };
538096c5ddc4Srjs    const char *divzero = divzero_table[(_BITS(bits, 5, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
538196c5ddc4Srjs    static const char *mode_table[] = {
538296c5ddc4Srjs        ".base2", ".natural", ".base2", ".natural"
538396c5ddc4Srjs    };
538496c5ddc4Srjs    const char *mode = mode_table[(_BITS(bits, 5, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
538596c5ddc4Srjs    static const char *precision_table[] = {
538696c5ddc4Srjs        "", "", "", ""
538796c5ddc4Srjs    };
538896c5ddc4Srjs    const char *precision = precision_table[(_BITS(bits, 5, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
538996c5ddc4Srjs    static const char *widen0_table[] = {
539096c5ddc4Srjs        ".h0", ".h0", ".h1", ".h1"
539196c5ddc4Srjs    };
539296c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 5, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
539396c5ddc4Srjs    static const char *neg0_table[] = {
539496c5ddc4Srjs        "", ".neg"
539596c5ddc4Srjs    };
539696c5ddc4Srjs
539796c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
539896c5ddc4Srjs
539996c5ddc4Srjs    static const char *abs0_table[] = {
540096c5ddc4Srjs        "", ".abs"
540196c5ddc4Srjs    };
540296c5ddc4Srjs
540396c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
540496c5ddc4Srjs
540596c5ddc4Srjs    fputs("+FLOG_TABLE.f32", fp);
540696c5ddc4Srjs    fputs(mode, fp);
540796c5ddc4Srjs    fputs(precision, fp);
540896c5ddc4Srjs    fputs(divzero, fp);
540996c5ddc4Srjs    fputs(" ", fp);
541096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
541196c5ddc4Srjs    fputs(", ", fp);
541296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
541396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
541496c5ddc4Srjs    fputs(widen0, fp);
541596c5ddc4Srjs    fputs(neg0, fp);
541696c5ddc4Srjs    fputs(abs0, fp);
541796c5ddc4Srjs}
541896c5ddc4Srjs
541996c5ddc4Srjsstatic void
542096c5ddc4Srjsbi_disasm_add_flog_table_f32_4(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
542196c5ddc4Srjs{
542296c5ddc4Srjs    static const char *abs0_table[] = {
542396c5ddc4Srjs        "", "", "", ""
542496c5ddc4Srjs    };
542596c5ddc4Srjs    const char *abs0 = abs0_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
542696c5ddc4Srjs    static const char *divzero_table[] = {
542796c5ddc4Srjs        "", "", "", ""
542896c5ddc4Srjs    };
542996c5ddc4Srjs    const char *divzero = divzero_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
543096c5ddc4Srjs    static const char *mode_table[] = {
543196c5ddc4Srjs        ".natural", ".base2", ".natural", ".base2"
543296c5ddc4Srjs    };
543396c5ddc4Srjs    const char *mode = mode_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
543496c5ddc4Srjs    static const char *neg0_table[] = {
543596c5ddc4Srjs        "", "", "", ""
543696c5ddc4Srjs    };
543796c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
543896c5ddc4Srjs    static const char *precision_table[] = {
543996c5ddc4Srjs        ".high", ".high", ".low", ".low"
544096c5ddc4Srjs    };
544196c5ddc4Srjs    const char *precision = precision_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
544296c5ddc4Srjs    static const char *widen0_table[] = {
544396c5ddc4Srjs        "", "", "", ""
544496c5ddc4Srjs    };
544596c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 3, 1) << 0) | (_BITS(bits, 4, 1) << 1)];
544696c5ddc4Srjs    fputs("+FLOG_TABLE.f32", fp);
544796c5ddc4Srjs    fputs(mode, fp);
544896c5ddc4Srjs    fputs(precision, fp);
544996c5ddc4Srjs    fputs(divzero, fp);
545096c5ddc4Srjs    fputs(" ", fp);
545196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
545296c5ddc4Srjs    fputs(", ", fp);
545396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
545496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
545596c5ddc4Srjs    fputs(widen0, fp);
545696c5ddc4Srjs    fputs(neg0, fp);
545796c5ddc4Srjs    fputs(abs0, fp);
545896c5ddc4Srjs}
545996c5ddc4Srjs
546096c5ddc4Srjsstatic void
546196c5ddc4Srjsbi_disasm_add_fmax_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
546296c5ddc4Srjs{
546396c5ddc4Srjs    static const char *abs1_table[] = {
546496c5ddc4Srjs        "", ".abs"
546596c5ddc4Srjs    };
546696c5ddc4Srjs
546796c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
546896c5ddc4Srjs
546996c5ddc4Srjs    static const char *neg0_table[] = {
547096c5ddc4Srjs        "", ".neg"
547196c5ddc4Srjs    };
547296c5ddc4Srjs
547396c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
547496c5ddc4Srjs
547596c5ddc4Srjs    static const char *neg1_table[] = {
547696c5ddc4Srjs        "", ".neg"
547796c5ddc4Srjs    };
547896c5ddc4Srjs
547996c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
548096c5ddc4Srjs
548196c5ddc4Srjs    static const char *clamp_table[] = {
548296c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
548396c5ddc4Srjs    };
548496c5ddc4Srjs
548596c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 11, 2)];
548696c5ddc4Srjs
548796c5ddc4Srjs    static const char *sem_table[] = {
548896c5ddc4Srjs        "", ".nan_propagate", ".c", ".inverse_c"
548996c5ddc4Srjs    };
549096c5ddc4Srjs
549196c5ddc4Srjs    const char *sem = sem_table[_BITS(bits, 13, 2)];
549296c5ddc4Srjs
549396c5ddc4Srjs    static const char *abs0_table[] = {
549496c5ddc4Srjs        "", ".abs"
549596c5ddc4Srjs    };
549696c5ddc4Srjs
549796c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
549896c5ddc4Srjs
549996c5ddc4Srjs    fputs("+FMAX.f32", fp);
550096c5ddc4Srjs    fputs(clamp, fp);
550196c5ddc4Srjs    fputs(sem, fp);
550296c5ddc4Srjs    fputs(" ", fp);
550396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
550496c5ddc4Srjs    fputs(", ", fp);
550596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
550696c5ddc4Srjs    fputs(neg0, fp);
550796c5ddc4Srjs    fputs(abs0, fp);
550896c5ddc4Srjs    fputs(", ", fp);
550996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
551096c5ddc4Srjs    fputs(abs1, fp);
551196c5ddc4Srjs    fputs(neg1, fp);
551296c5ddc4Srjs}
551396c5ddc4Srjs
551496c5ddc4Srjsstatic void
551596c5ddc4Srjsbi_disasm_add_fmax_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
551696c5ddc4Srjs{
551796c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
551896c5ddc4Srjs    static const char *abs0_0[] = {
551996c5ddc4Srjs        "", ".abs"
552096c5ddc4Srjs    };
552196c5ddc4Srjs    static const char *abs0_1[] = {
552296c5ddc4Srjs        ".abs", ".abs"
552396c5ddc4Srjs    };
552496c5ddc4Srjs    const char *abs0 = ordering ? abs0_1[(_BITS(bits, 6, 1) << 0)] : abs0_0[(_BITS(bits, 6, 1) << 0)];
552596c5ddc4Srjs    static const char *abs1_0[] = {
552696c5ddc4Srjs        "", ""
552796c5ddc4Srjs    };
552896c5ddc4Srjs    static const char *abs1_1[] = {
552996c5ddc4Srjs        "", ".abs"
553096c5ddc4Srjs    };
553196c5ddc4Srjs    const char *abs1 = ordering ? abs1_1[(_BITS(bits, 6, 1) << 0)] : abs1_0[(_BITS(bits, 6, 1) << 0)];
553296c5ddc4Srjs    static const char *neg0_table[] = {
553396c5ddc4Srjs        "", ".neg"
553496c5ddc4Srjs    };
553596c5ddc4Srjs
553696c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
553796c5ddc4Srjs
553896c5ddc4Srjs    static const char *neg1_table[] = {
553996c5ddc4Srjs        "", ".neg"
554096c5ddc4Srjs    };
554196c5ddc4Srjs
554296c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
554396c5ddc4Srjs
554496c5ddc4Srjs    static const char *swz0_table[] = {
554596c5ddc4Srjs        ".h00", ".h10", "", ".h11"
554696c5ddc4Srjs    };
554796c5ddc4Srjs
554896c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
554996c5ddc4Srjs
555096c5ddc4Srjs    static const char *swz1_table[] = {
555196c5ddc4Srjs        ".h00", ".h10", "", ".h11"
555296c5ddc4Srjs    };
555396c5ddc4Srjs
555496c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
555596c5ddc4Srjs
555696c5ddc4Srjs    static const char *sem_table[] = {
555796c5ddc4Srjs        "", ".nan_propagate", ".c", ".inverse_c"
555896c5ddc4Srjs    };
555996c5ddc4Srjs
556096c5ddc4Srjs    const char *sem = sem_table[_BITS(bits, 13, 2)];
556196c5ddc4Srjs
556296c5ddc4Srjs    fputs("+FMAX.v2f16", fp);
556396c5ddc4Srjs    fputs(sem, fp);
556496c5ddc4Srjs    fputs(" ", fp);
556596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
556696c5ddc4Srjs    fputs(", ", fp);
556796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
556896c5ddc4Srjs    fputs(abs0, fp);
556996c5ddc4Srjs    fputs(neg0, fp);
557096c5ddc4Srjs    fputs(swz0, fp);
557196c5ddc4Srjs    fputs(", ", fp);
557296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
557396c5ddc4Srjs    fputs(abs1, fp);
557496c5ddc4Srjs    fputs(neg1, fp);
557596c5ddc4Srjs    fputs(swz1, fp);
557696c5ddc4Srjs}
557796c5ddc4Srjs
557896c5ddc4Srjsstatic void
557996c5ddc4Srjsbi_disasm_add_fmin_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
558096c5ddc4Srjs{
558196c5ddc4Srjs    static const char *abs1_table[] = {
558296c5ddc4Srjs        "", ".abs"
558396c5ddc4Srjs    };
558496c5ddc4Srjs
558596c5ddc4Srjs    const char *abs1 = abs1_table[_BITS(bits, 6, 1)];
558696c5ddc4Srjs
558796c5ddc4Srjs    static const char *neg0_table[] = {
558896c5ddc4Srjs        "", ".neg"
558996c5ddc4Srjs    };
559096c5ddc4Srjs
559196c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
559296c5ddc4Srjs
559396c5ddc4Srjs    static const char *neg1_table[] = {
559496c5ddc4Srjs        "", ".neg"
559596c5ddc4Srjs    };
559696c5ddc4Srjs
559796c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
559896c5ddc4Srjs
559996c5ddc4Srjs    static const char *clamp_table[] = {
560096c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
560196c5ddc4Srjs    };
560296c5ddc4Srjs
560396c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 11, 2)];
560496c5ddc4Srjs
560596c5ddc4Srjs    static const char *sem_table[] = {
560696c5ddc4Srjs        "", ".nan_propagate", ".c", ".inverse_c"
560796c5ddc4Srjs    };
560896c5ddc4Srjs
560996c5ddc4Srjs    const char *sem = sem_table[_BITS(bits, 13, 2)];
561096c5ddc4Srjs
561196c5ddc4Srjs    static const char *abs0_table[] = {
561296c5ddc4Srjs        "", ".abs"
561396c5ddc4Srjs    };
561496c5ddc4Srjs
561596c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 15, 1)];
561696c5ddc4Srjs
561796c5ddc4Srjs    fputs("+FMIN.f32", fp);
561896c5ddc4Srjs    fputs(clamp, fp);
561996c5ddc4Srjs    fputs(sem, fp);
562096c5ddc4Srjs    fputs(" ", fp);
562196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
562296c5ddc4Srjs    fputs(", ", fp);
562396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
562496c5ddc4Srjs    fputs(neg0, fp);
562596c5ddc4Srjs    fputs(abs0, fp);
562696c5ddc4Srjs    fputs(", ", fp);
562796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
562896c5ddc4Srjs    fputs(abs1, fp);
562996c5ddc4Srjs    fputs(neg1, fp);
563096c5ddc4Srjs}
563196c5ddc4Srjs
563296c5ddc4Srjsstatic void
563396c5ddc4Srjsbi_disasm_add_fmin_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
563496c5ddc4Srjs{
563596c5ddc4Srjs    bool ordering = (_BITS(bits, 0, 3) > _BITS(bits, 3, 3));
563696c5ddc4Srjs    static const char *abs0_0[] = {
563796c5ddc4Srjs        "", ".abs"
563896c5ddc4Srjs    };
563996c5ddc4Srjs    static const char *abs0_1[] = {
564096c5ddc4Srjs        ".abs", ".abs"
564196c5ddc4Srjs    };
564296c5ddc4Srjs    const char *abs0 = ordering ? abs0_1[(_BITS(bits, 6, 1) << 0)] : abs0_0[(_BITS(bits, 6, 1) << 0)];
564396c5ddc4Srjs    static const char *abs1_0[] = {
564496c5ddc4Srjs        "", ""
564596c5ddc4Srjs    };
564696c5ddc4Srjs    static const char *abs1_1[] = {
564796c5ddc4Srjs        "", ".abs"
564896c5ddc4Srjs    };
564996c5ddc4Srjs    const char *abs1 = ordering ? abs1_1[(_BITS(bits, 6, 1) << 0)] : abs1_0[(_BITS(bits, 6, 1) << 0)];
565096c5ddc4Srjs    static const char *neg0_table[] = {
565196c5ddc4Srjs        "", ".neg"
565296c5ddc4Srjs    };
565396c5ddc4Srjs
565496c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
565596c5ddc4Srjs
565696c5ddc4Srjs    static const char *neg1_table[] = {
565796c5ddc4Srjs        "", ".neg"
565896c5ddc4Srjs    };
565996c5ddc4Srjs
566096c5ddc4Srjs    const char *neg1 = neg1_table[_BITS(bits, 8, 1)];
566196c5ddc4Srjs
566296c5ddc4Srjs    static const char *swz0_table[] = {
566396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
566496c5ddc4Srjs    };
566596c5ddc4Srjs
566696c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 9, 2)];
566796c5ddc4Srjs
566896c5ddc4Srjs    static const char *swz1_table[] = {
566996c5ddc4Srjs        ".h00", ".h10", "", ".h11"
567096c5ddc4Srjs    };
567196c5ddc4Srjs
567296c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 11, 2)];
567396c5ddc4Srjs
567496c5ddc4Srjs    static const char *sem_table[] = {
567596c5ddc4Srjs        "", ".nan_propagate", ".c", ".inverse_c"
567696c5ddc4Srjs    };
567796c5ddc4Srjs
567896c5ddc4Srjs    const char *sem = sem_table[_BITS(bits, 13, 2)];
567996c5ddc4Srjs
568096c5ddc4Srjs    fputs("+FMIN.v2f16", fp);
568196c5ddc4Srjs    fputs(sem, fp);
568296c5ddc4Srjs    fputs(" ", fp);
568396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
568496c5ddc4Srjs    fputs(", ", fp);
568596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
568696c5ddc4Srjs    fputs(abs0, fp);
568796c5ddc4Srjs    fputs(neg0, fp);
568896c5ddc4Srjs    fputs(swz0, fp);
568996c5ddc4Srjs    fputs(", ", fp);
569096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
569196c5ddc4Srjs    fputs(abs1, fp);
569296c5ddc4Srjs    fputs(neg1, fp);
569396c5ddc4Srjs    fputs(swz1, fp);
569496c5ddc4Srjs}
569596c5ddc4Srjs
569696c5ddc4Srjsstatic void
569796c5ddc4Srjsbi_disasm_add_fpclass_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
569896c5ddc4Srjs{
569996c5ddc4Srjs    static const char *lane0_table[] = {
570096c5ddc4Srjs        "", ".h1"
570196c5ddc4Srjs    };
570296c5ddc4Srjs
570396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 3, 1)];
570496c5ddc4Srjs
570596c5ddc4Srjs    fputs("+FPCLASS.f16", fp);
570696c5ddc4Srjs    fputs(" ", fp);
570796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
570896c5ddc4Srjs    fputs(", ", fp);
570996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
571096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
571196c5ddc4Srjs    fputs(lane0, fp);
571296c5ddc4Srjs}
571396c5ddc4Srjs
571496c5ddc4Srjsstatic void
571596c5ddc4Srjsbi_disasm_add_fpclass_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
571696c5ddc4Srjs{
571796c5ddc4Srjs    fputs("+FPCLASS.f32", fp);
571896c5ddc4Srjs    fputs(" ", fp);
571996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
572096c5ddc4Srjs    fputs(", ", fp);
572196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
572296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
572396c5ddc4Srjs}
572496c5ddc4Srjs
572596c5ddc4Srjsstatic void
572696c5ddc4Srjsbi_disasm_add_fpow_sc_apply(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
572796c5ddc4Srjs{
572896c5ddc4Srjs    fputs("+FPOW_SC_APPLY", fp);
572996c5ddc4Srjs    fputs(" ", fp);
573096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
573196c5ddc4Srjs    fputs(", ", fp);
573296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
573396c5ddc4Srjs    fputs(", ", fp);
573496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
573596c5ddc4Srjs}
573696c5ddc4Srjs
573796c5ddc4Srjsstatic void
573896c5ddc4Srjsbi_disasm_add_fpow_sc_det_f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
573996c5ddc4Srjs{
574096c5ddc4Srjs    static const char *lane1_table[] = {
574196c5ddc4Srjs        ".h0", ".h1", ".h0", ".h1"
574296c5ddc4Srjs    };
574396c5ddc4Srjs    const char *lane1 = lane1_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 8, 1) << 1)];
574496c5ddc4Srjs    static const char *func_table[] = {
574596c5ddc4Srjs        ".pow", ".pow", ".powr", ".powr"
574696c5ddc4Srjs    };
574796c5ddc4Srjs    const char *func = func_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 8, 1) << 1)];
574896c5ddc4Srjs    static const char *lane0_table[] = {
574996c5ddc4Srjs        "", ".h1"
575096c5ddc4Srjs    };
575196c5ddc4Srjs
575296c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
575396c5ddc4Srjs
575496c5ddc4Srjs    fputs("+FPOW_SC_DET.f16", fp);
575596c5ddc4Srjs    fputs(func, fp);
575696c5ddc4Srjs    fputs(" ", fp);
575796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
575896c5ddc4Srjs    fputs(", ", fp);
575996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
576096c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
576196c5ddc4Srjs    fputs(lane0, fp);
576296c5ddc4Srjs    fputs(", ", fp);
576396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
576496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
576596c5ddc4Srjs    fputs(lane1, fp);
576696c5ddc4Srjs}
576796c5ddc4Srjs
576896c5ddc4Srjsstatic void
576996c5ddc4Srjsbi_disasm_add_fpow_sc_det_f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
577096c5ddc4Srjs{
577196c5ddc4Srjs    static const char *lane1_table[] = {
577296c5ddc4Srjs        "", ""
577396c5ddc4Srjs    };
577496c5ddc4Srjs    const char *lane1 = lane1_table[(_BITS(bits, 8, 1) << 0)];
577596c5ddc4Srjs    static const char *func_table[] = {
577696c5ddc4Srjs        ".pown", ".rootn"
577796c5ddc4Srjs    };
577896c5ddc4Srjs    const char *func = func_table[(_BITS(bits, 8, 1) << 0)];
577996c5ddc4Srjs    static const char *lane0_table[] = {
578096c5ddc4Srjs        "", ".h1"
578196c5ddc4Srjs    };
578296c5ddc4Srjs
578396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 7, 1)];
578496c5ddc4Srjs
578596c5ddc4Srjs    fputs("+FPOW_SC_DET.f16", fp);
578696c5ddc4Srjs    fputs(func, fp);
578796c5ddc4Srjs    fputs(" ", fp);
578896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
578996c5ddc4Srjs    fputs(", ", fp);
579096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
579196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
579296c5ddc4Srjs    fputs(lane0, fp);
579396c5ddc4Srjs    fputs(", ", fp);
579496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
579596c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
579696c5ddc4Srjs    fputs(lane1, fp);
579796c5ddc4Srjs}
579896c5ddc4Srjs
579996c5ddc4Srjsstatic void
580096c5ddc4Srjsbi_disasm_add_fpow_sc_det_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
580196c5ddc4Srjs{
580296c5ddc4Srjs    static const char *func_table[] = {
580396c5ddc4Srjs        ".pow", ".powr", ".pown", ".rootn"
580496c5ddc4Srjs    };
580596c5ddc4Srjs
580696c5ddc4Srjs    const char *func = func_table[_BITS(bits, 7, 2)];
580796c5ddc4Srjs
580896c5ddc4Srjs    fputs("+FPOW_SC_DET.f32", fp);
580996c5ddc4Srjs    fputs(func, fp);
581096c5ddc4Srjs    fputs(" ", fp);
581196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
581296c5ddc4Srjs    fputs(", ", fp);
581396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
581496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
581596c5ddc4Srjs    fputs(", ", fp);
581696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
581796c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 3, 3)))) fputs("(INVALID)", fp);
581896c5ddc4Srjs}
581996c5ddc4Srjs
582096c5ddc4Srjsstatic void
582196c5ddc4Srjsbi_disasm_add_frcbrt_approx_a_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
582296c5ddc4Srjs{
582396c5ddc4Srjs    static const char *widen0_table[] = {
582496c5ddc4Srjs        ""
582596c5ddc4Srjs    };
582696c5ddc4Srjs    const char *widen0 = widen0_table[0];
582796c5ddc4Srjs    static const char *neg0_table[] = {
582896c5ddc4Srjs        "", ".neg"
582996c5ddc4Srjs    };
583096c5ddc4Srjs
583196c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
583296c5ddc4Srjs
583396c5ddc4Srjs    static const char *abs0_table[] = {
583496c5ddc4Srjs        "", ".abs"
583596c5ddc4Srjs    };
583696c5ddc4Srjs
583796c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
583896c5ddc4Srjs
583996c5ddc4Srjs    static const char *divzero_table[] = {
584096c5ddc4Srjs        "", ".divzero"
584196c5ddc4Srjs    };
584296c5ddc4Srjs
584396c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
584496c5ddc4Srjs
584596c5ddc4Srjs    fputs("+FRCBRT_APPROX_A.f32", fp);
584696c5ddc4Srjs    fputs(divzero, fp);
584796c5ddc4Srjs    fputs(" ", fp);
584896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
584996c5ddc4Srjs    fputs(", ", fp);
585096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
585196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
585296c5ddc4Srjs    fputs(widen0, fp);
585396c5ddc4Srjs    fputs(neg0, fp);
585496c5ddc4Srjs    fputs(abs0, fp);
585596c5ddc4Srjs}
585696c5ddc4Srjs
585796c5ddc4Srjsstatic void
585896c5ddc4Srjsbi_disasm_add_frcbrt_approx_a_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
585996c5ddc4Srjs{
586096c5ddc4Srjs    static const char *widen0_table[] = {
586196c5ddc4Srjs        ".h0", ".h1"
586296c5ddc4Srjs    };
586396c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 7, 1) << 0)];
586496c5ddc4Srjs    static const char *neg0_table[] = {
586596c5ddc4Srjs        "", ".neg"
586696c5ddc4Srjs    };
586796c5ddc4Srjs
586896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
586996c5ddc4Srjs
587096c5ddc4Srjs    static const char *abs0_table[] = {
587196c5ddc4Srjs        "", ".abs"
587296c5ddc4Srjs    };
587396c5ddc4Srjs
587496c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
587596c5ddc4Srjs
587696c5ddc4Srjs    static const char *divzero_table[] = {
587796c5ddc4Srjs        "", ".divzero"
587896c5ddc4Srjs    };
587996c5ddc4Srjs
588096c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
588196c5ddc4Srjs
588296c5ddc4Srjs    fputs("+FRCBRT_APPROX_A.f32", fp);
588396c5ddc4Srjs    fputs(divzero, fp);
588496c5ddc4Srjs    fputs(" ", fp);
588596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
588696c5ddc4Srjs    fputs(", ", fp);
588796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
588896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
588996c5ddc4Srjs    fputs(widen0, fp);
589096c5ddc4Srjs    fputs(neg0, fp);
589196c5ddc4Srjs    fputs(abs0, fp);
589296c5ddc4Srjs}
589396c5ddc4Srjs
589496c5ddc4Srjsstatic void
589596c5ddc4Srjsbi_disasm_add_frcbrt_approx_b_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
589696c5ddc4Srjs{
589796c5ddc4Srjs    fputs("+FRCBRT_APPROX_B.f32", fp);
589896c5ddc4Srjs    fputs(" ", fp);
589996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
590096c5ddc4Srjs    fputs(", ", fp);
590196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
590296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
590396c5ddc4Srjs}
590496c5ddc4Srjs
590596c5ddc4Srjsstatic void
590696c5ddc4Srjsbi_disasm_add_frcbrt_approx_c_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
590796c5ddc4Srjs{
590896c5ddc4Srjs    fputs("+FRCBRT_APPROX_C.f32", fp);
590996c5ddc4Srjs    fputs(" ", fp);
591096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
591196c5ddc4Srjs    fputs(", ", fp);
591296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
591396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
591496c5ddc4Srjs}
591596c5ddc4Srjs
591696c5ddc4Srjsstatic void
591796c5ddc4Srjsbi_disasm_add_frcp_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
591896c5ddc4Srjs{
591996c5ddc4Srjs    static const char *neg0_table[] = {
592096c5ddc4Srjs        "", ".neg"
592196c5ddc4Srjs    };
592296c5ddc4Srjs
592396c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
592496c5ddc4Srjs
592596c5ddc4Srjs    static const char *abs0_table[] = {
592696c5ddc4Srjs        "", ".abs"
592796c5ddc4Srjs    };
592896c5ddc4Srjs
592996c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
593096c5ddc4Srjs
593196c5ddc4Srjs    static const char *divzero_table[] = {
593296c5ddc4Srjs        "", ".divzero"
593396c5ddc4Srjs    };
593496c5ddc4Srjs
593596c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
593696c5ddc4Srjs
593796c5ddc4Srjs    static const char *lane0_table[] = {
593896c5ddc4Srjs        "", ".h1"
593996c5ddc4Srjs    };
594096c5ddc4Srjs
594196c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 8, 1)];
594296c5ddc4Srjs
594396c5ddc4Srjs    fputs("+FRCP.f16", fp);
594496c5ddc4Srjs    fputs(divzero, fp);
594596c5ddc4Srjs    fputs(" ", fp);
594696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
594796c5ddc4Srjs    fputs(", ", fp);
594896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
594996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
595096c5ddc4Srjs    fputs(neg0, fp);
595196c5ddc4Srjs    fputs(abs0, fp);
595296c5ddc4Srjs    fputs(lane0, fp);
595396c5ddc4Srjs}
595496c5ddc4Srjs
595596c5ddc4Srjsstatic void
595696c5ddc4Srjsbi_disasm_add_frcp_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
595796c5ddc4Srjs{
595896c5ddc4Srjs    static const char *widen0_table[] = {
595996c5ddc4Srjs        "", ".reserved"
596096c5ddc4Srjs    };
596196c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 6, 1) << 0)];
596296c5ddc4Srjs    static const char *neg0_table[] = {
596396c5ddc4Srjs        "", ".neg"
596496c5ddc4Srjs    };
596596c5ddc4Srjs
596696c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
596796c5ddc4Srjs
596896c5ddc4Srjs    static const char *abs0_table[] = {
596996c5ddc4Srjs        "", ".abs"
597096c5ddc4Srjs    };
597196c5ddc4Srjs
597296c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
597396c5ddc4Srjs
597496c5ddc4Srjs    fputs("+FRCP.f32", fp);
597596c5ddc4Srjs    fputs(" ", fp);
597696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
597796c5ddc4Srjs    fputs(", ", fp);
597896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
597996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
598096c5ddc4Srjs    fputs(widen0, fp);
598196c5ddc4Srjs    fputs(neg0, fp);
598296c5ddc4Srjs    fputs(abs0, fp);
598396c5ddc4Srjs}
598496c5ddc4Srjs
598596c5ddc4Srjsstatic void
598696c5ddc4Srjsbi_disasm_add_frcp_approx_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
598796c5ddc4Srjs{
598896c5ddc4Srjs    static const char *widen0_table[] = {
598996c5ddc4Srjs        ""
599096c5ddc4Srjs    };
599196c5ddc4Srjs    const char *widen0 = widen0_table[0];
599296c5ddc4Srjs    static const char *neg0_table[] = {
599396c5ddc4Srjs        "", ".neg"
599496c5ddc4Srjs    };
599596c5ddc4Srjs
599696c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
599796c5ddc4Srjs
599896c5ddc4Srjs    static const char *abs0_table[] = {
599996c5ddc4Srjs        "", ".abs"
600096c5ddc4Srjs    };
600196c5ddc4Srjs
600296c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
600396c5ddc4Srjs
600496c5ddc4Srjs    static const char *divzero_table[] = {
600596c5ddc4Srjs        "", ".divzero"
600696c5ddc4Srjs    };
600796c5ddc4Srjs
600896c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
600996c5ddc4Srjs
601096c5ddc4Srjs    fputs("+FRCP_APPROX.f32", fp);
601196c5ddc4Srjs    fputs(divzero, fp);
601296c5ddc4Srjs    fputs(" ", fp);
601396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
601496c5ddc4Srjs    fputs(", ", fp);
601596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
601696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
601796c5ddc4Srjs    fputs(widen0, fp);
601896c5ddc4Srjs    fputs(neg0, fp);
601996c5ddc4Srjs    fputs(abs0, fp);
602096c5ddc4Srjs}
602196c5ddc4Srjs
602296c5ddc4Srjsstatic void
602396c5ddc4Srjsbi_disasm_add_frcp_approx_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
602496c5ddc4Srjs{
602596c5ddc4Srjs    static const char *widen0_table[] = {
602696c5ddc4Srjs        ".h0", ".h1"
602796c5ddc4Srjs    };
602896c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 7, 1) << 0)];
602996c5ddc4Srjs    static const char *neg0_table[] = {
603096c5ddc4Srjs        "", ".neg"
603196c5ddc4Srjs    };
603296c5ddc4Srjs
603396c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
603496c5ddc4Srjs
603596c5ddc4Srjs    static const char *abs0_table[] = {
603696c5ddc4Srjs        "", ".abs"
603796c5ddc4Srjs    };
603896c5ddc4Srjs
603996c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
604096c5ddc4Srjs
604196c5ddc4Srjs    static const char *divzero_table[] = {
604296c5ddc4Srjs        "", ".divzero"
604396c5ddc4Srjs    };
604496c5ddc4Srjs
604596c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
604696c5ddc4Srjs
604796c5ddc4Srjs    fputs("+FRCP_APPROX.f32", fp);
604896c5ddc4Srjs    fputs(divzero, fp);
604996c5ddc4Srjs    fputs(" ", fp);
605096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
605196c5ddc4Srjs    fputs(", ", fp);
605296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
605396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
605496c5ddc4Srjs    fputs(widen0, fp);
605596c5ddc4Srjs    fputs(neg0, fp);
605696c5ddc4Srjs    fputs(abs0, fp);
605796c5ddc4Srjs}
605896c5ddc4Srjs
605996c5ddc4Srjsstatic void
606096c5ddc4Srjsbi_disasm_add_frexpe_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
606196c5ddc4Srjs{
606296c5ddc4Srjs    static const char *log_table[] = {
606396c5ddc4Srjs        ""
606496c5ddc4Srjs    };
606596c5ddc4Srjs    const char *log = log_table[0];
606696c5ddc4Srjs    static const char *neg0_table[] = {
606796c5ddc4Srjs        "", ".neg"
606896c5ddc4Srjs    };
606996c5ddc4Srjs
607096c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 6, 1)];
607196c5ddc4Srjs
607296c5ddc4Srjs    static const char *sqrt_table[] = {
607396c5ddc4Srjs        "", ".sqrt"
607496c5ddc4Srjs    };
607596c5ddc4Srjs
607696c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 8, 1)];
607796c5ddc4Srjs
607896c5ddc4Srjs    static const char *widen0_table[] = {
607996c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
608096c5ddc4Srjs    };
608196c5ddc4Srjs
608296c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
608396c5ddc4Srjs
608496c5ddc4Srjs    fputs("+FREXPE.f32", fp);
608596c5ddc4Srjs    fputs(sqrt, fp);
608696c5ddc4Srjs    fputs(log, fp);
608796c5ddc4Srjs    fputs(" ", fp);
608896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
608996c5ddc4Srjs    fputs(", ", fp);
609096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
609196c5ddc4Srjs    fputs(neg0, fp);
609296c5ddc4Srjs    fputs(widen0, fp);
609396c5ddc4Srjs}
609496c5ddc4Srjs
609596c5ddc4Srjsstatic void
609696c5ddc4Srjsbi_disasm_add_frexpe_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
609796c5ddc4Srjs{
609896c5ddc4Srjs    static const char *log_table[] = {
609996c5ddc4Srjs        ".log"
610096c5ddc4Srjs    };
610196c5ddc4Srjs    const char *log = log_table[0];
610296c5ddc4Srjs    static const char *neg0_table[] = {
610396c5ddc4Srjs        ""
610496c5ddc4Srjs    };
610596c5ddc4Srjs    const char *neg0 = neg0_table[0];
610696c5ddc4Srjs    static const char *sqrt_table[] = {
610796c5ddc4Srjs        ""
610896c5ddc4Srjs    };
610996c5ddc4Srjs    const char *sqrt = sqrt_table[0];
611096c5ddc4Srjs    static const char *widen0_table[] = {
611196c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
611296c5ddc4Srjs    };
611396c5ddc4Srjs
611496c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
611596c5ddc4Srjs
611696c5ddc4Srjs    fputs("+FREXPE.f32", fp);
611796c5ddc4Srjs    fputs(sqrt, fp);
611896c5ddc4Srjs    fputs(log, fp);
611996c5ddc4Srjs    fputs(" ", fp);
612096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
612196c5ddc4Srjs    fputs(", ", fp);
612296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
612396c5ddc4Srjs    fputs(neg0, fp);
612496c5ddc4Srjs    fputs(widen0, fp);
612596c5ddc4Srjs}
612696c5ddc4Srjs
612796c5ddc4Srjsstatic void
612896c5ddc4Srjsbi_disasm_add_frexpe_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
612996c5ddc4Srjs{
613096c5ddc4Srjs    static const char *log_table[] = {
613196c5ddc4Srjs        ""
613296c5ddc4Srjs    };
613396c5ddc4Srjs    const char *log = log_table[0];
613496c5ddc4Srjs    static const char *neg0_table[] = {
613596c5ddc4Srjs        "", ".neg"
613696c5ddc4Srjs    };
613796c5ddc4Srjs
613896c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 6, 1)];
613996c5ddc4Srjs
614096c5ddc4Srjs    static const char *sqrt_table[] = {
614196c5ddc4Srjs        "", ".sqrt"
614296c5ddc4Srjs    };
614396c5ddc4Srjs
614496c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 8, 1)];
614596c5ddc4Srjs
614696c5ddc4Srjs    static const char *swz0_table[] = {
614796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
614896c5ddc4Srjs    };
614996c5ddc4Srjs
615096c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
615196c5ddc4Srjs
615296c5ddc4Srjs    fputs("+FREXPE.v2f16", fp);
615396c5ddc4Srjs    fputs(sqrt, fp);
615496c5ddc4Srjs    fputs(log, fp);
615596c5ddc4Srjs    fputs(" ", fp);
615696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
615796c5ddc4Srjs    fputs(", ", fp);
615896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
615996c5ddc4Srjs    fputs(neg0, fp);
616096c5ddc4Srjs    fputs(swz0, fp);
616196c5ddc4Srjs}
616296c5ddc4Srjs
616396c5ddc4Srjsstatic void
616496c5ddc4Srjsbi_disasm_add_frexpe_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
616596c5ddc4Srjs{
616696c5ddc4Srjs    static const char *log_table[] = {
616796c5ddc4Srjs        ".log"
616896c5ddc4Srjs    };
616996c5ddc4Srjs    const char *log = log_table[0];
617096c5ddc4Srjs    static const char *neg0_table[] = {
617196c5ddc4Srjs        ""
617296c5ddc4Srjs    };
617396c5ddc4Srjs    const char *neg0 = neg0_table[0];
617496c5ddc4Srjs    static const char *sqrt_table[] = {
617596c5ddc4Srjs        ""
617696c5ddc4Srjs    };
617796c5ddc4Srjs    const char *sqrt = sqrt_table[0];
617896c5ddc4Srjs    static const char *swz0_table[] = {
617996c5ddc4Srjs        ".h00", ".h10", "", ".h11"
618096c5ddc4Srjs    };
618196c5ddc4Srjs
618296c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
618396c5ddc4Srjs
618496c5ddc4Srjs    fputs("+FREXPE.v2f16", fp);
618596c5ddc4Srjs    fputs(sqrt, fp);
618696c5ddc4Srjs    fputs(log, fp);
618796c5ddc4Srjs    fputs(" ", fp);
618896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
618996c5ddc4Srjs    fputs(", ", fp);
619096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
619196c5ddc4Srjs    fputs(neg0, fp);
619296c5ddc4Srjs    fputs(swz0, fp);
619396c5ddc4Srjs}
619496c5ddc4Srjs
619596c5ddc4Srjsstatic void
619696c5ddc4Srjsbi_disasm_add_frexpm_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
619796c5ddc4Srjs{
619896c5ddc4Srjs    static const char *log_table[] = {
619996c5ddc4Srjs        ""
620096c5ddc4Srjs    };
620196c5ddc4Srjs    const char *log = log_table[0];
620296c5ddc4Srjs    static const char *neg0_table[] = {
620396c5ddc4Srjs        ""
620496c5ddc4Srjs    };
620596c5ddc4Srjs    const char *neg0 = neg0_table[0];
620696c5ddc4Srjs    static const char *abs0_table[] = {
620796c5ddc4Srjs        "", ".abs"
620896c5ddc4Srjs    };
620996c5ddc4Srjs
621096c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
621196c5ddc4Srjs
621296c5ddc4Srjs    static const char *sqrt_table[] = {
621396c5ddc4Srjs        "", ".sqrt"
621496c5ddc4Srjs    };
621596c5ddc4Srjs
621696c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 7, 1)];
621796c5ddc4Srjs
621896c5ddc4Srjs    static const char *widen0_table[] = {
621996c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
622096c5ddc4Srjs    };
622196c5ddc4Srjs
622296c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
622396c5ddc4Srjs
622496c5ddc4Srjs    fputs("+FREXPM.f32", fp);
622596c5ddc4Srjs    fputs(sqrt, fp);
622696c5ddc4Srjs    fputs(log, fp);
622796c5ddc4Srjs    fputs(" ", fp);
622896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
622996c5ddc4Srjs    fputs(", ", fp);
623096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
623196c5ddc4Srjs    fputs(abs0, fp);
623296c5ddc4Srjs    fputs(widen0, fp);
623396c5ddc4Srjs    fputs(neg0, fp);
623496c5ddc4Srjs}
623596c5ddc4Srjs
623696c5ddc4Srjsstatic void
623796c5ddc4Srjsbi_disasm_add_frexpm_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
623896c5ddc4Srjs{
623996c5ddc4Srjs    static const char *log_table[] = {
624096c5ddc4Srjs        ".log"
624196c5ddc4Srjs    };
624296c5ddc4Srjs    const char *log = log_table[0];
624396c5ddc4Srjs    static const char *sqrt_table[] = {
624496c5ddc4Srjs        ""
624596c5ddc4Srjs    };
624696c5ddc4Srjs    const char *sqrt = sqrt_table[0];
624796c5ddc4Srjs    static const char *abs0_table[] = {
624896c5ddc4Srjs        "", ".abs"
624996c5ddc4Srjs    };
625096c5ddc4Srjs
625196c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
625296c5ddc4Srjs
625396c5ddc4Srjs    static const char *widen0_table[] = {
625496c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
625596c5ddc4Srjs    };
625696c5ddc4Srjs
625796c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
625896c5ddc4Srjs
625996c5ddc4Srjs    static const char *neg0_table[] = {
626096c5ddc4Srjs        "", ".neg"
626196c5ddc4Srjs    };
626296c5ddc4Srjs
626396c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
626496c5ddc4Srjs
626596c5ddc4Srjs    fputs("+FREXPM.f32", fp);
626696c5ddc4Srjs    fputs(sqrt, fp);
626796c5ddc4Srjs    fputs(log, fp);
626896c5ddc4Srjs    fputs(" ", fp);
626996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
627096c5ddc4Srjs    fputs(", ", fp);
627196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
627296c5ddc4Srjs    fputs(abs0, fp);
627396c5ddc4Srjs    fputs(widen0, fp);
627496c5ddc4Srjs    fputs(neg0, fp);
627596c5ddc4Srjs}
627696c5ddc4Srjs
627796c5ddc4Srjsstatic void
627896c5ddc4Srjsbi_disasm_add_frexpm_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
627996c5ddc4Srjs{
628096c5ddc4Srjs    static const char *log_table[] = {
628196c5ddc4Srjs        ""
628296c5ddc4Srjs    };
628396c5ddc4Srjs    const char *log = log_table[0];
628496c5ddc4Srjs    static const char *neg0_table[] = {
628596c5ddc4Srjs        ""
628696c5ddc4Srjs    };
628796c5ddc4Srjs    const char *neg0 = neg0_table[0];
628896c5ddc4Srjs    static const char *abs0_table[] = {
628996c5ddc4Srjs        "", ".abs"
629096c5ddc4Srjs    };
629196c5ddc4Srjs
629296c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
629396c5ddc4Srjs
629496c5ddc4Srjs    static const char *sqrt_table[] = {
629596c5ddc4Srjs        "", ".sqrt"
629696c5ddc4Srjs    };
629796c5ddc4Srjs
629896c5ddc4Srjs    const char *sqrt = sqrt_table[_BITS(bits, 7, 1)];
629996c5ddc4Srjs
630096c5ddc4Srjs    static const char *swz0_table[] = {
630196c5ddc4Srjs        ".h00", ".h10", "", ".h11"
630296c5ddc4Srjs    };
630396c5ddc4Srjs
630496c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
630596c5ddc4Srjs
630696c5ddc4Srjs    fputs("+FREXPM.v2f16", fp);
630796c5ddc4Srjs    fputs(sqrt, fp);
630896c5ddc4Srjs    fputs(log, fp);
630996c5ddc4Srjs    fputs(" ", fp);
631096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
631196c5ddc4Srjs    fputs(", ", fp);
631296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
631396c5ddc4Srjs    fputs(abs0, fp);
631496c5ddc4Srjs    fputs(swz0, fp);
631596c5ddc4Srjs    fputs(neg0, fp);
631696c5ddc4Srjs}
631796c5ddc4Srjs
631896c5ddc4Srjsstatic void
631996c5ddc4Srjsbi_disasm_add_frexpm_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
632096c5ddc4Srjs{
632196c5ddc4Srjs    static const char *log_table[] = {
632296c5ddc4Srjs        ".log"
632396c5ddc4Srjs    };
632496c5ddc4Srjs    const char *log = log_table[0];
632596c5ddc4Srjs    static const char *sqrt_table[] = {
632696c5ddc4Srjs        ""
632796c5ddc4Srjs    };
632896c5ddc4Srjs    const char *sqrt = sqrt_table[0];
632996c5ddc4Srjs    static const char *abs0_table[] = {
633096c5ddc4Srjs        "", ".abs"
633196c5ddc4Srjs    };
633296c5ddc4Srjs
633396c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 6, 1)];
633496c5ddc4Srjs
633596c5ddc4Srjs    static const char *swz0_table[] = {
633696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
633796c5ddc4Srjs    };
633896c5ddc4Srjs
633996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
634096c5ddc4Srjs
634196c5ddc4Srjs    static const char *neg0_table[] = {
634296c5ddc4Srjs        "", ".neg"
634396c5ddc4Srjs    };
634496c5ddc4Srjs
634596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 7, 1)];
634696c5ddc4Srjs
634796c5ddc4Srjs    fputs("+FREXPM.v2f16", fp);
634896c5ddc4Srjs    fputs(sqrt, fp);
634996c5ddc4Srjs    fputs(log, fp);
635096c5ddc4Srjs    fputs(" ", fp);
635196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
635296c5ddc4Srjs    fputs(", ", fp);
635396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
635496c5ddc4Srjs    fputs(abs0, fp);
635596c5ddc4Srjs    fputs(swz0, fp);
635696c5ddc4Srjs    fputs(neg0, fp);
635796c5ddc4Srjs}
635896c5ddc4Srjs
635996c5ddc4Srjsstatic void
636096c5ddc4Srjsbi_disasm_add_fround_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
636196c5ddc4Srjs{
636296c5ddc4Srjs    static const char *abs0_table[] = {
636396c5ddc4Srjs        "", ".abs"
636496c5ddc4Srjs    };
636596c5ddc4Srjs
636696c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
636796c5ddc4Srjs
636896c5ddc4Srjs    static const char *neg0_table[] = {
636996c5ddc4Srjs        "", ".neg"
637096c5ddc4Srjs    };
637196c5ddc4Srjs
637296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
637396c5ddc4Srjs
637496c5ddc4Srjs    static const char *widen0_table[] = {
637596c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
637696c5ddc4Srjs    };
637796c5ddc4Srjs
637896c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
637996c5ddc4Srjs
638096c5ddc4Srjs    static const char *round_table[] = {
638196c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
638296c5ddc4Srjs    };
638396c5ddc4Srjs
638496c5ddc4Srjs    const char *round = round_table[_BITS(bits, 9, 2)];
638596c5ddc4Srjs
638696c5ddc4Srjs    fputs("+FROUND.f32", fp);
638796c5ddc4Srjs    fputs(round, fp);
638896c5ddc4Srjs    fputs(" ", fp);
638996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
639096c5ddc4Srjs    fputs(", ", fp);
639196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
639296c5ddc4Srjs    fputs(abs0, fp);
639396c5ddc4Srjs    fputs(neg0, fp);
639496c5ddc4Srjs    fputs(widen0, fp);
639596c5ddc4Srjs}
639696c5ddc4Srjs
639796c5ddc4Srjsstatic void
639896c5ddc4Srjsbi_disasm_add_fround_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
639996c5ddc4Srjs{
640096c5ddc4Srjs    static const char *abs0_table[] = {
640196c5ddc4Srjs        "", ".abs"
640296c5ddc4Srjs    };
640396c5ddc4Srjs
640496c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 7, 1)];
640596c5ddc4Srjs
640696c5ddc4Srjs    static const char *neg0_table[] = {
640796c5ddc4Srjs        "", ".neg"
640896c5ddc4Srjs    };
640996c5ddc4Srjs
641096c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 8, 1)];
641196c5ddc4Srjs
641296c5ddc4Srjs    static const char *swz0_table[] = {
641396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
641496c5ddc4Srjs    };
641596c5ddc4Srjs
641696c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
641796c5ddc4Srjs
641896c5ddc4Srjs    static const char *round_table[] = {
641996c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
642096c5ddc4Srjs    };
642196c5ddc4Srjs
642296c5ddc4Srjs    const char *round = round_table[_BITS(bits, 9, 2)];
642396c5ddc4Srjs
642496c5ddc4Srjs    fputs("+FROUND.v2f16", fp);
642596c5ddc4Srjs    fputs(round, fp);
642696c5ddc4Srjs    fputs(" ", fp);
642796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
642896c5ddc4Srjs    fputs(", ", fp);
642996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
643096c5ddc4Srjs    fputs(abs0, fp);
643196c5ddc4Srjs    fputs(neg0, fp);
643296c5ddc4Srjs    fputs(swz0, fp);
643396c5ddc4Srjs}
643496c5ddc4Srjs
643596c5ddc4Srjsstatic void
643696c5ddc4Srjsbi_disasm_add_frsq_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
643796c5ddc4Srjs{
643896c5ddc4Srjs    static const char *neg0_table[] = {
643996c5ddc4Srjs        "", ".neg"
644096c5ddc4Srjs    };
644196c5ddc4Srjs
644296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
644396c5ddc4Srjs
644496c5ddc4Srjs    static const char *abs0_table[] = {
644596c5ddc4Srjs        "", ".abs"
644696c5ddc4Srjs    };
644796c5ddc4Srjs
644896c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
644996c5ddc4Srjs
645096c5ddc4Srjs    static const char *divzero_table[] = {
645196c5ddc4Srjs        "", ".divzero"
645296c5ddc4Srjs    };
645396c5ddc4Srjs
645496c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
645596c5ddc4Srjs
645696c5ddc4Srjs    static const char *lane0_table[] = {
645796c5ddc4Srjs        "", ".h1"
645896c5ddc4Srjs    };
645996c5ddc4Srjs
646096c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 8, 1)];
646196c5ddc4Srjs
646296c5ddc4Srjs    fputs("+FRSQ.f16", fp);
646396c5ddc4Srjs    fputs(divzero, fp);
646496c5ddc4Srjs    fputs(" ", fp);
646596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
646696c5ddc4Srjs    fputs(", ", fp);
646796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
646896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
646996c5ddc4Srjs    fputs(neg0, fp);
647096c5ddc4Srjs    fputs(abs0, fp);
647196c5ddc4Srjs    fputs(lane0, fp);
647296c5ddc4Srjs}
647396c5ddc4Srjs
647496c5ddc4Srjsstatic void
647596c5ddc4Srjsbi_disasm_add_frsq_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
647696c5ddc4Srjs{
647796c5ddc4Srjs    static const char *widen0_table[] = {
647896c5ddc4Srjs        "", ".reserved"
647996c5ddc4Srjs    };
648096c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 6, 1) << 0)];
648196c5ddc4Srjs    static const char *neg0_table[] = {
648296c5ddc4Srjs        "", ".neg"
648396c5ddc4Srjs    };
648496c5ddc4Srjs
648596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
648696c5ddc4Srjs
648796c5ddc4Srjs    static const char *abs0_table[] = {
648896c5ddc4Srjs        "", ".abs"
648996c5ddc4Srjs    };
649096c5ddc4Srjs
649196c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
649296c5ddc4Srjs
649396c5ddc4Srjs    fputs("+FRSQ.f32", fp);
649496c5ddc4Srjs    fputs(" ", fp);
649596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
649696c5ddc4Srjs    fputs(", ", fp);
649796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
649896c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
649996c5ddc4Srjs    fputs(widen0, fp);
650096c5ddc4Srjs    fputs(neg0, fp);
650196c5ddc4Srjs    fputs(abs0, fp);
650296c5ddc4Srjs}
650396c5ddc4Srjs
650496c5ddc4Srjsstatic void
650596c5ddc4Srjsbi_disasm_add_frsq_approx_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
650696c5ddc4Srjs{
650796c5ddc4Srjs    static const char *widen0_table[] = {
650896c5ddc4Srjs        ""
650996c5ddc4Srjs    };
651096c5ddc4Srjs    const char *widen0 = widen0_table[0];
651196c5ddc4Srjs    static const char *neg0_table[] = {
651296c5ddc4Srjs        "", ".neg"
651396c5ddc4Srjs    };
651496c5ddc4Srjs
651596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
651696c5ddc4Srjs
651796c5ddc4Srjs    static const char *abs0_table[] = {
651896c5ddc4Srjs        "", ".abs"
651996c5ddc4Srjs    };
652096c5ddc4Srjs
652196c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
652296c5ddc4Srjs
652396c5ddc4Srjs    static const char *divzero_table[] = {
652496c5ddc4Srjs        "", ".divzero"
652596c5ddc4Srjs    };
652696c5ddc4Srjs
652796c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
652896c5ddc4Srjs
652996c5ddc4Srjs    fputs("+FRSQ_APPROX.f32", fp);
653096c5ddc4Srjs    fputs(divzero, fp);
653196c5ddc4Srjs    fputs(" ", fp);
653296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
653396c5ddc4Srjs    fputs(", ", fp);
653496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
653596c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
653696c5ddc4Srjs    fputs(widen0, fp);
653796c5ddc4Srjs    fputs(neg0, fp);
653896c5ddc4Srjs    fputs(abs0, fp);
653996c5ddc4Srjs}
654096c5ddc4Srjs
654196c5ddc4Srjsstatic void
654296c5ddc4Srjsbi_disasm_add_frsq_approx_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
654396c5ddc4Srjs{
654496c5ddc4Srjs    static const char *widen0_table[] = {
654596c5ddc4Srjs        ".h0", ".h1"
654696c5ddc4Srjs    };
654796c5ddc4Srjs    const char *widen0 = widen0_table[(_BITS(bits, 7, 1) << 0)];
654896c5ddc4Srjs    static const char *neg0_table[] = {
654996c5ddc4Srjs        "", ".neg"
655096c5ddc4Srjs    };
655196c5ddc4Srjs
655296c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
655396c5ddc4Srjs
655496c5ddc4Srjs    static const char *abs0_table[] = {
655596c5ddc4Srjs        "", ".abs"
655696c5ddc4Srjs    };
655796c5ddc4Srjs
655896c5ddc4Srjs    const char *abs0 = abs0_table[_BITS(bits, 4, 1)];
655996c5ddc4Srjs
656096c5ddc4Srjs    static const char *divzero_table[] = {
656196c5ddc4Srjs        "", ".divzero"
656296c5ddc4Srjs    };
656396c5ddc4Srjs
656496c5ddc4Srjs    const char *divzero = divzero_table[_BITS(bits, 5, 1)];
656596c5ddc4Srjs
656696c5ddc4Srjs    fputs("+FRSQ_APPROX.f32", fp);
656796c5ddc4Srjs    fputs(divzero, fp);
656896c5ddc4Srjs    fputs(" ", fp);
656996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
657096c5ddc4Srjs    fputs(", ", fp);
657196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
657296c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
657396c5ddc4Srjs    fputs(widen0, fp);
657496c5ddc4Srjs    fputs(neg0, fp);
657596c5ddc4Srjs    fputs(abs0, fp);
657696c5ddc4Srjs}
657796c5ddc4Srjs
657896c5ddc4Srjsstatic void
657996c5ddc4Srjsbi_disasm_add_fsincos_offset_u6(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
658096c5ddc4Srjs{
658196c5ddc4Srjs    static const char *scale_table[] = {
658296c5ddc4Srjs        "", ".scale"
658396c5ddc4Srjs    };
658496c5ddc4Srjs
658596c5ddc4Srjs    const char *scale = scale_table[_BITS(bits, 3, 1)];
658696c5ddc4Srjs
658796c5ddc4Srjs    fputs("+FSINCOS_OFFSET.u6", fp);
658896c5ddc4Srjs    fputs(scale, fp);
658996c5ddc4Srjs    fputs(" ", fp);
659096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
659196c5ddc4Srjs    fputs(", ", fp);
659296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
659396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
659496c5ddc4Srjs}
659596c5ddc4Srjs
659696c5ddc4Srjsstatic void
659796c5ddc4Srjsbi_disasm_add_fsin_table_u6(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
659896c5ddc4Srjs{
659996c5ddc4Srjs    static const char *offset_table[] = {
660096c5ddc4Srjs        "", ".offset"
660196c5ddc4Srjs    };
660296c5ddc4Srjs
660396c5ddc4Srjs    const char *offset = offset_table[_BITS(bits, 4, 1)];
660496c5ddc4Srjs
660596c5ddc4Srjs    fputs("+FSIN_TABLE.u6", fp);
660696c5ddc4Srjs    fputs(offset, fp);
660796c5ddc4Srjs    fputs(" ", fp);
660896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
660996c5ddc4Srjs    fputs(", ", fp);
661096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
661196c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 0, 3)))) fputs("(INVALID)", fp);
661296c5ddc4Srjs}
661396c5ddc4Srjs
661496c5ddc4Srjsstatic void
661596c5ddc4Srjsbi_disasm_add_hadd_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
661696c5ddc4Srjs{
661796c5ddc4Srjs    static const char *round_table[] = {
661896c5ddc4Srjs        "", ".rtp"
661996c5ddc4Srjs    };
662096c5ddc4Srjs
662196c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
662296c5ddc4Srjs
662396c5ddc4Srjs    fputs("+HADD.s32", fp);
662496c5ddc4Srjs    fputs(round, fp);
662596c5ddc4Srjs    fputs(" ", fp);
662696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
662796c5ddc4Srjs    fputs(", ", fp);
662896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
662996c5ddc4Srjs    fputs(", ", fp);
663096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
663196c5ddc4Srjs}
663296c5ddc4Srjs
663396c5ddc4Srjsstatic void
663496c5ddc4Srjsbi_disasm_add_hadd_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
663596c5ddc4Srjs{
663696c5ddc4Srjs    static const char *round_table[] = {
663796c5ddc4Srjs        "", ".rtp"
663896c5ddc4Srjs    };
663996c5ddc4Srjs
664096c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
664196c5ddc4Srjs
664296c5ddc4Srjs    fputs("+HADD.u32", fp);
664396c5ddc4Srjs    fputs(round, fp);
664496c5ddc4Srjs    fputs(" ", fp);
664596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
664696c5ddc4Srjs    fputs(", ", fp);
664796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
664896c5ddc4Srjs    fputs(", ", fp);
664996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
665096c5ddc4Srjs}
665196c5ddc4Srjs
665296c5ddc4Srjsstatic void
665396c5ddc4Srjsbi_disasm_add_hadd_v2s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
665496c5ddc4Srjs{
665596c5ddc4Srjs    static const char *round_table[] = {
665696c5ddc4Srjs        "", ".rtp"
665796c5ddc4Srjs    };
665896c5ddc4Srjs
665996c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
666096c5ddc4Srjs
666196c5ddc4Srjs    static const char *swap1_table[] = {
666296c5ddc4Srjs        "", ".h10"
666396c5ddc4Srjs    };
666496c5ddc4Srjs
666596c5ddc4Srjs    const char *swap1 = swap1_table[_BITS(bits, 9, 1)];
666696c5ddc4Srjs
666796c5ddc4Srjs    static const char *swap0_table[] = {
666896c5ddc4Srjs        "", ".h10"
666996c5ddc4Srjs    };
667096c5ddc4Srjs
667196c5ddc4Srjs    const char *swap0 = swap0_table[_BITS(bits, 10, 1)];
667296c5ddc4Srjs
667396c5ddc4Srjs    fputs("+HADD.v2s16", fp);
667496c5ddc4Srjs    fputs(round, fp);
667596c5ddc4Srjs    fputs(" ", fp);
667696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
667796c5ddc4Srjs    fputs(", ", fp);
667896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
667996c5ddc4Srjs    fputs(swap0, fp);
668096c5ddc4Srjs    fputs(", ", fp);
668196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
668296c5ddc4Srjs    fputs(swap1, fp);
668396c5ddc4Srjs}
668496c5ddc4Srjs
668596c5ddc4Srjsstatic void
668696c5ddc4Srjsbi_disasm_add_hadd_v2u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
668796c5ddc4Srjs{
668896c5ddc4Srjs    static const char *round_table[] = {
668996c5ddc4Srjs        "", ".rtp"
669096c5ddc4Srjs    };
669196c5ddc4Srjs
669296c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
669396c5ddc4Srjs
669496c5ddc4Srjs    static const char *swap1_table[] = {
669596c5ddc4Srjs        "", ".h10"
669696c5ddc4Srjs    };
669796c5ddc4Srjs
669896c5ddc4Srjs    const char *swap1 = swap1_table[_BITS(bits, 9, 1)];
669996c5ddc4Srjs
670096c5ddc4Srjs    static const char *swap0_table[] = {
670196c5ddc4Srjs        "", ".h10"
670296c5ddc4Srjs    };
670396c5ddc4Srjs
670496c5ddc4Srjs    const char *swap0 = swap0_table[_BITS(bits, 10, 1)];
670596c5ddc4Srjs
670696c5ddc4Srjs    fputs("+HADD.v2u16", fp);
670796c5ddc4Srjs    fputs(round, fp);
670896c5ddc4Srjs    fputs(" ", fp);
670996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
671096c5ddc4Srjs    fputs(", ", fp);
671196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
671296c5ddc4Srjs    fputs(swap0, fp);
671396c5ddc4Srjs    fputs(", ", fp);
671496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
671596c5ddc4Srjs    fputs(swap1, fp);
671696c5ddc4Srjs}
671796c5ddc4Srjs
671896c5ddc4Srjsstatic void
671996c5ddc4Srjsbi_disasm_add_hadd_v4s8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
672096c5ddc4Srjs{
672196c5ddc4Srjs    static const char *round_table[] = {
672296c5ddc4Srjs        "", ".rtp"
672396c5ddc4Srjs    };
672496c5ddc4Srjs
672596c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
672696c5ddc4Srjs
672796c5ddc4Srjs    fputs("+HADD.v4s8", fp);
672896c5ddc4Srjs    fputs(round, fp);
672996c5ddc4Srjs    fputs(" ", fp);
673096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
673196c5ddc4Srjs    fputs(", ", fp);
673296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
673396c5ddc4Srjs    fputs(", ", fp);
673496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
673596c5ddc4Srjs}
673696c5ddc4Srjs
673796c5ddc4Srjsstatic void
673896c5ddc4Srjsbi_disasm_add_hadd_v4u8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
673996c5ddc4Srjs{
674096c5ddc4Srjs    static const char *round_table[] = {
674196c5ddc4Srjs        "", ".rtp"
674296c5ddc4Srjs    };
674396c5ddc4Srjs
674496c5ddc4Srjs    const char *round = round_table[_BITS(bits, 12, 1)];
674596c5ddc4Srjs
674696c5ddc4Srjs    fputs("+HADD.v4u8", fp);
674796c5ddc4Srjs    fputs(round, fp);
674896c5ddc4Srjs    fputs(" ", fp);
674996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
675096c5ddc4Srjs    fputs(", ", fp);
675196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
675296c5ddc4Srjs    fputs(", ", fp);
675396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
675496c5ddc4Srjs}
675596c5ddc4Srjs
675696c5ddc4Srjsstatic void
675796c5ddc4Srjsbi_disasm_add_iabs_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
675896c5ddc4Srjs{
675996c5ddc4Srjs    fputs("+IABS.s32", fp);
676096c5ddc4Srjs    fputs(" ", fp);
676196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
676296c5ddc4Srjs    fputs(", ", fp);
676396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
676496c5ddc4Srjs}
676596c5ddc4Srjs
676696c5ddc4Srjsstatic void
676796c5ddc4Srjsbi_disasm_add_iabs_v2s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
676896c5ddc4Srjs{
676996c5ddc4Srjs    static const char *swz0_table[] = {
677096c5ddc4Srjs        ".h00", ".h10", "", ".h11"
677196c5ddc4Srjs    };
677296c5ddc4Srjs
677396c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
677496c5ddc4Srjs
677596c5ddc4Srjs    fputs("+IABS.v2s16", fp);
677696c5ddc4Srjs    fputs(" ", fp);
677796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
677896c5ddc4Srjs    fputs(", ", fp);
677996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
678096c5ddc4Srjs    fputs(swz0, fp);
678196c5ddc4Srjs}
678296c5ddc4Srjs
678396c5ddc4Srjsstatic void
678496c5ddc4Srjsbi_disasm_add_iabs_v4s8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
678596c5ddc4Srjs{
678696c5ddc4Srjs    fputs("+IABS.v4s8", fp);
678796c5ddc4Srjs    fputs(" ", fp);
678896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
678996c5ddc4Srjs    fputs(", ", fp);
679096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
679196c5ddc4Srjs}
679296c5ddc4Srjs
679396c5ddc4Srjsstatic void
679496c5ddc4Srjsbi_disasm_add_iadd_s32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
679596c5ddc4Srjs{
679696c5ddc4Srjs    static const char *lanes1_table[] = {
679796c5ddc4Srjs        ""
679896c5ddc4Srjs    };
679996c5ddc4Srjs    const char *lanes1 = lanes1_table[0];
680096c5ddc4Srjs    static const char *saturate_table[] = {
680196c5ddc4Srjs        "", ".sat"
680296c5ddc4Srjs    };
680396c5ddc4Srjs
680496c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
680596c5ddc4Srjs
680696c5ddc4Srjs    fputs("+IADD.s32", fp);
680796c5ddc4Srjs    fputs(saturate, fp);
680896c5ddc4Srjs    fputs(" ", fp);
680996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
681096c5ddc4Srjs    fputs(", ", fp);
681196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
681296c5ddc4Srjs    fputs(", ", fp);
681396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
681496c5ddc4Srjs    fputs(lanes1, fp);
681596c5ddc4Srjs}
681696c5ddc4Srjs
681796c5ddc4Srjsstatic void
681896c5ddc4Srjsbi_disasm_add_iadd_s32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
681996c5ddc4Srjs{
682096c5ddc4Srjs    static const char *lanes1_table[] = {
682196c5ddc4Srjs        ".h0", ".h1"
682296c5ddc4Srjs    };
682396c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
682496c5ddc4Srjs    static const char *saturate_table[] = {
682596c5ddc4Srjs        "", ".sat"
682696c5ddc4Srjs    };
682796c5ddc4Srjs
682896c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
682996c5ddc4Srjs
683096c5ddc4Srjs    fputs("+IADD.s32", fp);
683196c5ddc4Srjs    fputs(saturate, fp);
683296c5ddc4Srjs    fputs(" ", fp);
683396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
683496c5ddc4Srjs    fputs(", ", fp);
683596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
683696c5ddc4Srjs    fputs(", ", fp);
683796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
683896c5ddc4Srjs    fputs(lanes1, fp);
683996c5ddc4Srjs}
684096c5ddc4Srjs
684196c5ddc4Srjsstatic void
684296c5ddc4Srjsbi_disasm_add_iadd_s32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
684396c5ddc4Srjs{
684496c5ddc4Srjs    static const char *lanes1_table[] = {
684596c5ddc4Srjs        ".b0", ".b1", ".b2", ".b3"
684696c5ddc4Srjs    };
684796c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 2) << 0)];
684896c5ddc4Srjs    static const char *saturate_table[] = {
684996c5ddc4Srjs        "", ".sat"
685096c5ddc4Srjs    };
685196c5ddc4Srjs
685296c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
685396c5ddc4Srjs
685496c5ddc4Srjs    fputs("+IADD.s32", fp);
685596c5ddc4Srjs    fputs(saturate, fp);
685696c5ddc4Srjs    fputs(" ", fp);
685796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
685896c5ddc4Srjs    fputs(", ", fp);
685996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
686096c5ddc4Srjs    fputs(", ", fp);
686196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
686296c5ddc4Srjs    fputs(lanes1, fp);
686396c5ddc4Srjs}
686496c5ddc4Srjs
686596c5ddc4Srjsstatic void
686696c5ddc4Srjsbi_disasm_add_iadd_u32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
686796c5ddc4Srjs{
686896c5ddc4Srjs    static const char *lanes1_table[] = {
686996c5ddc4Srjs        ".reserved", ""
687096c5ddc4Srjs    };
687196c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0)];
687296c5ddc4Srjs    static const char *saturate_table[] = {
687396c5ddc4Srjs        "", ".sat"
687496c5ddc4Srjs    };
687596c5ddc4Srjs
687696c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
687796c5ddc4Srjs
687896c5ddc4Srjs    fputs("+IADD.u32", fp);
687996c5ddc4Srjs    fputs(saturate, fp);
688096c5ddc4Srjs    fputs(" ", fp);
688196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
688296c5ddc4Srjs    fputs(", ", fp);
688396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
688496c5ddc4Srjs    fputs(", ", fp);
688596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
688696c5ddc4Srjs    fputs(lanes1, fp);
688796c5ddc4Srjs}
688896c5ddc4Srjs
688996c5ddc4Srjsstatic void
689096c5ddc4Srjsbi_disasm_add_iadd_u32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
689196c5ddc4Srjs{
689296c5ddc4Srjs    static const char *lanes1_table[] = {
689396c5ddc4Srjs        ".reserved", ".h0", ".reserved", ".h1"
689496c5ddc4Srjs    };
689596c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
689696c5ddc4Srjs    static const char *saturate_table[] = {
689796c5ddc4Srjs        "", ".sat"
689896c5ddc4Srjs    };
689996c5ddc4Srjs
690096c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
690196c5ddc4Srjs
690296c5ddc4Srjs    fputs("+IADD.u32", fp);
690396c5ddc4Srjs    fputs(saturate, fp);
690496c5ddc4Srjs    fputs(" ", fp);
690596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
690696c5ddc4Srjs    fputs(", ", fp);
690796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
690896c5ddc4Srjs    fputs(", ", fp);
690996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
691096c5ddc4Srjs    fputs(lanes1, fp);
691196c5ddc4Srjs}
691296c5ddc4Srjs
691396c5ddc4Srjsstatic void
691496c5ddc4Srjsbi_disasm_add_iadd_u32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
691596c5ddc4Srjs{
691696c5ddc4Srjs    static const char *lanes1_table[] = {
691796c5ddc4Srjs        ".reserved", ".b0", ".reserved", ".b1", ".reserved", ".b2", ".reserved", ".b3"
691896c5ddc4Srjs    };
691996c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
692096c5ddc4Srjs    static const char *saturate_table[] = {
692196c5ddc4Srjs        "", ".sat"
692296c5ddc4Srjs    };
692396c5ddc4Srjs
692496c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
692596c5ddc4Srjs
692696c5ddc4Srjs    fputs("+IADD.u32", fp);
692796c5ddc4Srjs    fputs(saturate, fp);
692896c5ddc4Srjs    fputs(" ", fp);
692996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
693096c5ddc4Srjs    fputs(", ", fp);
693196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
693296c5ddc4Srjs    fputs(", ", fp);
693396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
693496c5ddc4Srjs    fputs(lanes1, fp);
693596c5ddc4Srjs}
693696c5ddc4Srjs
693796c5ddc4Srjsstatic void
693896c5ddc4Srjsbi_disasm_add_iadd_v2s16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
693996c5ddc4Srjs{
694096c5ddc4Srjs    static const char *lanes1_table[] = {
694196c5ddc4Srjs        "", ".h10", "", ".h10"
694296c5ddc4Srjs    };
694396c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
694496c5ddc4Srjs    static const char *lanes0_table[] = {
694596c5ddc4Srjs        "", "", ".h10", ".h10"
694696c5ddc4Srjs    };
694796c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
694896c5ddc4Srjs    static const char *saturate_table[] = {
694996c5ddc4Srjs        "", ".sat"
695096c5ddc4Srjs    };
695196c5ddc4Srjs
695296c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
695396c5ddc4Srjs
695496c5ddc4Srjs    fputs("+IADD.v2s16", fp);
695596c5ddc4Srjs    fputs(saturate, fp);
695696c5ddc4Srjs    fputs(" ", fp);
695796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
695896c5ddc4Srjs    fputs(", ", fp);
695996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
696096c5ddc4Srjs    fputs(lanes0, fp);
696196c5ddc4Srjs    fputs(", ", fp);
696296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
696396c5ddc4Srjs    fputs(lanes1, fp);
696496c5ddc4Srjs}
696596c5ddc4Srjs
696696c5ddc4Srjsstatic void
696796c5ddc4Srjsbi_disasm_add_iadd_v2s16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
696896c5ddc4Srjs{
696996c5ddc4Srjs    static const char *lanes1_table[] = {
697096c5ddc4Srjs        ".h00", ".h11"
697196c5ddc4Srjs    };
697296c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
697396c5ddc4Srjs    static const char *lanes0_table[] = {
697496c5ddc4Srjs        "", ""
697596c5ddc4Srjs    };
697696c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
697796c5ddc4Srjs    static const char *saturate_table[] = {
697896c5ddc4Srjs        "", ".sat"
697996c5ddc4Srjs    };
698096c5ddc4Srjs
698196c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
698296c5ddc4Srjs
698396c5ddc4Srjs    fputs("+IADD.v2s16", fp);
698496c5ddc4Srjs    fputs(saturate, fp);
698596c5ddc4Srjs    fputs(" ", fp);
698696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
698796c5ddc4Srjs    fputs(", ", fp);
698896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
698996c5ddc4Srjs    fputs(lanes0, fp);
699096c5ddc4Srjs    fputs(", ", fp);
699196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
699296c5ddc4Srjs    fputs(lanes1, fp);
699396c5ddc4Srjs}
699496c5ddc4Srjs
699596c5ddc4Srjsstatic void
699696c5ddc4Srjsbi_disasm_add_iadd_v2s16_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
699796c5ddc4Srjs{
699896c5ddc4Srjs    static const char *lanes1_table[] = {
699996c5ddc4Srjs        ".b01", ".b23"
700096c5ddc4Srjs    };
700196c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
700296c5ddc4Srjs    static const char *lanes0_table[] = {
700396c5ddc4Srjs        "", ""
700496c5ddc4Srjs    };
700596c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
700696c5ddc4Srjs    static const char *saturate_table[] = {
700796c5ddc4Srjs        "", ".sat"
700896c5ddc4Srjs    };
700996c5ddc4Srjs
701096c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
701196c5ddc4Srjs
701296c5ddc4Srjs    fputs("+IADD.v2s16", fp);
701396c5ddc4Srjs    fputs(saturate, fp);
701496c5ddc4Srjs    fputs(" ", fp);
701596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
701696c5ddc4Srjs    fputs(", ", fp);
701796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
701896c5ddc4Srjs    fputs(lanes0, fp);
701996c5ddc4Srjs    fputs(", ", fp);
702096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
702196c5ddc4Srjs    fputs(lanes1, fp);
702296c5ddc4Srjs}
702396c5ddc4Srjs
702496c5ddc4Srjsstatic void
702596c5ddc4Srjsbi_disasm_add_iadd_v2u16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
702696c5ddc4Srjs{
702796c5ddc4Srjs    static const char *lanes1_table[] = {
702896c5ddc4Srjs        ".reserved", "", ".reserved", ".h10", ".reserved", "", ".reserved", ".h10"
702996c5ddc4Srjs    };
703096c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1) | (_BITS(bits, 10, 1) << 2)];
703196c5ddc4Srjs    static const char *lanes0_table[] = {
703296c5ddc4Srjs        ".reserved", "", ".reserved", "", ".reserved", ".h10", ".reserved", ".h10"
703396c5ddc4Srjs    };
703496c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1) | (_BITS(bits, 10, 1) << 2)];
703596c5ddc4Srjs    static const char *saturate_table[] = {
703696c5ddc4Srjs        "", ".sat"
703796c5ddc4Srjs    };
703896c5ddc4Srjs
703996c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
704096c5ddc4Srjs
704196c5ddc4Srjs    fputs("+IADD.v2u16", fp);
704296c5ddc4Srjs    fputs(saturate, fp);
704396c5ddc4Srjs    fputs(" ", fp);
704496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
704596c5ddc4Srjs    fputs(", ", fp);
704696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
704796c5ddc4Srjs    fputs(lanes0, fp);
704896c5ddc4Srjs    fputs(", ", fp);
704996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
705096c5ddc4Srjs    fputs(lanes1, fp);
705196c5ddc4Srjs}
705296c5ddc4Srjs
705396c5ddc4Srjsstatic void
705496c5ddc4Srjsbi_disasm_add_iadd_v2u16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
705596c5ddc4Srjs{
705696c5ddc4Srjs    static const char *lanes1_table[] = {
705796c5ddc4Srjs        ".reserved", ".h00", ".reserved", ".h11"
705896c5ddc4Srjs    };
705996c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
706096c5ddc4Srjs    static const char *lanes0_table[] = {
706196c5ddc4Srjs        ".reserved", "", ".reserved", ""
706296c5ddc4Srjs    };
706396c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
706496c5ddc4Srjs    static const char *saturate_table[] = {
706596c5ddc4Srjs        "", ".sat"
706696c5ddc4Srjs    };
706796c5ddc4Srjs
706896c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
706996c5ddc4Srjs
707096c5ddc4Srjs    fputs("+IADD.v2u16", fp);
707196c5ddc4Srjs    fputs(saturate, fp);
707296c5ddc4Srjs    fputs(" ", fp);
707396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
707496c5ddc4Srjs    fputs(", ", fp);
707596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
707696c5ddc4Srjs    fputs(lanes0, fp);
707796c5ddc4Srjs    fputs(", ", fp);
707896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
707996c5ddc4Srjs    fputs(lanes1, fp);
708096c5ddc4Srjs}
708196c5ddc4Srjs
708296c5ddc4Srjsstatic void
708396c5ddc4Srjsbi_disasm_add_iadd_v2u16_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
708496c5ddc4Srjs{
708596c5ddc4Srjs    static const char *lanes1_table[] = {
708696c5ddc4Srjs        ".reserved", ".b01", ".reserved", ".b23"
708796c5ddc4Srjs    };
708896c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
708996c5ddc4Srjs    static const char *lanes0_table[] = {
709096c5ddc4Srjs        ".reserved", "", ".reserved", ""
709196c5ddc4Srjs    };
709296c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
709396c5ddc4Srjs    static const char *saturate_table[] = {
709496c5ddc4Srjs        "", ".sat"
709596c5ddc4Srjs    };
709696c5ddc4Srjs
709796c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
709896c5ddc4Srjs
709996c5ddc4Srjs    fputs("+IADD.v2u16", fp);
710096c5ddc4Srjs    fputs(saturate, fp);
710196c5ddc4Srjs    fputs(" ", fp);
710296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
710396c5ddc4Srjs    fputs(", ", fp);
710496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
710596c5ddc4Srjs    fputs(lanes0, fp);
710696c5ddc4Srjs    fputs(", ", fp);
710796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
710896c5ddc4Srjs    fputs(lanes1, fp);
710996c5ddc4Srjs}
711096c5ddc4Srjs
711196c5ddc4Srjsstatic void
711296c5ddc4Srjsbi_disasm_add_iadd_v4s8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
711396c5ddc4Srjs{
711496c5ddc4Srjs    static const char *lanes1_table[] = {
711596c5ddc4Srjs        ""
711696c5ddc4Srjs    };
711796c5ddc4Srjs    const char *lanes1 = lanes1_table[0];
711896c5ddc4Srjs    static const char *lanes0_table[] = {
711996c5ddc4Srjs        ""
712096c5ddc4Srjs    };
712196c5ddc4Srjs    const char *lanes0 = lanes0_table[0];
712296c5ddc4Srjs    static const char *saturate_table[] = {
712396c5ddc4Srjs        "", ".sat"
712496c5ddc4Srjs    };
712596c5ddc4Srjs
712696c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
712796c5ddc4Srjs
712896c5ddc4Srjs    fputs("+IADD.v4s8", fp);
712996c5ddc4Srjs    fputs(saturate, fp);
713096c5ddc4Srjs    fputs(" ", fp);
713196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
713296c5ddc4Srjs    fputs(", ", fp);
713396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
713496c5ddc4Srjs    fputs(lanes0, fp);
713596c5ddc4Srjs    fputs(", ", fp);
713696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
713796c5ddc4Srjs    fputs(lanes1, fp);
713896c5ddc4Srjs}
713996c5ddc4Srjs
714096c5ddc4Srjsstatic void
714196c5ddc4Srjsbi_disasm_add_iadd_v4s8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
714296c5ddc4Srjs{
714396c5ddc4Srjs    static const char *lanes1_table[] = {
714496c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
714596c5ddc4Srjs    };
714696c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 2) << 0)];
714796c5ddc4Srjs    static const char *lanes0_table[] = {
714896c5ddc4Srjs        "", "", "", ""
714996c5ddc4Srjs    };
715096c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 2) << 0)];
715196c5ddc4Srjs    static const char *saturate_table[] = {
715296c5ddc4Srjs        "", ".sat"
715396c5ddc4Srjs    };
715496c5ddc4Srjs
715596c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
715696c5ddc4Srjs
715796c5ddc4Srjs    fputs("+IADD.v4s8", fp);
715896c5ddc4Srjs    fputs(saturate, fp);
715996c5ddc4Srjs    fputs(" ", fp);
716096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
716196c5ddc4Srjs    fputs(", ", fp);
716296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
716396c5ddc4Srjs    fputs(lanes0, fp);
716496c5ddc4Srjs    fputs(", ", fp);
716596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
716696c5ddc4Srjs    fputs(lanes1, fp);
716796c5ddc4Srjs}
716896c5ddc4Srjs
716996c5ddc4Srjsstatic void
717096c5ddc4Srjsbi_disasm_add_iadd_v4s8_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
717196c5ddc4Srjs{
717296c5ddc4Srjs    static const char *lanes1_table[] = {
717396c5ddc4Srjs        ".b0101", ".b2323"
717496c5ddc4Srjs    };
717596c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
717696c5ddc4Srjs    static const char *lanes0_table[] = {
717796c5ddc4Srjs        "", ""
717896c5ddc4Srjs    };
717996c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
718096c5ddc4Srjs    static const char *saturate_table[] = {
718196c5ddc4Srjs        "", ".sat"
718296c5ddc4Srjs    };
718396c5ddc4Srjs
718496c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
718596c5ddc4Srjs
718696c5ddc4Srjs    fputs("+IADD.v4s8", fp);
718796c5ddc4Srjs    fputs(saturate, fp);
718896c5ddc4Srjs    fputs(" ", fp);
718996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
719096c5ddc4Srjs    fputs(", ", fp);
719196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
719296c5ddc4Srjs    fputs(lanes0, fp);
719396c5ddc4Srjs    fputs(", ", fp);
719496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
719596c5ddc4Srjs    fputs(lanes1, fp);
719696c5ddc4Srjs}
719796c5ddc4Srjs
719896c5ddc4Srjsstatic void
719996c5ddc4Srjsbi_disasm_add_iadd_v4u8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
720096c5ddc4Srjs{
720196c5ddc4Srjs    static const char *lanes1_table[] = {
720296c5ddc4Srjs        ".reserved", ""
720396c5ddc4Srjs    };
720496c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0)];
720596c5ddc4Srjs    static const char *lanes0_table[] = {
720696c5ddc4Srjs        ".reserved", ""
720796c5ddc4Srjs    };
720896c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0)];
720996c5ddc4Srjs    static const char *saturate_table[] = {
721096c5ddc4Srjs        "", ".sat"
721196c5ddc4Srjs    };
721296c5ddc4Srjs
721396c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
721496c5ddc4Srjs
721596c5ddc4Srjs    fputs("+IADD.v4u8", fp);
721696c5ddc4Srjs    fputs(saturate, fp);
721796c5ddc4Srjs    fputs(" ", fp);
721896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
721996c5ddc4Srjs    fputs(", ", fp);
722096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
722196c5ddc4Srjs    fputs(lanes0, fp);
722296c5ddc4Srjs    fputs(", ", fp);
722396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
722496c5ddc4Srjs    fputs(lanes1, fp);
722596c5ddc4Srjs}
722696c5ddc4Srjs
722796c5ddc4Srjsstatic void
722896c5ddc4Srjsbi_disasm_add_iadd_v4u8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
722996c5ddc4Srjs{
723096c5ddc4Srjs    static const char *lanes1_table[] = {
723196c5ddc4Srjs        ".reserved", ".b0000", ".reserved", ".b1111", ".reserved", ".b2222", ".reserved", ".b3333"
723296c5ddc4Srjs    };
723396c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
723496c5ddc4Srjs    static const char *lanes0_table[] = {
723596c5ddc4Srjs        ".reserved", "", ".reserved", "", ".reserved", "", ".reserved", ""
723696c5ddc4Srjs    };
723796c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
723896c5ddc4Srjs    static const char *saturate_table[] = {
723996c5ddc4Srjs        "", ".sat"
724096c5ddc4Srjs    };
724196c5ddc4Srjs
724296c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
724396c5ddc4Srjs
724496c5ddc4Srjs    fputs("+IADD.v4u8", fp);
724596c5ddc4Srjs    fputs(saturate, fp);
724696c5ddc4Srjs    fputs(" ", fp);
724796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
724896c5ddc4Srjs    fputs(", ", fp);
724996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
725096c5ddc4Srjs    fputs(lanes0, fp);
725196c5ddc4Srjs    fputs(", ", fp);
725296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
725396c5ddc4Srjs    fputs(lanes1, fp);
725496c5ddc4Srjs}
725596c5ddc4Srjs
725696c5ddc4Srjsstatic void
725796c5ddc4Srjsbi_disasm_add_iadd_v4u8_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
725896c5ddc4Srjs{
725996c5ddc4Srjs    static const char *lanes1_table[] = {
726096c5ddc4Srjs        ".reserved", ".b0101", ".reserved", ".b2323"
726196c5ddc4Srjs    };
726296c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
726396c5ddc4Srjs    static const char *lanes0_table[] = {
726496c5ddc4Srjs        ".reserved", "", ".reserved", ""
726596c5ddc4Srjs    };
726696c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
726796c5ddc4Srjs    static const char *saturate_table[] = {
726896c5ddc4Srjs        "", ".sat"
726996c5ddc4Srjs    };
727096c5ddc4Srjs
727196c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
727296c5ddc4Srjs
727396c5ddc4Srjs    fputs("+IADD.v4u8", fp);
727496c5ddc4Srjs    fputs(saturate, fp);
727596c5ddc4Srjs    fputs(" ", fp);
727696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
727796c5ddc4Srjs    fputs(", ", fp);
727896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
727996c5ddc4Srjs    fputs(lanes0, fp);
728096c5ddc4Srjs    fputs(", ", fp);
728196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
728296c5ddc4Srjs    fputs(lanes1, fp);
728396c5ddc4Srjs}
728496c5ddc4Srjs
728596c5ddc4Srjsstatic void
728696c5ddc4Srjsbi_disasm_add_icmp_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
728796c5ddc4Srjs{
728896c5ddc4Srjs    static const char *result_type_table[] = {
728996c5ddc4Srjs        "", ".m1"
729096c5ddc4Srjs    };
729196c5ddc4Srjs
729296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
729396c5ddc4Srjs
729496c5ddc4Srjs    static const char *cmpf_table[] = {
729596c5ddc4Srjs        ".eq", ".ne"
729696c5ddc4Srjs    };
729796c5ddc4Srjs
729896c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 1)];
729996c5ddc4Srjs
730096c5ddc4Srjs    fputs("+ICMP.i32", fp);
730196c5ddc4Srjs    fputs(result_type, fp);
730296c5ddc4Srjs    fputs(cmpf, fp);
730396c5ddc4Srjs    fputs(" ", fp);
730496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
730596c5ddc4Srjs    fputs(", ", fp);
730696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
730796c5ddc4Srjs    fputs(", ", fp);
730896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
730996c5ddc4Srjs}
731096c5ddc4Srjs
731196c5ddc4Srjsstatic void
731296c5ddc4Srjsbi_disasm_add_icmp_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
731396c5ddc4Srjs{
731496c5ddc4Srjs    static const char *cmpf_table[] = {
731596c5ddc4Srjs        ".gt", ".ge"
731696c5ddc4Srjs    };
731796c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 6, 1) << 0)];
731896c5ddc4Srjs    static const char *result_type_table[] = {
731996c5ddc4Srjs        "", ".m1"
732096c5ddc4Srjs    };
732196c5ddc4Srjs
732296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
732396c5ddc4Srjs
732496c5ddc4Srjs    fputs("+ICMP.s32", fp);
732596c5ddc4Srjs    fputs(result_type, fp);
732696c5ddc4Srjs    fputs(cmpf, fp);
732796c5ddc4Srjs    fputs(" ", fp);
732896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
732996c5ddc4Srjs    fputs(", ", fp);
733096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
733196c5ddc4Srjs    fputs(", ", fp);
733296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
733396c5ddc4Srjs}
733496c5ddc4Srjs
733596c5ddc4Srjsstatic void
733696c5ddc4Srjsbi_disasm_add_icmp_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
733796c5ddc4Srjs{
733896c5ddc4Srjs    static const char *cmpf_table[] = {
733996c5ddc4Srjs        ".gt", ".ge"
734096c5ddc4Srjs    };
734196c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 6, 1) << 0)];
734296c5ddc4Srjs    static const char *result_type_table[] = {
734396c5ddc4Srjs        "", ".m1"
734496c5ddc4Srjs    };
734596c5ddc4Srjs
734696c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
734796c5ddc4Srjs
734896c5ddc4Srjs    fputs("+ICMP.u32", fp);
734996c5ddc4Srjs    fputs(result_type, fp);
735096c5ddc4Srjs    fputs(cmpf, fp);
735196c5ddc4Srjs    fputs(" ", fp);
735296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
735396c5ddc4Srjs    fputs(", ", fp);
735496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
735596c5ddc4Srjs    fputs(", ", fp);
735696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
735796c5ddc4Srjs}
735896c5ddc4Srjs
735996c5ddc4Srjsstatic void
736096c5ddc4Srjsbi_disasm_add_icmp_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
736196c5ddc4Srjs{
736296c5ddc4Srjs    static const char *swz0_table[] = {
736396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
736496c5ddc4Srjs    };
736596c5ddc4Srjs
736696c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
736796c5ddc4Srjs
736896c5ddc4Srjs    static const char *swz1_table[] = {
736996c5ddc4Srjs        ".h00", ".h10", "", ".h11"
737096c5ddc4Srjs    };
737196c5ddc4Srjs
737296c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 8, 2)];
737396c5ddc4Srjs
737496c5ddc4Srjs    static const char *result_type_table[] = {
737596c5ddc4Srjs        "", ".m1"
737696c5ddc4Srjs    };
737796c5ddc4Srjs
737896c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
737996c5ddc4Srjs
738096c5ddc4Srjs    static const char *cmpf_table[] = {
738196c5ddc4Srjs        ".eq", ".ne"
738296c5ddc4Srjs    };
738396c5ddc4Srjs
738496c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 11, 1)];
738596c5ddc4Srjs
738696c5ddc4Srjs    fputs("+ICMP.v2i16", fp);
738796c5ddc4Srjs    fputs(result_type, fp);
738896c5ddc4Srjs    fputs(cmpf, fp);
738996c5ddc4Srjs    fputs(" ", fp);
739096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
739196c5ddc4Srjs    fputs(", ", fp);
739296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
739396c5ddc4Srjs    fputs(swz0, fp);
739496c5ddc4Srjs    fputs(", ", fp);
739596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
739696c5ddc4Srjs    fputs(swz1, fp);
739796c5ddc4Srjs}
739896c5ddc4Srjs
739996c5ddc4Srjsstatic void
740096c5ddc4Srjsbi_disasm_add_icmp_v2s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
740196c5ddc4Srjs{
740296c5ddc4Srjs    static const char *cmpf_table[] = {
740396c5ddc4Srjs        ".gt", ".ge"
740496c5ddc4Srjs    };
740596c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
740696c5ddc4Srjs    static const char *swz0_table[] = {
740796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
740896c5ddc4Srjs    };
740996c5ddc4Srjs
741096c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
741196c5ddc4Srjs
741296c5ddc4Srjs    static const char *swz1_table[] = {
741396c5ddc4Srjs        ".h00", ".h10", "", ".h11"
741496c5ddc4Srjs    };
741596c5ddc4Srjs
741696c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 8, 2)];
741796c5ddc4Srjs
741896c5ddc4Srjs    static const char *result_type_table[] = {
741996c5ddc4Srjs        "", ".m1"
742096c5ddc4Srjs    };
742196c5ddc4Srjs
742296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
742396c5ddc4Srjs
742496c5ddc4Srjs    fputs("+ICMP.v2s16", fp);
742596c5ddc4Srjs    fputs(result_type, fp);
742696c5ddc4Srjs    fputs(cmpf, fp);
742796c5ddc4Srjs    fputs(" ", fp);
742896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
742996c5ddc4Srjs    fputs(", ", fp);
743096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
743196c5ddc4Srjs    fputs(swz0, fp);
743296c5ddc4Srjs    fputs(", ", fp);
743396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
743496c5ddc4Srjs    fputs(swz1, fp);
743596c5ddc4Srjs}
743696c5ddc4Srjs
743796c5ddc4Srjsstatic void
743896c5ddc4Srjsbi_disasm_add_icmp_v2u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
743996c5ddc4Srjs{
744096c5ddc4Srjs    static const char *cmpf_table[] = {
744196c5ddc4Srjs        ".gt", ".ge"
744296c5ddc4Srjs    };
744396c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 12, 1) << 0)];
744496c5ddc4Srjs    static const char *swz0_table[] = {
744596c5ddc4Srjs        ".h00", ".h10", "", ".h11"
744696c5ddc4Srjs    };
744796c5ddc4Srjs
744896c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
744996c5ddc4Srjs
745096c5ddc4Srjs    static const char *swz1_table[] = {
745196c5ddc4Srjs        ".h00", ".h10", "", ".h11"
745296c5ddc4Srjs    };
745396c5ddc4Srjs
745496c5ddc4Srjs    const char *swz1 = swz1_table[_BITS(bits, 8, 2)];
745596c5ddc4Srjs
745696c5ddc4Srjs    static const char *result_type_table[] = {
745796c5ddc4Srjs        "", ".m1"
745896c5ddc4Srjs    };
745996c5ddc4Srjs
746096c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
746196c5ddc4Srjs
746296c5ddc4Srjs    fputs("+ICMP.v2u16", fp);
746396c5ddc4Srjs    fputs(result_type, fp);
746496c5ddc4Srjs    fputs(cmpf, fp);
746596c5ddc4Srjs    fputs(" ", fp);
746696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
746796c5ddc4Srjs    fputs(", ", fp);
746896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
746996c5ddc4Srjs    fputs(swz0, fp);
747096c5ddc4Srjs    fputs(", ", fp);
747196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
747296c5ddc4Srjs    fputs(swz1, fp);
747396c5ddc4Srjs}
747496c5ddc4Srjs
747596c5ddc4Srjsstatic void
747696c5ddc4Srjsbi_disasm_add_icmp_v4i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
747796c5ddc4Srjs{
747896c5ddc4Srjs    static const char *result_type_table[] = {
747996c5ddc4Srjs        "", ".m1"
748096c5ddc4Srjs    };
748196c5ddc4Srjs
748296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
748396c5ddc4Srjs
748496c5ddc4Srjs    static const char *cmpf_table[] = {
748596c5ddc4Srjs        ".eq", ".ne"
748696c5ddc4Srjs    };
748796c5ddc4Srjs
748896c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 1)];
748996c5ddc4Srjs
749096c5ddc4Srjs    fputs("+ICMP.v4i8", fp);
749196c5ddc4Srjs    fputs(result_type, fp);
749296c5ddc4Srjs    fputs(cmpf, fp);
749396c5ddc4Srjs    fputs(" ", fp);
749496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
749596c5ddc4Srjs    fputs(", ", fp);
749696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
749796c5ddc4Srjs    fputs(", ", fp);
749896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
749996c5ddc4Srjs}
750096c5ddc4Srjs
750196c5ddc4Srjsstatic void
750296c5ddc4Srjsbi_disasm_add_icmp_v4s8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
750396c5ddc4Srjs{
750496c5ddc4Srjs    static const char *cmpf_table[] = {
750596c5ddc4Srjs        ".gt", ".ge"
750696c5ddc4Srjs    };
750796c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 6, 1) << 0)];
750896c5ddc4Srjs    static const char *result_type_table[] = {
750996c5ddc4Srjs        "", ".m1"
751096c5ddc4Srjs    };
751196c5ddc4Srjs
751296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
751396c5ddc4Srjs
751496c5ddc4Srjs    fputs("+ICMP.v4s8", fp);
751596c5ddc4Srjs    fputs(result_type, fp);
751696c5ddc4Srjs    fputs(cmpf, fp);
751796c5ddc4Srjs    fputs(" ", fp);
751896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
751996c5ddc4Srjs    fputs(", ", fp);
752096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
752196c5ddc4Srjs    fputs(", ", fp);
752296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
752396c5ddc4Srjs}
752496c5ddc4Srjs
752596c5ddc4Srjsstatic void
752696c5ddc4Srjsbi_disasm_add_icmp_v4u8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
752796c5ddc4Srjs{
752896c5ddc4Srjs    static const char *cmpf_table[] = {
752996c5ddc4Srjs        ".gt", ".ge"
753096c5ddc4Srjs    };
753196c5ddc4Srjs    const char *cmpf = cmpf_table[(_BITS(bits, 6, 1) << 0)];
753296c5ddc4Srjs    static const char *result_type_table[] = {
753396c5ddc4Srjs        "", ".m1"
753496c5ddc4Srjs    };
753596c5ddc4Srjs
753696c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
753796c5ddc4Srjs
753896c5ddc4Srjs    fputs("+ICMP.v4u8", fp);
753996c5ddc4Srjs    fputs(result_type, fp);
754096c5ddc4Srjs    fputs(cmpf, fp);
754196c5ddc4Srjs    fputs(" ", fp);
754296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
754396c5ddc4Srjs    fputs(", ", fp);
754496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
754596c5ddc4Srjs    fputs(", ", fp);
754696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
754796c5ddc4Srjs}
754896c5ddc4Srjs
754996c5ddc4Srjsstatic void
755096c5ddc4Srjsbi_disasm_add_icmpf_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
755196c5ddc4Srjs{
755296c5ddc4Srjs    fputs("+ICMPF.i32", fp);
755396c5ddc4Srjs    fputs(" ", fp);
755496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
755596c5ddc4Srjs    fputs(", ", fp);
755696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
755796c5ddc4Srjs    fputs(", ", fp);
755896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
755996c5ddc4Srjs    fputs(", ", fp);
756096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
756196c5ddc4Srjs}
756296c5ddc4Srjs
756396c5ddc4Srjsstatic void
756496c5ddc4Srjsbi_disasm_add_icmpi_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
756596c5ddc4Srjs{
756696c5ddc4Srjs    static const char *result_type_table[] = {
756796c5ddc4Srjs        "", ".m1"
756896c5ddc4Srjs    };
756996c5ddc4Srjs
757096c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
757196c5ddc4Srjs
757296c5ddc4Srjs    static const char *cmpf_table[] = {
757396c5ddc4Srjs        ".eq", ".ne"
757496c5ddc4Srjs    };
757596c5ddc4Srjs
757696c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 1)];
757796c5ddc4Srjs
757896c5ddc4Srjs    fputs("+ICMPI.i32", fp);
757996c5ddc4Srjs    fputs(result_type, fp);
758096c5ddc4Srjs    fputs(cmpf, fp);
758196c5ddc4Srjs    fputs(" ", fp);
758296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
758396c5ddc4Srjs    fputs(", ", fp);
758496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
758596c5ddc4Srjs    fputs(", ", fp);
758696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
758796c5ddc4Srjs}
758896c5ddc4Srjs
758996c5ddc4Srjsstatic void
759096c5ddc4Srjsbi_disasm_add_icmpi_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
759196c5ddc4Srjs{
759296c5ddc4Srjs    static const char *result_type_table[] = {
759396c5ddc4Srjs        "", ".m1"
759496c5ddc4Srjs    };
759596c5ddc4Srjs
759696c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
759796c5ddc4Srjs
759896c5ddc4Srjs    static const char *cmpf_table[] = {
759996c5ddc4Srjs        ".gt", ".ge"
760096c5ddc4Srjs    };
760196c5ddc4Srjs
760296c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 1)];
760396c5ddc4Srjs
760496c5ddc4Srjs    fputs("+ICMPI.s32", fp);
760596c5ddc4Srjs    fputs(result_type, fp);
760696c5ddc4Srjs    fputs(cmpf, fp);
760796c5ddc4Srjs    fputs(" ", fp);
760896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
760996c5ddc4Srjs    fputs(", ", fp);
761096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
761196c5ddc4Srjs    fputs(", ", fp);
761296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
761396c5ddc4Srjs}
761496c5ddc4Srjs
761596c5ddc4Srjsstatic void
761696c5ddc4Srjsbi_disasm_add_icmpi_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
761796c5ddc4Srjs{
761896c5ddc4Srjs    static const char *result_type_table[] = {
761996c5ddc4Srjs        "", ".m1"
762096c5ddc4Srjs    };
762196c5ddc4Srjs
762296c5ddc4Srjs    const char *result_type = result_type_table[_BITS(bits, 10, 1)];
762396c5ddc4Srjs
762496c5ddc4Srjs    static const char *cmpf_table[] = {
762596c5ddc4Srjs        ".gt", ".ge"
762696c5ddc4Srjs    };
762796c5ddc4Srjs
762896c5ddc4Srjs    const char *cmpf = cmpf_table[_BITS(bits, 6, 1)];
762996c5ddc4Srjs
763096c5ddc4Srjs    fputs("+ICMPI.u32", fp);
763196c5ddc4Srjs    fputs(result_type, fp);
763296c5ddc4Srjs    fputs(cmpf, fp);
763396c5ddc4Srjs    fputs(" ", fp);
763496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
763596c5ddc4Srjs    fputs(", ", fp);
763696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
763796c5ddc4Srjs    fputs(", ", fp);
763896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
763996c5ddc4Srjs}
764096c5ddc4Srjs
764196c5ddc4Srjsstatic void
764296c5ddc4Srjsbi_disasm_add_icmpm_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
764396c5ddc4Srjs{
764496c5ddc4Srjs    fputs("+ICMPM.i32", fp);
764596c5ddc4Srjs    fputs(" ", fp);
764696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
764796c5ddc4Srjs    fputs(", ", fp);
764896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
764996c5ddc4Srjs    fputs(", ", fp);
765096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
765196c5ddc4Srjs    fputs(", ", fp);
765296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
765396c5ddc4Srjs}
765496c5ddc4Srjs
765596c5ddc4Srjsstatic void
765696c5ddc4Srjsbi_disasm_add_ilogb_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
765796c5ddc4Srjs{
765896c5ddc4Srjs    static const char *widen0_table[] = {
765996c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
766096c5ddc4Srjs    };
766196c5ddc4Srjs
766296c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
766396c5ddc4Srjs
766496c5ddc4Srjs    fputs("+ILOGB.f32", fp);
766596c5ddc4Srjs    fputs(" ", fp);
766696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
766796c5ddc4Srjs    fputs(", ", fp);
766896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
766996c5ddc4Srjs    fputs(widen0, fp);
767096c5ddc4Srjs}
767196c5ddc4Srjs
767296c5ddc4Srjsstatic void
767396c5ddc4Srjsbi_disasm_add_ilogb_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
767496c5ddc4Srjs{
767596c5ddc4Srjs    static const char *swz0_table[] = {
767696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
767796c5ddc4Srjs    };
767896c5ddc4Srjs
767996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
768096c5ddc4Srjs
768196c5ddc4Srjs    fputs("+ILOGB.v2f16", fp);
768296c5ddc4Srjs    fputs(" ", fp);
768396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
768496c5ddc4Srjs    fputs(", ", fp);
768596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
768696c5ddc4Srjs    fputs(swz0, fp);
768796c5ddc4Srjs}
768896c5ddc4Srjs
768996c5ddc4Srjsstatic void
769096c5ddc4Srjsbi_disasm_add_imov_fma(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
769196c5ddc4Srjs{
769296c5ddc4Srjs    static const char *threads_table[] = {
769396c5ddc4Srjs        ".even", ""
769496c5ddc4Srjs    };
769596c5ddc4Srjs
769696c5ddc4Srjs    const char *threads = threads_table[_BITS(bits, 3, 1)];
769796c5ddc4Srjs
769896c5ddc4Srjs    fputs("+IMOV_FMA", fp);
769996c5ddc4Srjs    fputs(threads, fp);
770096c5ddc4Srjs    fputs(" ", fp);
770196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
770296c5ddc4Srjs}
770396c5ddc4Srjs
770496c5ddc4Srjsstatic void
770596c5ddc4Srjsbi_disasm_add_isub_s32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
770696c5ddc4Srjs{
770796c5ddc4Srjs    static const char *lanes1_table[] = {
770896c5ddc4Srjs        ""
770996c5ddc4Srjs    };
771096c5ddc4Srjs    const char *lanes1 = lanes1_table[0];
771196c5ddc4Srjs    static const char *saturate_table[] = {
771296c5ddc4Srjs        "", ".sat"
771396c5ddc4Srjs    };
771496c5ddc4Srjs
771596c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
771696c5ddc4Srjs
771796c5ddc4Srjs    fputs("+ISUB.s32", fp);
771896c5ddc4Srjs    fputs(saturate, fp);
771996c5ddc4Srjs    fputs(" ", fp);
772096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
772196c5ddc4Srjs    fputs(", ", fp);
772296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
772396c5ddc4Srjs    fputs(", ", fp);
772496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
772596c5ddc4Srjs    fputs(lanes1, fp);
772696c5ddc4Srjs}
772796c5ddc4Srjs
772896c5ddc4Srjsstatic void
772996c5ddc4Srjsbi_disasm_add_isub_s32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
773096c5ddc4Srjs{
773196c5ddc4Srjs    static const char *lanes1_table[] = {
773296c5ddc4Srjs        ".h0", ".h1"
773396c5ddc4Srjs    };
773496c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
773596c5ddc4Srjs    static const char *saturate_table[] = {
773696c5ddc4Srjs        "", ".sat"
773796c5ddc4Srjs    };
773896c5ddc4Srjs
773996c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
774096c5ddc4Srjs
774196c5ddc4Srjs    fputs("+ISUB.s32", fp);
774296c5ddc4Srjs    fputs(saturate, fp);
774396c5ddc4Srjs    fputs(" ", fp);
774496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
774596c5ddc4Srjs    fputs(", ", fp);
774696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
774796c5ddc4Srjs    fputs(", ", fp);
774896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
774996c5ddc4Srjs    fputs(lanes1, fp);
775096c5ddc4Srjs}
775196c5ddc4Srjs
775296c5ddc4Srjsstatic void
775396c5ddc4Srjsbi_disasm_add_isub_s32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
775496c5ddc4Srjs{
775596c5ddc4Srjs    static const char *lanes1_table[] = {
775696c5ddc4Srjs        ".b0", ".b1", ".b2", ".b3"
775796c5ddc4Srjs    };
775896c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 2) << 0)];
775996c5ddc4Srjs    static const char *saturate_table[] = {
776096c5ddc4Srjs        "", ".sat"
776196c5ddc4Srjs    };
776296c5ddc4Srjs
776396c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
776496c5ddc4Srjs
776596c5ddc4Srjs    fputs("+ISUB.s32", fp);
776696c5ddc4Srjs    fputs(saturate, fp);
776796c5ddc4Srjs    fputs(" ", fp);
776896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
776996c5ddc4Srjs    fputs(", ", fp);
777096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
777196c5ddc4Srjs    fputs(", ", fp);
777296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
777396c5ddc4Srjs    fputs(lanes1, fp);
777496c5ddc4Srjs}
777596c5ddc4Srjs
777696c5ddc4Srjsstatic void
777796c5ddc4Srjsbi_disasm_add_isub_u32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
777896c5ddc4Srjs{
777996c5ddc4Srjs    static const char *lanes1_table[] = {
778096c5ddc4Srjs        ".reserved", ""
778196c5ddc4Srjs    };
778296c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0)];
778396c5ddc4Srjs    static const char *saturate_table[] = {
778496c5ddc4Srjs        "", ".sat"
778596c5ddc4Srjs    };
778696c5ddc4Srjs
778796c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
778896c5ddc4Srjs
778996c5ddc4Srjs    fputs("+ISUB.u32", fp);
779096c5ddc4Srjs    fputs(saturate, fp);
779196c5ddc4Srjs    fputs(" ", fp);
779296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
779396c5ddc4Srjs    fputs(", ", fp);
779496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
779596c5ddc4Srjs    fputs(", ", fp);
779696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
779796c5ddc4Srjs    fputs(lanes1, fp);
779896c5ddc4Srjs}
779996c5ddc4Srjs
780096c5ddc4Srjsstatic void
780196c5ddc4Srjsbi_disasm_add_isub_u32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
780296c5ddc4Srjs{
780396c5ddc4Srjs    static const char *lanes1_table[] = {
780496c5ddc4Srjs        ".reserved", ".h0", ".reserved", ".h1"
780596c5ddc4Srjs    };
780696c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
780796c5ddc4Srjs    static const char *saturate_table[] = {
780896c5ddc4Srjs        "", ".sat"
780996c5ddc4Srjs    };
781096c5ddc4Srjs
781196c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
781296c5ddc4Srjs
781396c5ddc4Srjs    fputs("+ISUB.u32", fp);
781496c5ddc4Srjs    fputs(saturate, fp);
781596c5ddc4Srjs    fputs(" ", fp);
781696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
781796c5ddc4Srjs    fputs(", ", fp);
781896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
781996c5ddc4Srjs    fputs(", ", fp);
782096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
782196c5ddc4Srjs    fputs(lanes1, fp);
782296c5ddc4Srjs}
782396c5ddc4Srjs
782496c5ddc4Srjsstatic void
782596c5ddc4Srjsbi_disasm_add_isub_u32_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
782696c5ddc4Srjs{
782796c5ddc4Srjs    static const char *lanes1_table[] = {
782896c5ddc4Srjs        ".reserved", ".b0", ".reserved", ".b1", ".reserved", ".b2", ".reserved", ".b3"
782996c5ddc4Srjs    };
783096c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
783196c5ddc4Srjs    static const char *saturate_table[] = {
783296c5ddc4Srjs        "", ".sat"
783396c5ddc4Srjs    };
783496c5ddc4Srjs
783596c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
783696c5ddc4Srjs
783796c5ddc4Srjs    fputs("+ISUB.u32", fp);
783896c5ddc4Srjs    fputs(saturate, fp);
783996c5ddc4Srjs    fputs(" ", fp);
784096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
784196c5ddc4Srjs    fputs(", ", fp);
784296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
784396c5ddc4Srjs    fputs(", ", fp);
784496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
784596c5ddc4Srjs    fputs(lanes1, fp);
784696c5ddc4Srjs}
784796c5ddc4Srjs
784896c5ddc4Srjsstatic void
784996c5ddc4Srjsbi_disasm_add_isub_v2s16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
785096c5ddc4Srjs{
785196c5ddc4Srjs    static const char *lanes1_table[] = {
785296c5ddc4Srjs        "", ".h10", "", ".h10"
785396c5ddc4Srjs    };
785496c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
785596c5ddc4Srjs    static const char *lanes0_table[] = {
785696c5ddc4Srjs        "", "", ".h10", ".h10"
785796c5ddc4Srjs    };
785896c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
785996c5ddc4Srjs    static const char *saturate_table[] = {
786096c5ddc4Srjs        "", ".sat"
786196c5ddc4Srjs    };
786296c5ddc4Srjs
786396c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
786496c5ddc4Srjs
786596c5ddc4Srjs    fputs("+ISUB.v2s16", fp);
786696c5ddc4Srjs    fputs(saturate, fp);
786796c5ddc4Srjs    fputs(" ", fp);
786896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
786996c5ddc4Srjs    fputs(", ", fp);
787096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
787196c5ddc4Srjs    fputs(lanes0, fp);
787296c5ddc4Srjs    fputs(", ", fp);
787396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
787496c5ddc4Srjs    fputs(lanes1, fp);
787596c5ddc4Srjs}
787696c5ddc4Srjs
787796c5ddc4Srjsstatic void
787896c5ddc4Srjsbi_disasm_add_isub_v2s16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
787996c5ddc4Srjs{
788096c5ddc4Srjs    static const char *lanes1_table[] = {
788196c5ddc4Srjs        ".h00", ".h11"
788296c5ddc4Srjs    };
788396c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
788496c5ddc4Srjs    static const char *lanes0_table[] = {
788596c5ddc4Srjs        "", ""
788696c5ddc4Srjs    };
788796c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
788896c5ddc4Srjs    static const char *saturate_table[] = {
788996c5ddc4Srjs        "", ".sat"
789096c5ddc4Srjs    };
789196c5ddc4Srjs
789296c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
789396c5ddc4Srjs
789496c5ddc4Srjs    fputs("+ISUB.v2s16", fp);
789596c5ddc4Srjs    fputs(saturate, fp);
789696c5ddc4Srjs    fputs(" ", fp);
789796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
789896c5ddc4Srjs    fputs(", ", fp);
789996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
790096c5ddc4Srjs    fputs(lanes0, fp);
790196c5ddc4Srjs    fputs(", ", fp);
790296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
790396c5ddc4Srjs    fputs(lanes1, fp);
790496c5ddc4Srjs}
790596c5ddc4Srjs
790696c5ddc4Srjsstatic void
790796c5ddc4Srjsbi_disasm_add_isub_v2s16_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
790896c5ddc4Srjs{
790996c5ddc4Srjs    static const char *lanes1_table[] = {
791096c5ddc4Srjs        ".b01", ".b23"
791196c5ddc4Srjs    };
791296c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
791396c5ddc4Srjs    static const char *lanes0_table[] = {
791496c5ddc4Srjs        "", ""
791596c5ddc4Srjs    };
791696c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
791796c5ddc4Srjs    static const char *saturate_table[] = {
791896c5ddc4Srjs        "", ".sat"
791996c5ddc4Srjs    };
792096c5ddc4Srjs
792196c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
792296c5ddc4Srjs
792396c5ddc4Srjs    fputs("+ISUB.v2s16", fp);
792496c5ddc4Srjs    fputs(saturate, fp);
792596c5ddc4Srjs    fputs(" ", fp);
792696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
792796c5ddc4Srjs    fputs(", ", fp);
792896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
792996c5ddc4Srjs    fputs(lanes0, fp);
793096c5ddc4Srjs    fputs(", ", fp);
793196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
793296c5ddc4Srjs    fputs(lanes1, fp);
793396c5ddc4Srjs}
793496c5ddc4Srjs
793596c5ddc4Srjsstatic void
793696c5ddc4Srjsbi_disasm_add_isub_v2u16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
793796c5ddc4Srjs{
793896c5ddc4Srjs    static const char *lanes1_table[] = {
793996c5ddc4Srjs        ".reserved", "", ".reserved", ".h10", ".reserved", "", ".reserved", ".h10"
794096c5ddc4Srjs    };
794196c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1) | (_BITS(bits, 10, 1) << 2)];
794296c5ddc4Srjs    static const char *lanes0_table[] = {
794396c5ddc4Srjs        ".reserved", "", ".reserved", "", ".reserved", ".h10", ".reserved", ".h10"
794496c5ddc4Srjs    };
794596c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1) | (_BITS(bits, 10, 1) << 2)];
794696c5ddc4Srjs    static const char *saturate_table[] = {
794796c5ddc4Srjs        "", ".sat"
794896c5ddc4Srjs    };
794996c5ddc4Srjs
795096c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
795196c5ddc4Srjs
795296c5ddc4Srjs    fputs("+ISUB.v2u16", fp);
795396c5ddc4Srjs    fputs(saturate, fp);
795496c5ddc4Srjs    fputs(" ", fp);
795596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
795696c5ddc4Srjs    fputs(", ", fp);
795796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
795896c5ddc4Srjs    fputs(lanes0, fp);
795996c5ddc4Srjs    fputs(", ", fp);
796096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
796196c5ddc4Srjs    fputs(lanes1, fp);
796296c5ddc4Srjs}
796396c5ddc4Srjs
796496c5ddc4Srjsstatic void
796596c5ddc4Srjsbi_disasm_add_isub_v2u16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
796696c5ddc4Srjs{
796796c5ddc4Srjs    static const char *lanes1_table[] = {
796896c5ddc4Srjs        ".reserved", ".h00", ".reserved", ".h11"
796996c5ddc4Srjs    };
797096c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
797196c5ddc4Srjs    static const char *lanes0_table[] = {
797296c5ddc4Srjs        ".reserved", "", ".reserved", ""
797396c5ddc4Srjs    };
797496c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
797596c5ddc4Srjs    static const char *saturate_table[] = {
797696c5ddc4Srjs        "", ".sat"
797796c5ddc4Srjs    };
797896c5ddc4Srjs
797996c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
798096c5ddc4Srjs
798196c5ddc4Srjs    fputs("+ISUB.v2u16", fp);
798296c5ddc4Srjs    fputs(saturate, fp);
798396c5ddc4Srjs    fputs(" ", fp);
798496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
798596c5ddc4Srjs    fputs(", ", fp);
798696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
798796c5ddc4Srjs    fputs(lanes0, fp);
798896c5ddc4Srjs    fputs(", ", fp);
798996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
799096c5ddc4Srjs    fputs(lanes1, fp);
799196c5ddc4Srjs}
799296c5ddc4Srjs
799396c5ddc4Srjsstatic void
799496c5ddc4Srjsbi_disasm_add_isub_v2u16_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
799596c5ddc4Srjs{
799696c5ddc4Srjs    static const char *lanes1_table[] = {
799796c5ddc4Srjs        ".reserved", ".b01", ".reserved", ".b23"
799896c5ddc4Srjs    };
799996c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
800096c5ddc4Srjs    static const char *lanes0_table[] = {
800196c5ddc4Srjs        ".reserved", "", ".reserved", ""
800296c5ddc4Srjs    };
800396c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
800496c5ddc4Srjs    static const char *saturate_table[] = {
800596c5ddc4Srjs        "", ".sat"
800696c5ddc4Srjs    };
800796c5ddc4Srjs
800896c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
800996c5ddc4Srjs
801096c5ddc4Srjs    fputs("+ISUB.v2u16", fp);
801196c5ddc4Srjs    fputs(saturate, fp);
801296c5ddc4Srjs    fputs(" ", fp);
801396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
801496c5ddc4Srjs    fputs(", ", fp);
801596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
801696c5ddc4Srjs    fputs(lanes0, fp);
801796c5ddc4Srjs    fputs(", ", fp);
801896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
801996c5ddc4Srjs    fputs(lanes1, fp);
802096c5ddc4Srjs}
802196c5ddc4Srjs
802296c5ddc4Srjsstatic void
802396c5ddc4Srjsbi_disasm_add_isub_v4s8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
802496c5ddc4Srjs{
802596c5ddc4Srjs    static const char *lanes1_table[] = {
802696c5ddc4Srjs        ""
802796c5ddc4Srjs    };
802896c5ddc4Srjs    const char *lanes1 = lanes1_table[0];
802996c5ddc4Srjs    static const char *lanes0_table[] = {
803096c5ddc4Srjs        ""
803196c5ddc4Srjs    };
803296c5ddc4Srjs    const char *lanes0 = lanes0_table[0];
803396c5ddc4Srjs    static const char *saturate_table[] = {
803496c5ddc4Srjs        "", ".sat"
803596c5ddc4Srjs    };
803696c5ddc4Srjs
803796c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
803896c5ddc4Srjs
803996c5ddc4Srjs    fputs("+ISUB.v4s8", fp);
804096c5ddc4Srjs    fputs(saturate, fp);
804196c5ddc4Srjs    fputs(" ", fp);
804296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
804396c5ddc4Srjs    fputs(", ", fp);
804496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
804596c5ddc4Srjs    fputs(lanes0, fp);
804696c5ddc4Srjs    fputs(", ", fp);
804796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
804896c5ddc4Srjs    fputs(lanes1, fp);
804996c5ddc4Srjs}
805096c5ddc4Srjs
805196c5ddc4Srjsstatic void
805296c5ddc4Srjsbi_disasm_add_isub_v4s8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
805396c5ddc4Srjs{
805496c5ddc4Srjs    static const char *lanes1_table[] = {
805596c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333"
805696c5ddc4Srjs    };
805796c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 2) << 0)];
805896c5ddc4Srjs    static const char *lanes0_table[] = {
805996c5ddc4Srjs        "", "", "", ""
806096c5ddc4Srjs    };
806196c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 2) << 0)];
806296c5ddc4Srjs    static const char *saturate_table[] = {
806396c5ddc4Srjs        "", ".sat"
806496c5ddc4Srjs    };
806596c5ddc4Srjs
806696c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
806796c5ddc4Srjs
806896c5ddc4Srjs    fputs("+ISUB.v4s8", fp);
806996c5ddc4Srjs    fputs(saturate, fp);
807096c5ddc4Srjs    fputs(" ", fp);
807196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
807296c5ddc4Srjs    fputs(", ", fp);
807396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
807496c5ddc4Srjs    fputs(lanes0, fp);
807596c5ddc4Srjs    fputs(", ", fp);
807696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
807796c5ddc4Srjs    fputs(lanes1, fp);
807896c5ddc4Srjs}
807996c5ddc4Srjs
808096c5ddc4Srjsstatic void
808196c5ddc4Srjsbi_disasm_add_isub_v4s8_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
808296c5ddc4Srjs{
808396c5ddc4Srjs    static const char *lanes1_table[] = {
808496c5ddc4Srjs        ".b0101", ".b2323"
808596c5ddc4Srjs    };
808696c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 9, 1) << 0)];
808796c5ddc4Srjs    static const char *lanes0_table[] = {
808896c5ddc4Srjs        "", ""
808996c5ddc4Srjs    };
809096c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 9, 1) << 0)];
809196c5ddc4Srjs    static const char *saturate_table[] = {
809296c5ddc4Srjs        "", ".sat"
809396c5ddc4Srjs    };
809496c5ddc4Srjs
809596c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
809696c5ddc4Srjs
809796c5ddc4Srjs    fputs("+ISUB.v4s8", fp);
809896c5ddc4Srjs    fputs(saturate, fp);
809996c5ddc4Srjs    fputs(" ", fp);
810096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
810196c5ddc4Srjs    fputs(", ", fp);
810296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
810396c5ddc4Srjs    fputs(lanes0, fp);
810496c5ddc4Srjs    fputs(", ", fp);
810596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
810696c5ddc4Srjs    fputs(lanes1, fp);
810796c5ddc4Srjs}
810896c5ddc4Srjs
810996c5ddc4Srjsstatic void
811096c5ddc4Srjsbi_disasm_add_isub_v4u8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
811196c5ddc4Srjs{
811296c5ddc4Srjs    static const char *lanes1_table[] = {
811396c5ddc4Srjs        ".reserved", ""
811496c5ddc4Srjs    };
811596c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0)];
811696c5ddc4Srjs    static const char *lanes0_table[] = {
811796c5ddc4Srjs        ".reserved", ""
811896c5ddc4Srjs    };
811996c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0)];
812096c5ddc4Srjs    static const char *saturate_table[] = {
812196c5ddc4Srjs        "", ".sat"
812296c5ddc4Srjs    };
812396c5ddc4Srjs
812496c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
812596c5ddc4Srjs
812696c5ddc4Srjs    fputs("+ISUB.v4u8", fp);
812796c5ddc4Srjs    fputs(saturate, fp);
812896c5ddc4Srjs    fputs(" ", fp);
812996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
813096c5ddc4Srjs    fputs(", ", fp);
813196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
813296c5ddc4Srjs    fputs(lanes0, fp);
813396c5ddc4Srjs    fputs(", ", fp);
813496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
813596c5ddc4Srjs    fputs(lanes1, fp);
813696c5ddc4Srjs}
813796c5ddc4Srjs
813896c5ddc4Srjsstatic void
813996c5ddc4Srjsbi_disasm_add_isub_v4u8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
814096c5ddc4Srjs{
814196c5ddc4Srjs    static const char *lanes1_table[] = {
814296c5ddc4Srjs        ".reserved", ".b0000", ".reserved", ".b1111", ".reserved", ".b2222", ".reserved", ".b3333"
814396c5ddc4Srjs    };
814496c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
814596c5ddc4Srjs    static const char *lanes0_table[] = {
814696c5ddc4Srjs        ".reserved", "", ".reserved", "", ".reserved", "", ".reserved", ""
814796c5ddc4Srjs    };
814896c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 2) << 1)];
814996c5ddc4Srjs    static const char *saturate_table[] = {
815096c5ddc4Srjs        "", ".sat"
815196c5ddc4Srjs    };
815296c5ddc4Srjs
815396c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
815496c5ddc4Srjs
815596c5ddc4Srjs    fputs("+ISUB.v4u8", fp);
815696c5ddc4Srjs    fputs(saturate, fp);
815796c5ddc4Srjs    fputs(" ", fp);
815896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
815996c5ddc4Srjs    fputs(", ", fp);
816096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
816196c5ddc4Srjs    fputs(lanes0, fp);
816296c5ddc4Srjs    fputs(", ", fp);
816396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
816496c5ddc4Srjs    fputs(lanes1, fp);
816596c5ddc4Srjs}
816696c5ddc4Srjs
816796c5ddc4Srjsstatic void
816896c5ddc4Srjsbi_disasm_add_isub_v4u8_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
816996c5ddc4Srjs{
817096c5ddc4Srjs    static const char *lanes1_table[] = {
817196c5ddc4Srjs        ".reserved", ".b0101", ".reserved", ".b2323"
817296c5ddc4Srjs    };
817396c5ddc4Srjs    const char *lanes1 = lanes1_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
817496c5ddc4Srjs    static const char *lanes0_table[] = {
817596c5ddc4Srjs        ".reserved", "", ".reserved", ""
817696c5ddc4Srjs    };
817796c5ddc4Srjs    const char *lanes0 = lanes0_table[(_BITS(bits, 7, 1) << 0) | (_BITS(bits, 9, 1) << 1)];
817896c5ddc4Srjs    static const char *saturate_table[] = {
817996c5ddc4Srjs        "", ".sat"
818096c5ddc4Srjs    };
818196c5ddc4Srjs
818296c5ddc4Srjs    const char *saturate = saturate_table[_BITS(bits, 8, 1)];
818396c5ddc4Srjs
818496c5ddc4Srjs    fputs("+ISUB.v4u8", fp);
818596c5ddc4Srjs    fputs(saturate, fp);
818696c5ddc4Srjs    fputs(" ", fp);
818796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
818896c5ddc4Srjs    fputs(", ", fp);
818996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
819096c5ddc4Srjs    fputs(lanes0, fp);
819196c5ddc4Srjs    fputs(", ", fp);
819296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
819396c5ddc4Srjs    fputs(lanes1, fp);
819496c5ddc4Srjs}
819596c5ddc4Srjs
819696c5ddc4Srjsstatic void
819796c5ddc4Srjsbi_disasm_add_jump(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
819896c5ddc4Srjs{
819996c5ddc4Srjs    fputs("+JUMP", fp);
820096c5ddc4Srjs    fputs(" ", fp);
820196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
820296c5ddc4Srjs    fputs(", ", fp);
820396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
820496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
820596c5ddc4Srjs}
820696c5ddc4Srjs
820796c5ddc4Srjsstatic void
820896c5ddc4Srjsbi_disasm_add_kaboom(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
820996c5ddc4Srjs{
821096c5ddc4Srjs    fputs("+KABOOM", fp);
821196c5ddc4Srjs    fputs(" ", fp);
821296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
821396c5ddc4Srjs    fputs(", ", fp);
821496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
821596c5ddc4Srjs}
821696c5ddc4Srjs
821796c5ddc4Srjsstatic void
821896c5ddc4Srjsbi_disasm_add_ldexp_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
821996c5ddc4Srjs{
822096c5ddc4Srjs    static const char *round_table[] = {
822196c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz", ".rtna", ".reserved", ".inf", ".inf0"
822296c5ddc4Srjs    };
822396c5ddc4Srjs
822496c5ddc4Srjs    const char *round = round_table[_BITS(bits, 6, 3)];
822596c5ddc4Srjs
822696c5ddc4Srjs    fputs("+LDEXP.f32", fp);
822796c5ddc4Srjs    fputs(round, fp);
822896c5ddc4Srjs    fputs(" ", fp);
822996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
823096c5ddc4Srjs    fputs(", ", fp);
823196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
823296c5ddc4Srjs    fputs(", ", fp);
823396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
823496c5ddc4Srjs}
823596c5ddc4Srjs
823696c5ddc4Srjsstatic void
823796c5ddc4Srjsbi_disasm_add_ldexp_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
823896c5ddc4Srjs{
823996c5ddc4Srjs    static const char *round_table[] = {
824096c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz", ".rtna", ".reserved", ".inf", ".inf0"
824196c5ddc4Srjs    };
824296c5ddc4Srjs
824396c5ddc4Srjs    const char *round = round_table[_BITS(bits, 6, 3)];
824496c5ddc4Srjs
824596c5ddc4Srjs    fputs("+LDEXP.v2f16", fp);
824696c5ddc4Srjs    fputs(round, fp);
824796c5ddc4Srjs    fputs(" ", fp);
824896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
824996c5ddc4Srjs    fputs(", ", fp);
825096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
825196c5ddc4Srjs    fputs(", ", fp);
825296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
825396c5ddc4Srjs}
825496c5ddc4Srjs
825596c5ddc4Srjsstatic void
825696c5ddc4Srjsbi_disasm_add_ld_attr_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
825796c5ddc4Srjs{
825896c5ddc4Srjs    static const char *register_format_table[] = {
825996c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
826096c5ddc4Srjs    };
826196c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 13, 3) << 0)];
826296c5ddc4Srjs    static const char *vecsize_table[] = {
826396c5ddc4Srjs        "", ".v2", ".v3", ".v4"
826496c5ddc4Srjs    };
826596c5ddc4Srjs
826696c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
826796c5ddc4Srjs
826896c5ddc4Srjs    fputs("+LD_ATTR", fp);
826996c5ddc4Srjs    fputs(register_format, fp);
827096c5ddc4Srjs    fputs(vecsize, fp);
827196c5ddc4Srjs    fputs(" ", fp);
827296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
827396c5ddc4Srjs    fputs(", ", fp);
827496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
827596c5ddc4Srjs    fputs(", ", fp);
827696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
827796c5ddc4Srjs    fputs(", ", fp);
827896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
827996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
828096c5ddc4Srjs}
828196c5ddc4Srjs
828296c5ddc4Srjsstatic void
828396c5ddc4Srjsbi_disasm_add_ld_attr_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
828496c5ddc4Srjs{
828596c5ddc4Srjs    static const char *register_format_table[] = {
828696c5ddc4Srjs        ".auto"
828796c5ddc4Srjs    };
828896c5ddc4Srjs    const char *register_format = register_format_table[0];
828996c5ddc4Srjs    static const char *vecsize_table[] = {
829096c5ddc4Srjs        "", ".v2", ".v3", ".v4"
829196c5ddc4Srjs    };
829296c5ddc4Srjs
829396c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
829496c5ddc4Srjs
829596c5ddc4Srjs    fputs("+LD_ATTR", fp);
829696c5ddc4Srjs    fputs(register_format, fp);
829796c5ddc4Srjs    fputs(vecsize, fp);
829896c5ddc4Srjs    fputs(" ", fp);
829996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
830096c5ddc4Srjs    fputs(", ", fp);
830196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
830296c5ddc4Srjs    fputs(", ", fp);
830396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
830496c5ddc4Srjs    fputs(", ", fp);
830596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
830696c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
830796c5ddc4Srjs}
830896c5ddc4Srjs
830996c5ddc4Srjsstatic void
831096c5ddc4Srjsbi_disasm_add_ld_attr_imm_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
831196c5ddc4Srjs{
831296c5ddc4Srjs    static const char *register_format_table[] = {
831396c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
831496c5ddc4Srjs    };
831596c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 13, 3) << 0)];
831696c5ddc4Srjs    static const char *vecsize_table[] = {
831796c5ddc4Srjs        "", ".v2", ".v3", ".v4"
831896c5ddc4Srjs    };
831996c5ddc4Srjs
832096c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
832196c5ddc4Srjs
832296c5ddc4Srjs    fputs("+LD_ATTR_IMM", fp);
832396c5ddc4Srjs    fputs(register_format, fp);
832496c5ddc4Srjs    fputs(vecsize, fp);
832596c5ddc4Srjs    fputs(" ", fp);
832696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
832796c5ddc4Srjs    fputs(", ", fp);
832896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
832996c5ddc4Srjs    fputs(", ", fp);
833096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
833196c5ddc4Srjs    fprintf(fp, ", attribute_index:%u", _BITS(bits, 6, 4));
833296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
833396c5ddc4Srjs}
833496c5ddc4Srjs
833596c5ddc4Srjsstatic void
833696c5ddc4Srjsbi_disasm_add_ld_attr_imm_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
833796c5ddc4Srjs{
833896c5ddc4Srjs    static const char *register_format_table[] = {
833996c5ddc4Srjs        ".auto"
834096c5ddc4Srjs    };
834196c5ddc4Srjs    const char *register_format = register_format_table[0];
834296c5ddc4Srjs    static const char *vecsize_table[] = {
834396c5ddc4Srjs        "", ".v2", ".v3", ".v4"
834496c5ddc4Srjs    };
834596c5ddc4Srjs
834696c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
834796c5ddc4Srjs
834896c5ddc4Srjs    fputs("+LD_ATTR_IMM", fp);
834996c5ddc4Srjs    fputs(register_format, fp);
835096c5ddc4Srjs    fputs(vecsize, fp);
835196c5ddc4Srjs    fputs(" ", fp);
835296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
835396c5ddc4Srjs    fputs(", ", fp);
835496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
835596c5ddc4Srjs    fputs(", ", fp);
835696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
835796c5ddc4Srjs    fprintf(fp, ", attribute_index:%u", _BITS(bits, 6, 4));
835896c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
835996c5ddc4Srjs}
836096c5ddc4Srjs
836196c5ddc4Srjsstatic void
836296c5ddc4Srjsbi_disasm_add_ld_attr_tex_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
836396c5ddc4Srjs{
836496c5ddc4Srjs    static const char *register_format_table[] = {
836596c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
836696c5ddc4Srjs    };
836796c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 13, 3) << 0)];
836896c5ddc4Srjs    static const char *vecsize_table[] = {
836996c5ddc4Srjs        "", ".v2", ".v3", ".v4"
837096c5ddc4Srjs    };
837196c5ddc4Srjs
837296c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
837396c5ddc4Srjs
837496c5ddc4Srjs    fputs("+LD_ATTR_TEX", fp);
837596c5ddc4Srjs    fputs(register_format, fp);
837696c5ddc4Srjs    fputs(vecsize, fp);
837796c5ddc4Srjs    fputs(" ", fp);
837896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
837996c5ddc4Srjs    fputs(", ", fp);
838096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
838196c5ddc4Srjs    fputs(", ", fp);
838296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
838396c5ddc4Srjs    fputs(", ", fp);
838496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
838596c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
838696c5ddc4Srjs}
838796c5ddc4Srjs
838896c5ddc4Srjsstatic void
838996c5ddc4Srjsbi_disasm_add_ld_attr_tex_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
839096c5ddc4Srjs{
839196c5ddc4Srjs    static const char *register_format_table[] = {
839296c5ddc4Srjs        ".auto"
839396c5ddc4Srjs    };
839496c5ddc4Srjs    const char *register_format = register_format_table[0];
839596c5ddc4Srjs    static const char *vecsize_table[] = {
839696c5ddc4Srjs        "", ".v2", ".v3", ".v4"
839796c5ddc4Srjs    };
839896c5ddc4Srjs
839996c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 11, 2)];
840096c5ddc4Srjs
840196c5ddc4Srjs    fputs("+LD_ATTR_TEX", fp);
840296c5ddc4Srjs    fputs(register_format, fp);
840396c5ddc4Srjs    fputs(vecsize, fp);
840496c5ddc4Srjs    fputs(" ", fp);
840596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
840696c5ddc4Srjs    fputs(", ", fp);
840796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
840896c5ddc4Srjs    fputs(", ", fp);
840996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
841096c5ddc4Srjs    fputs(", ", fp);
841196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
841296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
841396c5ddc4Srjs}
841496c5ddc4Srjs
841596c5ddc4Srjsstatic void
841696c5ddc4Srjsbi_disasm_add_ld_cvt(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
841796c5ddc4Srjs{
841896c5ddc4Srjs    static const char *vecsize_table[] = {
841996c5ddc4Srjs        "", ".v2", ".v3", ".v4"
842096c5ddc4Srjs    };
842196c5ddc4Srjs
842296c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 9, 2)];
842396c5ddc4Srjs
842496c5ddc4Srjs    fputs("+LD_CVT", fp);
842596c5ddc4Srjs    fputs(vecsize, fp);
842696c5ddc4Srjs    fputs(" ", fp);
842796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
842896c5ddc4Srjs    fputs(", ", fp);
842996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
843096c5ddc4Srjs    fputs(", ", fp);
843196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
843296c5ddc4Srjs    fputs(", ", fp);
843396c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
843496c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
843596c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
843696c5ddc4Srjs}
843796c5ddc4Srjs
843896c5ddc4Srjsstatic void
843996c5ddc4Srjsbi_disasm_add_ld_gclk_u64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
844096c5ddc4Srjs{
844196c5ddc4Srjs    static const char *source_table[] = {
844296c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".system_timestamp", ".cycle_counter"
844396c5ddc4Srjs    };
844496c5ddc4Srjs
844596c5ddc4Srjs    const char *source = source_table[_BITS(bits, 0, 3)];
844696c5ddc4Srjs
844796c5ddc4Srjs    fputs("+LD_GCLK.u64", fp);
844896c5ddc4Srjs    fputs(source, fp);
844996c5ddc4Srjs    fputs(" ", fp);
845096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
845196c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
845296c5ddc4Srjs}
845396c5ddc4Srjs
845496c5ddc4Srjsstatic void
845596c5ddc4Srjsbi_disasm_add_ld_tile(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
845696c5ddc4Srjs{
845796c5ddc4Srjs    static const char *vecsize_table[] = {
845896c5ddc4Srjs        "", ".v2", ".v3", ".v4"
845996c5ddc4Srjs    };
846096c5ddc4Srjs
846196c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 9, 2)];
846296c5ddc4Srjs
846396c5ddc4Srjs    fputs("+LD_TILE", fp);
846496c5ddc4Srjs    fputs(vecsize, fp);
846596c5ddc4Srjs    fputs(" ", fp);
846696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
846796c5ddc4Srjs    fputs(", ", fp);
846896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
846996c5ddc4Srjs    fputs(", ", fp);
847096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
847196c5ddc4Srjs    fputs(", ", fp);
847296c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
847396c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
847496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
847596c5ddc4Srjs}
847696c5ddc4Srjs
847796c5ddc4Srjsstatic void
847896c5ddc4Srjsbi_disasm_add_ld_var_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
847996c5ddc4Srjs{
848096c5ddc4Srjs    static const char *update_table[] = {
848196c5ddc4Srjs        ".store", ".store", ".store", ".store", ".store", ".store", ".store", ".store", ".retrieve", ".retrieve", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".conditional", ".conditional", ".conditional", ".conditional", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".reserved", ".reserved", ".reserved", ".reserved"
848296c5ddc4Srjs    };
848396c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
848496c5ddc4Srjs    static const char *sample_table[] = {
848596c5ddc4Srjs        ".center", ".center", ".centroid", ".centroid", ".sample", ".sample", ".explicit", ".explicit", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".center", ".center", ".centroid", ".centroid", ".center", ".center", ".centroid", ".centroid", ".sample", ".sample", ".explicit", ".explicit", ".reserved", ".reserved", ".reserved", ".reserved"
848696c5ddc4Srjs    };
848796c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
848896c5ddc4Srjs    static const char *register_format_table[] = {
848996c5ddc4Srjs        ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".reserved", ".reserved", ".reserved", ".reserved"
849096c5ddc4Srjs    };
849196c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
849296c5ddc4Srjs    static const char *vecsize_table[] = {
849396c5ddc4Srjs        "", ".v2", ".v3", ".v4"
849496c5ddc4Srjs    };
849596c5ddc4Srjs
849696c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
849796c5ddc4Srjs
849896c5ddc4Srjs    fputs("+LD_VAR", fp);
849996c5ddc4Srjs    fputs(vecsize, fp);
850096c5ddc4Srjs    fputs(update, fp);
850196c5ddc4Srjs    fputs(register_format, fp);
850296c5ddc4Srjs    fputs(sample, fp);
850396c5ddc4Srjs    fputs(" ", fp);
850496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
850596c5ddc4Srjs    fputs(", ", fp);
850696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
850796c5ddc4Srjs    fputs(", ", fp);
850896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
850996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
851096c5ddc4Srjs}
851196c5ddc4Srjs
851296c5ddc4Srjsstatic void
851396c5ddc4Srjsbi_disasm_add_ld_var_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
851496c5ddc4Srjs{
851596c5ddc4Srjs    static const char *update_table[] = {
851696c5ddc4Srjs        ".store", ".store", ".store", ".store", ".retrieve", ".reserved", ".reserved", ".reserved", ".conditional", ".conditional", ".clobber", ".clobber", ".clobber", ".clobber", ".reserved", ".reserved"
851796c5ddc4Srjs    };
851896c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 10, 4) << 0)];
851996c5ddc4Srjs    static const char *sample_table[] = {
852096c5ddc4Srjs        ".center", ".centroid", ".sample", ".explicit", "", ".reserved", ".reserved", ".reserved", ".center", ".centroid", ".center", ".centroid", ".sample", ".explicit", ".reserved", ".reserved"
852196c5ddc4Srjs    };
852296c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 10, 4) << 0)];
852396c5ddc4Srjs    static const char *register_format_table[] = {
852496c5ddc4Srjs        ".auto", ".auto", ".auto", ".auto", ".auto", ".reserved", ".reserved", ".reserved", ".auto", ".auto", ".auto", ".auto", ".auto", ".auto", ".reserved", ".reserved"
852596c5ddc4Srjs    };
852696c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 10, 4) << 0)];
852796c5ddc4Srjs    static const char *vecsize_table[] = {
852896c5ddc4Srjs        "", ".v2", ".v3", ".v4"
852996c5ddc4Srjs    };
853096c5ddc4Srjs
853196c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
853296c5ddc4Srjs
853396c5ddc4Srjs    fputs("+LD_VAR", fp);
853496c5ddc4Srjs    fputs(vecsize, fp);
853596c5ddc4Srjs    fputs(update, fp);
853696c5ddc4Srjs    fputs(register_format, fp);
853796c5ddc4Srjs    fputs(sample, fp);
853896c5ddc4Srjs    fputs(" ", fp);
853996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
854096c5ddc4Srjs    fputs(", ", fp);
854196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
854296c5ddc4Srjs    fputs(", ", fp);
854396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
854496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
854596c5ddc4Srjs}
854696c5ddc4Srjs
854796c5ddc4Srjsstatic void
854896c5ddc4Srjsbi_disasm_add_ld_var_flat_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
854996c5ddc4Srjs{
855096c5ddc4Srjs    static const char *register_format_table[] = {
855196c5ddc4Srjs        ".f32", ".u32", ".f16", ".s32"
855296c5ddc4Srjs    };
855396c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 10, 1) << 0) | (_BITS(bits, 19, 1) << 1)];
855496c5ddc4Srjs    static const char *vecsize_table[] = {
855596c5ddc4Srjs        "", ".v2", ".v3", ".v4"
855696c5ddc4Srjs    };
855796c5ddc4Srjs
855896c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
855996c5ddc4Srjs
856096c5ddc4Srjs    static const char *function_table[] = {
856196c5ddc4Srjs        ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".and", ".or"
856296c5ddc4Srjs    };
856396c5ddc4Srjs
856496c5ddc4Srjs    const char *function = function_table[_BITS(bits, 0, 3)];
856596c5ddc4Srjs
856696c5ddc4Srjs    fputs("+LD_VAR_FLAT", fp);
856796c5ddc4Srjs    fputs(vecsize, fp);
856896c5ddc4Srjs    fputs(register_format, fp);
856996c5ddc4Srjs    fputs(function, fp);
857096c5ddc4Srjs    fputs(" ", fp);
857196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
857296c5ddc4Srjs    fputs(", ", fp);
857396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
857496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
857596c5ddc4Srjs}
857696c5ddc4Srjs
857796c5ddc4Srjsstatic void
857896c5ddc4Srjsbi_disasm_add_ld_var_flat_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
857996c5ddc4Srjs{
858096c5ddc4Srjs    static const char *register_format_table[] = {
858196c5ddc4Srjs        ".auto"
858296c5ddc4Srjs    };
858396c5ddc4Srjs    const char *register_format = register_format_table[0];
858496c5ddc4Srjs    static const char *vecsize_table[] = {
858596c5ddc4Srjs        "", ".v2", ".v3", ".v4"
858696c5ddc4Srjs    };
858796c5ddc4Srjs
858896c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
858996c5ddc4Srjs
859096c5ddc4Srjs    static const char *function_table[] = {
859196c5ddc4Srjs        ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".and", ".or"
859296c5ddc4Srjs    };
859396c5ddc4Srjs
859496c5ddc4Srjs    const char *function = function_table[_BITS(bits, 0, 3)];
859596c5ddc4Srjs
859696c5ddc4Srjs    fputs("+LD_VAR_FLAT", fp);
859796c5ddc4Srjs    fputs(vecsize, fp);
859896c5ddc4Srjs    fputs(register_format, fp);
859996c5ddc4Srjs    fputs(function, fp);
860096c5ddc4Srjs    fputs(" ", fp);
860196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
860296c5ddc4Srjs    fputs(", ", fp);
860396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
860496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
860596c5ddc4Srjs}
860696c5ddc4Srjs
860796c5ddc4Srjsstatic void
860896c5ddc4Srjsbi_disasm_add_ld_var_flat_imm_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
860996c5ddc4Srjs{
861096c5ddc4Srjs    static const char *register_format_table[] = {
861196c5ddc4Srjs        ".f32", ".u32", ".f16", ".s32"
861296c5ddc4Srjs    };
861396c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 10, 1) << 0) | (_BITS(bits, 19, 1) << 1)];
861496c5ddc4Srjs    static const char *vecsize_table[] = {
861596c5ddc4Srjs        "", ".v2", ".v3", ".v4"
861696c5ddc4Srjs    };
861796c5ddc4Srjs
861896c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
861996c5ddc4Srjs
862096c5ddc4Srjs    static const char *function_table[] = {
862196c5ddc4Srjs        ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".and", ".or"
862296c5ddc4Srjs    };
862396c5ddc4Srjs
862496c5ddc4Srjs    const char *function = function_table[_BITS(bits, 0, 3)];
862596c5ddc4Srjs
862696c5ddc4Srjs    fputs("+LD_VAR_FLAT_IMM", fp);
862796c5ddc4Srjs    fputs(vecsize, fp);
862896c5ddc4Srjs    fputs(register_format, fp);
862996c5ddc4Srjs    fputs(function, fp);
863096c5ddc4Srjs    fputs(" ", fp);
863196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
863296c5ddc4Srjs    fprintf(fp, ", index:%u", _BITS(bits, 3, 5));
863396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
863496c5ddc4Srjs}
863596c5ddc4Srjs
863696c5ddc4Srjsstatic void
863796c5ddc4Srjsbi_disasm_add_ld_var_flat_imm_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
863896c5ddc4Srjs{
863996c5ddc4Srjs    static const char *register_format_table[] = {
864096c5ddc4Srjs        ".auto"
864196c5ddc4Srjs    };
864296c5ddc4Srjs    const char *register_format = register_format_table[0];
864396c5ddc4Srjs    static const char *vecsize_table[] = {
864496c5ddc4Srjs        "", ".v2", ".v3", ".v4"
864596c5ddc4Srjs    };
864696c5ddc4Srjs
864796c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
864896c5ddc4Srjs
864996c5ddc4Srjs    static const char *function_table[] = {
865096c5ddc4Srjs        ".reserved", ".reserved", ".reserved", "", ".reserved", ".reserved", ".and", ".or"
865196c5ddc4Srjs    };
865296c5ddc4Srjs
865396c5ddc4Srjs    const char *function = function_table[_BITS(bits, 0, 3)];
865496c5ddc4Srjs
865596c5ddc4Srjs    fputs("+LD_VAR_FLAT_IMM", fp);
865696c5ddc4Srjs    fputs(vecsize, fp);
865796c5ddc4Srjs    fputs(register_format, fp);
865896c5ddc4Srjs    fputs(function, fp);
865996c5ddc4Srjs    fputs(" ", fp);
866096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
866196c5ddc4Srjs    fprintf(fp, ", index:%u", _BITS(bits, 3, 5));
866296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
866396c5ddc4Srjs}
866496c5ddc4Srjs
866596c5ddc4Srjsstatic void
866696c5ddc4Srjsbi_disasm_add_ld_var_imm_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
866796c5ddc4Srjs{
866896c5ddc4Srjs    static const char *update_table[] = {
866996c5ddc4Srjs        ".store", ".store", ".store", ".store", ".store", ".store", ".store", ".store", ".retrieve", ".retrieve", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".conditional", ".conditional", ".conditional", ".conditional", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".clobber", ".reserved", ".reserved", ".reserved", ".reserved"
867096c5ddc4Srjs    };
867196c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
867296c5ddc4Srjs    static const char *sample_table[] = {
867396c5ddc4Srjs        ".center", ".center", ".centroid", ".centroid", ".sample", ".sample", ".explicit", ".explicit", "", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".center", ".center", ".centroid", ".centroid", ".center", ".center", ".centroid", ".centroid", ".sample", ".sample", ".explicit", ".explicit", ".reserved", ".reserved", ".reserved", ".reserved"
867496c5ddc4Srjs    };
867596c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
867696c5ddc4Srjs    static const char *register_format_table[] = {
867796c5ddc4Srjs        ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".f32", ".f16", ".reserved", ".reserved", ".reserved", ".reserved"
867896c5ddc4Srjs    };
867996c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 19, 1) << 0) | (_BITS(bits, 10, 4) << 1)];
868096c5ddc4Srjs    static const char *vecsize_table[] = {
868196c5ddc4Srjs        "", ".v2", ".v3", ".v4"
868296c5ddc4Srjs    };
868396c5ddc4Srjs
868496c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
868596c5ddc4Srjs
868696c5ddc4Srjs    fputs("+LD_VAR_IMM", fp);
868796c5ddc4Srjs    fputs(vecsize, fp);
868896c5ddc4Srjs    fputs(update, fp);
868996c5ddc4Srjs    fputs(register_format, fp);
869096c5ddc4Srjs    fputs(sample, fp);
869196c5ddc4Srjs    fputs(" ", fp);
869296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
869396c5ddc4Srjs    fputs(", ", fp);
869496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
869596c5ddc4Srjs    fprintf(fp, ", index:%u", _BITS(bits, 3, 5));
869696c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
869796c5ddc4Srjs}
869896c5ddc4Srjs
869996c5ddc4Srjsstatic void
870096c5ddc4Srjsbi_disasm_add_ld_var_imm_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
870196c5ddc4Srjs{
870296c5ddc4Srjs    static const char *update_table[] = {
870396c5ddc4Srjs        ".store", ".store", ".store", ".store", ".retrieve", ".reserved", ".reserved", ".reserved", ".conditional", ".conditional", ".clobber", ".clobber", ".clobber", ".clobber", ".reserved", ".reserved"
870496c5ddc4Srjs    };
870596c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 10, 4) << 0)];
870696c5ddc4Srjs    static const char *sample_table[] = {
870796c5ddc4Srjs        ".center", ".centroid", ".sample", ".explicit", "", ".reserved", ".reserved", ".reserved", ".center", ".centroid", ".center", ".centroid", ".sample", ".explicit", ".reserved", ".reserved"
870896c5ddc4Srjs    };
870996c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 10, 4) << 0)];
871096c5ddc4Srjs    static const char *register_format_table[] = {
871196c5ddc4Srjs        ".auto", ".auto", ".auto", ".auto", ".auto", ".reserved", ".reserved", ".reserved", ".auto", ".auto", ".auto", ".auto", ".auto", ".auto", ".reserved", ".reserved"
871296c5ddc4Srjs    };
871396c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 10, 4) << 0)];
871496c5ddc4Srjs    static const char *vecsize_table[] = {
871596c5ddc4Srjs        "", ".v2", ".v3", ".v4"
871696c5ddc4Srjs    };
871796c5ddc4Srjs
871896c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 8, 2)];
871996c5ddc4Srjs
872096c5ddc4Srjs    fputs("+LD_VAR_IMM", fp);
872196c5ddc4Srjs    fputs(vecsize, fp);
872296c5ddc4Srjs    fputs(update, fp);
872396c5ddc4Srjs    fputs(register_format, fp);
872496c5ddc4Srjs    fputs(sample, fp);
872596c5ddc4Srjs    fputs(" ", fp);
872696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
872796c5ddc4Srjs    fputs(", ", fp);
872896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
872996c5ddc4Srjs    fprintf(fp, ", index:%u", _BITS(bits, 3, 5));
873096c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
873196c5ddc4Srjs}
873296c5ddc4Srjs
873396c5ddc4Srjsstatic void
873496c5ddc4Srjsbi_disasm_add_ld_var_special_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
873596c5ddc4Srjs{
873696c5ddc4Srjs    static const char *update_table[] = {
873796c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".clobber", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
873896c5ddc4Srjs    };
873996c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 19, 1) << 2) | (_BITS(bits, 10, 4) << 3)];
874096c5ddc4Srjs    static const char *register_format_table[] = {
874196c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".f32", ".reserved", ".f32", ".f32", ".f16", ".reserved", ".f16", ".f16", ".f32", ".reserved", ".f32", ".f32", ".f16", ".reserved", ".f16", ".f16", ".f32", ".reserved", ".f32", ".f32", ".f16", ".reserved", ".f16", ".f16", ".f32", ".reserved", ".f32", ".reserved", ".f16", ".reserved", ".f16", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
874296c5ddc4Srjs    };
874396c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 19, 1) << 2) | (_BITS(bits, 10, 4) << 3)];
874496c5ddc4Srjs    static const char *sample_table[] = {
874596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".center", ".reserved", ".center", ".center", ".center", ".reserved", ".center", ".center", ".centroid", ".reserved", ".centroid", ".centroid", ".centroid", ".reserved", ".centroid", ".centroid", ".sample", ".reserved", ".sample", ".sample", ".sample", ".reserved", ".sample", ".sample", ".explicit", ".reserved", ".explicit", ".reserved", ".explicit", ".reserved", ".explicit", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
874696c5ddc4Srjs    };
874796c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 19, 1) << 2) | (_BITS(bits, 10, 4) << 3)];
874896c5ddc4Srjs    static const char *varying_name_table[] = {
874996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".frag_z", ".point", ".reserved", ".frag_w", ".reserved", ".point", ".reserved", ".frag_w", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
875096c5ddc4Srjs    };
875196c5ddc4Srjs    const char *varying_name = varying_name_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 19, 1) << 2) | (_BITS(bits, 10, 4) << 3)];
875296c5ddc4Srjs    static const char *vecsize_table[] = {
875396c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".v2", ".reserved", "", "", ".v2", ".reserved", "", "", ".v2", ".reserved", "", "", ".v2", ".reserved", "", "", ".v2", ".reserved", "", "", ".v2", ".reserved", "", "", ".v2", ".reserved", "", ".reserved", ".v2", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
875496c5ddc4Srjs    };
875596c5ddc4Srjs    const char *vecsize = vecsize_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 19, 1) << 2) | (_BITS(bits, 10, 4) << 3)];
875696c5ddc4Srjs    fputs("+LD_VAR_SPECIAL", fp);
875796c5ddc4Srjs    fputs(varying_name, fp);
875896c5ddc4Srjs    fputs(vecsize, fp);
875996c5ddc4Srjs    fputs(update, fp);
876096c5ddc4Srjs    fputs(register_format, fp);
876196c5ddc4Srjs    fputs(sample, fp);
876296c5ddc4Srjs    fputs(" ", fp);
876396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
876496c5ddc4Srjs    fputs(", ", fp);
876596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
876696c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
876796c5ddc4Srjs}
876896c5ddc4Srjs
876996c5ddc4Srjsstatic void
877096c5ddc4Srjsbi_disasm_add_ld_var_special_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
877196c5ddc4Srjs{
877296c5ddc4Srjs    static const char *update_table[] = {
877396c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".clobber", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
877496c5ddc4Srjs    };
877596c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 10, 4) << 2)];
877696c5ddc4Srjs    static const char *register_format_table[] = {
877796c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".auto", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
877896c5ddc4Srjs    };
877996c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 10, 4) << 2)];
878096c5ddc4Srjs    static const char *sample_table[] = {
878196c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".center", ".reserved", ".center", ".reserved", ".centroid", ".reserved", ".centroid", ".reserved", ".sample", ".reserved", ".sample", ".reserved", ".explicit", ".reserved", ".explicit", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
878296c5ddc4Srjs    };
878396c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 10, 4) << 2)];
878496c5ddc4Srjs    static const char *varying_name_table[] = {
878596c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".point", ".reserved", ".frag_w", ".reserved", ".point", ".reserved", ".frag_w", ".reserved", ".point", ".reserved", ".frag_w", ".reserved", ".point", ".reserved", ".frag_w", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
878696c5ddc4Srjs    };
878796c5ddc4Srjs    const char *varying_name = varying_name_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 10, 4) << 2)];
878896c5ddc4Srjs    static const char *vecsize_table[] = {
878996c5ddc4Srjs        ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".v2", ".reserved", "", ".reserved", ".v2", ".reserved", "", ".reserved", ".v2", ".reserved", "", ".reserved", ".v2", ".reserved", "", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved", ".reserved"
879096c5ddc4Srjs    };
879196c5ddc4Srjs    const char *vecsize = vecsize_table[(_BITS(bits, 3, 2) << 0) | (_BITS(bits, 10, 4) << 2)];
879296c5ddc4Srjs    fputs("+LD_VAR_SPECIAL", fp);
879396c5ddc4Srjs    fputs(varying_name, fp);
879496c5ddc4Srjs    fputs(vecsize, fp);
879596c5ddc4Srjs    fputs(update, fp);
879696c5ddc4Srjs    fputs(register_format, fp);
879796c5ddc4Srjs    fputs(sample, fp);
879896c5ddc4Srjs    fputs(" ", fp);
879996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
880096c5ddc4Srjs    fputs(", ", fp);
880196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
880296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
880396c5ddc4Srjs}
880496c5ddc4Srjs
880596c5ddc4Srjsstatic void
880696c5ddc4Srjsbi_disasm_add_lea_attr_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
880796c5ddc4Srjs{
880896c5ddc4Srjs    static const char *register_format_table[] = {
880996c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
881096c5ddc4Srjs    };
881196c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 11, 3) << 0)];
881296c5ddc4Srjs    fputs("+LEA_ATTR", fp);
881396c5ddc4Srjs    fputs(register_format, fp);
881496c5ddc4Srjs    fputs(" ", fp);
881596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
881696c5ddc4Srjs    fputs(", ", fp);
881796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
881896c5ddc4Srjs    fputs(", ", fp);
881996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
882096c5ddc4Srjs    fputs(", ", fp);
882196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
882296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
882396c5ddc4Srjs}
882496c5ddc4Srjs
882596c5ddc4Srjsstatic void
882696c5ddc4Srjsbi_disasm_add_lea_attr_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
882796c5ddc4Srjs{
882896c5ddc4Srjs    static const char *register_format_table[] = {
882996c5ddc4Srjs        ".auto"
883096c5ddc4Srjs    };
883196c5ddc4Srjs    const char *register_format = register_format_table[0];
883296c5ddc4Srjs    fputs("+LEA_ATTR", fp);
883396c5ddc4Srjs    fputs(register_format, fp);
883496c5ddc4Srjs    fputs(" ", fp);
883596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
883696c5ddc4Srjs    fputs(", ", fp);
883796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
883896c5ddc4Srjs    fputs(", ", fp);
883996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
884096c5ddc4Srjs    fputs(", ", fp);
884196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
884296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
884396c5ddc4Srjs}
884496c5ddc4Srjs
884596c5ddc4Srjsstatic void
884696c5ddc4Srjsbi_disasm_add_lea_attr_imm_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
884796c5ddc4Srjs{
884896c5ddc4Srjs    static const char *register_format_table[] = {
884996c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
885096c5ddc4Srjs    };
885196c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 11, 3) << 0)];
885296c5ddc4Srjs    fputs("+LEA_ATTR_IMM", fp);
885396c5ddc4Srjs    fputs(register_format, fp);
885496c5ddc4Srjs    fputs(" ", fp);
885596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
885696c5ddc4Srjs    fputs(", ", fp);
885796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
885896c5ddc4Srjs    fputs(", ", fp);
885996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
886096c5ddc4Srjs    fprintf(fp, ", attribute_index:%u", _BITS(bits, 6, 4));
886196c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
886296c5ddc4Srjs}
886396c5ddc4Srjs
886496c5ddc4Srjsstatic void
886596c5ddc4Srjsbi_disasm_add_lea_attr_imm_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
886696c5ddc4Srjs{
886796c5ddc4Srjs    static const char *register_format_table[] = {
886896c5ddc4Srjs        ".auto"
886996c5ddc4Srjs    };
887096c5ddc4Srjs    const char *register_format = register_format_table[0];
887196c5ddc4Srjs    fputs("+LEA_ATTR_IMM", fp);
887296c5ddc4Srjs    fputs(register_format, fp);
887396c5ddc4Srjs    fputs(" ", fp);
887496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
887596c5ddc4Srjs    fputs(", ", fp);
887696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
887796c5ddc4Srjs    fputs(", ", fp);
887896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
887996c5ddc4Srjs    fprintf(fp, ", attribute_index:%u", _BITS(bits, 6, 4));
888096c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
888196c5ddc4Srjs}
888296c5ddc4Srjs
888396c5ddc4Srjsstatic void
888496c5ddc4Srjsbi_disasm_add_lea_attr_tex_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
888596c5ddc4Srjs{
888696c5ddc4Srjs    static const char *register_format_table[] = {
888796c5ddc4Srjs        ".f16", ".f32", ".s32", ".u32", ".s16", ".u16", ".f64", ".i64"
888896c5ddc4Srjs    };
888996c5ddc4Srjs    const char *register_format = register_format_table[(_BITS(bits, 11, 3) << 0)];
889096c5ddc4Srjs    fputs("+LEA_ATTR_TEX", fp);
889196c5ddc4Srjs    fputs(register_format, fp);
889296c5ddc4Srjs    fputs(" ", fp);
889396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
889496c5ddc4Srjs    fputs(", ", fp);
889596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
889696c5ddc4Srjs    fputs(", ", fp);
889796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
889896c5ddc4Srjs    fputs(", ", fp);
889996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
890096c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
890196c5ddc4Srjs}
890296c5ddc4Srjs
890396c5ddc4Srjsstatic void
890496c5ddc4Srjsbi_disasm_add_lea_attr_tex_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
890596c5ddc4Srjs{
890696c5ddc4Srjs    static const char *register_format_table[] = {
890796c5ddc4Srjs        ".auto"
890896c5ddc4Srjs    };
890996c5ddc4Srjs    const char *register_format = register_format_table[0];
891096c5ddc4Srjs    fputs("+LEA_ATTR_TEX", fp);
891196c5ddc4Srjs    fputs(register_format, fp);
891296c5ddc4Srjs    fputs(" ", fp);
891396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
891496c5ddc4Srjs    fputs(", ", fp);
891596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
891696c5ddc4Srjs    fputs(", ", fp);
891796c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
891896c5ddc4Srjs    fputs(", ", fp);
891996c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
892096c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
892196c5ddc4Srjs}
892296c5ddc4Srjs
892396c5ddc4Srjsstatic void
892496c5ddc4Srjsbi_disasm_add_lea_tex(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
892596c5ddc4Srjs{
892696c5ddc4Srjs    static const char *format_table[] = {
892796c5ddc4Srjs        ".u16", ".u32"
892896c5ddc4Srjs    };
892996c5ddc4Srjs
893096c5ddc4Srjs    const char *format = format_table[_BITS(bits, 11, 1)];
893196c5ddc4Srjs
893296c5ddc4Srjs    fputs("+LEA_TEX", fp);
893396c5ddc4Srjs    fputs(format, fp);
893496c5ddc4Srjs    fputs(" ", fp);
893596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
893696c5ddc4Srjs    fputs(", ", fp);
893796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
893896c5ddc4Srjs    fputs(", ", fp);
893996c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
894096c5ddc4Srjs    fputs(", ", fp);
894196c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
894296c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
894396c5ddc4Srjs}
894496c5ddc4Srjs
894596c5ddc4Srjsstatic void
894696c5ddc4Srjsbi_disasm_add_lea_tex_imm(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
894796c5ddc4Srjs{
894896c5ddc4Srjs    static const char *format_table[] = {
894996c5ddc4Srjs        ".u16", ".u32"
895096c5ddc4Srjs    };
895196c5ddc4Srjs
895296c5ddc4Srjs    const char *format = format_table[_BITS(bits, 11, 1)];
895396c5ddc4Srjs
895496c5ddc4Srjs    fputs("+LEA_TEX_IMM", fp);
895596c5ddc4Srjs    fputs(format, fp);
895696c5ddc4Srjs    fputs(" ", fp);
895796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
895896c5ddc4Srjs    fputs(", ", fp);
895996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
896096c5ddc4Srjs    fputs(", ", fp);
896196c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
896296c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 6, 5));
896396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
896496c5ddc4Srjs}
896596c5ddc4Srjs
896696c5ddc4Srjsstatic void
896796c5ddc4Srjsbi_disasm_add_load_i128(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
896896c5ddc4Srjs{
896996c5ddc4Srjs    static const char *seg_table[] = {
897096c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
897196c5ddc4Srjs    };
897296c5ddc4Srjs
897396c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
897496c5ddc4Srjs
897596c5ddc4Srjs    fputs("+LOAD.i128", fp);
897696c5ddc4Srjs    fputs(seg, fp);
897796c5ddc4Srjs    fputs(" ", fp);
897896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
897996c5ddc4Srjs    fputs(", ", fp);
898096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
898196c5ddc4Srjs    fputs(", ", fp);
898296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
898396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
898496c5ddc4Srjs}
898596c5ddc4Srjs
898696c5ddc4Srjsstatic void
898796c5ddc4Srjsbi_disasm_add_load_i16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
898896c5ddc4Srjs{
898996c5ddc4Srjs    static const char *lane_dest_table[] = {
899096c5ddc4Srjs        "", ".h1"
899196c5ddc4Srjs    };
899296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
899396c5ddc4Srjs    static const char *extend_table[] = {
899496c5ddc4Srjs        "", ""
899596c5ddc4Srjs    };
899696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
899796c5ddc4Srjs    static const char *seg_table[] = {
899896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
899996c5ddc4Srjs    };
900096c5ddc4Srjs
900196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
900296c5ddc4Srjs
900396c5ddc4Srjs    fputs("+LOAD.i16", fp);
900496c5ddc4Srjs    fputs(seg, fp);
900596c5ddc4Srjs    fputs(lane_dest, fp);
900696c5ddc4Srjs    fputs(extend, fp);
900796c5ddc4Srjs    fputs(" ", fp);
900896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
900996c5ddc4Srjs    fputs(", ", fp);
901096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
901196c5ddc4Srjs    fputs(", ", fp);
901296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
901396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
901496c5ddc4Srjs}
901596c5ddc4Srjs
901696c5ddc4Srjsstatic void
901796c5ddc4Srjsbi_disasm_add_load_i16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
901896c5ddc4Srjs{
901996c5ddc4Srjs    static const char *lane_dest_table[] = {
902096c5ddc4Srjs        ".w0", ".w0"
902196c5ddc4Srjs    };
902296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
902396c5ddc4Srjs    static const char *extend_table[] = {
902496c5ddc4Srjs        ".sext", ".zext"
902596c5ddc4Srjs    };
902696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
902796c5ddc4Srjs    static const char *seg_table[] = {
902896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
902996c5ddc4Srjs    };
903096c5ddc4Srjs
903196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
903296c5ddc4Srjs
903396c5ddc4Srjs    fputs("+LOAD.i16", fp);
903496c5ddc4Srjs    fputs(seg, fp);
903596c5ddc4Srjs    fputs(lane_dest, fp);
903696c5ddc4Srjs    fputs(extend, fp);
903796c5ddc4Srjs    fputs(" ", fp);
903896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
903996c5ddc4Srjs    fputs(", ", fp);
904096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
904196c5ddc4Srjs    fputs(", ", fp);
904296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
904396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
904496c5ddc4Srjs}
904596c5ddc4Srjs
904696c5ddc4Srjsstatic void
904796c5ddc4Srjsbi_disasm_add_load_i16_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
904896c5ddc4Srjs{
904996c5ddc4Srjs    static const char *lane_dest_table[] = {
905096c5ddc4Srjs        ".d0", ".d0"
905196c5ddc4Srjs    };
905296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
905396c5ddc4Srjs    static const char *extend_table[] = {
905496c5ddc4Srjs        ".sext", ".zext"
905596c5ddc4Srjs    };
905696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
905796c5ddc4Srjs    static const char *seg_table[] = {
905896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
905996c5ddc4Srjs    };
906096c5ddc4Srjs
906196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
906296c5ddc4Srjs
906396c5ddc4Srjs    fputs("+LOAD.i16", fp);
906496c5ddc4Srjs    fputs(seg, fp);
906596c5ddc4Srjs    fputs(lane_dest, fp);
906696c5ddc4Srjs    fputs(extend, fp);
906796c5ddc4Srjs    fputs(" ", fp);
906896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
906996c5ddc4Srjs    fputs(", ", fp);
907096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
907196c5ddc4Srjs    fputs(", ", fp);
907296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
907396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
907496c5ddc4Srjs}
907596c5ddc4Srjs
907696c5ddc4Srjsstatic void
907796c5ddc4Srjsbi_disasm_add_load_i24(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
907896c5ddc4Srjs{
907996c5ddc4Srjs    static const char *seg_table[] = {
908096c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
908196c5ddc4Srjs    };
908296c5ddc4Srjs
908396c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
908496c5ddc4Srjs
908596c5ddc4Srjs    fputs("+LOAD.i24", fp);
908696c5ddc4Srjs    fputs(seg, fp);
908796c5ddc4Srjs    fputs(" ", fp);
908896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
908996c5ddc4Srjs    fputs(", ", fp);
909096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
909196c5ddc4Srjs    fputs(", ", fp);
909296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
909396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
909496c5ddc4Srjs}
909596c5ddc4Srjs
909696c5ddc4Srjsstatic void
909796c5ddc4Srjsbi_disasm_add_load_i32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
909896c5ddc4Srjs{
909996c5ddc4Srjs    static const char *lane_dest_table[] = {
910096c5ddc4Srjs        ""
910196c5ddc4Srjs    };
910296c5ddc4Srjs    const char *lane_dest = lane_dest_table[0];
910396c5ddc4Srjs    static const char *extend_table[] = {
910496c5ddc4Srjs        ""
910596c5ddc4Srjs    };
910696c5ddc4Srjs    const char *extend = extend_table[0];
910796c5ddc4Srjs    static const char *seg_table[] = {
910896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
910996c5ddc4Srjs    };
911096c5ddc4Srjs
911196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
911296c5ddc4Srjs
911396c5ddc4Srjs    fputs("+LOAD.i32", fp);
911496c5ddc4Srjs    fputs(seg, fp);
911596c5ddc4Srjs    fputs(lane_dest, fp);
911696c5ddc4Srjs    fputs(extend, fp);
911796c5ddc4Srjs    fputs(" ", fp);
911896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
911996c5ddc4Srjs    fputs(", ", fp);
912096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
912196c5ddc4Srjs    fputs(", ", fp);
912296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
912396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
912496c5ddc4Srjs}
912596c5ddc4Srjs
912696c5ddc4Srjsstatic void
912796c5ddc4Srjsbi_disasm_add_load_i32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
912896c5ddc4Srjs{
912996c5ddc4Srjs    static const char *lane_dest_table[] = {
913096c5ddc4Srjs        ".d0", ".d0"
913196c5ddc4Srjs    };
913296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
913396c5ddc4Srjs    static const char *extend_table[] = {
913496c5ddc4Srjs        ".sext", ".zext"
913596c5ddc4Srjs    };
913696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
913796c5ddc4Srjs    static const char *seg_table[] = {
913896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
913996c5ddc4Srjs    };
914096c5ddc4Srjs
914196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
914296c5ddc4Srjs
914396c5ddc4Srjs    fputs("+LOAD.i32", fp);
914496c5ddc4Srjs    fputs(seg, fp);
914596c5ddc4Srjs    fputs(lane_dest, fp);
914696c5ddc4Srjs    fputs(extend, fp);
914796c5ddc4Srjs    fputs(" ", fp);
914896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
914996c5ddc4Srjs    fputs(", ", fp);
915096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
915196c5ddc4Srjs    fputs(", ", fp);
915296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
915396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
915496c5ddc4Srjs}
915596c5ddc4Srjs
915696c5ddc4Srjsstatic void
915796c5ddc4Srjsbi_disasm_add_load_i48(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
915896c5ddc4Srjs{
915996c5ddc4Srjs    static const char *seg_table[] = {
916096c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
916196c5ddc4Srjs    };
916296c5ddc4Srjs
916396c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
916496c5ddc4Srjs
916596c5ddc4Srjs    fputs("+LOAD.i48", fp);
916696c5ddc4Srjs    fputs(seg, fp);
916796c5ddc4Srjs    fputs(" ", fp);
916896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
916996c5ddc4Srjs    fputs(", ", fp);
917096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
917196c5ddc4Srjs    fputs(", ", fp);
917296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
917396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
917496c5ddc4Srjs}
917596c5ddc4Srjs
917696c5ddc4Srjsstatic void
917796c5ddc4Srjsbi_disasm_add_load_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
917896c5ddc4Srjs{
917996c5ddc4Srjs    static const char *seg_table[] = {
918096c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
918196c5ddc4Srjs    };
918296c5ddc4Srjs
918396c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
918496c5ddc4Srjs
918596c5ddc4Srjs    fputs("+LOAD.i64", fp);
918696c5ddc4Srjs    fputs(seg, fp);
918796c5ddc4Srjs    fputs(" ", fp);
918896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
918996c5ddc4Srjs    fputs(", ", fp);
919096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
919196c5ddc4Srjs    fputs(", ", fp);
919296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
919396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
919496c5ddc4Srjs}
919596c5ddc4Srjs
919696c5ddc4Srjsstatic void
919796c5ddc4Srjsbi_disasm_add_load_i8_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
919896c5ddc4Srjs{
919996c5ddc4Srjs    static const char *lane_dest_table[] = {
920096c5ddc4Srjs        "", ".b1", ".b2", ".b3"
920196c5ddc4Srjs    };
920296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 2) << 0)];
920396c5ddc4Srjs    static const char *extend_table[] = {
920496c5ddc4Srjs        "", "", "", ""
920596c5ddc4Srjs    };
920696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 2) << 0)];
920796c5ddc4Srjs    static const char *seg_table[] = {
920896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
920996c5ddc4Srjs    };
921096c5ddc4Srjs
921196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
921296c5ddc4Srjs
921396c5ddc4Srjs    fputs("+LOAD.i8", fp);
921496c5ddc4Srjs    fputs(seg, fp);
921596c5ddc4Srjs    fputs(lane_dest, fp);
921696c5ddc4Srjs    fputs(extend, fp);
921796c5ddc4Srjs    fputs(" ", fp);
921896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
921996c5ddc4Srjs    fputs(", ", fp);
922096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
922196c5ddc4Srjs    fputs(", ", fp);
922296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
922396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
922496c5ddc4Srjs}
922596c5ddc4Srjs
922696c5ddc4Srjsstatic void
922796c5ddc4Srjsbi_disasm_add_load_i8_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
922896c5ddc4Srjs{
922996c5ddc4Srjs    static const char *lane_dest_table[] = {
923096c5ddc4Srjs        ".h0", ".h0", ".h1", ".h1"
923196c5ddc4Srjs    };
923296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
923396c5ddc4Srjs    static const char *extend_table[] = {
923496c5ddc4Srjs        ".sext", ".zext", ".sext", ".zext"
923596c5ddc4Srjs    };
923696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0) | (_BITS(bits, 10, 1) << 1)];
923796c5ddc4Srjs    static const char *seg_table[] = {
923896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
923996c5ddc4Srjs    };
924096c5ddc4Srjs
924196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
924296c5ddc4Srjs
924396c5ddc4Srjs    fputs("+LOAD.i8", fp);
924496c5ddc4Srjs    fputs(seg, fp);
924596c5ddc4Srjs    fputs(lane_dest, fp);
924696c5ddc4Srjs    fputs(extend, fp);
924796c5ddc4Srjs    fputs(" ", fp);
924896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
924996c5ddc4Srjs    fputs(", ", fp);
925096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
925196c5ddc4Srjs    fputs(", ", fp);
925296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
925396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
925496c5ddc4Srjs}
925596c5ddc4Srjs
925696c5ddc4Srjsstatic void
925796c5ddc4Srjsbi_disasm_add_load_i8_2(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
925896c5ddc4Srjs{
925996c5ddc4Srjs    static const char *lane_dest_table[] = {
926096c5ddc4Srjs        ".w0", ".w0"
926196c5ddc4Srjs    };
926296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
926396c5ddc4Srjs    static const char *extend_table[] = {
926496c5ddc4Srjs        ".sext", ".zext"
926596c5ddc4Srjs    };
926696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
926796c5ddc4Srjs    static const char *seg_table[] = {
926896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
926996c5ddc4Srjs    };
927096c5ddc4Srjs
927196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
927296c5ddc4Srjs
927396c5ddc4Srjs    fputs("+LOAD.i8", fp);
927496c5ddc4Srjs    fputs(seg, fp);
927596c5ddc4Srjs    fputs(lane_dest, fp);
927696c5ddc4Srjs    fputs(extend, fp);
927796c5ddc4Srjs    fputs(" ", fp);
927896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
927996c5ddc4Srjs    fputs(", ", fp);
928096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
928196c5ddc4Srjs    fputs(", ", fp);
928296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
928396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
928496c5ddc4Srjs}
928596c5ddc4Srjs
928696c5ddc4Srjsstatic void
928796c5ddc4Srjsbi_disasm_add_load_i8_3(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
928896c5ddc4Srjs{
928996c5ddc4Srjs    static const char *lane_dest_table[] = {
929096c5ddc4Srjs        ".d0", ".d0"
929196c5ddc4Srjs    };
929296c5ddc4Srjs    const char *lane_dest = lane_dest_table[(_BITS(bits, 9, 1) << 0)];
929396c5ddc4Srjs    static const char *extend_table[] = {
929496c5ddc4Srjs        ".sext", ".zext"
929596c5ddc4Srjs    };
929696c5ddc4Srjs    const char *extend = extend_table[(_BITS(bits, 9, 1) << 0)];
929796c5ddc4Srjs    static const char *seg_table[] = {
929896c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
929996c5ddc4Srjs    };
930096c5ddc4Srjs
930196c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
930296c5ddc4Srjs
930396c5ddc4Srjs    fputs("+LOAD.i8", fp);
930496c5ddc4Srjs    fputs(seg, fp);
930596c5ddc4Srjs    fputs(lane_dest, fp);
930696c5ddc4Srjs    fputs(extend, fp);
930796c5ddc4Srjs    fputs(" ", fp);
930896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
930996c5ddc4Srjs    fputs(", ", fp);
931096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
931196c5ddc4Srjs    fputs(", ", fp);
931296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
931396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
931496c5ddc4Srjs}
931596c5ddc4Srjs
931696c5ddc4Srjsstatic void
931796c5ddc4Srjsbi_disasm_add_load_i96(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
931896c5ddc4Srjs{
931996c5ddc4Srjs    static const char *seg_table[] = {
932096c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".ubo", ".reserved", ".reserved", ".tl"
932196c5ddc4Srjs    };
932296c5ddc4Srjs
932396c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
932496c5ddc4Srjs
932596c5ddc4Srjs    fputs("+LOAD.i96", fp);
932696c5ddc4Srjs    fputs(seg, fp);
932796c5ddc4Srjs    fputs(" ", fp);
932896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
932996c5ddc4Srjs    fputs(", ", fp);
933096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
933196c5ddc4Srjs    fputs(", ", fp);
933296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
933396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
933496c5ddc4Srjs}
933596c5ddc4Srjs
933696c5ddc4Srjsstatic void
933796c5ddc4Srjsbi_disasm_add_logb_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
933896c5ddc4Srjs{
933996c5ddc4Srjs    static const char *widen0_table[] = {
934096c5ddc4Srjs        ".reserved", "", ".h0", ".h1"
934196c5ddc4Srjs    };
934296c5ddc4Srjs
934396c5ddc4Srjs    const char *widen0 = widen0_table[_BITS(bits, 3, 2)];
934496c5ddc4Srjs
934596c5ddc4Srjs    fputs("+LOGB.f32", fp);
934696c5ddc4Srjs    fputs(" ", fp);
934796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
934896c5ddc4Srjs    fputs(", ", fp);
934996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
935096c5ddc4Srjs    fputs(widen0, fp);
935196c5ddc4Srjs}
935296c5ddc4Srjs
935396c5ddc4Srjsstatic void
935496c5ddc4Srjsbi_disasm_add_logb_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
935596c5ddc4Srjs{
935696c5ddc4Srjs    static const char *swz0_table[] = {
935796c5ddc4Srjs        ".h00", ".h10", "", ".h11"
935896c5ddc4Srjs    };
935996c5ddc4Srjs
936096c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 2)];
936196c5ddc4Srjs
936296c5ddc4Srjs    fputs("+LOGB.v2f16", fp);
936396c5ddc4Srjs    fputs(" ", fp);
936496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
936596c5ddc4Srjs    fputs(", ", fp);
936696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
936796c5ddc4Srjs    fputs(swz0, fp);
936896c5ddc4Srjs}
936996c5ddc4Srjs
937096c5ddc4Srjsstatic void
937196c5ddc4Srjsbi_disasm_add_mkvec_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
937296c5ddc4Srjs{
937396c5ddc4Srjs    static const char *lane0_table[] = {
937496c5ddc4Srjs        "", ".h1"
937596c5ddc4Srjs    };
937696c5ddc4Srjs
937796c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 6, 1)];
937896c5ddc4Srjs
937996c5ddc4Srjs    static const char *lane1_table[] = {
938096c5ddc4Srjs        "", ".h1"
938196c5ddc4Srjs    };
938296c5ddc4Srjs
938396c5ddc4Srjs    const char *lane1 = lane1_table[_BITS(bits, 7, 1)];
938496c5ddc4Srjs
938596c5ddc4Srjs    fputs("+MKVEC.v2i16", fp);
938696c5ddc4Srjs    fputs(" ", fp);
938796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
938896c5ddc4Srjs    fputs(", ", fp);
938996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
939096c5ddc4Srjs    fputs(lane0, fp);
939196c5ddc4Srjs    fputs(", ", fp);
939296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
939396c5ddc4Srjs    fputs(lane1, fp);
939496c5ddc4Srjs}
939596c5ddc4Srjs
939696c5ddc4Srjsstatic void
939796c5ddc4Srjsbi_disasm_add_mov_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
939896c5ddc4Srjs{
939996c5ddc4Srjs    fputs("+MOV.i32", fp);
940096c5ddc4Srjs    fputs(" ", fp);
940196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
940296c5ddc4Srjs    fputs(", ", fp);
940396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
940496c5ddc4Srjs}
940596c5ddc4Srjs
940696c5ddc4Srjsstatic void
940796c5ddc4Srjsbi_disasm_add_mux_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
940896c5ddc4Srjs{
940996c5ddc4Srjs    static const char *mux_table[] = {
941096c5ddc4Srjs        ".neg", "", ".fp_zero", ".bit"
941196c5ddc4Srjs    };
941296c5ddc4Srjs
941396c5ddc4Srjs    const char *mux = mux_table[_BITS(bits, 9, 2)];
941496c5ddc4Srjs
941596c5ddc4Srjs    fputs("+MUX.i32", fp);
941696c5ddc4Srjs    fputs(mux, fp);
941796c5ddc4Srjs    fputs(" ", fp);
941896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
941996c5ddc4Srjs    fputs(", ", fp);
942096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
942196c5ddc4Srjs    fputs(", ", fp);
942296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
942396c5ddc4Srjs    fputs(", ", fp);
942496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
942596c5ddc4Srjs}
942696c5ddc4Srjs
942796c5ddc4Srjsstatic void
942896c5ddc4Srjsbi_disasm_add_mux_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
942996c5ddc4Srjs{
943096c5ddc4Srjs    static const char *mux_table[] = {
943196c5ddc4Srjs        ".neg", "", ".fp_zero", ".bit"
943296c5ddc4Srjs    };
943396c5ddc4Srjs
943496c5ddc4Srjs    const char *mux = mux_table[_BITS(bits, 9, 2)];
943596c5ddc4Srjs
943696c5ddc4Srjs    static const char *swap2_table[] = {
943796c5ddc4Srjs        "", ".h10"
943896c5ddc4Srjs    };
943996c5ddc4Srjs
944096c5ddc4Srjs    const char *swap2 = swap2_table[_BITS(bits, 11, 1)];
944196c5ddc4Srjs
944296c5ddc4Srjs    static const char *swap1_table[] = {
944396c5ddc4Srjs        "", ".h10"
944496c5ddc4Srjs    };
944596c5ddc4Srjs
944696c5ddc4Srjs    const char *swap1 = swap1_table[_BITS(bits, 12, 1)];
944796c5ddc4Srjs
944896c5ddc4Srjs    static const char *swap0_table[] = {
944996c5ddc4Srjs        "", ".h10"
945096c5ddc4Srjs    };
945196c5ddc4Srjs
945296c5ddc4Srjs    const char *swap0 = swap0_table[_BITS(bits, 13, 1)];
945396c5ddc4Srjs
945496c5ddc4Srjs    fputs("+MUX.v2i16", fp);
945596c5ddc4Srjs    fputs(mux, fp);
945696c5ddc4Srjs    fputs(" ", fp);
945796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
945896c5ddc4Srjs    fputs(", ", fp);
945996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
946096c5ddc4Srjs    fputs(swap0, fp);
946196c5ddc4Srjs    fputs(", ", fp);
946296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
946396c5ddc4Srjs    fputs(swap1, fp);
946496c5ddc4Srjs    fputs(", ", fp);
946596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
946696c5ddc4Srjs    fputs(swap2, fp);
946796c5ddc4Srjs}
946896c5ddc4Srjs
946996c5ddc4Srjsstatic void
947096c5ddc4Srjsbi_disasm_add_mux_v4i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
947196c5ddc4Srjs{
947296c5ddc4Srjs    static const char *mux_table[] = {
947396c5ddc4Srjs        ".neg", ""
947496c5ddc4Srjs    };
947596c5ddc4Srjs
947696c5ddc4Srjs    const char *mux = mux_table[_BITS(bits, 9, 1)];
947796c5ddc4Srjs
947896c5ddc4Srjs    fputs("+MUX.v4i8", fp);
947996c5ddc4Srjs    fputs(mux, fp);
948096c5ddc4Srjs    fputs(" ", fp);
948196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
948296c5ddc4Srjs    fputs(", ", fp);
948396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
948496c5ddc4Srjs    fputs(", ", fp);
948596c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
948696c5ddc4Srjs    fputs(", ", fp);
948796c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
948896c5ddc4Srjs}
948996c5ddc4Srjs
949096c5ddc4Srjsstatic void
949196c5ddc4Srjsbi_disasm_add_nop(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
949296c5ddc4Srjs{
949396c5ddc4Srjs    fputs("+NOP", fp);
949496c5ddc4Srjs    fputs(" ", fp);
949596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
949696c5ddc4Srjs}
949796c5ddc4Srjs
949896c5ddc4Srjsstatic void
949996c5ddc4Srjsbi_disasm_add_quiet_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
950096c5ddc4Srjs{
950196c5ddc4Srjs    fputs("+QUIET.f32", fp);
950296c5ddc4Srjs    fputs(" ", fp);
950396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
950496c5ddc4Srjs    fputs(", ", fp);
950596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
950696c5ddc4Srjs}
950796c5ddc4Srjs
950896c5ddc4Srjsstatic void
950996c5ddc4Srjsbi_disasm_add_quiet_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
951096c5ddc4Srjs{
951196c5ddc4Srjs    static const char *swz0_table[] = {
951296c5ddc4Srjs        ".h00", ".h10", "", ".h11"
951396c5ddc4Srjs    };
951496c5ddc4Srjs
951596c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
951696c5ddc4Srjs
951796c5ddc4Srjs    fputs("+QUIET.v2f16", fp);
951896c5ddc4Srjs    fputs(" ", fp);
951996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
952096c5ddc4Srjs    fputs(", ", fp);
952196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
952296c5ddc4Srjs    fputs(swz0, fp);
952396c5ddc4Srjs}
952496c5ddc4Srjs
952596c5ddc4Srjsstatic void
952696c5ddc4Srjsbi_disasm_add_s16_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
952796c5ddc4Srjs{
952896c5ddc4Srjs    static const char *lane0_table[] = {
952996c5ddc4Srjs        "", ".h1"
953096c5ddc4Srjs    };
953196c5ddc4Srjs
953296c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
953396c5ddc4Srjs
953496c5ddc4Srjs    fputs("+S16_TO_F32", fp);
953596c5ddc4Srjs    fputs(" ", fp);
953696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
953796c5ddc4Srjs    fputs(", ", fp);
953896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
953996c5ddc4Srjs    fputs(lane0, fp);
954096c5ddc4Srjs}
954196c5ddc4Srjs
954296c5ddc4Srjsstatic void
954396c5ddc4Srjsbi_disasm_add_s16_to_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
954496c5ddc4Srjs{
954596c5ddc4Srjs    static const char *lane0_table[] = {
954696c5ddc4Srjs        "", ".h1"
954796c5ddc4Srjs    };
954896c5ddc4Srjs
954996c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
955096c5ddc4Srjs
955196c5ddc4Srjs    fputs("+S16_TO_S32", fp);
955296c5ddc4Srjs    fputs(" ", fp);
955396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
955496c5ddc4Srjs    fputs(", ", fp);
955596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
955696c5ddc4Srjs    fputs(lane0, fp);
955796c5ddc4Srjs}
955896c5ddc4Srjs
955996c5ddc4Srjsstatic void
956096c5ddc4Srjsbi_disasm_add_s32_to_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
956196c5ddc4Srjs{
956296c5ddc4Srjs    static const char *round_table[] = {
956396c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
956496c5ddc4Srjs    };
956596c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
956696c5ddc4Srjs    fputs("+S32_TO_F32", fp);
956796c5ddc4Srjs    fputs(round, fp);
956896c5ddc4Srjs    fputs(" ", fp);
956996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
957096c5ddc4Srjs    fputs(", ", fp);
957196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
957296c5ddc4Srjs}
957396c5ddc4Srjs
957496c5ddc4Srjsstatic void
957596c5ddc4Srjsbi_disasm_add_s32_to_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
957696c5ddc4Srjs{
957796c5ddc4Srjs    static const char *round_table[] = {
957896c5ddc4Srjs        ".rtna"
957996c5ddc4Srjs    };
958096c5ddc4Srjs    const char *round = round_table[0];
958196c5ddc4Srjs    fputs("+S32_TO_F32", fp);
958296c5ddc4Srjs    fputs(round, fp);
958396c5ddc4Srjs    fputs(" ", fp);
958496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
958596c5ddc4Srjs    fputs(", ", fp);
958696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
958796c5ddc4Srjs}
958896c5ddc4Srjs
958996c5ddc4Srjsstatic void
959096c5ddc4Srjsbi_disasm_add_s8_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
959196c5ddc4Srjs{
959296c5ddc4Srjs    static const char *lane0_table[] = {
959396c5ddc4Srjs        "", ".b1", ".b2", ".b3"
959496c5ddc4Srjs    };
959596c5ddc4Srjs
959696c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
959796c5ddc4Srjs
959896c5ddc4Srjs    fputs("+S8_TO_F32", fp);
959996c5ddc4Srjs    fputs(" ", fp);
960096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
960196c5ddc4Srjs    fputs(", ", fp);
960296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
960396c5ddc4Srjs    fputs(lane0, fp);
960496c5ddc4Srjs}
960596c5ddc4Srjs
960696c5ddc4Srjsstatic void
960796c5ddc4Srjsbi_disasm_add_s8_to_s32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
960896c5ddc4Srjs{
960996c5ddc4Srjs    static const char *lane0_table[] = {
961096c5ddc4Srjs        "", ".b1", ".b2", ".b3"
961196c5ddc4Srjs    };
961296c5ddc4Srjs
961396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
961496c5ddc4Srjs
961596c5ddc4Srjs    fputs("+S8_TO_S32", fp);
961696c5ddc4Srjs    fputs(" ", fp);
961796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
961896c5ddc4Srjs    fputs(", ", fp);
961996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
962096c5ddc4Srjs    fputs(lane0, fp);
962196c5ddc4Srjs}
962296c5ddc4Srjs
962396c5ddc4Srjsstatic void
962496c5ddc4Srjsbi_disasm_add_seg_add(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
962596c5ddc4Srjs{
962696c5ddc4Srjs    static const char *seg_table[] = {
962796c5ddc4Srjs        ".reserved", ".reserved", ".wls", ".reserved", ".reserved", ".reserved", ".reserved", ".tl"
962896c5ddc4Srjs    };
962996c5ddc4Srjs
963096c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 3, 3)];
963196c5ddc4Srjs
963296c5ddc4Srjs    static const char *preserve_null_table[] = {
963396c5ddc4Srjs        "", ".preserve_null"
963496c5ddc4Srjs    };
963596c5ddc4Srjs
963696c5ddc4Srjs    const char *preserve_null = preserve_null_table[_BITS(bits, 7, 1)];
963796c5ddc4Srjs
963896c5ddc4Srjs    fputs("+SEG_ADD", fp);
963996c5ddc4Srjs    fputs(seg, fp);
964096c5ddc4Srjs    fputs(preserve_null, fp);
964196c5ddc4Srjs    fputs(" ", fp);
964296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
964396c5ddc4Srjs    fputs(", ", fp);
964496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
964596c5ddc4Srjs}
964696c5ddc4Srjs
964796c5ddc4Srjsstatic void
964896c5ddc4Srjsbi_disasm_add_seg_sub(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
964996c5ddc4Srjs{
965096c5ddc4Srjs    static const char *seg_table[] = {
965196c5ddc4Srjs        ".reserved", ".reserved", ".wls", ".reserved", ".reserved", ".reserved", ".reserved", ".tl"
965296c5ddc4Srjs    };
965396c5ddc4Srjs
965496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 3, 3)];
965596c5ddc4Srjs
965696c5ddc4Srjs    static const char *preserve_null_table[] = {
965796c5ddc4Srjs        "", ".preserve_null"
965896c5ddc4Srjs    };
965996c5ddc4Srjs
966096c5ddc4Srjs    const char *preserve_null = preserve_null_table[_BITS(bits, 7, 1)];
966196c5ddc4Srjs
966296c5ddc4Srjs    fputs("+SEG_SUB", fp);
966396c5ddc4Srjs    fputs(seg, fp);
966496c5ddc4Srjs    fputs(preserve_null, fp);
966596c5ddc4Srjs    fputs(" ", fp);
966696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
966796c5ddc4Srjs    fputs(", ", fp);
966896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
966996c5ddc4Srjs}
967096c5ddc4Srjs
967196c5ddc4Srjsstatic void
967296c5ddc4Srjsbi_disasm_add_shaddxh_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
967396c5ddc4Srjs{
967496c5ddc4Srjs    fputs("+SHADDXH.i32", fp);
967596c5ddc4Srjs    fputs(" ", fp);
967696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
967796c5ddc4Srjs    fputs(", ", fp);
967896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
967996c5ddc4Srjs    fputs(", ", fp);
968096c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
968196c5ddc4Srjs}
968296c5ddc4Srjs
968396c5ddc4Srjsstatic void
968496c5ddc4Srjsbi_disasm_add_shift_double_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
968596c5ddc4Srjs{
968696c5ddc4Srjs    fputs("+SHIFT_DOUBLE.i32", fp);
968796c5ddc4Srjs    fputs(" ", fp);
968896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
968996c5ddc4Srjs    fputs(", ", fp);
969096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
969196c5ddc4Srjs    fputs(", ", fp);
969296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
969396c5ddc4Srjs    fputs(", ", fp);
969496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
969596c5ddc4Srjs}
969696c5ddc4Srjs
969796c5ddc4Srjsstatic void
969896c5ddc4Srjsbi_disasm_add_store_i128(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
969996c5ddc4Srjs{
970096c5ddc4Srjs    static const char *seg_table[] = {
970196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
970296c5ddc4Srjs    };
970396c5ddc4Srjs
970496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
970596c5ddc4Srjs
970696c5ddc4Srjs    fputs("+STORE.i128", fp);
970796c5ddc4Srjs    fputs(seg, fp);
970896c5ddc4Srjs    fputs(" ", fp);
970996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
971096c5ddc4Srjs    fputs(", ", fp);
971196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
971296c5ddc4Srjs    fputs(", ", fp);
971396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
971496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
971596c5ddc4Srjs}
971696c5ddc4Srjs
971796c5ddc4Srjsstatic void
971896c5ddc4Srjsbi_disasm_add_store_i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
971996c5ddc4Srjs{
972096c5ddc4Srjs    static const char *seg_table[] = {
972196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
972296c5ddc4Srjs    };
972396c5ddc4Srjs
972496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
972596c5ddc4Srjs
972696c5ddc4Srjs    fputs("+STORE.i16", fp);
972796c5ddc4Srjs    fputs(seg, fp);
972896c5ddc4Srjs    fputs(" ", fp);
972996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
973096c5ddc4Srjs    fputs(", ", fp);
973196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
973296c5ddc4Srjs    fputs(", ", fp);
973396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
973496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
973596c5ddc4Srjs}
973696c5ddc4Srjs
973796c5ddc4Srjsstatic void
973896c5ddc4Srjsbi_disasm_add_store_i24(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
973996c5ddc4Srjs{
974096c5ddc4Srjs    static const char *seg_table[] = {
974196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
974296c5ddc4Srjs    };
974396c5ddc4Srjs
974496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
974596c5ddc4Srjs
974696c5ddc4Srjs    fputs("+STORE.i24", fp);
974796c5ddc4Srjs    fputs(seg, fp);
974896c5ddc4Srjs    fputs(" ", fp);
974996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
975096c5ddc4Srjs    fputs(", ", fp);
975196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
975296c5ddc4Srjs    fputs(", ", fp);
975396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
975496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
975596c5ddc4Srjs}
975696c5ddc4Srjs
975796c5ddc4Srjsstatic void
975896c5ddc4Srjsbi_disasm_add_store_i32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
975996c5ddc4Srjs{
976096c5ddc4Srjs    static const char *seg_table[] = {
976196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
976296c5ddc4Srjs    };
976396c5ddc4Srjs
976496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
976596c5ddc4Srjs
976696c5ddc4Srjs    fputs("+STORE.i32", fp);
976796c5ddc4Srjs    fputs(seg, fp);
976896c5ddc4Srjs    fputs(" ", fp);
976996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
977096c5ddc4Srjs    fputs(", ", fp);
977196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
977296c5ddc4Srjs    fputs(", ", fp);
977396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
977496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
977596c5ddc4Srjs}
977696c5ddc4Srjs
977796c5ddc4Srjsstatic void
977896c5ddc4Srjsbi_disasm_add_store_i48(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
977996c5ddc4Srjs{
978096c5ddc4Srjs    static const char *seg_table[] = {
978196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
978296c5ddc4Srjs    };
978396c5ddc4Srjs
978496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
978596c5ddc4Srjs
978696c5ddc4Srjs    fputs("+STORE.i48", fp);
978796c5ddc4Srjs    fputs(seg, fp);
978896c5ddc4Srjs    fputs(" ", fp);
978996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
979096c5ddc4Srjs    fputs(", ", fp);
979196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
979296c5ddc4Srjs    fputs(", ", fp);
979396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
979496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
979596c5ddc4Srjs}
979696c5ddc4Srjs
979796c5ddc4Srjsstatic void
979896c5ddc4Srjsbi_disasm_add_store_i64(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
979996c5ddc4Srjs{
980096c5ddc4Srjs    static const char *seg_table[] = {
980196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
980296c5ddc4Srjs    };
980396c5ddc4Srjs
980496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
980596c5ddc4Srjs
980696c5ddc4Srjs    fputs("+STORE.i64", fp);
980796c5ddc4Srjs    fputs(seg, fp);
980896c5ddc4Srjs    fputs(" ", fp);
980996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
981096c5ddc4Srjs    fputs(", ", fp);
981196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
981296c5ddc4Srjs    fputs(", ", fp);
981396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
981496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
981596c5ddc4Srjs}
981696c5ddc4Srjs
981796c5ddc4Srjsstatic void
981896c5ddc4Srjsbi_disasm_add_store_i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
981996c5ddc4Srjs{
982096c5ddc4Srjs    static const char *seg_table[] = {
982196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
982296c5ddc4Srjs    };
982396c5ddc4Srjs
982496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
982596c5ddc4Srjs
982696c5ddc4Srjs    fputs("+STORE.i8", fp);
982796c5ddc4Srjs    fputs(seg, fp);
982896c5ddc4Srjs    fputs(" ", fp);
982996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
983096c5ddc4Srjs    fputs(", ", fp);
983196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
983296c5ddc4Srjs    fputs(", ", fp);
983396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
983496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
983596c5ddc4Srjs}
983696c5ddc4Srjs
983796c5ddc4Srjsstatic void
983896c5ddc4Srjsbi_disasm_add_store_i96(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
983996c5ddc4Srjs{
984096c5ddc4Srjs    static const char *seg_table[] = {
984196c5ddc4Srjs        ".reserved", "", ".wls", ".stream", ".reserved", ".reserved", ".reserved", ".tl"
984296c5ddc4Srjs    };
984396c5ddc4Srjs
984496c5ddc4Srjs    const char *seg = seg_table[_BITS(bits, 6, 3)];
984596c5ddc4Srjs
984696c5ddc4Srjs    fputs("+STORE.i96", fp);
984796c5ddc4Srjs    fputs(seg, fp);
984896c5ddc4Srjs    fputs(" ", fp);
984996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
985096c5ddc4Srjs    fputs(", ", fp);
985196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
985296c5ddc4Srjs    fputs(", ", fp);
985396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
985496c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
985596c5ddc4Srjs}
985696c5ddc4Srjs
985796c5ddc4Srjsstatic void
985896c5ddc4Srjsbi_disasm_add_st_cvt(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
985996c5ddc4Srjs{
986096c5ddc4Srjs    static const char *vecsize_table[] = {
986196c5ddc4Srjs        "", ".v2", ".v3", ".v4"
986296c5ddc4Srjs    };
986396c5ddc4Srjs
986496c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 9, 2)];
986596c5ddc4Srjs
986696c5ddc4Srjs    fputs("+ST_CVT", fp);
986796c5ddc4Srjs    fputs(vecsize, fp);
986896c5ddc4Srjs    fputs(" ", fp);
986996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
987096c5ddc4Srjs    fputs(", ", fp);
987196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
987296c5ddc4Srjs    fputs(", ", fp);
987396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
987496c5ddc4Srjs    fputs(", ", fp);
987596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
987696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
987796c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
987896c5ddc4Srjs}
987996c5ddc4Srjs
988096c5ddc4Srjsstatic void
988196c5ddc4Srjsbi_disasm_add_st_tile(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
988296c5ddc4Srjs{
988396c5ddc4Srjs    static const char *vecsize_table[] = {
988496c5ddc4Srjs        "", ".v2", ".v3", ".v4"
988596c5ddc4Srjs    };
988696c5ddc4Srjs
988796c5ddc4Srjs    const char *vecsize = vecsize_table[_BITS(bits, 9, 2)];
988896c5ddc4Srjs
988996c5ddc4Srjs    fputs("+ST_TILE", fp);
989096c5ddc4Srjs    fputs(vecsize, fp);
989196c5ddc4Srjs    fputs(" ", fp);
989296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
989396c5ddc4Srjs    fputs(", ", fp);
989496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
989596c5ddc4Srjs    fputs(", ", fp);
989696c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
989796c5ddc4Srjs    fputs(", ", fp);
989896c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
989996c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
990096c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
990196c5ddc4Srjs}
990296c5ddc4Srjs
990396c5ddc4Srjsstatic void
990496c5ddc4Srjsbi_disasm_add_swz_v2i16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
990596c5ddc4Srjs{
990696c5ddc4Srjs    static const char *swz0_table[] = {
990796c5ddc4Srjs        ".h00", ".h10", ".reserved", ".h11"
990896c5ddc4Srjs    };
990996c5ddc4Srjs
991096c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
991196c5ddc4Srjs
991296c5ddc4Srjs    fputs("+SWZ.v2i16", fp);
991396c5ddc4Srjs    fputs(" ", fp);
991496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
991596c5ddc4Srjs    fputs(", ", fp);
991696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
991796c5ddc4Srjs    fputs(swz0, fp);
991896c5ddc4Srjs}
991996c5ddc4Srjs
992096c5ddc4Srjsstatic void
992196c5ddc4Srjsbi_disasm_add_swz_v4i8(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
992296c5ddc4Srjs{
992396c5ddc4Srjs    static const char *swz0_table[] = {
992496c5ddc4Srjs        ".b0000", ".b1111", ".b2222", ".b3333", ".b0011", ".b2233", ".b1032", ".b3210"
992596c5ddc4Srjs    };
992696c5ddc4Srjs
992796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 3, 3)];
992896c5ddc4Srjs
992996c5ddc4Srjs    fputs("+SWZ.v4i8", fp);
993096c5ddc4Srjs    fputs(" ", fp);
993196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
993296c5ddc4Srjs    fputs(", ", fp);
993396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
993496c5ddc4Srjs    fputs(swz0, fp);
993596c5ddc4Srjs}
993696c5ddc4Srjs
993796c5ddc4Srjsstatic void
993896c5ddc4Srjsbi_disasm_add_texc(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
993996c5ddc4Srjs{
994096c5ddc4Srjs    static const char *skip_table[] = {
994196c5ddc4Srjs        "", ".skip"
994296c5ddc4Srjs    };
994396c5ddc4Srjs
994496c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 9, 1)];
994596c5ddc4Srjs
994696c5ddc4Srjs    fputs("+TEXC", fp);
994796c5ddc4Srjs    fputs(skip, fp);
994896c5ddc4Srjs    fputs(" ", fp);
994996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
995096c5ddc4Srjs    fputs(", ", fp);
995196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
995296c5ddc4Srjs    fputs(", ", fp);
995396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
995496c5ddc4Srjs    fputs(", ", fp);
995596c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
995696c5ddc4Srjs    if (!(0xf7 & (1 << _BITS(bits, 6, 3)))) fputs("(INVALID)", fp);
995796c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
995896c5ddc4Srjs}
995996c5ddc4Srjs
996096c5ddc4Srjsstatic void
996196c5ddc4Srjsbi_disasm_add_texs_2d_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
996296c5ddc4Srjs{
996396c5ddc4Srjs    static const char *skip_table[] = {
996496c5ddc4Srjs        "", ".skip"
996596c5ddc4Srjs    };
996696c5ddc4Srjs
996796c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 9, 1)];
996896c5ddc4Srjs
996996c5ddc4Srjs    static const char *lod_mode_table[] = {
997096c5ddc4Srjs        ".computed_lod", ""
997196c5ddc4Srjs    };
997296c5ddc4Srjs
997396c5ddc4Srjs    const char *lod_mode = lod_mode_table[_BITS(bits, 13, 1)];
997496c5ddc4Srjs
997596c5ddc4Srjs    fputs("+TEXS_2D.f16", fp);
997696c5ddc4Srjs    fputs(skip, fp);
997796c5ddc4Srjs    fputs(lod_mode, fp);
997896c5ddc4Srjs    fputs(" ", fp);
997996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
998096c5ddc4Srjs    fputs(", ", fp);
998196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
998296c5ddc4Srjs    fputs(", ", fp);
998396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
998496c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 6, 3));
998596c5ddc4Srjs    fprintf(fp, ", sampler_index:%u", _BITS(bits, 10, 3));
998696c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
998796c5ddc4Srjs}
998896c5ddc4Srjs
998996c5ddc4Srjsstatic void
999096c5ddc4Srjsbi_disasm_add_texs_2d_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
999196c5ddc4Srjs{
999296c5ddc4Srjs    static const char *skip_table[] = {
999396c5ddc4Srjs        "", ".skip"
999496c5ddc4Srjs    };
999596c5ddc4Srjs
999696c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 9, 1)];
999796c5ddc4Srjs
999896c5ddc4Srjs    static const char *lod_mode_table[] = {
999996c5ddc4Srjs        ".computed_lod", ""
1000096c5ddc4Srjs    };
1000196c5ddc4Srjs
1000296c5ddc4Srjs    const char *lod_mode = lod_mode_table[_BITS(bits, 13, 1)];
1000396c5ddc4Srjs
1000496c5ddc4Srjs    fputs("+TEXS_2D.f32", fp);
1000596c5ddc4Srjs    fputs(skip, fp);
1000696c5ddc4Srjs    fputs(lod_mode, fp);
1000796c5ddc4Srjs    fputs(" ", fp);
1000896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1000996c5ddc4Srjs    fputs(", ", fp);
1001096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1001196c5ddc4Srjs    fputs(", ", fp);
1001296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
1001396c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 6, 3));
1001496c5ddc4Srjs    fprintf(fp, ", sampler_index:%u", _BITS(bits, 10, 3));
1001596c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1001696c5ddc4Srjs}
1001796c5ddc4Srjs
1001896c5ddc4Srjsstatic void
1001996c5ddc4Srjsbi_disasm_add_texs_cube_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1002096c5ddc4Srjs{
1002196c5ddc4Srjs    static const char *skip_table[] = {
1002296c5ddc4Srjs        "", ".skip"
1002396c5ddc4Srjs    };
1002496c5ddc4Srjs
1002596c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 9, 1)];
1002696c5ddc4Srjs
1002796c5ddc4Srjs    fputs("+TEXS_CUBE.f16", fp);
1002896c5ddc4Srjs    fputs(skip, fp);
1002996c5ddc4Srjs    fputs(" ", fp);
1003096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1003196c5ddc4Srjs    fputs(", ", fp);
1003296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1003396c5ddc4Srjs    fputs(", ", fp);
1003496c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
1003596c5ddc4Srjs    fputs(", ", fp);
1003696c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
1003796c5ddc4Srjs    fprintf(fp, ", sampler_index:%u", _BITS(bits, 10, 2));
1003896c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 12, 2));
1003996c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1004096c5ddc4Srjs}
1004196c5ddc4Srjs
1004296c5ddc4Srjsstatic void
1004396c5ddc4Srjsbi_disasm_add_texs_cube_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1004496c5ddc4Srjs{
1004596c5ddc4Srjs    static const char *skip_table[] = {
1004696c5ddc4Srjs        "", ".skip"
1004796c5ddc4Srjs    };
1004896c5ddc4Srjs
1004996c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 9, 1)];
1005096c5ddc4Srjs
1005196c5ddc4Srjs    fputs("+TEXS_CUBE.f32", fp);
1005296c5ddc4Srjs    fputs(skip, fp);
1005396c5ddc4Srjs    fputs(" ", fp);
1005496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1005596c5ddc4Srjs    fputs(", ", fp);
1005696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1005796c5ddc4Srjs    fputs(", ", fp);
1005896c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
1005996c5ddc4Srjs    fputs(", ", fp);
1006096c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
1006196c5ddc4Srjs    fprintf(fp, ", sampler_index:%u", _BITS(bits, 10, 2));
1006296c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 12, 2));
1006396c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1006496c5ddc4Srjs}
1006596c5ddc4Srjs
1006696c5ddc4Srjsstatic void
1006796c5ddc4Srjsbi_disasm_add_u16_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1006896c5ddc4Srjs{
1006996c5ddc4Srjs    static const char *lane0_table[] = {
1007096c5ddc4Srjs        "", ".h1"
1007196c5ddc4Srjs    };
1007296c5ddc4Srjs
1007396c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
1007496c5ddc4Srjs
1007596c5ddc4Srjs    fputs("+U16_TO_F32", fp);
1007696c5ddc4Srjs    fputs(" ", fp);
1007796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1007896c5ddc4Srjs    fputs(", ", fp);
1007996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1008096c5ddc4Srjs    fputs(lane0, fp);
1008196c5ddc4Srjs}
1008296c5ddc4Srjs
1008396c5ddc4Srjsstatic void
1008496c5ddc4Srjsbi_disasm_add_u16_to_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1008596c5ddc4Srjs{
1008696c5ddc4Srjs    static const char *lane0_table[] = {
1008796c5ddc4Srjs        "", ".h1"
1008896c5ddc4Srjs    };
1008996c5ddc4Srjs
1009096c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 1)];
1009196c5ddc4Srjs
1009296c5ddc4Srjs    fputs("+U16_TO_U32", fp);
1009396c5ddc4Srjs    fputs(" ", fp);
1009496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1009596c5ddc4Srjs    fputs(", ", fp);
1009696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1009796c5ddc4Srjs    fputs(lane0, fp);
1009896c5ddc4Srjs}
1009996c5ddc4Srjs
1010096c5ddc4Srjsstatic void
1010196c5ddc4Srjsbi_disasm_add_u32_to_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1010296c5ddc4Srjs{
1010396c5ddc4Srjs    static const char *round_table[] = {
1010496c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
1010596c5ddc4Srjs    };
1010696c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
1010796c5ddc4Srjs    fputs("+U32_TO_F32", fp);
1010896c5ddc4Srjs    fputs(round, fp);
1010996c5ddc4Srjs    fputs(" ", fp);
1011096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1011196c5ddc4Srjs    fputs(", ", fp);
1011296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1011396c5ddc4Srjs}
1011496c5ddc4Srjs
1011596c5ddc4Srjsstatic void
1011696c5ddc4Srjsbi_disasm_add_u32_to_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1011796c5ddc4Srjs{
1011896c5ddc4Srjs    static const char *round_table[] = {
1011996c5ddc4Srjs        ".rtna"
1012096c5ddc4Srjs    };
1012196c5ddc4Srjs    const char *round = round_table[0];
1012296c5ddc4Srjs    fputs("+U32_TO_F32", fp);
1012396c5ddc4Srjs    fputs(round, fp);
1012496c5ddc4Srjs    fputs(" ", fp);
1012596c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1012696c5ddc4Srjs    fputs(", ", fp);
1012796c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1012896c5ddc4Srjs}
1012996c5ddc4Srjs
1013096c5ddc4Srjsstatic void
1013196c5ddc4Srjsbi_disasm_add_u8_to_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1013296c5ddc4Srjs{
1013396c5ddc4Srjs    static const char *lane0_table[] = {
1013496c5ddc4Srjs        "", ".b1", ".b2", ".b3"
1013596c5ddc4Srjs    };
1013696c5ddc4Srjs
1013796c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
1013896c5ddc4Srjs
1013996c5ddc4Srjs    fputs("+U8_TO_F32", fp);
1014096c5ddc4Srjs    fputs(" ", fp);
1014196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1014296c5ddc4Srjs    fputs(", ", fp);
1014396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1014496c5ddc4Srjs    fputs(lane0, fp);
1014596c5ddc4Srjs}
1014696c5ddc4Srjs
1014796c5ddc4Srjsstatic void
1014896c5ddc4Srjsbi_disasm_add_u8_to_u32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1014996c5ddc4Srjs{
1015096c5ddc4Srjs    static const char *lane0_table[] = {
1015196c5ddc4Srjs        "", ".b1", ".b2", ".b3"
1015296c5ddc4Srjs    };
1015396c5ddc4Srjs
1015496c5ddc4Srjs    const char *lane0 = lane0_table[_BITS(bits, 4, 2)];
1015596c5ddc4Srjs
1015696c5ddc4Srjs    fputs("+U8_TO_U32", fp);
1015796c5ddc4Srjs    fputs(" ", fp);
1015896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1015996c5ddc4Srjs    fputs(", ", fp);
1016096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1016196c5ddc4Srjs    fputs(lane0, fp);
1016296c5ddc4Srjs}
1016396c5ddc4Srjs
1016496c5ddc4Srjsstatic void
1016596c5ddc4Srjsbi_disasm_add_v2f16_to_v2s16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1016696c5ddc4Srjs{
1016796c5ddc4Srjs    static const char *round_table[] = {
1016896c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
1016996c5ddc4Srjs    };
1017096c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
1017196c5ddc4Srjs    static const char *swz0_table[] = {
1017296c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1017396c5ddc4Srjs    };
1017496c5ddc4Srjs
1017596c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
1017696c5ddc4Srjs
1017796c5ddc4Srjs    fputs("+V2F16_TO_V2S16", fp);
1017896c5ddc4Srjs    fputs(round, fp);
1017996c5ddc4Srjs    fputs(" ", fp);
1018096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1018196c5ddc4Srjs    fputs(", ", fp);
1018296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1018396c5ddc4Srjs    fputs(swz0, fp);
1018496c5ddc4Srjs}
1018596c5ddc4Srjs
1018696c5ddc4Srjsstatic void
1018796c5ddc4Srjsbi_disasm_add_v2f16_to_v2s16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1018896c5ddc4Srjs{
1018996c5ddc4Srjs    static const char *round_table[] = {
1019096c5ddc4Srjs        ".rtna"
1019196c5ddc4Srjs    };
1019296c5ddc4Srjs    const char *round = round_table[0];
1019396c5ddc4Srjs    static const char *swz0_table[] = {
1019496c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1019596c5ddc4Srjs    };
1019696c5ddc4Srjs
1019796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
1019896c5ddc4Srjs
1019996c5ddc4Srjs    fputs("+V2F16_TO_V2S16", fp);
1020096c5ddc4Srjs    fputs(round, fp);
1020196c5ddc4Srjs    fputs(" ", fp);
1020296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1020396c5ddc4Srjs    fputs(", ", fp);
1020496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1020596c5ddc4Srjs    fputs(swz0, fp);
1020696c5ddc4Srjs}
1020796c5ddc4Srjs
1020896c5ddc4Srjsstatic void
1020996c5ddc4Srjsbi_disasm_add_v2f16_to_v2u16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1021096c5ddc4Srjs{
1021196c5ddc4Srjs    static const char *round_table[] = {
1021296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
1021396c5ddc4Srjs    };
1021496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
1021596c5ddc4Srjs    static const char *swz0_table[] = {
1021696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1021796c5ddc4Srjs    };
1021896c5ddc4Srjs
1021996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
1022096c5ddc4Srjs
1022196c5ddc4Srjs    fputs("+V2F16_TO_V2U16", fp);
1022296c5ddc4Srjs    fputs(round, fp);
1022396c5ddc4Srjs    fputs(" ", fp);
1022496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1022596c5ddc4Srjs    fputs(", ", fp);
1022696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1022796c5ddc4Srjs    fputs(swz0, fp);
1022896c5ddc4Srjs}
1022996c5ddc4Srjs
1023096c5ddc4Srjsstatic void
1023196c5ddc4Srjsbi_disasm_add_v2f16_to_v2u16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1023296c5ddc4Srjs{
1023396c5ddc4Srjs    static const char *round_table[] = {
1023496c5ddc4Srjs        ".rtna"
1023596c5ddc4Srjs    };
1023696c5ddc4Srjs    const char *round = round_table[0];
1023796c5ddc4Srjs    static const char *swz0_table[] = {
1023896c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1023996c5ddc4Srjs    };
1024096c5ddc4Srjs
1024196c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
1024296c5ddc4Srjs
1024396c5ddc4Srjs    fputs("+V2F16_TO_V2U16", fp);
1024496c5ddc4Srjs    fputs(round, fp);
1024596c5ddc4Srjs    fputs(" ", fp);
1024696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1024796c5ddc4Srjs    fputs(", ", fp);
1024896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1024996c5ddc4Srjs    fputs(swz0, fp);
1025096c5ddc4Srjs}
1025196c5ddc4Srjs
1025296c5ddc4Srjsstatic void
1025396c5ddc4Srjsbi_disasm_add_v2f32_to_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1025496c5ddc4Srjs{
1025596c5ddc4Srjs    static const char *neg1_table[] = {
1025696c5ddc4Srjs        "", "", ".neg", ".neg"
1025796c5ddc4Srjs    };
1025896c5ddc4Srjs    const char *neg1 = neg1_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
1025996c5ddc4Srjs    static const char *abs0_table[] = {
1026096c5ddc4Srjs        "", ".abs", "", ".abs"
1026196c5ddc4Srjs    };
1026296c5ddc4Srjs    const char *abs0 = abs0_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
1026396c5ddc4Srjs    static const char *neg0_table[] = {
1026496c5ddc4Srjs        "", "", ".neg", ".neg"
1026596c5ddc4Srjs    };
1026696c5ddc4Srjs    const char *neg0 = neg0_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
1026796c5ddc4Srjs    static const char *abs1_table[] = {
1026896c5ddc4Srjs        "", ".abs", "", ".abs"
1026996c5ddc4Srjs    };
1027096c5ddc4Srjs    const char *abs1 = abs1_table[(_BITS(bits, 6, 1) << 0) | (_BITS(bits, 7, 1) << 1)];
1027196c5ddc4Srjs    static const char *clamp_table[] = {
1027296c5ddc4Srjs        "", ".clamp_0_inf", ".clamp_m1_1", ".clamp_0_1"
1027396c5ddc4Srjs    };
1027496c5ddc4Srjs
1027596c5ddc4Srjs    const char *clamp = clamp_table[_BITS(bits, 8, 2)];
1027696c5ddc4Srjs
1027796c5ddc4Srjs    static const char *round_table[] = {
1027896c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz", ".rtna", ".reserved", ".reserved", ".reserved"
1027996c5ddc4Srjs    };
1028096c5ddc4Srjs
1028196c5ddc4Srjs    const char *round = round_table[_BITS(bits, 10, 3)];
1028296c5ddc4Srjs
1028396c5ddc4Srjs    fputs("+V2F32_TO_V2F16", fp);
1028496c5ddc4Srjs    fputs(clamp, fp);
1028596c5ddc4Srjs    fputs(round, fp);
1028696c5ddc4Srjs    fputs(" ", fp);
1028796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1028896c5ddc4Srjs    fputs(", ", fp);
1028996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1029096c5ddc4Srjs    fputs(abs0, fp);
1029196c5ddc4Srjs    fputs(neg0, fp);
1029296c5ddc4Srjs    fputs(", ", fp);
1029396c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
1029496c5ddc4Srjs    fputs(abs1, fp);
1029596c5ddc4Srjs    fputs(neg1, fp);
1029696c5ddc4Srjs}
1029796c5ddc4Srjs
1029896c5ddc4Srjsstatic void
1029996c5ddc4Srjsbi_disasm_add_v2s16_to_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1030096c5ddc4Srjs{
1030196c5ddc4Srjs    static const char *round_table[] = {
1030296c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
1030396c5ddc4Srjs    };
1030496c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
1030596c5ddc4Srjs    static const char *swz0_table[] = {
1030696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1030796c5ddc4Srjs    };
1030896c5ddc4Srjs
1030996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
1031096c5ddc4Srjs
1031196c5ddc4Srjs    fputs("+V2S16_TO_V2F16", fp);
1031296c5ddc4Srjs    fputs(round, fp);
1031396c5ddc4Srjs    fputs(" ", fp);
1031496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1031596c5ddc4Srjs    fputs(", ", fp);
1031696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1031796c5ddc4Srjs    fputs(swz0, fp);
1031896c5ddc4Srjs}
1031996c5ddc4Srjs
1032096c5ddc4Srjsstatic void
1032196c5ddc4Srjsbi_disasm_add_v2s16_to_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1032296c5ddc4Srjs{
1032396c5ddc4Srjs    static const char *round_table[] = {
1032496c5ddc4Srjs        ".rtna"
1032596c5ddc4Srjs    };
1032696c5ddc4Srjs    const char *round = round_table[0];
1032796c5ddc4Srjs    static const char *swz0_table[] = {
1032896c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1032996c5ddc4Srjs    };
1033096c5ddc4Srjs
1033196c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
1033296c5ddc4Srjs
1033396c5ddc4Srjs    fputs("+V2S16_TO_V2F16", fp);
1033496c5ddc4Srjs    fputs(round, fp);
1033596c5ddc4Srjs    fputs(" ", fp);
1033696c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1033796c5ddc4Srjs    fputs(", ", fp);
1033896c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1033996c5ddc4Srjs    fputs(swz0, fp);
1034096c5ddc4Srjs}
1034196c5ddc4Srjs
1034296c5ddc4Srjsstatic void
1034396c5ddc4Srjsbi_disasm_add_v2s8_to_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1034496c5ddc4Srjs{
1034596c5ddc4Srjs    static const char *swz0_table[] = {
1034696c5ddc4Srjs        ".b00", ".b10", ".b20", ".b30", "", ".b11", ".b21", ".b31", ".b02", ".b12", ".b22", ".b32", ".b03", ".b13", ".b23", ".b33"
1034796c5ddc4Srjs    };
1034896c5ddc4Srjs
1034996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 4)];
1035096c5ddc4Srjs
1035196c5ddc4Srjs    fputs("+V2S8_TO_V2F16", fp);
1035296c5ddc4Srjs    fputs(" ", fp);
1035396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1035496c5ddc4Srjs    fputs(", ", fp);
1035596c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1035696c5ddc4Srjs    fputs(swz0, fp);
1035796c5ddc4Srjs}
1035896c5ddc4Srjs
1035996c5ddc4Srjsstatic void
1036096c5ddc4Srjsbi_disasm_add_v2s8_to_v2s16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1036196c5ddc4Srjs{
1036296c5ddc4Srjs    static const char *swz0_table[] = {
1036396c5ddc4Srjs        ".b00", ".b10", ".b20", ".b30", "", ".b11", ".b21", ".b31", ".b02", ".b12", ".b22", ".b32", ".b03", ".b13", ".b23", ".b33"
1036496c5ddc4Srjs    };
1036596c5ddc4Srjs
1036696c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 4)];
1036796c5ddc4Srjs
1036896c5ddc4Srjs    fputs("+V2S8_TO_V2S16", fp);
1036996c5ddc4Srjs    fputs(" ", fp);
1037096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1037196c5ddc4Srjs    fputs(", ", fp);
1037296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1037396c5ddc4Srjs    fputs(swz0, fp);
1037496c5ddc4Srjs}
1037596c5ddc4Srjs
1037696c5ddc4Srjsstatic void
1037796c5ddc4Srjsbi_disasm_add_v2u16_to_v2f16_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1037896c5ddc4Srjs{
1037996c5ddc4Srjs    static const char *round_table[] = {
1038096c5ddc4Srjs        "", ".rtp", ".rtn", ".rtz"
1038196c5ddc4Srjs    };
1038296c5ddc4Srjs    const char *round = round_table[(_BITS(bits, 4, 2) << 0)];
1038396c5ddc4Srjs    static const char *swz0_table[] = {
1038496c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1038596c5ddc4Srjs    };
1038696c5ddc4Srjs
1038796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 6, 2)];
1038896c5ddc4Srjs
1038996c5ddc4Srjs    fputs("+V2U16_TO_V2F16", fp);
1039096c5ddc4Srjs    fputs(round, fp);
1039196c5ddc4Srjs    fputs(" ", fp);
1039296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1039396c5ddc4Srjs    fputs(", ", fp);
1039496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1039596c5ddc4Srjs    fputs(swz0, fp);
1039696c5ddc4Srjs}
1039796c5ddc4Srjs
1039896c5ddc4Srjsstatic void
1039996c5ddc4Srjsbi_disasm_add_v2u16_to_v2f16_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1040096c5ddc4Srjs{
1040196c5ddc4Srjs    static const char *round_table[] = {
1040296c5ddc4Srjs        ".rtna"
1040396c5ddc4Srjs    };
1040496c5ddc4Srjs    const char *round = round_table[0];
1040596c5ddc4Srjs    static const char *swz0_table[] = {
1040696c5ddc4Srjs        ".h00", ".h10", "", ".h11"
1040796c5ddc4Srjs    };
1040896c5ddc4Srjs
1040996c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 2)];
1041096c5ddc4Srjs
1041196c5ddc4Srjs    fputs("+V2U16_TO_V2F16", fp);
1041296c5ddc4Srjs    fputs(round, fp);
1041396c5ddc4Srjs    fputs(" ", fp);
1041496c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1041596c5ddc4Srjs    fputs(", ", fp);
1041696c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1041796c5ddc4Srjs    fputs(swz0, fp);
1041896c5ddc4Srjs}
1041996c5ddc4Srjs
1042096c5ddc4Srjsstatic void
1042196c5ddc4Srjsbi_disasm_add_v2u8_to_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1042296c5ddc4Srjs{
1042396c5ddc4Srjs    static const char *swz0_table[] = {
1042496c5ddc4Srjs        ".b00", ".b10", ".b20", ".b30", "", ".b11", ".b21", ".b31", ".b02", ".b12", ".b22", ".b32", ".b03", ".b13", ".b23", ".b33"
1042596c5ddc4Srjs    };
1042696c5ddc4Srjs
1042796c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 4)];
1042896c5ddc4Srjs
1042996c5ddc4Srjs    fputs("+V2U8_TO_V2F16", fp);
1043096c5ddc4Srjs    fputs(" ", fp);
1043196c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1043296c5ddc4Srjs    fputs(", ", fp);
1043396c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1043496c5ddc4Srjs    fputs(swz0, fp);
1043596c5ddc4Srjs}
1043696c5ddc4Srjs
1043796c5ddc4Srjsstatic void
1043896c5ddc4Srjsbi_disasm_add_v2u8_to_v2u16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1043996c5ddc4Srjs{
1044096c5ddc4Srjs    static const char *swz0_table[] = {
1044196c5ddc4Srjs        ".b00", ".b10", ".b20", ".b30", "", ".b11", ".b21", ".b31", ".b02", ".b12", ".b22", ".b32", ".b03", ".b13", ".b23", ".b33"
1044296c5ddc4Srjs    };
1044396c5ddc4Srjs
1044496c5ddc4Srjs    const char *swz0 = swz0_table[_BITS(bits, 4, 4)];
1044596c5ddc4Srjs
1044696c5ddc4Srjs    fputs("+V2U8_TO_V2U16", fp);
1044796c5ddc4Srjs    fputs(" ", fp);
1044896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1044996c5ddc4Srjs    fputs(", ", fp);
1045096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1045196c5ddc4Srjs    fputs(swz0, fp);
1045296c5ddc4Srjs}
1045396c5ddc4Srjs
1045496c5ddc4Srjsstatic void
1045596c5ddc4Srjsbi_disasm_add_var_tex_f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1045696c5ddc4Srjs{
1045796c5ddc4Srjs    static const char *update_table[] = {
1045896c5ddc4Srjs        ".store", ".retrieve", ".reserved", ".reserved"
1045996c5ddc4Srjs    };
1046096c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 5, 2) << 0)];
1046196c5ddc4Srjs    static const char *sample_table[] = {
1046296c5ddc4Srjs        ".center", "", ".reserved", ".reserved"
1046396c5ddc4Srjs    };
1046496c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 5, 2) << 0)];
1046596c5ddc4Srjs    static const char *skip_table[] = {
1046696c5ddc4Srjs        "", ".skip"
1046796c5ddc4Srjs    };
1046896c5ddc4Srjs
1046996c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 7, 1)];
1047096c5ddc4Srjs
1047196c5ddc4Srjs    static const char *lod_mode_table[] = {
1047296c5ddc4Srjs        ".computed_lod", ""
1047396c5ddc4Srjs    };
1047496c5ddc4Srjs
1047596c5ddc4Srjs    const char *lod_mode = lod_mode_table[_BITS(bits, 9, 1)];
1047696c5ddc4Srjs
1047796c5ddc4Srjs    fputs("+VAR_TEX.f16", fp);
1047896c5ddc4Srjs    fputs(update, fp);
1047996c5ddc4Srjs    fputs(skip, fp);
1048096c5ddc4Srjs    fputs(lod_mode, fp);
1048196c5ddc4Srjs    fputs(sample, fp);
1048296c5ddc4Srjs    fputs(" ", fp);
1048396c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1048496c5ddc4Srjs    fprintf(fp, ", varying_index:%u", _BITS(bits, 0, 3));
1048596c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 3, 2));
1048696c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1048796c5ddc4Srjs}
1048896c5ddc4Srjs
1048996c5ddc4Srjsstatic void
1049096c5ddc4Srjsbi_disasm_add_var_tex_f32(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1049196c5ddc4Srjs{
1049296c5ddc4Srjs    static const char *update_table[] = {
1049396c5ddc4Srjs        ".store", ".retrieve", ".reserved", ".reserved"
1049496c5ddc4Srjs    };
1049596c5ddc4Srjs    const char *update = update_table[(_BITS(bits, 5, 2) << 0)];
1049696c5ddc4Srjs    static const char *sample_table[] = {
1049796c5ddc4Srjs        ".center", "", ".reserved", ".reserved"
1049896c5ddc4Srjs    };
1049996c5ddc4Srjs    const char *sample = sample_table[(_BITS(bits, 5, 2) << 0)];
1050096c5ddc4Srjs    static const char *skip_table[] = {
1050196c5ddc4Srjs        "", ".skip"
1050296c5ddc4Srjs    };
1050396c5ddc4Srjs
1050496c5ddc4Srjs    const char *skip = skip_table[_BITS(bits, 7, 1)];
1050596c5ddc4Srjs
1050696c5ddc4Srjs    static const char *lod_mode_table[] = {
1050796c5ddc4Srjs        ".computed_lod", ""
1050896c5ddc4Srjs    };
1050996c5ddc4Srjs
1051096c5ddc4Srjs    const char *lod_mode = lod_mode_table[_BITS(bits, 9, 1)];
1051196c5ddc4Srjs
1051296c5ddc4Srjs    fputs("+VAR_TEX.f32", fp);
1051396c5ddc4Srjs    fputs(update, fp);
1051496c5ddc4Srjs    fputs(skip, fp);
1051596c5ddc4Srjs    fputs(lod_mode, fp);
1051696c5ddc4Srjs    fputs(sample, fp);
1051796c5ddc4Srjs    fputs(" ", fp);
1051896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1051996c5ddc4Srjs    fprintf(fp, ", varying_index:%u", _BITS(bits, 0, 3));
1052096c5ddc4Srjs    fprintf(fp, ", texture_index:%u", _BITS(bits, 3, 2));
1052196c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1052296c5ddc4Srjs}
1052396c5ddc4Srjs
1052496c5ddc4Srjsstatic void
1052596c5ddc4Srjsbi_disasm_add_vn_asst2_f32_0(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1052696c5ddc4Srjs{
1052796c5ddc4Srjs    static const char *scale_table[] = {
1052896c5ddc4Srjs        ""
1052996c5ddc4Srjs    };
1053096c5ddc4Srjs    const char *scale = scale_table[0];
1053196c5ddc4Srjs    static const char *neg0_table[] = {
1053296c5ddc4Srjs        "", ".neg"
1053396c5ddc4Srjs    };
1053496c5ddc4Srjs
1053596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
1053696c5ddc4Srjs
1053796c5ddc4Srjs    fputs("+VN_ASST2.f32", fp);
1053896c5ddc4Srjs    fputs(scale, fp);
1053996c5ddc4Srjs    fputs(" ", fp);
1054096c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1054196c5ddc4Srjs    fputs(", ", fp);
1054296c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1054396c5ddc4Srjs    fputs(neg0, fp);
1054496c5ddc4Srjs}
1054596c5ddc4Srjs
1054696c5ddc4Srjsstatic void
1054796c5ddc4Srjsbi_disasm_add_vn_asst2_f32_1(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1054896c5ddc4Srjs{
1054996c5ddc4Srjs    static const char *scale_table[] = {
1055096c5ddc4Srjs        ".scale"
1055196c5ddc4Srjs    };
1055296c5ddc4Srjs    const char *scale = scale_table[0];
1055396c5ddc4Srjs    static const char *neg0_table[] = {
1055496c5ddc4Srjs        "", ".neg"
1055596c5ddc4Srjs    };
1055696c5ddc4Srjs
1055796c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 4, 1)];
1055896c5ddc4Srjs
1055996c5ddc4Srjs    fputs("+VN_ASST2.f32", fp);
1056096c5ddc4Srjs    fputs(scale, fp);
1056196c5ddc4Srjs    fputs(" ", fp);
1056296c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1056396c5ddc4Srjs    fputs(", ", fp);
1056496c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1056596c5ddc4Srjs    fputs(neg0, fp);
1056696c5ddc4Srjs}
1056796c5ddc4Srjs
1056896c5ddc4Srjsstatic void
1056996c5ddc4Srjsbi_disasm_add_vn_asst2_v2f16(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1057096c5ddc4Srjs{
1057196c5ddc4Srjs    static const char *neg0_table[] = {
1057296c5ddc4Srjs        "", ".neg"
1057396c5ddc4Srjs    };
1057496c5ddc4Srjs
1057596c5ddc4Srjs    const char *neg0 = neg0_table[_BITS(bits, 3, 1)];
1057696c5ddc4Srjs
1057796c5ddc4Srjs    fputs("+VN_ASST2.v2f16", fp);
1057896c5ddc4Srjs    fputs(" ", fp);
1057996c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1058096c5ddc4Srjs    fputs(", ", fp);
1058196c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1058296c5ddc4Srjs    fputs(neg0, fp);
1058396c5ddc4Srjs}
1058496c5ddc4Srjs
1058596c5ddc4Srjsstatic void
1058696c5ddc4Srjsbi_disasm_add_wmask(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1058796c5ddc4Srjs{
1058896c5ddc4Srjs    static const char *subgroup_table[] = {
1058996c5ddc4Srjs        ".subgroup2", ".subgroup4", ".subgroup8", ".reserved"
1059096c5ddc4Srjs    };
1059196c5ddc4Srjs
1059296c5ddc4Srjs    const char *subgroup = subgroup_table[_BITS(bits, 4, 2)];
1059396c5ddc4Srjs
1059496c5ddc4Srjs    fputs("+WMASK", fp);
1059596c5ddc4Srjs    fputs(subgroup, fp);
1059696c5ddc4Srjs    fputs(" ", fp);
1059796c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1059896c5ddc4Srjs    fputs(", ", fp);
1059996c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1060096c5ddc4Srjs    fprintf(fp, ", fill:%u", _BITS(bits, 3, 1));
1060196c5ddc4Srjs}
1060296c5ddc4Srjs
1060396c5ddc4Srjsstatic void
1060496c5ddc4Srjsbi_disasm_add_zs_emit(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1060596c5ddc4Srjs{
1060696c5ddc4Srjs    static const char *z_table[] = {
1060796c5ddc4Srjs        ".reserved", "", ".z", ".z"
1060896c5ddc4Srjs    };
1060996c5ddc4Srjs    const char *z = z_table[(_BITS(bits, 9, 2) << 0)];
1061096c5ddc4Srjs    static const char *stencil_table[] = {
1061196c5ddc4Srjs        ".reserved", ".stencil", "", ".stencil"
1061296c5ddc4Srjs    };
1061396c5ddc4Srjs    const char *stencil = stencil_table[(_BITS(bits, 9, 2) << 0)];
1061496c5ddc4Srjs    fputs("+ZS_EMIT", fp);
1061596c5ddc4Srjs    fputs(stencil, fp);
1061696c5ddc4Srjs    fputs(z, fp);
1061796c5ddc4Srjs    fputs(" ", fp);
1061896c5ddc4Srjs    bi_disasm_dest_add(fp, next_regs, last);
1061996c5ddc4Srjs    fputs(", ", fp);
1062096c5ddc4Srjs    dump_src(fp, _BITS(bits, 0, 3), *srcs, branch_offset, consts, false);
1062196c5ddc4Srjs    fputs(", ", fp);
1062296c5ddc4Srjs    dump_src(fp, _BITS(bits, 3, 3), *srcs, branch_offset, consts, false);
1062396c5ddc4Srjs    fputs(", ", fp);
1062496c5ddc4Srjs    dump_src(fp, _BITS(bits, 6, 3), *srcs, branch_offset, consts, false);
1062596c5ddc4Srjs    fprintf(fp, ", @r%u", staging_register);
1062696c5ddc4Srjs}
1062796c5ddc4Srjs
1062896c5ddc4Srjsvoid
1062996c5ddc4Srjsbi_disasm_fma(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1063096c5ddc4Srjs{
1063196c5ddc4Srjs    fputs("    ", fp);
1063296c5ddc4Srjs
1063396c5ddc4Srjs    if (unlikely(((bits & 0x7fffff) == 0x701963)))
1063496c5ddc4Srjs        bi_disasm_fma_nop(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1063596c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff8) == 0x701fc0)))
1063696c5ddc4Srjs        bi_disasm_fma_bitrev_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1063796c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff8) == 0x701968)))
1063896c5ddc4Srjs        bi_disasm_fma_mov_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1063996c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff8) == 0x73c6d8)))
1064096c5ddc4Srjs        bi_disasm_fma_popcount_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1064196c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff8) == 0x701970)))
1064296c5ddc4Srjs        bi_disasm_fma_quiet_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1064396c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff0) == 0x701fd0)))
1064496c5ddc4Srjs        bi_disasm_fma_clz_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1064596c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff0) == 0x701f90)))
1064696c5ddc4Srjs        bi_disasm_fma_clz_v4u8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1064796c5ddc4Srjs    else if (unlikely(((bits & 0x7ffff0) == 0x700d10)))
1064896c5ddc4Srjs        bi_disasm_fma_f16_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1064996c5ddc4Srjs    else if (unlikely(((bits & 0x7fffe8) == 0x700cc0)))
1065096c5ddc4Srjs        bi_disasm_fma_s16_to_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1065196c5ddc4Srjs    else if (unlikely(((bits & 0x7fffe8) == 0x700cc8)))
1065296c5ddc4Srjs        bi_disasm_fma_u16_to_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1065396c5ddc4Srjs    else if (unlikely(((bits & 0x7fffe0) == 0x70f3e0)))
1065496c5ddc4Srjs        bi_disasm_fma_dtsel_imm(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1065596c5ddc4Srjs    else if (unlikely(((bits & 0x7fffe0) == 0x701e20)))
1065696c5ddc4Srjs        bi_disasm_fma_frexpe_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1065796c5ddc4Srjs    else if (unlikely(((bits & 0x7fffe0) == 0x701e00)))
1065896c5ddc4Srjs        bi_disasm_fma_frexpe_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1065996c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc8) == 0x701900)))
1066096c5ddc4Srjs        bi_disasm_fma_quiet_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1066196c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc8) == 0x700b40)))
1066296c5ddc4Srjs        bi_disasm_fma_s8_to_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1066396c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc8) == 0x700b48)))
1066496c5ddc4Srjs        bi_disasm_fma_u8_to_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1066596c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc0) == 0x701ec0)))
1066696c5ddc4Srjs        bi_disasm_fma_clz_v2u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1066796c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc0) == 0x70cb40)))
1066896c5ddc4Srjs        bi_disasm_fma_fmul_slice_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1066996c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc0) == 0x73c0c0)))
1067096c5ddc4Srjs        bi_disasm_fma_imul_i32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1067196c5ddc4Srjs    else if (unlikely(((bits & 0x7fffc0) == 0x73e0c0)))
1067296c5ddc4Srjs        bi_disasm_fma_imul_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1067396c5ddc4Srjs    else if (unlikely(((bits & 0x7fff80) == 0x70f100)))
1067496c5ddc4Srjs        bi_disasm_fma_imuld(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1067596c5ddc4Srjs    else if (unlikely(((bits & 0x7fff40) == 0x701500)))
1067696c5ddc4Srjs        bi_disasm_fma_seg_add(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1067796c5ddc4Srjs    else if (unlikely(((bits & 0x7fff40) == 0x701540)))
1067896c5ddc4Srjs        bi_disasm_fma_seg_sub(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1067996c5ddc4Srjs    else if (unlikely(((bits & 0x7fff20) == 0x701b20)))
1068096c5ddc4Srjs        bi_disasm_fma_frexpm_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1068196c5ddc4Srjs    else if (unlikely(((bits & 0x7fff20) == 0x701a20)))
1068296c5ddc4Srjs        bi_disasm_fma_frexpm_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1068396c5ddc4Srjs    else if (unlikely(((bits & 0x7fff20) == 0x701b00)))
1068496c5ddc4Srjs        bi_disasm_fma_frexpm_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1068596c5ddc4Srjs    else if (unlikely(((bits & 0x7fff20) == 0x701a00)))
1068696c5ddc4Srjs        bi_disasm_fma_frexpm_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1068796c5ddc4Srjs    else if (unlikely(((bits & 0x7fff00) == 0x70f000)))
1068896c5ddc4Srjs        bi_disasm_fma_mkvec_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1068996c5ddc4Srjs    else if (unlikely(((bits & 0x7ffea0) == 0x701c20)))
1069096c5ddc4Srjs        bi_disasm_fma_frexpe_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1069196c5ddc4Srjs    else if (unlikely(((bits & 0x7ffea0) == 0x701c00)))
1069296c5ddc4Srjs        bi_disasm_fma_frexpe_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1069396c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe60) == 0x707620)))
1069496c5ddc4Srjs        bi_disasm_fma_fround_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1069596c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe60) == 0x707600)))
1069696c5ddc4Srjs        bi_disasm_fma_fround_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1069796c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe38) == 0x335818)))
1069896c5ddc4Srjs        bi_disasm_fma_arshift_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1069996c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x2f5e00)))
1070096c5ddc4Srjs        bi_disasm_fma_atom_c1_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1070196c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x2f1e00)))
1070296c5ddc4Srjs        bi_disasm_fma_atom_c1_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1070396c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x2f7e00)))
1070496c5ddc4Srjs        bi_disasm_fma_atom_c1_return_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1070596c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x2f3e00)))
1070696c5ddc4Srjs        bi_disasm_fma_atom_c1_return_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1070796c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x70d000)))
1070896c5ddc4Srjs        bi_disasm_fma_fmul_cslice(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1070996c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x27fc00)))
1071096c5ddc4Srjs        bi_disasm_fma_iaddc_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1071196c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x27fe00)))
1071296c5ddc4Srjs        bi_disasm_fma_isubb_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1071396c5ddc4Srjs    else if (unlikely(((bits & 0x7ffe00) == 0x70e600)))
1071496c5ddc4Srjs        bi_disasm_fma_shaddxl_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1071596c5ddc4Srjs    else if (unlikely(((bits & 0x7ffc00) == 0x6ee400)))
1071696c5ddc4Srjs        bi_disasm_fma_atom_post_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1071796c5ddc4Srjs    else if (unlikely(((bits & 0x7ffc00) == 0x6ee000)))
1071896c5ddc4Srjs        bi_disasm_fma_atom_post_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1071996c5ddc4Srjs    else if (unlikely(((bits & 0x7ffc00) == 0x706800)))
1072096c5ddc4Srjs        bi_disasm_fma_cubeface1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1072196c5ddc4Srjs    else if (unlikely(((bits & 0x7ffc00) == 0x70f400)))
1072296c5ddc4Srjs        bi_disasm_fma_fadd_lscale_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1072396c5ddc4Srjs    else if (unlikely(((bits & 0x7ff9c0) == 0x73e8c0)))
1072496c5ddc4Srjs        bi_disasm_fma_idp_v4i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1072596c5ddc4Srjs    else if (unlikely(((bits & 0x7ff9c0) == 0x73c8c0)))
1072696c5ddc4Srjs        bi_disasm_fma_imul_i32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1072796c5ddc4Srjs    else if (unlikely(((bits & 0x7ff9c0) == 0x7380c0)))
1072896c5ddc4Srjs        bi_disasm_fma_imul_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1072996c5ddc4Srjs    else if (unlikely(((bits & 0x7ff860) == 0x70c020)))
1073096c5ddc4Srjs        bi_disasm_fma_fround_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1073196c5ddc4Srjs    else if (unlikely(((bits & 0x7ff860) == 0x70c000)))
1073296c5ddc4Srjs        bi_disasm_fma_fround_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1073396c5ddc4Srjs    else if (unlikely(((bits & 0x7ff838) == 0x335018)))
1073496c5ddc4Srjs        bi_disasm_fma_arshift_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1073596c5ddc4Srjs    else if (unlikely(((bits & 0x7ff838) == 0x334818)))
1073696c5ddc4Srjs        bi_disasm_fma_arshift_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1073796c5ddc4Srjs    else if (unlikely(((bits & 0x7ff838) == 0x335818)
1073896c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1073996c5ddc4Srjs    ))
1074096c5ddc4Srjs        bi_disasm_fma_arshift_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1074196c5ddc4Srjs    else if (unlikely(((bits & 0x7ff838) == 0x334018)))
1074296c5ddc4Srjs        bi_disasm_fma_arshift_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1074396c5ddc4Srjs    else if (unlikely(((bits & 0x7ff800) == 0x33f800)))
1074496c5ddc4Srjs        bi_disasm_fma_flshift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1074596c5ddc4Srjs    else if (unlikely(((bits & 0x7ff800) == 0x33f000)))
1074696c5ddc4Srjs        bi_disasm_fma_frshift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1074796c5ddc4Srjs    else if (unlikely(((bits & 0x7ff800) == 0x70e800)))
1074896c5ddc4Srjs        bi_disasm_fma_shaddxl_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1074996c5ddc4Srjs    else if (unlikely(((bits & 0x7ff800) == 0x70e000)))
1075096c5ddc4Srjs        bi_disasm_fma_shaddxl_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1075196c5ddc4Srjs    else if (unlikely(((bits & 0x7ff1c0) == 0x73b0c0)))
1075296c5ddc4Srjs        bi_disasm_fma_imul_i32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1075396c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x33e000)))
1075496c5ddc4Srjs        bi_disasm_fma_arshift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1075596c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x2eb000)))
1075696c5ddc4Srjs        bi_disasm_fma_jump_ex(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1075796c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x33b000)))
1075896c5ddc4Srjs        bi_disasm_fma_lrot_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1075996c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x33c000)))
1076096c5ddc4Srjs        bi_disasm_fma_lshift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1076196c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x33a000)))
1076296c5ddc4Srjs        bi_disasm_fma_rrot_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1076396c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x33d000)))
1076496c5ddc4Srjs        bi_disasm_fma_rshift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1076596c5ddc4Srjs    else if (unlikely(((bits & 0x7ff000) == 0x6eb000)))
1076696c5ddc4Srjs        bi_disasm_fma_vn_asst1_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1076796c5ddc4Srjs    else if (unlikely(((bits & 0x7fe1c0) == 0x7240c0)))
1076896c5ddc4Srjs        bi_disasm_fma_imul_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1076996c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2f4000)))
1077096c5ddc4Srjs        bi_disasm_fma_atom_c_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1077196c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2f0000)))
1077296c5ddc4Srjs        bi_disasm_fma_atom_c_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1077396c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2f6000)))
1077496c5ddc4Srjs        bi_disasm_fma_atom_c_return_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1077596c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2f2000)))
1077696c5ddc4Srjs        bi_disasm_fma_atom_c_return_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1077796c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x6ec000)))
1077896c5ddc4Srjs        bi_disasm_fma_atom_pre_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1077996c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2e4000)))
1078096c5ddc4Srjs        bi_disasm_fma_csel_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1078196c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x2e6000)))
1078296c5ddc4Srjs        bi_disasm_fma_csel_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1078396c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x6e4000)))
1078496c5ddc4Srjs        bi_disasm_fma_csel_v2s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1078596c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x6e6000)))
1078696c5ddc4Srjs        bi_disasm_fma_csel_v2u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1078796c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x6e8000)))
1078896c5ddc4Srjs        bi_disasm_fma_v2f32_to_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1078996c5ddc4Srjs    else if (unlikely(((bits & 0x7fe000) == 0x27c000)))
1079096c5ddc4Srjs        bi_disasm_fma_vn_asst1_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1079196c5ddc4Srjs    else if (unlikely(((bits & 0x7fde00) == 0x325800)))
1079296c5ddc4Srjs        bi_disasm_fma_lshift_xor_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1079396c5ddc4Srjs    else if (unlikely(((bits & 0x7fde00) == 0x321800)))
1079496c5ddc4Srjs        bi_disasm_fma_rshift_xor_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1079596c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x325000)))
1079696c5ddc4Srjs        bi_disasm_fma_lshift_xor_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1079796c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x324800)))
1079896c5ddc4Srjs        bi_disasm_fma_lshift_xor_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1079996c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x325800)
1080096c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1080196c5ddc4Srjs    ))
1080296c5ddc4Srjs        bi_disasm_fma_lshift_xor_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1080396c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x324000)))
1080496c5ddc4Srjs        bi_disasm_fma_lshift_xor_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1080596c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x321000)))
1080696c5ddc4Srjs        bi_disasm_fma_rshift_xor_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1080796c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x320800)))
1080896c5ddc4Srjs        bi_disasm_fma_rshift_xor_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1080996c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x321800)
1081096c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1081196c5ddc4Srjs    ))
1081296c5ddc4Srjs        bi_disasm_fma_rshift_xor_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1081396c5ddc4Srjs    else if (unlikely(((bits & 0x7fd800) == 0x320000)))
1081496c5ddc4Srjs        bi_disasm_fma_rshift_xor_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1081596c5ddc4Srjs    else if (unlikely(((bits & 0x7fc000) == 0x2e0000)
1081696c5ddc4Srjs        && !(0x8 & (1 << _BITS(bits, 12, 2)))
1081796c5ddc4Srjs    ))
1081896c5ddc4Srjs        bi_disasm_fma_csel_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1081996c5ddc4Srjs    else if (unlikely(((bits & 0x7fc000) == 0x6e0000)
1082096c5ddc4Srjs        && !(0x8 & (1 << _BITS(bits, 12, 2)))
1082196c5ddc4Srjs    ))
1082296c5ddc4Srjs        bi_disasm_fma_csel_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1082396c5ddc4Srjs    else if (unlikely(((bits & 0x7f8000) == 0x2e0000)
1082496c5ddc4Srjs        && !(0xf7 & (1 << _BITS(bits, 12, 3)))
1082596c5ddc4Srjs    ))
1082696c5ddc4Srjs        bi_disasm_fma_csel_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1082796c5ddc4Srjs    else if (unlikely(((bits & 0x7f8000) == 0x6e0000)
1082896c5ddc4Srjs        && !(0xf7 & (1 << _BITS(bits, 12, 3)))
1082996c5ddc4Srjs    ))
1083096c5ddc4Srjs        bi_disasm_fma_csel_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1083196c5ddc4Srjs    else if (unlikely(((bits & 0x7f3e00) == 0x311800)))
1083296c5ddc4Srjs        bi_disasm_fma_lshift_and_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1083396c5ddc4Srjs    else if (unlikely(((bits & 0x7f3e00) == 0x313800)))
1083496c5ddc4Srjs        bi_disasm_fma_lshift_or_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1083596c5ddc4Srjs    else if (unlikely(((bits & 0x7f3e00) == 0x301800)))
1083696c5ddc4Srjs        bi_disasm_fma_rshift_and_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1083796c5ddc4Srjs    else if (unlikely(((bits & 0x7f3e00) == 0x303800)))
1083896c5ddc4Srjs        bi_disasm_fma_rshift_or_v4i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1083996c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x311000)))
1084096c5ddc4Srjs        bi_disasm_fma_lshift_and_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1084196c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x310800)))
1084296c5ddc4Srjs        bi_disasm_fma_lshift_and_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1084396c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x311800)
1084496c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1084596c5ddc4Srjs    ))
1084696c5ddc4Srjs        bi_disasm_fma_lshift_and_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1084796c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x310000)))
1084896c5ddc4Srjs        bi_disasm_fma_lshift_and_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1084996c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x313000)))
1085096c5ddc4Srjs        bi_disasm_fma_lshift_or_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1085196c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x312800)))
1085296c5ddc4Srjs        bi_disasm_fma_lshift_or_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1085396c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x313800)
1085496c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1085596c5ddc4Srjs    ))
1085696c5ddc4Srjs        bi_disasm_fma_lshift_or_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1085796c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x312000)))
1085896c5ddc4Srjs        bi_disasm_fma_lshift_or_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1085996c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x301000)))
1086096c5ddc4Srjs        bi_disasm_fma_rshift_and_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1086196c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x300800)))
1086296c5ddc4Srjs        bi_disasm_fma_rshift_and_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1086396c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x301800)
1086496c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1086596c5ddc4Srjs    ))
1086696c5ddc4Srjs        bi_disasm_fma_rshift_and_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1086796c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x300000)))
1086896c5ddc4Srjs        bi_disasm_fma_rshift_and_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1086996c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x303000)))
1087096c5ddc4Srjs        bi_disasm_fma_rshift_or_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1087196c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x302800)))
1087296c5ddc4Srjs        bi_disasm_fma_rshift_or_v2i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1087396c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x303800)
1087496c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1087596c5ddc4Srjs    ))
1087696c5ddc4Srjs        bi_disasm_fma_rshift_or_v2i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1087796c5ddc4Srjs    else if (unlikely(((bits & 0x7f3800) == 0x302000)))
1087896c5ddc4Srjs        bi_disasm_fma_rshift_or_v4i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1087996c5ddc4Srjs    else if (unlikely(((bits & 0x7f0000) == 0x710000)))
1088096c5ddc4Srjs        bi_disasm_fma_mkvec_v4i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1088196c5ddc4Srjs    else if (unlikely(((bits & 0x7e0000) == 0x2c0000)))
1088296c5ddc4Srjs        bi_disasm_fma_fadd_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1088396c5ddc4Srjs    else if (unlikely(((bits & 0x7e0000) == 0x6c0000)))
1088496c5ddc4Srjs        bi_disasm_fma_fadd_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1088596c5ddc4Srjs    else if (unlikely(((bits & 0x7c0000) == 0x240000)))
1088696c5ddc4Srjs        bi_disasm_fma_fcmp_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1088796c5ddc4Srjs    else if (unlikely(((bits & 0x7c0000) == 0x640000)))
1088896c5ddc4Srjs        bi_disasm_fma_fcmp_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1088996c5ddc4Srjs    else if (unlikely(((bits & 0x7c0000) == 0x280000)))
1089096c5ddc4Srjs        bi_disasm_fma_fma_rscale_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1089196c5ddc4Srjs    else if (unlikely(((bits & 0x7c0000) == 0x680000)
1089296c5ddc4Srjs        && !(0x40 & (1 << _BITS(bits, 12, 3)))
1089396c5ddc4Srjs    ))
1089496c5ddc4Srjs        bi_disasm_fma_fma_rscale_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1089596c5ddc4Srjs    else if (unlikely(((bits & 0x600000) == 0x0)))
1089696c5ddc4Srjs        bi_disasm_fma_fma_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1089796c5ddc4Srjs    else if (unlikely(((bits & 0x600000) == 0x400000)))
1089896c5ddc4Srjs        bi_disasm_fma_fma_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1089996c5ddc4Srjs    else
1090096c5ddc4Srjs        fprintf(fp, "INSTR_INVALID_ENC fma %X", bits);
1090196c5ddc4Srjs
1090296c5ddc4Srjs    fputs("\n", fp);
1090396c5ddc4Srjs}
1090496c5ddc4Srjsvoid
1090596c5ddc4Srjsbi_disasm_add(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, struct bi_constants *consts, bool last)
1090696c5ddc4Srjs{
1090796c5ddc4Srjs    fputs("    ", fp);
1090896c5ddc4Srjs
1090996c5ddc4Srjs    if (unlikely(((bits & 0xfffff) == 0xd7874)))
1091096c5ddc4Srjs        bi_disasm_add_barrier(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1091196c5ddc4Srjs    else if (unlikely(((bits & 0xfffff) == 0x3d964)))
1091296c5ddc4Srjs        bi_disasm_add_nop(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1091396c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3de58)))
1091496c5ddc4Srjs        bi_disasm_add_cubeface2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1091596c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0xd7860)))
1091696c5ddc4Srjs        bi_disasm_add_doorbell(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1091796c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0xd7850)))
1091896c5ddc4Srjs        bi_disasm_add_eureka(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1091996c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3cca0)))
1092096c5ddc4Srjs        bi_disasm_add_f32_to_s32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1092196c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3cca8)))
1092296c5ddc4Srjs        bi_disasm_add_f32_to_u32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1092396c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x66340)))
1092496c5ddc4Srjs        bi_disasm_add_flogd_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1092596c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x67c50)))
1092696c5ddc4Srjs        bi_disasm_add_fpclass_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1092796c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x67ab0)))
1092896c5ddc4Srjs        bi_disasm_add_frcbrt_approx_b_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1092996c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x67ab8)))
1093096c5ddc4Srjs        bi_disasm_add_frcbrt_approx_c_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1093196c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3dea0)))
1093296c5ddc4Srjs        bi_disasm_add_iabs_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1093396c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3deb0)))
1093496c5ddc4Srjs        bi_disasm_add_iabs_v4s8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1093596c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0xd7858)))
1093696c5ddc4Srjs        bi_disasm_add_kaboom(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1093796c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0xd7800)))
1093896c5ddc4Srjs        bi_disasm_add_ld_gclk_u64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1093996c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3d968)))
1094096c5ddc4Srjs        bi_disasm_add_mov_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1094196c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3d970)))
1094296c5ddc4Srjs        bi_disasm_add_quiet_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1094396c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3cd00)))
1094496c5ddc4Srjs        bi_disasm_add_s32_to_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1094596c5ddc4Srjs    else if (unlikely(((bits & 0xffff8) == 0x3cd08)))
1094696c5ddc4Srjs        bi_disasm_add_u32_to_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1094796c5ddc4Srjs    else if (unlikely(((bits & 0xffff7) == 0xd7820)))
1094896c5ddc4Srjs        bi_disasm_add_imov_fma(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1094996c5ddc4Srjs    else if (unlikely(((bits & 0xffff0) == 0x3cd10)))
1095096c5ddc4Srjs        bi_disasm_add_f16_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1095196c5ddc4Srjs    else if (unlikely(((bits & 0xffff0) == 0x67c40)))
1095296c5ddc4Srjs        bi_disasm_add_fpclass_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1095396c5ddc4Srjs    else if (unlikely(((bits & 0xffff0) == 0x67aa0)))
1095496c5ddc4Srjs        bi_disasm_add_fsincos_offset_u6(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1095596c5ddc4Srjs    else if (unlikely(((bits & 0xffff0) == 0x3df80)))
1095696c5ddc4Srjs        bi_disasm_add_vn_asst2_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1095796c5ddc4Srjs    else if (unlikely(((bits & 0xffff0) == 0x3dfa0)))
1095896c5ddc4Srjs        bi_disasm_add_vn_asst2_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1095996c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x67a88)))
1096096c5ddc4Srjs        bi_disasm_add_fcos_table_u6(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1096196c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x67a80)))
1096296c5ddc4Srjs        bi_disasm_add_fsin_table_u6(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1096396c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x3cce0)))
1096496c5ddc4Srjs        bi_disasm_add_s16_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1096596c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x3ccc0)))
1096696c5ddc4Srjs        bi_disasm_add_s16_to_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1096796c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x3cce8)))
1096896c5ddc4Srjs        bi_disasm_add_u16_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1096996c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x3ccc8)))
1097096c5ddc4Srjs        bi_disasm_add_u16_to_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1097196c5ddc4Srjs    else if (unlikely(((bits & 0xfffe8) == 0x3de80)))
1097296c5ddc4Srjs        bi_disasm_add_vn_asst2_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1097396c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x67ac0)))
1097496c5ddc4Srjs        bi_disasm_add_fexp_table_u4(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1097596c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x67ae0)))
1097696c5ddc4Srjs        bi_disasm_add_flog_table_f32_4(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1097796c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3de20)))
1097896c5ddc4Srjs        bi_disasm_add_frexpe_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1097996c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3de00)))
1098096c5ddc4Srjs        bi_disasm_add_frexpe_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1098196c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3d9e0)))
1098296c5ddc4Srjs        bi_disasm_add_ilogb_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1098396c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3d9c0)))
1098496c5ddc4Srjs        bi_disasm_add_ilogb_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1098596c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3d9a0)))
1098696c5ddc4Srjs        bi_disasm_add_logb_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1098796c5ddc4Srjs    else if (unlikely(((bits & 0xfffe0) == 0x3d980)))
1098896c5ddc4Srjs        bi_disasm_add_logb_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1098996c5ddc4Srjs    else if (unlikely(((bits & 0xfffd8) == 0x3cc40)))
1099096c5ddc4Srjs        bi_disasm_add_f16_to_s32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1099196c5ddc4Srjs    else if (unlikely(((bits & 0xfffd8) == 0x3cc48)))
1099296c5ddc4Srjs        bi_disasm_add_f16_to_u32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1099396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3c980)))
1099496c5ddc4Srjs        bi_disasm_add_f32_to_s32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1099596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3c988)))
1099696c5ddc4Srjs        bi_disasm_add_f32_to_u32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1099796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3de88)))
1099896c5ddc4Srjs        bi_disasm_add_iabs_v2s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1099996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3d900)))
1100096c5ddc4Srjs        bi_disasm_add_quiet_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1100196c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cbc0)))
1100296c5ddc4Srjs        bi_disasm_add_s32_to_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1100396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb80)))
1100496c5ddc4Srjs        bi_disasm_add_s8_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1100596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb40)))
1100696c5ddc4Srjs        bi_disasm_add_s8_to_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1100796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3d948)))
1100896c5ddc4Srjs        bi_disasm_add_swz_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1100996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cbc8)))
1101096c5ddc4Srjs        bi_disasm_add_u32_to_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1101196c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb88)))
1101296c5ddc4Srjs        bi_disasm_add_u8_to_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1101396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb48)))
1101496c5ddc4Srjs        bi_disasm_add_u8_to_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1101596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3ca80)))
1101696c5ddc4Srjs        bi_disasm_add_v2f16_to_v2s16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1101796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3ca88)))
1101896c5ddc4Srjs        bi_disasm_add_v2f16_to_v2u16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1101996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb00)))
1102096c5ddc4Srjs        bi_disasm_add_v2s16_to_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1102196c5ddc4Srjs    else if (unlikely(((bits & 0xfffc8) == 0x3cb08)))
1102296c5ddc4Srjs        bi_disasm_add_v2u16_to_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1102396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x3f0c0)))
1102496c5ddc4Srjs        bi_disasm_add_clper_v6_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1102596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x75200)))
1102696c5ddc4Srjs        bi_disasm_add_fadd_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1102796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67a00)))
1102896c5ddc4Srjs        bi_disasm_add_fatan_assist_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1102996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67a40)))
1103096c5ddc4Srjs        bi_disasm_add_fatan_table_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1103196c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x66ac0)))
1103296c5ddc4Srjs        bi_disasm_add_fexp_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1103396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67300)))
1103496c5ddc4Srjs        bi_disasm_add_flog_table_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1103596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67b00)))
1103696c5ddc4Srjs        bi_disasm_add_flog_table_f32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1103796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x75080)))
1103896c5ddc4Srjs        bi_disasm_add_fpow_sc_apply(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1103996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67200)))
1104096c5ddc4Srjs        bi_disasm_add_frcbrt_approx_a_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1104196c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67000)))
1104296c5ddc4Srjs        bi_disasm_add_frcp_approx_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1104396c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x67100)))
1104496c5ddc4Srjs        bi_disasm_add_frsq_approx_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1104596c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x3f8c0)))
1104696c5ddc4Srjs        bi_disasm_add_shaddxh_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1104796c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x3df40)))
1104896c5ddc4Srjs        bi_disasm_add_swz_v4i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1104996c5ddc4Srjs    else if (unlikely(((bits & 0xfffc0) == 0x3d700)))
1105096c5ddc4Srjs        bi_disasm_add_wmask(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1105196c5ddc4Srjs    else if (unlikely(((bits & 0xfffa0) == 0x66000)
1105296c5ddc4Srjs        && !(0x2 & (1 << _BITS(bits, 6, 1)))
1105396c5ddc4Srjs    ))
1105496c5ddc4Srjs        bi_disasm_add_frcp_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1105596c5ddc4Srjs    else if (unlikely(((bits & 0xfffa0) == 0x66100)
1105696c5ddc4Srjs        && !(0x2 & (1 << _BITS(bits, 6, 1)))
1105796c5ddc4Srjs    ))
1105896c5ddc4Srjs        bi_disasm_add_frsq_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1105996c5ddc4Srjs    else if (unlikely(((bits & 0xfff48) == 0x3c500)))
1106096c5ddc4Srjs        bi_disasm_add_f16_to_s32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1106196c5ddc4Srjs    else if (unlikely(((bits & 0xfff48) == 0x3c508)))
1106296c5ddc4Srjs        bi_disasm_add_f16_to_u32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1106396c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x67340)))
1106496c5ddc4Srjs        bi_disasm_add_flog_table_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1106596c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x67b40)))
1106696c5ddc4Srjs        bi_disasm_add_flog_table_f32_3(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1106796c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x67240)))
1106896c5ddc4Srjs        bi_disasm_add_frcbrt_approx_a_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1106996c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x67040)))
1107096c5ddc4Srjs        bi_disasm_add_frcp_approx_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1107196c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x67140)))
1107296c5ddc4Srjs        bi_disasm_add_frsq_approx_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1107396c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x3d500)))
1107496c5ddc4Srjs        bi_disasm_add_seg_add(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1107596c5ddc4Srjs    else if (unlikely(((bits & 0xfff40) == 0x3d540)))
1107696c5ddc4Srjs        bi_disasm_add_seg_sub(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1107796c5ddc4Srjs    else if (unlikely(((bits & 0xfff20) == 0x3db20)))
1107896c5ddc4Srjs        bi_disasm_add_frexpm_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1107996c5ddc4Srjs    else if (unlikely(((bits & 0xfff20) == 0x3da20)))
1108096c5ddc4Srjs        bi_disasm_add_frexpm_f32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1108196c5ddc4Srjs    else if (unlikely(((bits & 0xfff20) == 0x3db00)))
1108296c5ddc4Srjs        bi_disasm_add_frexpm_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1108396c5ddc4Srjs    else if (unlikely(((bits & 0xfff20) == 0x3da00)))
1108496c5ddc4Srjs        bi_disasm_add_frexpm_v2f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1108596c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c200)))
1108696c5ddc4Srjs        bi_disasm_add_v2f16_to_v2s16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1108796c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c208)))
1108896c5ddc4Srjs        bi_disasm_add_v2f16_to_v2u16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1108996c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c600)))
1109096c5ddc4Srjs        bi_disasm_add_v2s16_to_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1109196c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c800)))
1109296c5ddc4Srjs        bi_disasm_add_v2s8_to_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1109396c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c700)))
1109496c5ddc4Srjs        bi_disasm_add_v2s8_to_v2s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1109596c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c608)))
1109696c5ddc4Srjs        bi_disasm_add_v2u16_to_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1109796c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c808)))
1109896c5ddc4Srjs        bi_disasm_add_v2u8_to_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1109996c5ddc4Srjs    else if (unlikely(((bits & 0xfff08) == 0x3c708)))
1110096c5ddc4Srjs        bi_disasm_add_v2u8_to_v2u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1110196c5ddc4Srjs    else if (unlikely(((bits & 0xfff00) == 0xc8f00)))
1110296c5ddc4Srjs        bi_disasm_add_atest(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1110396c5ddc4Srjs    else if (unlikely(((bits & 0xfff00) == 0x67800)))
1110496c5ddc4Srjs        bi_disasm_add_fatan_assist_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1110596c5ddc4Srjs    else if (unlikely(((bits & 0xfff00) == 0x67900)))
1110696c5ddc4Srjs        bi_disasm_add_fatan_table_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1110796c5ddc4Srjs    else if (unlikely(((bits & 0xfff00) == 0x75300)))
1110896c5ddc4Srjs        bi_disasm_add_mkvec_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1110996c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0x67080)))
1111096c5ddc4Srjs        bi_disasm_add_frcp_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1111196c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0x67280)))
1111296c5ddc4Srjs        bi_disasm_add_frsq_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1111396c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0xbc600)))
1111496c5ddc4Srjs        bi_disasm_add_iadd_s32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1111596c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0xbc400)))
1111696c5ddc4Srjs        bi_disasm_add_iadd_v4s8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1111796c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0xbd600)))
1111896c5ddc4Srjs        bi_disasm_add_isub_s32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1111996c5ddc4Srjs    else if (unlikely(((bits & 0xffec0) == 0xbd400)))
1112096c5ddc4Srjs        bi_disasm_add_isub_v4s8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1112196c5ddc4Srjs    else if (unlikely(((bits & 0xffea0) == 0x3dc20)))
1112296c5ddc4Srjs        bi_disasm_add_frexpe_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1112396c5ddc4Srjs    else if (unlikely(((bits & 0xffea0) == 0x3dc00)))
1112496c5ddc4Srjs        bi_disasm_add_frexpe_v2f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1112596c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0x67600)))
1112696c5ddc4Srjs        bi_disasm_add_fpow_sc_det_f16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1112796c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0x67640)))
1112896c5ddc4Srjs        bi_disasm_add_fpow_sc_det_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1112996c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0xbc600)))
1113096c5ddc4Srjs        bi_disasm_add_iadd_u32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1113196c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0xbc400)))
1113296c5ddc4Srjs        bi_disasm_add_iadd_v4u8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1113396c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0xbd600)))
1113496c5ddc4Srjs        bi_disasm_add_isub_u32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1113596c5ddc4Srjs    else if (unlikely(((bits & 0xffe40) == 0xbd400)))
1113696c5ddc4Srjs        bi_disasm_add_isub_v4u8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1113796c5ddc4Srjs    else if (unlikely(((bits & 0xffe3f) == 0x6f83c)))
1113896c5ddc4Srjs        bi_disasm_add_branch_diverg(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1113996c5ddc4Srjs    else if (unlikely(((bits & 0xffe3f) == 0x6fa34)))
1114096c5ddc4Srjs        bi_disasm_add_branch_no_diverg(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1114196c5ddc4Srjs    else if (unlikely(((bits & 0xffe3f) == 0x6fe34)))
1114296c5ddc4Srjs        bi_disasm_add_jump(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1114396c5ddc4Srjs    else if (unlikely(((bits & 0xffe38) == 0x6fa38)))
1114496c5ddc4Srjs        bi_disasm_add_branch_lowbits_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1114596c5ddc4Srjs    else if (unlikely(((bits & 0xffe30) == 0x6f800)))
1114696c5ddc4Srjs        bi_disasm_add_branchz_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1114796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0xd7400)))
1114896c5ddc4Srjs        bi_disasm_add_atom_cx(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1114996c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0xca800)))
1115096c5ddc4Srjs        bi_disasm_add_blend(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1115196c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x6f800)
1115296c5ddc4Srjs        && !(0x9 & (1 << _BITS(bits, 4, 2)))
1115396c5ddc4Srjs    ))
1115496c5ddc4Srjs        bi_disasm_add_branchz_i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1115596c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x67400)))
1115696c5ddc4Srjs        bi_disasm_add_fpow_sc_det_f16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1115796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x7be00)))
1115896c5ddc4Srjs        bi_disasm_add_icmpf_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1115996c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x7ba00)))
1116096c5ddc4Srjs        bi_disasm_add_icmpm_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1116196c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x74c00)))
1116296c5ddc4Srjs        bi_disasm_add_ldexp_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1116396c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x74e00)))
1116496c5ddc4Srjs        bi_disasm_add_ldexp_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1116596c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0xc8400)))
1116696c5ddc4Srjs        bi_disasm_add_lea_attr_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1116796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0xc8600)))
1116896c5ddc4Srjs        bi_disasm_add_lea_attr_tex_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1116996c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x61000)))
1117096c5ddc4Srjs        bi_disasm_add_load_i128(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1117196c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65000)))
1117296c5ddc4Srjs        bi_disasm_add_load_i24(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1117396c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x60c00)))
1117496c5ddc4Srjs        bi_disasm_add_load_i32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1117596c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65200)))
1117696c5ddc4Srjs        bi_disasm_add_load_i48(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1117796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x60e00)))
1117896c5ddc4Srjs        bi_disasm_add_load_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1117996c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65400)))
1118096c5ddc4Srjs        bi_disasm_add_load_i96(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1118196c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0xefe00)))
1118296c5ddc4Srjs        bi_disasm_add_shift_double_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1118396c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x61200)))
1118496c5ddc4Srjs        bi_disasm_add_store_i128(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1118596c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x62800)))
1118696c5ddc4Srjs        bi_disasm_add_store_i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1118796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65800)))
1118896c5ddc4Srjs        bi_disasm_add_store_i24(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1118996c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x62c00)))
1119096c5ddc4Srjs        bi_disasm_add_store_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1119196c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65a00)))
1119296c5ddc4Srjs        bi_disasm_add_store_i48(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1119396c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x62e00)))
1119496c5ddc4Srjs        bi_disasm_add_store_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1119596c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x62000)))
1119696c5ddc4Srjs        bi_disasm_add_store_i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1119796c5ddc4Srjs    else if (unlikely(((bits & 0xffe00) == 0x65c00)))
1119896c5ddc4Srjs        bi_disasm_add_store_i96(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1119996c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x648c0)))
1120096c5ddc4Srjs        bi_disasm_add_acmpstore_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1120196c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x64900)))
1120296c5ddc4Srjs        bi_disasm_add_acmpstore_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1120396c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x644c0)))
1120496c5ddc4Srjs        bi_disasm_add_acmpxchg_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1120596c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x64500)))
1120696c5ddc4Srjs        bi_disasm_add_acmpxchg_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1120796c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x640c0)))
1120896c5ddc4Srjs        bi_disasm_add_axchg_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1120996c5ddc4Srjs    else if (unlikely(((bits & 0xffdc0) == 0x64100)))
1121096c5ddc4Srjs        bi_disasm_add_axchg_i64(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1121196c5ddc4Srjs    else if (unlikely(((bits & 0xffd00) == 0xca100)
1121296c5ddc4Srjs        && !(0xc & (1 << _BITS(bits, 5, 2)))
1121396c5ddc4Srjs    ))
1121496c5ddc4Srjs        bi_disasm_add_var_tex_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1121596c5ddc4Srjs    else if (unlikely(((bits & 0xffd00) == 0xca000)
1121696c5ddc4Srjs        && !(0xc & (1 << _BITS(bits, 5, 2)))
1121796c5ddc4Srjs    ))
1121896c5ddc4Srjs        bi_disasm_add_var_tex_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1121996c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbec00)))
1122096c5ddc4Srjs        bi_disasm_add_iadd_s32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1122196c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbec40)))
1122296c5ddc4Srjs        bi_disasm_add_iadd_v2s16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1122396c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbe800)))
1122496c5ddc4Srjs        bi_disasm_add_iadd_v2s16_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1122596c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbe840)))
1122696c5ddc4Srjs        bi_disasm_add_iadd_v4s8_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1122796c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbfc00)))
1122896c5ddc4Srjs        bi_disasm_add_isub_s32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1122996c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbfc40)))
1123096c5ddc4Srjs        bi_disasm_add_isub_v2s16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1123196c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbf800)))
1123296c5ddc4Srjs        bi_disasm_add_isub_v2s16_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1123396c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xbf840)))
1123496c5ddc4Srjs        bi_disasm_add_isub_v4s8_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1123596c5ddc4Srjs    else if (unlikely(((bits & 0xffcc0) == 0xcf8c0)))
1123696c5ddc4Srjs        bi_disasm_add_ld_var_flat_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1123796c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbec00)))
1123896c5ddc4Srjs        bi_disasm_add_iadd_u32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1123996c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbec40)))
1124096c5ddc4Srjs        bi_disasm_add_iadd_v2u16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1124196c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbe800)))
1124296c5ddc4Srjs        bi_disasm_add_iadd_v2u16_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1124396c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbe840)))
1124496c5ddc4Srjs        bi_disasm_add_iadd_v4u8_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1124596c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbfc00)))
1124696c5ddc4Srjs        bi_disasm_add_isub_u32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1124796c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbfc40)))
1124896c5ddc4Srjs        bi_disasm_add_isub_v2u16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1124996c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbf800)))
1125096c5ddc4Srjs        bi_disasm_add_isub_v2u16_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1125196c5ddc4Srjs    else if (unlikely(((bits & 0xffc40) == 0xbf840)))
1125296c5ddc4Srjs        bi_disasm_add_isub_v4u8_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1125396c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x3e000)))
1125496c5ddc4Srjs        bi_disasm_add_cube_ssel(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1125596c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x3e400)))
1125696c5ddc4Srjs        bi_disasm_add_cube_tsel(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1125796c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0xcf800)))
1125896c5ddc4Srjs        bi_disasm_add_ld_var_flat_imm_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1125996c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0xc8000)))
1126096c5ddc4Srjs        bi_disasm_add_lea_attr_imm_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1126196c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x60800)))
1126296c5ddc4Srjs        bi_disasm_add_load_i16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1126396c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x63000)))
1126496c5ddc4Srjs        bi_disasm_add_load_i16_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1126596c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x61800)))
1126696c5ddc4Srjs        bi_disasm_add_load_i16_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1126796c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x61c00)))
1126896c5ddc4Srjs        bi_disasm_add_load_i32_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1126996c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x63400)))
1127096c5ddc4Srjs        bi_disasm_add_load_i8_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1127196c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x61400)))
1127296c5ddc4Srjs        bi_disasm_add_load_i8_3(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1127396c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0x74800)))
1127496c5ddc4Srjs        bi_disasm_add_mux_v4i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1127596c5ddc4Srjs    else if (unlikely(((bits & 0xffc00) == 0xd7000)))
1127696c5ddc4Srjs        bi_disasm_add_texc(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1127796c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b300)))
1127896c5ddc4Srjs        bi_disasm_add_icmp_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1127996c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b200)))
1128096c5ddc4Srjs        bi_disasm_add_icmp_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1128196c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b280)))
1128296c5ddc4Srjs        bi_disasm_add_icmp_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1128396c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b100)))
1128496c5ddc4Srjs        bi_disasm_add_icmp_v4i8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1128596c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b000)))
1128696c5ddc4Srjs        bi_disasm_add_icmp_v4s8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1128796c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b080)))
1128896c5ddc4Srjs        bi_disasm_add_icmp_v4u8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1128996c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b900)))
1129096c5ddc4Srjs        bi_disasm_add_icmpi_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1129196c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b800)))
1129296c5ddc4Srjs        bi_disasm_add_icmpi_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1129396c5ddc4Srjs    else if (unlikely(((bits & 0xffb80) == 0x7b880)))
1129496c5ddc4Srjs        bi_disasm_add_icmpi_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1129596c5ddc4Srjs    else if (unlikely(((bits & 0xffa38) == 0x6f238)))
1129696c5ddc4Srjs        bi_disasm_add_branchc_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1129796c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbe000)))
1129896c5ddc4Srjs        bi_disasm_add_iadd_s32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1129996c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbc800)))
1130096c5ddc4Srjs        bi_disasm_add_iadd_v2s16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1130196c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbe040)))
1130296c5ddc4Srjs        bi_disasm_add_iadd_v4s8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1130396c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbf000)))
1130496c5ddc4Srjs        bi_disasm_add_isub_s32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1130596c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbd800)))
1130696c5ddc4Srjs        bi_disasm_add_isub_v2s16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1130796c5ddc4Srjs    else if (unlikely(((bits & 0xff8c0) == 0xbf040)))
1130896c5ddc4Srjs        bi_disasm_add_isub_v4s8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1130996c5ddc4Srjs    else if (unlikely(((bits & 0xff860) == 0x3e820)))
1131096c5ddc4Srjs        bi_disasm_add_fround_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1131196c5ddc4Srjs    else if (unlikely(((bits & 0xff860) == 0x3e800)))
1131296c5ddc4Srjs        bi_disasm_add_fround_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1131396c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbe000)))
1131496c5ddc4Srjs        bi_disasm_add_iadd_u32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1131596c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbc800)))
1131696c5ddc4Srjs        bi_disasm_add_iadd_v2u16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1131796c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbe040)))
1131896c5ddc4Srjs        bi_disasm_add_iadd_v4u8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1131996c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbf000)))
1132096c5ddc4Srjs        bi_disasm_add_isub_u32_2(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1132196c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbd800)))
1132296c5ddc4Srjs        bi_disasm_add_isub_v2u16_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1132396c5ddc4Srjs    else if (unlikely(((bits & 0xff840) == 0xbf040)))
1132496c5ddc4Srjs        bi_disasm_add_isub_v4u8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1132596c5ddc4Srjs    else if (unlikely(((bits & 0xff830) == 0x6f030)))
1132696c5ddc4Srjs        bi_disasm_add_branchc_i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1132796c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xc8800)
1132896c5ddc4Srjs        && !(0xe0 & (1 << _BITS(bits, 8, 3)))
1132996c5ddc4Srjs    ))
1133096c5ddc4Srjs        bi_disasm_add_discard_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1133196c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xc9000)))
1133296c5ddc4Srjs        bi_disasm_add_ld_cvt(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1133396c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xcb000)))
1133496c5ddc4Srjs        bi_disasm_add_ld_tile(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1133596c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0x60000)))
1133696c5ddc4Srjs        bi_disasm_add_load_i8_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1133796c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0x63800)))
1133896c5ddc4Srjs        bi_disasm_add_load_i8_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1133996c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0x74000)))
1134096c5ddc4Srjs        bi_disasm_add_mux_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1134196c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xc9800)))
1134296c5ddc4Srjs        bi_disasm_add_st_cvt(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1134396c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xcb800)))
1134496c5ddc4Srjs        bi_disasm_add_st_tile(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1134596c5ddc4Srjs    else if (unlikely(((bits & 0xff800) == 0xd7800)
1134696c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 2)))
1134796c5ddc4Srjs    ))
1134896c5ddc4Srjs        bi_disasm_add_zs_emit(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1134996c5ddc4Srjs    else if (unlikely(((bits & 0xff600) == 0xd6600)))
1135096c5ddc4Srjs        bi_disasm_add_lea_tex(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1135196c5ddc4Srjs    else if (unlikely(((bits & 0xff038) == 0x6f008)
1135296c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1135396c5ddc4Srjs    ))
1135496c5ddc4Srjs        bi_disasm_add_branchz_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1135596c5ddc4Srjs    else if (unlikely(((bits & 0xff038) == 0x6f000)
1135696c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1135796c5ddc4Srjs    ))
1135896c5ddc4Srjs        bi_disasm_add_branchz_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1135996c5ddc4Srjs    else if (unlikely(((bits & 0xff030) == 0x6f000)
1136096c5ddc4Srjs        && !(0x1f & (1 << _BITS(bits, 9, 3)))
1136196c5ddc4Srjs    ))
1136296c5ddc4Srjs        bi_disasm_add_branchz_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1136396c5ddc4Srjs    else if (unlikely(((bits & 0xff008) == 0x6f008)
1136496c5ddc4Srjs        && !(0x9 & (1 << _BITS(bits, 4, 2)))
1136596c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1136696c5ddc4Srjs    ))
1136796c5ddc4Srjs        bi_disasm_add_branchz_s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1136896c5ddc4Srjs    else if (unlikely(((bits & 0xff008) == 0x6f000)
1136996c5ddc4Srjs        && !(0x9 & (1 << _BITS(bits, 4, 2)))
1137096c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1137196c5ddc4Srjs    ))
1137296c5ddc4Srjs        bi_disasm_add_branchz_u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1137396c5ddc4Srjs    else if (unlikely(((bits & 0xff000) == 0x6f000)
1137496c5ddc4Srjs        && !(0x9 & (1 << _BITS(bits, 4, 2)))
1137596c5ddc4Srjs        && !(0x1f & (1 << _BITS(bits, 9, 3)))
1137696c5ddc4Srjs    ))
1137796c5ddc4Srjs        bi_disasm_add_branchz_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1137896c5ddc4Srjs    else if (unlikely(((bits & 0xff000) == 0x7a000)))
1137996c5ddc4Srjs        bi_disasm_add_icmp_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1138096c5ddc4Srjs    else if (unlikely(((bits & 0xff000) == 0xd6000)))
1138196c5ddc4Srjs        bi_disasm_add_lea_tex_imm(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1138296c5ddc4Srjs    else if (unlikely(((bits & 0xfefc0) == 0xbc640)))
1138396c5ddc4Srjs        bi_disasm_add_hadd_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1138496c5ddc4Srjs    else if (unlikely(((bits & 0xfefc0) == 0xbc6c0)))
1138596c5ddc4Srjs        bi_disasm_add_hadd_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1138696c5ddc4Srjs    else if (unlikely(((bits & 0xfefc0) == 0xbc440)))
1138796c5ddc4Srjs        bi_disasm_add_hadd_v4s8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1138896c5ddc4Srjs    else if (unlikely(((bits & 0xfefc0) == 0xbc4c0)))
1138996c5ddc4Srjs        bi_disasm_add_hadd_v4u8(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1139096c5ddc4Srjs    else if (unlikely(((bits & 0xfe9c0) == 0xbc840)))
1139196c5ddc4Srjs        bi_disasm_add_hadd_v2s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1139296c5ddc4Srjs    else if (unlikely(((bits & 0xfe9c0) == 0xbc8c0)))
1139396c5ddc4Srjs        bi_disasm_add_hadd_v2u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1139496c5ddc4Srjs    else if (unlikely(((bits & 0xfe800) == 0x78000)))
1139596c5ddc4Srjs        bi_disasm_add_icmp_v2s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1139696c5ddc4Srjs    else if (unlikely(((bits & 0xfe800) == 0x78800)))
1139796c5ddc4Srjs        bi_disasm_add_icmp_v2u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1139896c5ddc4Srjs    else if (unlikely(((bits & 0xfe600) == 0xc4400)))
1139996c5ddc4Srjs        bi_disasm_add_ld_attr_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1140096c5ddc4Srjs    else if (unlikely(((bits & 0xfe600) == 0xc4600)))
1140196c5ddc4Srjs        bi_disasm_add_ld_attr_tex_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1140296c5ddc4Srjs    else if (unlikely(((bits & 0xfe400) == 0xc4000)))
1140396c5ddc4Srjs        bi_disasm_add_ld_attr_imm_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1140496c5ddc4Srjs    else if (unlikely(((bits & 0xfe000) == 0x76000)))
1140596c5ddc4Srjs        bi_disasm_add_v2f32_to_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1140696c5ddc4Srjs    else if (unlikely(((bits & 0xfc600) == 0xc0400)))
1140796c5ddc4Srjs        bi_disasm_add_lea_attr_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1140896c5ddc4Srjs    else if (unlikely(((bits & 0xfc600) == 0xc0600)))
1140996c5ddc4Srjs        bi_disasm_add_lea_attr_tex_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1141096c5ddc4Srjs    else if (unlikely(((bits & 0xfc400) == 0xc0000)))
1141196c5ddc4Srjs        bi_disasm_add_lea_attr_imm_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1141296c5ddc4Srjs    else if (unlikely(((bits & 0xfc3e0) == 0xcc0a0)
1141396c5ddc4Srjs        && !(0x2 & (1 << _BITS(bits, 3, 2)))
1141496c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1141596c5ddc4Srjs    ))
1141696c5ddc4Srjs        bi_disasm_add_ld_var_special_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1141796c5ddc4Srjs    else if (unlikely(((bits & 0xfc0c0) == 0xcc0c0)
1141896c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1141996c5ddc4Srjs    ))
1142096c5ddc4Srjs        bi_disasm_add_ld_var_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1142196c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0x7c000)))
1142296c5ddc4Srjs        bi_disasm_add_clper_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1142396c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0xcc000)
1142496c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1142596c5ddc4Srjs    ))
1142696c5ddc4Srjs        bi_disasm_add_ld_var_imm_1(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1142796c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0x70000)))
1142896c5ddc4Srjs        bi_disasm_add_mux_v2i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1142996c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0xd8000)))
1143096c5ddc4Srjs        bi_disasm_add_texs_2d_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1143196c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0x58000)))
1143296c5ddc4Srjs        bi_disasm_add_texs_2d_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1143396c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0xdc000)))
1143496c5ddc4Srjs        bi_disasm_add_texs_cube_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1143596c5ddc4Srjs    else if (unlikely(((bits & 0xfc000) == 0x5c000)))
1143696c5ddc4Srjs        bi_disasm_add_texs_cube_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1143796c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1143896c5ddc4Srjs        && !(0xe1 & (1 << _BITS(bits, 12, 3)))
1143996c5ddc4Srjs        && !(0xf & (1 << _BITS(bits, 9, 3)))
1144096c5ddc4Srjs    ))
1144196c5ddc4Srjs        bi_disasm_add_branch_f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1144296c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1144396c5ddc4Srjs        && !(0x9e & (1 << _BITS(bits, 12, 3)))
1144496c5ddc4Srjs        && !(0x1 & (1 << _BITS(bits, 9, 3)))
1144596c5ddc4Srjs    ))
1144696c5ddc4Srjs        bi_disasm_add_branch_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1144796c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1144896c5ddc4Srjs        && !(0xe1 & (1 << _BITS(bits, 12, 3)))
1144996c5ddc4Srjs        && !(0xed & (1 << _BITS(bits, 9, 3)))
1145096c5ddc4Srjs    ))
1145196c5ddc4Srjs        bi_disasm_add_branch_i16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1145296c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1145396c5ddc4Srjs        && !(0xfe & (1 << _BITS(bits, 12, 3)))
1145496c5ddc4Srjs        && !(0xed & (1 << _BITS(bits, 9, 3)))
1145596c5ddc4Srjs    ))
1145696c5ddc4Srjs        bi_disasm_add_branch_i32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1145796c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1145896c5ddc4Srjs        && !(0xe9 & (1 << _BITS(bits, 12, 3)))
1145996c5ddc4Srjs        && !(0xe0 & (1 << _BITS(bits, 9, 3)))
1146096c5ddc4Srjs    ))
1146196c5ddc4Srjs        bi_disasm_add_branch_s16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1146296c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1146396c5ddc4Srjs        && !(0xfe & (1 << _BITS(bits, 12, 3)))
1146496c5ddc4Srjs        && !(0xe0 & (1 << _BITS(bits, 9, 3)))
1146596c5ddc4Srjs    ))
1146696c5ddc4Srjs        bi_disasm_add_branch_s32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1146796c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1146896c5ddc4Srjs        && !(0xf1 & (1 << _BITS(bits, 12, 3)))
1146996c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1147096c5ddc4Srjs    ))
1147196c5ddc4Srjs        bi_disasm_add_branch_u16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1147296c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x68000)
1147396c5ddc4Srjs        && !(0xfe & (1 << _BITS(bits, 12, 3)))
1147496c5ddc4Srjs        && !(0xf0 & (1 << _BITS(bits, 9, 3)))
1147596c5ddc4Srjs    ))
1147696c5ddc4Srjs        bi_disasm_add_branch_u32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1147796c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x80000)))
1147896c5ddc4Srjs        bi_disasm_add_fmax_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1147996c5ddc4Srjs    else if (unlikely(((bits & 0xf8000) == 0x90000)))
1148096c5ddc4Srjs        bi_disasm_add_fmin_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1148196c5ddc4Srjs    else if (unlikely(((bits & 0xf0600) == 0x0)))
1148296c5ddc4Srjs        bi_disasm_add_fmax_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1148396c5ddc4Srjs    else if (unlikely(((bits & 0xf0600) == 0x10000)))
1148496c5ddc4Srjs        bi_disasm_add_fmin_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1148596c5ddc4Srjs    else if (unlikely(((bits & 0xf0600) == 0x40400)))
1148696c5ddc4Srjs        bi_disasm_add_ld_attr_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1148796c5ddc4Srjs    else if (unlikely(((bits & 0xf0600) == 0x40600)))
1148896c5ddc4Srjs        bi_disasm_add_ld_attr_tex_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1148996c5ddc4Srjs    else if (unlikely(((bits & 0xf0400) == 0x40000)))
1149096c5ddc4Srjs        bi_disasm_add_ld_attr_imm_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1149196c5ddc4Srjs    else if (unlikely(((bits & 0xf0000) == 0x20000)))
1149296c5ddc4Srjs        bi_disasm_add_fadd_f32_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1149396c5ddc4Srjs    else if (unlikely(((bits & 0xf0000) == 0xa0000)))
1149496c5ddc4Srjs        bi_disasm_add_fadd_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1149596c5ddc4Srjs    else if (unlikely(((bits & 0xf0000) == 0x30000)))
1149696c5ddc4Srjs        bi_disasm_add_fcmp_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1149796c5ddc4Srjs    else if (unlikely(((bits & 0xf0000) == 0xb0000)))
1149896c5ddc4Srjs        bi_disasm_add_fcmp_v2f16(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1149996c5ddc4Srjs    else if (unlikely(((bits & 0xe8000) == 0x88000)
1150096c5ddc4Srjs        && !(0x2 & (1 << _BITS(bits, 9, 3)))
1150196c5ddc4Srjs    ))
1150296c5ddc4Srjs        bi_disasm_add_fadd_rscale_f32(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1150396c5ddc4Srjs    else if (unlikely(((bits & 0x7f8c0) == 0x538c0)))
1150496c5ddc4Srjs        bi_disasm_add_ld_var_flat_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1150596c5ddc4Srjs    else if (unlikely(((bits & 0x7f800) == 0x53800)))
1150696c5ddc4Srjs        bi_disasm_add_ld_var_flat_imm_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1150796c5ddc4Srjs    else if (unlikely(((bits & 0x7c3e0) == 0x500a0)
1150896c5ddc4Srjs        && !(0x2 & (1 << _BITS(bits, 3, 2)))
1150996c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1151096c5ddc4Srjs    ))
1151196c5ddc4Srjs        bi_disasm_add_ld_var_special_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1151296c5ddc4Srjs    else if (unlikely(((bits & 0x7c0c0) == 0x500c0)
1151396c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1151496c5ddc4Srjs    ))
1151596c5ddc4Srjs        bi_disasm_add_ld_var_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1151696c5ddc4Srjs    else if (unlikely(((bits & 0x7c000) == 0x50000)
1151796c5ddc4Srjs        && !(0xc0e0 & (1 << _BITS(bits, 10, 4)))
1151896c5ddc4Srjs    ))
1151996c5ddc4Srjs        bi_disasm_add_ld_var_imm_0(fp, bits, srcs, next_regs, staging_register, branch_offset, consts, last);
1152096c5ddc4Srjs    else
1152196c5ddc4Srjs        fprintf(fp, "INSTR_INVALID_ENC add %X", bits);
1152296c5ddc4Srjs
1152396c5ddc4Srjs    fputs("\n", fp);
1152496c5ddc4Srjs}
11525