xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/tic6x-insn-formats.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* TI C6X instruction format information.
2*aab831ceSchristos    Copyright (C) 2010-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This program is free software; you can redistribute it and/or modify
598b9484cSchristos    it under the terms of the GNU General Public License as published by
698b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
798b9484cSchristos    (at your option) any later version.
898b9484cSchristos 
998b9484cSchristos    This program is distributed in the hope that it will be useful,
1098b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1198b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1298b9484cSchristos    GNU General Public License for more details.
1398b9484cSchristos 
1498b9484cSchristos    You should have received a copy of the GNU General Public License
1598b9484cSchristos    along with this program; if not, write to the Free Software
1698b9484cSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1798b9484cSchristos    MA 02110-1301, USA.  */
1898b9484cSchristos 
1998b9484cSchristos /* Define the FMT macro before including this file; it takes a name
2098b9484cSchristos    and the fields from tic6x_insn_format (defined in tic6x.h).  */
2198b9484cSchristos 
2203467a24Schristos /* Expansion fields values for 16 bits insn.  */
2303467a24Schristos #define SAT(a) (((a) & 1) << TIC6X_COMPACT_SAT_POS)
2403467a24Schristos #define BR(a) (((a) & 1) << TIC6X_COMPACT_BR_POS)
2503467a24Schristos #define DSZ(a) (((a) & 7) << TIC6X_COMPACT_DSZ_POS)
2603467a24Schristos /* Composite fields for 16 bits insn.  */
2703467a24Schristos #define BFLD(low_pos, width, pos) { (low_pos), (width), (pos) }
2803467a24Schristos #define BFLD1(a) 1, { a }
2903467a24Schristos #define BFLD2(a, b) 2, { a, b }
3003467a24Schristos #define BFLD3(a, b, c) 3, { a, b, c }
3103467a24Schristos #define BFLD4(a, b, c, d) 4, { a, b, c, d }
3203467a24Schristos #define COMPFLD(name, bitfields) { CONCAT2(tic6x_field_,name),  bitfields }
3303467a24Schristos /**/
3403467a24Schristos #define FLD(name, pos, width) { CONCAT2(tic6x_field_,name), BFLD1(BFLD(pos, width, 0)) }
3598b9484cSchristos #define CFLDS FLD(p, 0, 1), FLD(creg, 29, 3), FLD(z, 28, 1)
3698b9484cSchristos #define CFLDS2(a, b) 5, { CFLDS, a, b }
3798b9484cSchristos #define CFLDS3(a, b, c) 6, { CFLDS, a, b, c }
3898b9484cSchristos #define CFLDS4(a, b, c, d) 7, { CFLDS, a, b, c, d }
3998b9484cSchristos #define CFLDS5(a, b, c, d, e) 8, { CFLDS, a, b, c, d, e }
4098b9484cSchristos #define CFLDS6(a, b, c, d, e, f) 9, { CFLDS, a, b, c, d, e, f }
4198b9484cSchristos #define CFLDS7(a, b, c, d, e, f, g) 10, { CFLDS, a, b, c, d, e, f, g }
4298b9484cSchristos #define CFLDS8(a, b, c, d, e, f, g, h) 11, { CFLDS, a, b, c, d, e, f, g, h }
4398b9484cSchristos #define NFLDS FLD(p, 0, 1)
4498b9484cSchristos #define NFLDS1(a) 2, { NFLDS, a }
4598b9484cSchristos #define NFLDS2(a, b) 3, { NFLDS, a, b }
4698b9484cSchristos #define NFLDS3(a, b, c) 4, { NFLDS, a, b, c }
4798b9484cSchristos #define NFLDS5(a, b, c, d, e) 6, { NFLDS, a, b, c, d, e }
4898b9484cSchristos #define NFLDS6(a, b, c, d, e, f) 7, { NFLDS, a, b, c, d, e, f }
4998b9484cSchristos #define NFLDS7(a, b, c, d, e, f, g) 8, { NFLDS, a, b, c, d, e, f, g }
5003467a24Schristos /* 16 bits insn */
5103467a24Schristos #define FLDS1(a) 1, { a }
5203467a24Schristos #define FLDS2(a, b) 2, { a, b }
5303467a24Schristos #define FLDS3(a, b, c) 3, { a, b, c }
5403467a24Schristos #define FLDS4(a, b, c, d) 4, { a, b, c, d }
5503467a24Schristos #define FLDS5(a, b, c, d, e) 5, { a, b, c, d, e }
5603467a24Schristos #define SFLDS FLD(s, 0, 1)
5703467a24Schristos #define SFLDS1(a) 2, { SFLDS, a }
5803467a24Schristos #define SFLDS2(a, b) 3, { SFLDS, a, b }
5903467a24Schristos #define SFLDS3(a, b, c) 4, { SFLDS, a, b, c }
6003467a24Schristos #define SFLDS4(a, b, c, d) 5, { SFLDS, a, b, c, d }
6103467a24Schristos #define SFLDS5(a, b, c, d, e) 6, { SFLDS, a, b, c, d, e }
6203467a24Schristos #define SFLDS6(a, b, c, d, e, f) 7, { SFLDS, a, b, c, d, e, f }
6303467a24Schristos #define SFLDS7(a, b, c, d, e, f, g) 8, { SFLDS, a, b, c, d, e, f, g }
6403467a24Schristos /**/
6598b9484cSchristos 
6698b9484cSchristos /* These are in the order from SPRUFE8, appendices C-H.  */
6798b9484cSchristos 
6898b9484cSchristos /* Appendix C 32-bit formats.  */
6998b9484cSchristos 
7098b9484cSchristos FMT(d_1_or_2_src, 32, 0x40, 0x7c,
7198b9484cSchristos     CFLDS5(FLD(s, 1, 1), FLD(op, 7, 6), FLD(src1, 13, 5), FLD(src2, 18, 5),
7298b9484cSchristos 	   FLD(dst, 23, 5)))
7398b9484cSchristos FMT(d_ext_1_or_2_src, 32, 0x830, 0xc3c,
7498b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 6, 4), FLD(x, 12, 1), FLD(src1, 13, 5),
7598b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
7698b9484cSchristos FMT(d_load_store, 32, 0x4, 0xc,
7798b9484cSchristos     CFLDS8(FLD(s, 1, 1), FLD(op, 4, 3), FLD(y, 7, 1), FLD(r, 8, 1),
7898b9484cSchristos 	   FLD(mode, 9, 4), FLD(offsetR, 13, 5), FLD(baseR, 18, 5),
7998b9484cSchristos 	   FLD(srcdst, 23, 5)))
8098b9484cSchristos /* The nonaligned loads and stores have the formats shown in the
8198b9484cSchristos    individual instruction descriptions; the appendix is incorrect.  */
8298b9484cSchristos FMT(d_load_nonaligned, 32, 0x124, 0x17c,
8398b9484cSchristos     CFLDS7(FLD(s, 1, 1), FLD(y, 7, 1), FLD(mode, 9, 4), FLD(offsetR, 13, 5),
8498b9484cSchristos 	   FLD(baseR, 18, 5), FLD(sc, 23, 1), FLD(dst, 24, 4)))
8598b9484cSchristos FMT(d_store_nonaligned, 32, 0x174, 0x17c,
8698b9484cSchristos     CFLDS7(FLD(s, 1, 1), FLD(y, 7, 1), FLD(mode, 9, 4), FLD(offsetR, 13, 5),
8798b9484cSchristos 	   FLD(baseR, 18, 5), FLD(sc, 23, 1), FLD(src, 24, 4)))
8898b9484cSchristos FMT(d_load_store_long, 32, 0xc, 0xc,
8998b9484cSchristos     CFLDS5(FLD(s, 1, 1), FLD(op, 4, 3), FLD(y, 7, 1), FLD(offsetR, 8, 15),
9098b9484cSchristos 	   FLD(dst, 23, 5)))
9198b9484cSchristos FMT(d_adda_long, 32, 0x1000000c, 0xf000000c,
9298b9484cSchristos     NFLDS5(FLD(s, 1, 1), FLD(op, 4, 3), FLD(y, 7, 1), FLD(offsetR, 8, 15),
9398b9484cSchristos 	   FLD(dst, 23, 5)))
9498b9484cSchristos 
9598b9484cSchristos /* Appendix C 16-bit formats will go here.  */
9698b9484cSchristos 
9703467a24Schristos /* C-8 */
9803467a24Schristos FMT(d_doff4_dsz_0xx, 16, DSZ(0) | 0x0004, DSZ(0x4) | 0x0406,
9903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
10003467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
10103467a24Schristos FMT(d_doff4_dsz_100, 16, DSZ(4) | 0x0004, DSZ(0x7) | 0x0406,
10203467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
10303467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
10403467a24Schristos FMT(d_doff4_dsz_000, 16, DSZ(0) | 0x0004, DSZ(0x7) | 0x0406,
10503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
10603467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
10703467a24Schristos FMT(d_doff4_dsz_x01, 16, DSZ(1) | 0x0004, DSZ(0x3) | 0x0406,
10803467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
10903467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
11003467a24Schristos FMT(d_doff4_dsz_01x, 16, DSZ(2) | 0x0004, DSZ(0x6) | 0x0406,
11103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
11203467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
11303467a24Schristos FMT(d_doff4_dsz_111, 16, DSZ(7) | 0x0004, DSZ(0x7) | 0x0406,
11403467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
11503467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
11603467a24Schristos FMT(d_doff4_dsz_x11, 16, DSZ(3) | 0x0004, DSZ(0x3) | 0x0406,
11703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
11803467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
11903467a24Schristos FMT(d_doff4_dsz_010, 16, DSZ(2) | 0x0004, DSZ(0x7) | 0x0406,
12003467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
12103467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
12203467a24Schristos FMT(d_doff4_dsz_110, 16, DSZ(6) | 0x0004, DSZ(0x7) | 0x0406,
12303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
12403467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
12503467a24Schristos 
12603467a24Schristos /* C-9 */
12703467a24Schristos FMT(d_doff4dw, 16, DSZ(4) | 0x0004, DSZ(0x4) | 0x0406,
12803467a24Schristos     SFLDS7(FLD(op, 3, 1), FLD(na, 4, 1), FLD(srcdst, 5, 2), FLD(ptr, 7, 2), FLD(sz, 9, 1), FLD(t, 12, 1),
12903467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
13003467a24Schristos 
13103467a24Schristos /* C-10 */
13203467a24Schristos FMT(d_dind_dsz_0xx, 16, DSZ(0) | 0x0404, DSZ(0x4) | 0x0c06,
13303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
13403467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
13503467a24Schristos 
13603467a24Schristos FMT(d_dind_dsz_x01, 16, DSZ(1) | 0x0404, DSZ(0x3) | 0x0c06,
13703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
13803467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
13903467a24Schristos 
14003467a24Schristos FMT(d_dind_dsz_x11, 16, DSZ(3) | 0x0404, DSZ(0x3) | 0x0c06,
14103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
14203467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
14303467a24Schristos 
14403467a24Schristos FMT(d_dind_dsz_01x, 16, DSZ(2) | 0x0404, DSZ(0x6) | 0x0c06,
14503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
14603467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
14703467a24Schristos 
14803467a24Schristos FMT(d_dind_dsz_000, 16, DSZ(0) | 0x0404, DSZ(0x7) | 0x0c06,
14903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
15003467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
15103467a24Schristos 
15203467a24Schristos FMT(d_dind_dsz_010, 16, DSZ(2) | 0x0404, DSZ(0x7) | 0x0c06,
15303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
15403467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
15503467a24Schristos 
15603467a24Schristos FMT(d_dind_dsz_100, 16, DSZ(4) | 0x0404, DSZ(0x7) | 0x0c06,
15703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
15803467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
15903467a24Schristos 
16003467a24Schristos FMT(d_dind_dsz_110, 16, DSZ(6) | 0x0404, DSZ(0x7) | 0x0c06,
16103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
16203467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
16303467a24Schristos 
16403467a24Schristos FMT(d_dind_dsz_111, 16, DSZ(7) | 0x0404, DSZ(0x7) | 0x0c06,
16503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
16603467a24Schristos            FLD(t, 12, 1), FLD(src1, 13, 3)))
16703467a24Schristos 
16803467a24Schristos /* C-11 */
16903467a24Schristos FMT(d_dinddw, 16, DSZ(4) | 0x0404, DSZ(0x4) | 0x0c06,
17003467a24Schristos     SFLDS7(FLD(op, 3, 1), FLD(na, 4, 1), FLD(srcdst, 5, 2), FLD(ptr, 7, 2),
17103467a24Schristos            FLD(sz, 9, 1), FLD(t, 12, 1), FLD(src1, 13, 3)))
17203467a24Schristos 
17303467a24Schristos /* C-12 */
17403467a24Schristos FMT(d_dinc_dsz_x01, 16, DSZ(1) | 0x0c04, DSZ(0x3) | 0xcc06,
17503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
17603467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
17703467a24Schristos 
17803467a24Schristos FMT(d_dinc_dsz_0xx, 16, DSZ(0) | 0x0c04, DSZ(0x4) | 0xcc06,
17903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
18003467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
18103467a24Schristos 
18203467a24Schristos FMT(d_dinc_dsz_01x, 16, DSZ(2) | 0x0c04, DSZ(0x6) | 0xcc06,
18303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
18403467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
18503467a24Schristos 
18603467a24Schristos FMT(d_dinc_dsz_x11,16, DSZ(3) | 0x0c04, DSZ(0x3) | 0xcc06,
18703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
18803467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
18903467a24Schristos 
19003467a24Schristos FMT(d_dinc_dsz_000, 16, DSZ(0) | 0x0c04, DSZ(0x7) | 0xcc06,
19103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
19203467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
19303467a24Schristos 
19403467a24Schristos FMT(d_dinc_dsz_010, 16, DSZ(2) | 0x0c04, DSZ(0x7) | 0xcc06,
19503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
19603467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
19703467a24Schristos 
19803467a24Schristos FMT(d_dinc_dsz_100, 16, DSZ(4) | 0x0c04, DSZ(0x7) | 0xcc06,
19903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
20003467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
20103467a24Schristos 
20203467a24Schristos FMT(d_dinc_dsz_110, 16, DSZ(6) | 0x0c04, DSZ(0x7) | 0xcc06,
20303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
20403467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
20503467a24Schristos 
20603467a24Schristos FMT(d_dinc_dsz_111, 16, DSZ(7) | 0x0c04, DSZ(0x7) | 0xcc06,
20703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
20803467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
20903467a24Schristos 
21003467a24Schristos /* C-13*/
21103467a24Schristos FMT(d_dincdw, 16, DSZ(4) | 0x0c04, DSZ(0x4) | 0xcc06,
21203467a24Schristos     SFLDS7(FLD(op, 3, 1), FLD(na, 4, 1), FLD(srcdst, 5, 2), FLD(ptr, 7, 2),
21303467a24Schristos            FLD(sz, 9, 1), FLD(t, 12, 1), FLD(cst, 13, 1)))
21403467a24Schristos 
21503467a24Schristos /* C-14 */
21603467a24Schristos FMT(d_ddec_dsz_01x, 16, DSZ(2) | 0x4c04, DSZ(0x6) | 0xcc06,
21703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
21803467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
21903467a24Schristos 
22003467a24Schristos FMT(d_ddec_dsz_0xx, 16, DSZ(0) | 0x4c04, DSZ(0x4) | 0xcc06,
22103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
22203467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
22303467a24Schristos 
22403467a24Schristos FMT(d_ddec_dsz_x01, 16, DSZ(1) | 0x4c04, DSZ(0x3) | 0xcc06,
22503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
22603467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
22703467a24Schristos 
22803467a24Schristos FMT(d_ddec_dsz_x11, 16, DSZ(3) | 0x4c04, DSZ(0x3) | 0xcc06,
22903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
23003467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
23103467a24Schristos 
23203467a24Schristos FMT(d_ddec_dsz_000, 16, DSZ(0) | 0x4c04, DSZ(0x7) | 0xcc06,
23303467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
23403467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
23503467a24Schristos 
23603467a24Schristos FMT(d_ddec_dsz_010, 16, DSZ(2) | 0x4c04, DSZ(0x7) | 0xcc06,
23703467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
23803467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
23903467a24Schristos 
24003467a24Schristos FMT(d_ddec_dsz_100, 16, DSZ(4) | 0x4c04, DSZ(0x7) | 0xcc06,
24103467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
24203467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
24303467a24Schristos 
24403467a24Schristos FMT(d_ddec_dsz_110, 16, DSZ(6) | 0x4c04, DSZ(0x7) | 0xcc06,
24503467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
24603467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
24703467a24Schristos 
24803467a24Schristos FMT(d_ddec_dsz_111, 16, DSZ(7) | 0x4c04, DSZ(0x7) | 0xcc06,
24903467a24Schristos     SFLDS6(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(ptr, 7, 2), FLD(sz, 9, 1),
25003467a24Schristos            FLD(t, 12, 1), FLD(cst, 13, 1)))
25103467a24Schristos 
25203467a24Schristos /* C-15 */
25303467a24Schristos FMT(d_ddecdw, 16, DSZ(4) | 0x4c04, DSZ(0x4) | 0xcc06,
25403467a24Schristos     SFLDS7(FLD(op, 3, 1), FLD(na, 4, 1),  FLD(srcdst, 5, 2), FLD(ptr, 7, 2),
25503467a24Schristos            FLD(sz, 9, 1), FLD(t, 12, 1), FLD(cst, 13, 1)))
25603467a24Schristos 
25703467a24Schristos /* C-16 */
25803467a24Schristos FMT(d_dstk, 16, 0x8c04, 0x8c06,
25903467a24Schristos     SFLDS4(FLD(op, 3, 1), FLD(srcdst, 4, 3), FLD(t, 12, 1),
26003467a24Schristos            COMPFLD(cst, BFLD2(BFLD(7, 3, 2), BFLD(13, 2, 0)))))
26103467a24Schristos 
26203467a24Schristos /* C-17 */
26303467a24Schristos FMT(d_dx2op, 16, 0x0036, 0x047e,
26403467a24Schristos     SFLDS4(FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1), FLD(srcdst, 13, 3)))
26503467a24Schristos 
26603467a24Schristos /* C-18 */
26703467a24Schristos FMT(d_dx5, 16, 0x0436, 0x047e,
26803467a24Schristos     SFLDS2(FLD(dst, 7, 3),
26903467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
27003467a24Schristos 
27103467a24Schristos /* C-19 */
27203467a24Schristos FMT(d_dx5p, 16, 0x0c76, 0x1c7e,
27303467a24Schristos     SFLDS2(FLD(op, 7, 1),
27403467a24Schristos            COMPFLD(cst, BFLD2(BFLD(8, 2, 3), BFLD(13, 3, 0)))))
27503467a24Schristos 
27603467a24Schristos /* C-20 */
27703467a24Schristos FMT(d_dx1, 16, 0x1876, 0x1c7e,
27803467a24Schristos     SFLDS2(FLD(srcdst, 7, 3), FLD(op, 13, 3)))
27903467a24Schristos 
28003467a24Schristos /* C-21 */
28103467a24Schristos FMT(d_dpp, 16, 0x0077, 0x087f,
28203467a24Schristos     SFLDS5(FLD(srcdst, 7, 4), FLD(t, 12, 1), FLD(cst, 13, 1), FLD(op, 14, 1),
28303467a24Schristos            FLD(dw, 15, 1)))
28403467a24Schristos 
28598b9484cSchristos /* Appendix D 32-bit formats.  */
28698b9484cSchristos 
28798b9484cSchristos FMT(l_1_or_2_src, 32, 0x18, 0x1c,
28898b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 5, 7), FLD(x, 12, 1), FLD(src1, 13, 5),
28998b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
29098b9484cSchristos FMT(l_1_or_2_src_noncond, 32, 0x10000018, 0xf000001c,
29198b9484cSchristos     NFLDS6(FLD(s, 1, 1), FLD(op, 5, 7), FLD(x, 12, 1), FLD(src1, 13, 5),
29298b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
29398b9484cSchristos FMT(l_unary, 32, 0x358, 0xffc,
29498b9484cSchristos     CFLDS5(FLD(s, 1, 1), FLD(x, 12, 1), FLD(op, 13, 5), FLD(src2, 18, 5),
29598b9484cSchristos 	   FLD(dst, 23, 5)))
29698b9484cSchristos 
29798b9484cSchristos /* Appendix D 16-bit formats will go here.  */
29898b9484cSchristos 
29903467a24Schristos /* D-4 */
30003467a24Schristos FMT(l_l3_sat_0, 16, SAT(0) | 0x0000, SAT(1) | 0x040e,
30103467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
30203467a24Schristos            FLD(src1, 13, 3)))
30303467a24Schristos 
30403467a24Schristos FMT(l_l3_sat_1, 16, SAT(1) | 0x0000, SAT(1) | 0x040e,
30503467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
30603467a24Schristos            FLD(src1, 13, 3)))
30703467a24Schristos 
30803467a24Schristos /* D-5 - combine cst3 and n fields into a single field cst */
30903467a24Schristos FMT(l_l3i, 16, 0x0400, 0x040e,
31003467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(sn, 11, 1), FLD(x, 12, 1),
31103467a24Schristos            COMPFLD(cst, BFLD2(BFLD(13, 3, 0), BFLD(11, 1, 3)))))
31203467a24Schristos 
31303467a24Schristos /* D-6 Mtbd ? */
31403467a24Schristos 
31503467a24Schristos /* D-7 */
31603467a24Schristos FMT(l_l2c, 16, 0x0408, 0x040e,
31703467a24Schristos     SFLDS5(FLD(dst, 4, 1), FLD(src2, 7, 3), FLD(x, 12, 1), FLD(src1, 13, 3),
31803467a24Schristos            COMPFLD(op, BFLD2(BFLD(5, 2, 0), BFLD(11, 1, 2)))))
31903467a24Schristos 
32003467a24Schristos /* D-8 */
32103467a24Schristos FMT(l_lx5, 16, 0x0426, 0x047e,
32203467a24Schristos     SFLDS2(FLD(dst, 7, 3),
32303467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
32403467a24Schristos 
32503467a24Schristos /* D-9 */
32603467a24Schristos FMT(l_lx3c, 16, 0x0026, 0x147e,
32703467a24Schristos     SFLDS3(FLD(src2, 7, 3), FLD(dst, 11, 1), FLD(cst, 13, 3)))
32803467a24Schristos 
32903467a24Schristos /* D-10 */
33003467a24Schristos FMT(l_lx1c, 16, 0x1026, 0x147e,
33103467a24Schristos     SFLDS4(FLD(src2, 7, 3), FLD(dst, 11, 1), FLD(cst, 13, 1), FLD(op, 14, 2)))
33203467a24Schristos 
33303467a24Schristos /* D-11 */
33403467a24Schristos FMT(l_lx1, 16, 0x1866, 0x1c7e,
33503467a24Schristos     SFLDS2(FLD(srcdst, 7, 3), FLD(op, 13, 3)))
33603467a24Schristos 
33798b9484cSchristos /* Appendix E 32-bit formats.  */
33898b9484cSchristos 
33998b9484cSchristos FMT(m_compound, 32, 0x30, 0x83c,
34098b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 6, 5), FLD(x, 12, 1), FLD(src1, 13, 5),
34198b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
34298b9484cSchristos FMT(m_1_or_2_src, 32, 0x10000030, 0xf000083c,
34398b9484cSchristos     NFLDS6(FLD(s, 1, 1), FLD(op, 6, 5), FLD(x, 12, 1), FLD(src1, 13, 5),
34498b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
34598b9484cSchristos /* Contrary to SPRUFE8, this does have predicate fields.  */
34698b9484cSchristos FMT(m_unary, 32, 0xf0, 0xffc,
34798b9484cSchristos     CFLDS5(FLD(s, 1, 1), FLD(x, 12, 1), FLD(op, 13, 5), FLD(src2, 18, 5),
34898b9484cSchristos 	   FLD(dst, 23, 5)))
34998b9484cSchristos 
35098b9484cSchristos /* M-unit formats missing from Appendix E.  */
35198b9484cSchristos FMT(m_mpy, 32, 0x0, 0x7c,
35298b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 7, 5), FLD(x, 12, 1), FLD(src1, 13, 5),
35398b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
35498b9484cSchristos 
35598b9484cSchristos /* Appendix E 16-bit formats will go here.  */
35603467a24Schristos FMT(m_m3_sat_0, 16, SAT(0) | 0x001e, SAT(1) | 0x001e,
35703467a24Schristos     SFLDS5(FLD(op, 5, 2), FLD(src2, 7, 3), FLD(dst, 10, 2),
35803467a24Schristos            FLD(x, 12, 1), FLD(src1, 13, 3)))
35903467a24Schristos FMT(m_m3_sat_1, 16, SAT(1) | 0x001e, SAT(1) | 0x001e,
36003467a24Schristos     SFLDS5(FLD(op, 5, 2), FLD(src2, 7, 3), FLD(dst, 10, 2),
36103467a24Schristos            FLD(x, 12, 1), FLD(src1, 13, 3)))
36298b9484cSchristos 
36398b9484cSchristos /* Appendix F 32-bit formats.  */
36498b9484cSchristos 
36598b9484cSchristos FMT(s_1_or_2_src, 32, 0x20, 0x3c,
36698b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 6, 6), FLD(x, 12, 1), FLD(src1, 13, 5),
36798b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23 ,5)))
36898b9484cSchristos FMT(s_ext_1_or_2_src, 32, 0xc30, 0xc3c,
36998b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 6, 4), FLD(x, 12, 1), FLD(src1, 13, 5),
37098b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
37198b9484cSchristos FMT(s_ext_1_or_2_src_noncond, 32, 0xc30, 0xe0000c3c,
37298b9484cSchristos     NFLDS7(FLD(s, 1, 1), FLD(op, 6, 4), FLD(x, 12, 1), FLD(src1, 13, 5),
37398b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5), FLD(z, 28, 1)))
37498b9484cSchristos FMT(s_unary, 32, 0xf20, 0xffc,
37598b9484cSchristos     CFLDS5(FLD(s, 1, 1), FLD(x, 12, 1), FLD(op, 13, 5), FLD(src2, 18, 5),
37698b9484cSchristos 	   FLD(dst, 23, 5)))
37798b9484cSchristos FMT(s_ext_branch_cond_imm, 32, 0x10, 0x7c,
37898b9484cSchristos     CFLDS2(FLD(s, 1, 1), FLD(cst, 7, 21)))
37998b9484cSchristos FMT(s_call_imm_nop, 32, 0x10, 0xe000007c,
38098b9484cSchristos     NFLDS3(FLD(s, 1, 1), FLD(cst, 7, 21), FLD(z, 28, 1)))
38198b9484cSchristos FMT(s_branch_nop_cst, 32, 0x120, 0x1ffc,
38298b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(src1, 13, 3), FLD(src2, 16, 12)))
38398b9484cSchristos FMT(s_branch_nop_reg, 32, 0x800360, 0xf830ffc,
38498b9484cSchristos     CFLDS4(FLD(s, 1, 1), FLD(x, 12, 1), FLD(src1, 13, 3), FLD(src2, 18, 5)))
38598b9484cSchristos FMT(s_branch, 32, 0x360, 0xf83effc,
38698b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(x, 12, 1), FLD(src2, 18, 5)))
38798b9484cSchristos FMT(s_mvk, 32, 0x28, 0x3c,
38898b9484cSchristos     CFLDS4(FLD(s, 1, 1), FLD(h, 6, 1), FLD(cst, 7, 16), FLD(dst, 23, 5)))
38998b9484cSchristos FMT(s_field, 32, 0x8, 0x3c,
39098b9484cSchristos     CFLDS6(FLD(s, 1, 1), FLD(op, 6, 2), FLD(cstb, 8, 5), FLD(csta, 13, 5),
39198b9484cSchristos 	   FLD(src2, 18, 5), FLD(dst, 23, 5)))
39298b9484cSchristos 
39398b9484cSchristos /* S-unit formats missing from Appendix F.  */
39498b9484cSchristos FMT(s_addk, 32, 0x50, 0x7c,
39598b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(cst, 7, 16), FLD(dst, 23, 5)))
39698b9484cSchristos FMT(s_addkpc, 32, 0x160, 0x1ffc,
39798b9484cSchristos     CFLDS4(FLD(s, 1, 1), FLD(src2, 13, 3), FLD(src1, 16, 7), FLD(dst, 23, 5)))
39898b9484cSchristos FMT(s_b_irp, 32, 0x1800e0, 0x7feffc,
39998b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(x, 12, 1), FLD(dst, 23, 5)))
40098b9484cSchristos FMT(s_b_nrp, 32, 0x1c00e0, 0x7feffc,
40198b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(x, 12, 1), FLD(dst, 23, 5)))
40298b9484cSchristos FMT(s_bdec, 32, 0x1020, 0x1ffc,
40398b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(src, 13, 10), FLD(dst, 23, 5)))
40498b9484cSchristos FMT(s_bpos, 32, 0x20, 0x1ffc,
40598b9484cSchristos     CFLDS3(FLD(s, 1, 1), FLD(src, 13, 10), FLD(dst, 23, 5)))
40698b9484cSchristos 
40798b9484cSchristos /* Appendix F 16-bit formats will go here.  */
40898b9484cSchristos 
40903467a24Schristos /* F-17 Sbs7 Instruction Format */
41003467a24Schristos FMT(s_sbs7, 16, BR(1) | 0x000a, BR(1) | 0x003e,
41103467a24Schristos     SFLDS2(FLD(cst, 6, 7), FLD(n, 13, 3)))
41203467a24Schristos 
41303467a24Schristos /* F-18 Sbu8 Instruction Format */
41403467a24Schristos FMT(s_sbu8, 16, BR(1) | 0xc00a, BR(1) | 0xc03e,
41503467a24Schristos     SFLDS1(FLD(cst, 6, 8)))
41603467a24Schristos 
41703467a24Schristos /* F-19 Scs10 Instruction Format */
41803467a24Schristos FMT(s_scs10, 16, BR(1) | 0x001a, BR(1) | 0x003e,
41903467a24Schristos     SFLDS1(FLD(cst, 6, 10)))
42003467a24Schristos 
42103467a24Schristos /* F-20 Sbs7c Instruction Format */
42203467a24Schristos FMT(s_sbs7c, 16, BR(1) | 0x002a, BR(1) | 0x002e,
42303467a24Schristos     SFLDS3(FLD(z, 4, 1), FLD(cst, 6, 7), FLD(n, 13, 3)))
42403467a24Schristos 
42503467a24Schristos /* F-21 Sbu8c Instruction Format */
42603467a24Schristos FMT(s_sbu8c, 16, BR(1) | 0xc02a, BR(1) |  0xc02e,
42703467a24Schristos     SFLDS2(FLD(z, 4, 1), FLD(cst, 6, 8)))
42803467a24Schristos 
42903467a24Schristos /* F-22 S3 Instruction Format */
43003467a24Schristos FMT(s_s3, 16, BR(0) | 0x000a, BR(1) | 0x040e,
43103467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
43203467a24Schristos           FLD(src1, 13, 3)))
43303467a24Schristos 
43403467a24Schristos FMT(s_s3_sat_x, 16, BR(0) | SAT(0) | 0x000a, BR(1) | SAT(0) | 0x040e,
43503467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
43603467a24Schristos           FLD(src1, 13, 3)))
43703467a24Schristos 
43803467a24Schristos FMT(s_s3_sat_0, 16, BR(0) | SAT(0) | 0x000a, BR(1) | SAT(1) | 0x040e,
43903467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
44003467a24Schristos           FLD(src1, 13, 3)))
44103467a24Schristos 
44203467a24Schristos FMT(s_s3_sat_1, 16, BR(0) | SAT(1) | 0x000a, BR(1) | SAT(1) |	 0x040e,
44303467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
44403467a24Schristos           FLD(src1, 13, 3)))
44503467a24Schristos 
44603467a24Schristos /* F-23 S3i Instruction Format */
44703467a24Schristos FMT(s_s3i, 16, BR(0) | 0x040a, BR(1) | 0x040e,
44803467a24Schristos     SFLDS5(FLD(dst, 4, 3), FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
44903467a24Schristos            FLD(cst, 13, 3)))
45003467a24Schristos 
45103467a24Schristos /* F-24 Smvk8 Instruction Format */
45203467a24Schristos FMT(s_smvk8, 16, 0x0012, 0x001e,
45303467a24Schristos     SFLDS2(FLD(dst, 7, 3),
45403467a24Schristos            COMPFLD(cst, BFLD4(BFLD(10, 1, 7), BFLD(5, 2, 5), BFLD(11, 2, 3), BFLD(13, 3, 0)))))
45503467a24Schristos 
45603467a24Schristos /* F-25 Ssh5 Instruction Format */
45703467a24Schristos FMT(s_ssh5_sat_x, 16, SAT(0) | 0x0402, SAT(0) | 0x041e,
45803467a24Schristos     SFLDS3(FLD(op, 5, 2), FLD(srcdst, 7, 3),
45903467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
46003467a24Schristos FMT(s_ssh5_sat_0, 16, SAT(0) | 0x0402, SAT(1) | 0x041e,
46103467a24Schristos     SFLDS3(FLD(op, 5, 2), FLD(srcdst, 7, 3),
46203467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
46303467a24Schristos FMT(s_ssh5_sat_1, 16, SAT(1) | 0x0402, SAT(1) | 0x041e,
46403467a24Schristos     SFLDS3(FLD(op, 5, 2), FLD(srcdst, 7, 3),
46503467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
46603467a24Schristos 
46703467a24Schristos /* F-26 S2sh Instruction Format */
46803467a24Schristos FMT(s_s2sh, 16, 0x0462, 0x047e,
46903467a24Schristos     SFLDS3(FLD(srcdst, 7, 3), FLD(op, 11, 2), FLD(src1, 13, 3)))
47003467a24Schristos 
47103467a24Schristos /* F-27 Sc5 Instruction Format */
47203467a24Schristos FMT(s_sc5, 16, 0x0002, 0x041e,
47303467a24Schristos     SFLDS3(FLD(op, 5, 2), FLD(srcdst, 7, 3),
47403467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
47503467a24Schristos 
47603467a24Schristos /* F-28 S2ext Instruction Format */
47703467a24Schristos FMT(s_s2ext, 16, 0x0062, 0x047e,
47803467a24Schristos     SFLDS3(FLD(src, 7, 3), FLD(op, 11, 2), FLD(dst, 13, 3)))
47903467a24Schristos 
48003467a24Schristos /* F-29 Sx2op Instruction Format */
48103467a24Schristos FMT(s_sx2op, 16, 0x002e, 0x047e,
48203467a24Schristos     SFLDS4(FLD(src2, 7, 3), FLD(op, 11, 1), FLD(x, 12, 1),
48303467a24Schristos            FLD(srcdst, 13, 3)))
48403467a24Schristos 
48503467a24Schristos /* F-30 Sx5 Instruction Format */
48603467a24Schristos FMT(s_sx5, 16, 0x042e, 0x047e,
48703467a24Schristos     SFLDS2(FLD(dst, 7, 3),
48803467a24Schristos            COMPFLD(cst, BFLD2(BFLD(11, 2, 3), BFLD(13, 3, 0)))))
48903467a24Schristos 
49003467a24Schristos /* F-31 Sx1 Instruction Format */
49103467a24Schristos FMT(s_sx1, 16, 0x186e, 0x1c7e,
49203467a24Schristos     SFLDS2(FLD(srcdst, 7, 3), FLD(op, 13, 3)))
49303467a24Schristos 
49403467a24Schristos /* F-32 Sx1b Instruction Format */
49503467a24Schristos FMT(s_sx1b, 16, 0x006e, 0x187e,
49603467a24Schristos     SFLDS2(FLD(src2, 7, 4), FLD(n, 13, 3)))
49703467a24Schristos 
49898b9484cSchristos /* Appendix G 16-bit formats will go here.  */
49903467a24Schristos FMT(lsdmvto, 16, 0x0006, 0x0066,
50003467a24Schristos     SFLDS4(FLD(unit, 3, 2),
50103467a24Schristos            FLD(x, 12, 1), FLD(dst, 13, 3),
50203467a24Schristos            COMPFLD(src2, BFLD2(BFLD(10, 2, 3), BFLD(7, 3, 0)))))
50303467a24Schristos 
50403467a24Schristos FMT(lsdmvfr, 16, 0x0046, 0x0066,
50503467a24Schristos     SFLDS4(FLD(unit, 3, 2), FLD(src2, 7, 3), FLD(x, 12, 1),
50603467a24Schristos            COMPFLD(dst, BFLD2(BFLD(10, 2, 3), BFLD(13, 3, 0)))))
50703467a24Schristos 
50803467a24Schristos /* G-3 */
50903467a24Schristos FMT(lsdx1c, 16, 0x0866, 0x1c66,
51003467a24Schristos     SFLDS4(FLD(unit, 3, 2), FLD(dst, 7, 3), FLD(cst, 13, 1),
51103467a24Schristos            FLD(cc, 14, 2)))
51203467a24Schristos 
51303467a24Schristos /* G-4 */
51403467a24Schristos FMT(lsdx1, 16, 0x1866, 0x1c66,
51503467a24Schristos     SFLDS3(FLD(unit, 3, 2), FLD(srcdst, 7, 3), FLD(op, 13, 3)))
51698b9484cSchristos 
51798b9484cSchristos /* Appendix H 32-bit formats.  */
51898b9484cSchristos 
51998b9484cSchristos FMT(nfu_loop_buffer, 32, 0x00020000, 0x00021ffc,
52098b9484cSchristos     CFLDS4(FLD(s, 1, 1), FLD(op, 13, 4), FLD(csta, 18, 5), FLD(cstb, 23, 5)))
52198b9484cSchristos /* Corrected relative to Appendix H.  */
52298b9484cSchristos FMT(nfu_nop_idle, 32, 0x00000000, 0xfffe1ffc,
52398b9484cSchristos     NFLDS2(FLD(s, 1, 1), FLD(op, 13, 4)))
52498b9484cSchristos 
52598b9484cSchristos /* No-unit formats missing from Appendix H (given the NOP and IDLE
52698b9484cSchristos    correction).  */
52798b9484cSchristos FMT(nfu_dint, 32, 0x10004000, 0xfffffffc,
52898b9484cSchristos     NFLDS1(FLD(s, 1, 1)))
52998b9484cSchristos FMT(nfu_rint, 32, 0x10006000, 0xfffffffc,
53098b9484cSchristos     NFLDS1(FLD(s, 1, 1)))
53198b9484cSchristos FMT(nfu_swe, 32, 0x10000000, 0xfffffffc,
53298b9484cSchristos     NFLDS1(FLD(s, 1, 1)))
53398b9484cSchristos FMT(nfu_swenr, 32, 0x10002000, 0xfffffffc,
53498b9484cSchristos     NFLDS1(FLD(s, 1, 1)))
53598b9484cSchristos /* Although formally covered by the loop buffer format, the fields in
53698b9484cSchristos    that format are not useful for all such instructions and not all
53798b9484cSchristos    instructions can be predicated.  */
53898b9484cSchristos FMT(nfu_spkernel, 32, 0x00034000, 0xf03ffffc,
53998b9484cSchristos     NFLDS2(FLD(s, 1, 1), FLD(fstgfcyc, 22, 6)))
54098b9484cSchristos FMT(nfu_spkernelr, 32, 0x00036000, 0xfffffffc,
54198b9484cSchristos     NFLDS1(FLD(s, 1, 1)))
54298b9484cSchristos FMT(nfu_spmask, 32, 0x00020000, 0xfc021ffc,
54398b9484cSchristos     NFLDS3(FLD(s, 1, 1), FLD(op, 13, 4), FLD(mask, 18, 8)))
54498b9484cSchristos 
54598b9484cSchristos /* Appendix H 16-bit formats will go here.  */
54698b9484cSchristos 
54703467a24Schristos /* H-5 */
54803467a24Schristos FMT(nfu_uspl, 16, 0x0c66, 0xbc7e,
54903467a24Schristos    FLDS2(FLD(op, 0, 1), COMPFLD(ii, BFLD2(BFLD(7, 3, 0), BFLD(14, 1, 3)))))
55003467a24Schristos 
55103467a24Schristos /* H-6 */
55203467a24Schristos /* make up some fields to pretend to have s and z fields s for this format
55303467a24Schristos    so as to fit in other predicated compact instruction to avoid special-
55403467a24Schristos    casing this instruction in tic6x-dis.c
55503467a24Schristos    use op field as a predicate adress register selector (s field)
55603467a24Schristos    use the first zeroed bit as a z value as this insn only supports [a0]
55703467a24Schristos    and [b0] predicate forms.
55803467a24Schristos */
55903467a24Schristos FMT(nfu_uspldr, 16, 0x8c66, 0xbc7e,
56003467a24Schristos    FLDS4(FLD(op, 0, 1), FLD(s, 0, 1), FLD(z, 3, 1),
56103467a24Schristos          COMPFLD(ii, BFLD2(BFLD(7, 3, 0), BFLD(14, 1, 3)))))
56203467a24Schristos 
56303467a24Schristos /* H-7 */
56403467a24Schristos FMT(nfu_uspk, 16, 0x1c66, 0x3c7e,
56503467a24Schristos    FLDS1(COMPFLD(fstgfcyc, BFLD3(BFLD(0, 1, 0), BFLD(7, 3, 1), BFLD(14, 2, 4)))))
56603467a24Schristos 
56703467a24Schristos /* H-8a */
56803467a24Schristos FMT(nfu_uspma, 16, 0x2c66, 0x3c7e,
56903467a24Schristos    FLDS1(COMPFLD(mask, BFLD3(BFLD(0, 1, 0), BFLD(7, 3, 1), BFLD(14, 2, 4)))))
57003467a24Schristos 
57103467a24Schristos /* H-8b */
57203467a24Schristos FMT(nfu_uspmb, 16, 0x3c66, 0x3c7e,
57303467a24Schristos    FLDS1(COMPFLD(mask, BFLD3(BFLD(0, 1, 0), BFLD(7, 3, 1), BFLD(14, 2, 4)))))
57403467a24Schristos 
57503467a24Schristos /* H-9 */
57603467a24Schristos FMT(nfu_unop, 16, 0x0c6e, 0x1fff,
57703467a24Schristos    FLDS1(FLD(n, 13, 3)))
57803467a24Schristos 
57998b9484cSchristos #undef FLD
58098b9484cSchristos #undef CFLDS
58198b9484cSchristos #undef CFLDS2
58298b9484cSchristos #undef CFLDS3
58398b9484cSchristos #undef CFLDS4
58498b9484cSchristos #undef CFLDS5
58598b9484cSchristos #undef CFLDS6
58698b9484cSchristos #undef CFLDS7
58798b9484cSchristos #undef CFLDS8
58898b9484cSchristos #undef NFLDS
58998b9484cSchristos #undef NFLDS1
59098b9484cSchristos #undef NFLDS2
59198b9484cSchristos #undef NFLDS3
59298b9484cSchristos #undef NFLDS5
59398b9484cSchristos #undef NFLDS6
59498b9484cSchristos #undef NFLDS7
59503467a24Schristos #undef SFLDS
59603467a24Schristos #undef SFLDS1
59703467a24Schristos #undef SFLDS2
59803467a24Schristos #undef SFLDS3
59903467a24Schristos #undef SFLDS4
60003467a24Schristos #undef SFLDS5
60103467a24Schristos #undef SFLDS6
60203467a24Schristos #undef SFLDS7
60303467a24Schristos #undef BFLD
60403467a24Schristos #undef BFLD1
60503467a24Schristos #undef BFLD2
60603467a24Schristos #undef BFLD3
60703467a24Schristos #undef BFLD4
60803467a24Schristos #undef FLDS1
60903467a24Schristos #undef FLDS2
61003467a24Schristos #undef FLDS3
61103467a24Schristos #undef FLDS4
61203467a24Schristos #undef FLDS5
61303467a24Schristos #undef COMPFLD
61403467a24Schristos #undef DSZ
61503467a24Schristos #undef BR
61603467a24Schristos #undef SAT
617