xref: /openbsd-src/gnu/usr.bin/binutils/opcodes/d10v-opc.c (revision d2201f2f89f0be1a0be6f7568000ed297414a06d)
1fddef416Sniklas /* d10v-opc.c -- D10V opcode list
2*d2201f2fSdrahn    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3fddef416Sniklas    Written by Martin Hunt, Cygnus Support
4fddef416Sniklas 
5fddef416Sniklas This file is part of GDB, GAS, and the GNU binutils.
6fddef416Sniklas 
7fddef416Sniklas GDB, GAS, and the GNU binutils are free software; you can redistribute
8fddef416Sniklas them and/or modify them under the terms of the GNU General Public
9fddef416Sniklas License as published by the Free Software Foundation; either version
10fddef416Sniklas 2, or (at your option) any later version.
11fddef416Sniklas 
12fddef416Sniklas GDB, GAS, and the GNU binutils are distributed in the hope that they
13fddef416Sniklas will be useful, but WITHOUT ANY WARRANTY; without even the implied
14fddef416Sniklas warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
15fddef416Sniklas the GNU General Public License for more details.
16fddef416Sniklas 
17fddef416Sniklas You should have received a copy of the GNU General Public License
18fddef416Sniklas along with this file; see the file COPYING.  If not, write to the Free
19fddef416Sniklas Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20fddef416Sniklas 
21fddef416Sniklas #include <stdio.h>
22f7cc78ecSespie #include "sysdep.h"
23fddef416Sniklas #include "opcode/d10v.h"
24fddef416Sniklas 
25fddef416Sniklas 
26fddef416Sniklas /*   The table is sorted. Suitable for searching by a binary search. */
27fddef416Sniklas const struct pd_reg d10v_predefined_registers[] =
28fddef416Sniklas {
29f7cc78ecSespie   { "a0", NULL, OPERAND_ACC0+0 },
30f7cc78ecSespie   { "a1", NULL, OPERAND_ACC1+1 },
31fddef416Sniklas   { "bpc", NULL, OPERAND_CONTROL+3 },
32fddef416Sniklas   { "bpsw", NULL, OPERAND_CONTROL+1 },
33f7cc78ecSespie   { "c", NULL, OPERAND_CFLAG+3 },
34fddef416Sniklas   { "cr0", "psw", OPERAND_CONTROL },
35fddef416Sniklas   { "cr1", "bpsw", OPERAND_CONTROL+1 },
36fddef416Sniklas   { "cr10", "mod_s", OPERAND_CONTROL+10 },
37fddef416Sniklas   { "cr11", "mod_e", OPERAND_CONTROL+11 },
38fddef416Sniklas   { "cr12", NULL, OPERAND_CONTROL+12 },
39fddef416Sniklas   { "cr13", NULL, OPERAND_CONTROL+13 },
40fddef416Sniklas   { "cr14", "iba", OPERAND_CONTROL+14 },
41fddef416Sniklas   { "cr15", NULL, OPERAND_CONTROL+15 },
42fddef416Sniklas   { "cr2", "pc", OPERAND_CONTROL+2 },
43fddef416Sniklas   { "cr3", "bpc", OPERAND_CONTROL+3 },
44fddef416Sniklas   { "cr4", "dpsw", OPERAND_CONTROL+4 },
45fddef416Sniklas   { "cr5", "dpc", OPERAND_CONTROL+5 },
46fddef416Sniklas   { "cr6", NULL, OPERAND_CONTROL+6 },
47fddef416Sniklas   { "cr7", "rpt_c", OPERAND_CONTROL+7 },
48fddef416Sniklas   { "cr8", "rpt_s", OPERAND_CONTROL+8 },
49fddef416Sniklas   { "cr9", "rpt_e", OPERAND_CONTROL+9 },
50fddef416Sniklas   { "dpc", NULL, OPERAND_CONTROL+5 },
51fddef416Sniklas   { "dpsw", NULL, OPERAND_CONTROL+4 },
52f7cc78ecSespie   { "f0", NULL, OPERAND_FFLAG+0 },
53f7cc78ecSespie   { "f1", NULL, OPERAND_FFLAG+1 },
54fddef416Sniklas   { "iba", NULL, OPERAND_CONTROL+14 },
55f7cc78ecSespie   { "link", "r13", OPERAND_GPR+13 },
56fddef416Sniklas   { "mod_e", NULL, OPERAND_CONTROL+11 },
57fddef416Sniklas   { "mod_s", NULL, OPERAND_CONTROL+10 },
58fddef416Sniklas   { "pc", NULL, OPERAND_CONTROL+2 },
59fddef416Sniklas   { "psw", NULL, OPERAND_CONTROL+0 },
60f7cc78ecSespie   { "r0", NULL, OPERAND_GPR+0 },
61f7cc78ecSespie   { "r0-r1", NULL, OPERAND_GPR+0},
62f7cc78ecSespie   { "r1", NULL, OPERAND_GPR+1 },
63f7cc78ecSespie   { "r1", NULL, OPERAND_GPR+1 },
64f7cc78ecSespie   { "r10", NULL, OPERAND_GPR+10 },
65f7cc78ecSespie   { "r10-r11", NULL, OPERAND_GPR+10 },
66f7cc78ecSespie   { "r11", NULL, OPERAND_GPR+11 },
67f7cc78ecSespie   { "r12", NULL, OPERAND_GPR+12 },
68f7cc78ecSespie   { "r12-r13", NULL, OPERAND_GPR+12 },
69f7cc78ecSespie   { "r13", NULL, OPERAND_GPR+13 },
70f7cc78ecSespie   { "r14", NULL, OPERAND_GPR+14 },
71f7cc78ecSespie   { "r14-r15", NULL, OPERAND_GPR+14 },
72*d2201f2fSdrahn   { "r15", "sp", OPERAND_SP|(OPERAND_GPR+15) },
73f7cc78ecSespie   { "r2", NULL, OPERAND_GPR+2 },
74f7cc78ecSespie   { "r2-r3", NULL, OPERAND_GPR+2 },
75f7cc78ecSespie   { "r3", NULL, OPERAND_GPR+3 },
76f7cc78ecSespie   { "r4", NULL, OPERAND_GPR+4 },
77f7cc78ecSespie   { "r4-r5", NULL, OPERAND_GPR+4 },
78f7cc78ecSespie   { "r5", NULL, OPERAND_GPR+5 },
79f7cc78ecSespie   { "r6", NULL, OPERAND_GPR+6 },
80f7cc78ecSespie   { "r6-r7", NULL, OPERAND_GPR+6 },
81f7cc78ecSespie   { "r7", NULL, OPERAND_GPR+7 },
82f7cc78ecSespie   { "r8", NULL, OPERAND_GPR+8 },
83f7cc78ecSespie   { "r8-r9", NULL, OPERAND_GPR+8 },
84f7cc78ecSespie   { "r9", NULL, OPERAND_GPR+9 },
85fddef416Sniklas   { "rpt_c", NULL, OPERAND_CONTROL+7 },
86fddef416Sniklas   { "rpt_e", NULL, OPERAND_CONTROL+9 },
87fddef416Sniklas   { "rpt_s", NULL, OPERAND_CONTROL+8 },
88*d2201f2fSdrahn   { "sp", NULL, OPERAND_SP|(OPERAND_GPR+15) },
89fddef416Sniklas };
90fddef416Sniklas 
91fddef416Sniklas int
d10v_reg_name_cnt()92fddef416Sniklas d10v_reg_name_cnt()
93fddef416Sniklas {
94fddef416Sniklas   return (sizeof(d10v_predefined_registers) / sizeof(struct pd_reg));
95fddef416Sniklas }
96fddef416Sniklas 
97fddef416Sniklas const struct d10v_operand d10v_operands[] =
98fddef416Sniklas {
99fddef416Sniklas #define UNUSED	(0)
100fddef416Sniklas   { 0, 0, 0 },
101fddef416Sniklas #define RSRC	(UNUSED + 1)
102f7cc78ecSespie   { 4, 1, OPERAND_GPR|OPERAND_REG },
103*d2201f2fSdrahn #define RSRC_SP (RSRC + 1)
104*d2201f2fSdrahn   { 4, 1, OPERAND_SP|OPERAND_GPR|OPERAND_REG },
105*d2201f2fSdrahn #define RSRC_NOSP (RSRC_SP + 1)
106*d2201f2fSdrahn   { 4, 1, OPERAND_NOSP|OPERAND_GPR|OPERAND_REG },
107*d2201f2fSdrahn #define RDST	(RSRC_NOSP + 1)
108f7cc78ecSespie   { 4, 5, OPERAND_DEST|OPERAND_GPR|OPERAND_REG },
109fddef416Sniklas #define ASRC	(RDST + 1)
110f7cc78ecSespie   { 1, 4, OPERAND_ACC0|OPERAND_ACC1|OPERAND_REG },
111f7cc78ecSespie #define ASRC0ONLY (ASRC + 1)
112f7cc78ecSespie   { 1, 4, OPERAND_ACC0|OPERAND_REG },
113f7cc78ecSespie #define ADST	(ASRC0ONLY + 1)
114f7cc78ecSespie   { 1, 8, OPERAND_DEST|OPERAND_ACC0|OPERAND_ACC1|OPERAND_REG },
115fddef416Sniklas #define RSRCE	(ADST + 1)
116f7cc78ecSespie   { 4, 1, OPERAND_EVEN|OPERAND_GPR|OPERAND_REG },
117fddef416Sniklas #define RDSTE	(RSRCE + 1)
118f7cc78ecSespie   { 4, 5, OPERAND_EVEN|OPERAND_DEST|OPERAND_GPR|OPERAND_REG },
119fddef416Sniklas #define NUM16	(RDSTE + 1)
120fddef416Sniklas   { 16, 0, OPERAND_NUM|OPERAND_SIGNED },
121fddef416Sniklas #define NUM3	(NUM16 + 1)			/* rac, rachi */
122f7cc78ecSespie   { 3, 1, OPERAND_NUM|OPERAND_SIGNED|RESTRICTED_NUM3 },
123fddef416Sniklas #define NUM4	(NUM3 + 1)
124fddef416Sniklas   { 4, 1, OPERAND_NUM|OPERAND_SIGNED },
125fddef416Sniklas #define UNUM4	(NUM4 + 1)
126fddef416Sniklas   { 4, 1, OPERAND_NUM },
127fddef416Sniklas #define UNUM4S	(UNUM4 + 1)			/* addi, slli, srai, srli, subi */
128fddef416Sniklas   { 4, 1, OPERAND_NUM|OPERAND_SHIFT },
129fddef416Sniklas #define UNUM8	(UNUM4S + 1)			/* repi */
130fddef416Sniklas   { 8, 16, OPERAND_NUM },
131fddef416Sniklas #define UNUM16	(UNUM8 + 1)			/* cmpui */
132fddef416Sniklas   { 16, 0, OPERAND_NUM },
133fddef416Sniklas #define ANUM16	(UNUM16 + 1)
134fddef416Sniklas   { 16, 0, OPERAND_ADDR|OPERAND_SIGNED },
135fddef416Sniklas #define ANUM8	(ANUM16 + 1)
136fddef416Sniklas   { 8, 0, OPERAND_ADDR|OPERAND_SIGNED },
137fddef416Sniklas #define ASRC2	(ANUM8 + 1)
138f7cc78ecSespie   { 1, 8, OPERAND_ACC0|OPERAND_ACC1|OPERAND_REG },
139fddef416Sniklas #define RSRC2	(ASRC2 + 1)
140f7cc78ecSespie   { 4, 5, OPERAND_GPR|OPERAND_REG },
141fddef416Sniklas #define RSRC2E	(RSRC2 + 1)
142f7cc78ecSespie   { 4, 5, OPERAND_GPR|OPERAND_REG|OPERAND_EVEN },
143fddef416Sniklas #define ASRC0	(RSRC2E + 1)
144f7cc78ecSespie   { 1, 0, OPERAND_ACC0|OPERAND_ACC1|OPERAND_REG },
145fddef416Sniklas #define ADST0	(ASRC0 + 1)
146f7cc78ecSespie   { 1, 0, OPERAND_ACC0|OPERAND_ACC1|OPERAND_REG|OPERAND_DEST },
147f7cc78ecSespie #define FFSRC	(ADST0 + 1)
148f7cc78ecSespie   { 2, 1, OPERAND_REG | OPERAND_FFLAG },
149f7cc78ecSespie #define CFSRC	(FFSRC + 1)
150f7cc78ecSespie   { 2, 1, OPERAND_REG | OPERAND_CFLAG },
151f7cc78ecSespie #define FDST	(CFSRC + 1)
152f7cc78ecSespie   { 1, 5, OPERAND_REG | OPERAND_FFLAG | OPERAND_DEST},
153fddef416Sniklas #define ATSIGN	(FDST + 1)
154fddef416Sniklas   { 0, 0, OPERAND_ATSIGN},
155fddef416Sniklas #define ATPAR	(ATSIGN + 1)	/* "@(" */
156fddef416Sniklas   { 0, 0, OPERAND_ATPAR},
157fddef416Sniklas #define PLUS	(ATPAR + 1)	/* postincrement */
158fddef416Sniklas   { 0, 0, OPERAND_PLUS},
159fddef416Sniklas #define MINUS	(PLUS + 1)	/* postdecrement */
160fddef416Sniklas   { 0, 0, OPERAND_MINUS},
161fddef416Sniklas #define ATMINUS	(MINUS + 1)	/* predecrement */
162fddef416Sniklas   { 0, 0, OPERAND_ATMINUS},
163fddef416Sniklas #define CSRC	(ATMINUS + 1)	/* control register */
164fddef416Sniklas   { 4, 1, OPERAND_REG|OPERAND_CONTROL},
165fddef416Sniklas #define CDST	(CSRC + 1)	/* control register */
166fddef416Sniklas   { 4, 5, OPERAND_REG|OPERAND_CONTROL|OPERAND_DEST},
167fddef416Sniklas };
168fddef416Sniklas 
169fddef416Sniklas const struct d10v_opcode d10v_opcodes[] = {
170fddef416Sniklas   { "abs", SHORT_2, 1, EITHER, PAR|WF0, 0x4607, 0x7e1f, { RDST } },
171fddef416Sniklas   { "abs", SHORT_2, 1, IU, PAR|WF0, 0x5607, 0x7eff, { ADST } },
172fddef416Sniklas   { "add", SHORT_2, 1, EITHER, PAR|WCAR, 0x0200, 0x7e01, { RDST, RSRC } },
173fddef416Sniklas   { "add", SHORT_2, 1, IU, PAR, 0x1201, 0x7ee3, { ADST, RSRCE } },
174fddef416Sniklas   { "add", SHORT_2, 1, IU, PAR, 0x1203, 0x7eef, { ADST, ASRC } },
175fddef416Sniklas   { "add2w", SHORT_2, 2, IU, PAR|WCAR, 0x1200, 0x7e23, { RDSTE, RSRCE } },
176fddef416Sniklas   { "add3", LONG_L, 1, MU, SEQ|WCAR, 0x1000000, 0x3f000000, { RDST, RSRC, NUM16 } },
177fddef416Sniklas   { "addac3", LONG_R, 1, IU, SEQ, 0x17000200, 0x3ffffe22, { RDSTE, RSRCE, ASRC0 } },
178fddef416Sniklas   { "addac3", LONG_R, 1, IU, SEQ, 0x17000202, 0x3ffffe2e, { RDSTE, ASRC, ASRC0 } },
179fddef416Sniklas   { "addac3s", LONG_R, 1, IU, SEQ, 0x17001200, 0x3ffffe22, { RDSTE, RSRCE, ASRC0 } },
180fddef416Sniklas   { "addac3s", LONG_R, 1, IU, SEQ, 0x17001202, 0x3ffffe2e, { RDSTE, ASRC, ASRC0 } },
181fddef416Sniklas   { "addi", SHORT_2, 1, EITHER, PAR|WCAR,  0x201, 0x7e01, { RDST, UNUM4S } },
182fddef416Sniklas   { "and", SHORT_2, 1, EITHER, PAR, 0xc00, 0x7e01, { RDST, RSRC } },
183fddef416Sniklas   { "and3", LONG_L, 1, MU, SEQ, 0x6000000, 0x3f000000, { RDST, RSRC, NUM16 } },
184fddef416Sniklas   { "bclri", SHORT_2, 1, IU, PAR, 0xc01, 0x7e01, { RDST, UNUM4 } },
185fddef416Sniklas   { "bl", OPCODE_FAKE, 0, 0, 0, 0, 0, { 0, 8, 16, 0 } },
1865f210c2aSfgsch   { "bl.s", SHORT_B, 3, MU, ALONE|BRANCH_LINK|PAR, 0x4900, 0x7f00, { ANUM8 } },
187fddef416Sniklas   { "bl.l", LONG_B, 3, MU, BRANCH_LINK|SEQ, 0x24800000, 0x3fff0000, { ANUM16 } },
188fddef416Sniklas   { "bnoti", SHORT_2, 1, IU, PAR, 0xa01, 0x7e01, { RDST, UNUM4 } },
189fddef416Sniklas   { "bra", OPCODE_FAKE, 0, 0, 0, 0, 0, { 0, 8, 16, 0 } },
1905f210c2aSfgsch   { "bra.s", SHORT_B, 3, MU, ALONE|BRANCH|PAR, 0x4800, 0x7f00, { ANUM8 } },
191fddef416Sniklas   { "bra.l", LONG_B, 3, MU, BRANCH|SEQ, 0x24000000, 0x3fff0000, { ANUM16 } },
192fddef416Sniklas   { "brf0f", OPCODE_FAKE, 0, 0, 0, 0, 0, { 0, 8, 16, 0 } },
193fddef416Sniklas   { "brf0f.s", SHORT_B, 3, MU, BRANCH|PAR|RF0, 0x4a00, 0x7f00, { ANUM8 } },
194fddef416Sniklas   { "brf0f.l", LONG_B, 3, MU, SEQ, 0x25000000, 0x3fff0000, { ANUM16 } },
195fddef416Sniklas   { "brf0t", OPCODE_FAKE, 0, 0, 0, 0, 0, { 0, 8, 16, 0 } },
196fddef416Sniklas   { "brf0t.s", SHORT_B, 3, MU, BRANCH|PAR|RF0, 0x4b00, 0x7f00, { ANUM8 } },
197fddef416Sniklas   { "brf0t.l", LONG_B, 3, MU, SEQ, 0x25800000, 0x3fff0000, { ANUM16 } },
198fddef416Sniklas   { "bseti", SHORT_2, 1, IU, PAR, 0x801, 0x7e01, { RDST, UNUM4 } },
199*d2201f2fSdrahn   { "btsti", SHORT_2, 1, IU, PAR|WF0, 0xe01, 0x7e01, { RSRC2, UNUM4 } },
200fddef416Sniklas   { "clrac", SHORT_2, 1, IU, PAR, 0x5601, 0x7eff, { ADST } },
201fddef416Sniklas   { "cmp", SHORT_2, 1, EITHER, PAR|WF0, 0x600, 0x7e01, { RSRC2, RSRC } },
202fddef416Sniklas   { "cmp", SHORT_2, 1, IU, PAR|WF0, 0x1603, 0x7eef, { ASRC2, ASRC } },
203fddef416Sniklas   { "cmpeq", SHORT_2, 1, EITHER, PAR|WF0, 0x400, 0x7e01, { RSRC2, RSRC } },
204fddef416Sniklas   { "cmpeq", SHORT_2, 1, IU, PAR|WF0, 0x1403, 0x7eef, { ASRC2, ASRC } },
205fddef416Sniklas   { "cmpeqi", OPCODE_FAKE, 0, 0, 0, 0, 0, { 1, 4, 16, 0 } },
206fddef416Sniklas   { "cmpeqi.s", SHORT_2, 1, EITHER, PAR|WF0, 0x401, 0x7e01, { RSRC2, NUM4 } },
207fddef416Sniklas   { "cmpeqi.l", LONG_L, 1, MU, SEQ, 0x2000000, 0x3f0f0000, { RSRC2, NUM16 } },
208fddef416Sniklas   { "cmpi", OPCODE_FAKE, 0, 0, 0, 0, 0, { 1, 4, 16, 0 } },
209fddef416Sniklas   { "cmpi.s", SHORT_2, 1, EITHER, PAR|WF0, 0x601, 0x7e01, { RSRC2, NUM4 } },
210fddef416Sniklas   { "cmpi.l", LONG_L, 1, MU, SEQ, 0x3000000, 0x3f0f0000, { RSRC2, NUM16 } },
211fddef416Sniklas   { "cmpu", SHORT_2, 1, EITHER, PAR|WF0, 0x4600, 0x7e01, { RSRC2, RSRC } },
212fddef416Sniklas   { "cmpui", LONG_L, 1, MU, SEQ, 0x23000000, 0x3f0f0000, { RSRC2, UNUM16 } },
213f7cc78ecSespie   { "cpfg", SHORT_2, 1, MU, PAR, 0x4e0f, 0x7fdf, { FDST, CFSRC } },
214f7cc78ecSespie   { "cpfg", SHORT_2, 1, MU, PAR, 0x4e09, 0x7fd9, { FDST, FFSRC } },
2155f210c2aSfgsch   { "dbt", SHORT_2, 5, MU, ALONE|PAR, 0x5f20, 0x7fff, { 0 } },
216fddef416Sniklas   { "divs", LONG_L, 1, BOTH, SEQ, 0x14002800, 0x3f10fe21, { RDSTE, RSRC } },
217fddef416Sniklas   { "exef0f", SHORT_2, 1, EITHER, PARONLY, 0x4e04, 0x7fff, { 0 } },
218fddef416Sniklas   { "exef0t", SHORT_2, 1, EITHER, PARONLY, 0x4e24, 0x7fff, { 0 } },
219fddef416Sniklas   { "exef1f", SHORT_2, 1, EITHER, PARONLY, 0x4e40, 0x7fff, { 0 } },
220fddef416Sniklas   { "exef1t", SHORT_2, 1, EITHER, PARONLY, 0x4e42, 0x7fff, { 0 } },
221fddef416Sniklas   { "exefaf", SHORT_2, 1, EITHER, PARONLY, 0x4e00, 0x7fff, { 0 } },
222fddef416Sniklas   { "exefat", SHORT_2, 1, EITHER, PARONLY, 0x4e02, 0x7fff, { 0 } },
223fddef416Sniklas   { "exetaf", SHORT_2, 1, EITHER, PARONLY, 0x4e20, 0x7fff, { 0 } },
224fddef416Sniklas   { "exetat", SHORT_2, 1, EITHER, PARONLY, 0x4e22, 0x7fff, { 0 } },
225fddef416Sniklas   { "exp", LONG_R, 1, IU, SEQ, 0x15002a00, 0x3ffffe03, { RDST, RSRCE } },
226fddef416Sniklas   { "exp", LONG_R, 1, IU, SEQ, 0x15002a02, 0x3ffffe0f, { RDST, ASRC } },
2275f210c2aSfgsch   { "jl", SHORT_2, 3, MU, ALONE|BRANCH_LINK|PAR, 0x4d00, 0x7fe1, { RSRC } },
2285f210c2aSfgsch   { "jmp", SHORT_2, 3, MU, ALONE|BRANCH|PAR, 0x4c00, 0x7fe1, { RSRC } },
229fddef416Sniklas   { "ld", LONG_L, 1, MU, SEQ, 0x30000000, 0x3f000000, { RDST, ATPAR, NUM16, RSRC } },
230fddef416Sniklas   { "ld", SHORT_2, 1, MU, PAR|RMEM, 0x6401, 0x7e01, { RDST, ATSIGN, RSRC, MINUS } },
231fddef416Sniklas   { "ld", SHORT_2, 1, MU, PAR|RMEM, 0x6001, 0x7e01, { RDST, ATSIGN, RSRC, PLUS } },
232fddef416Sniklas   { "ld", SHORT_2, 1, MU, PAR|RMEM, 0x6000, 0x7e01, { RDST, ATSIGN, RSRC } },
233f7cc78ecSespie   { "ld", LONG_L, 1, MU, SEQ, 0x32010000, 0x3f0f0000, { RDST, ATSIGN, NUM16 } },
234fddef416Sniklas   { "ld2w", LONG_L, 1, MU, SEQ, 0x31000000, 0x3f100000, { RDSTE, ATPAR, NUM16, RSRC } },
235fddef416Sniklas   { "ld2w", SHORT_2, 1, MU, PAR|RMEM, 0x6601, 0x7e21, { RDSTE, ATSIGN, RSRC, MINUS } },
236fddef416Sniklas   { "ld2w", SHORT_2, 1, MU, PAR|RMEM, 0x6201, 0x7e21, { RDSTE, ATSIGN, RSRC, PLUS } },
237fddef416Sniklas   { "ld2w", SHORT_2, 1, MU, PAR|RMEM, 0x6200, 0x7e21, { RDSTE, ATSIGN, RSRC } },
238f7cc78ecSespie   { "ld2w", LONG_L, 1, MU, SEQ, 0x33010000, 0x3f1f0000, { RDSTE, ATSIGN, NUM16 } },
239fddef416Sniklas   { "ldb", LONG_L, 1, MU, SEQ, 0x38000000, 0x3f000000, { RDST, ATPAR, NUM16, RSRC } },
240fddef416Sniklas   { "ldb", SHORT_2, 1, MU, PAR|RMEM, 0x7000, 0x7e01, { RDST, ATSIGN, RSRC } },
241fddef416Sniklas   { "ldi", OPCODE_FAKE, 0, 0, 0, 0, 0, { 1, 4, 16, 0 } },
242fddef416Sniklas   { "ldi.s", SHORT_2, 1, EITHER, PAR|RMEM, 0x4001, 0x7e01 , { RDST, NUM4 } },
243fddef416Sniklas   { "ldi.l", LONG_L, 1, MU, SEQ, 0x20000000, 0x3f0f0000, { RDST, NUM16 } },
244fddef416Sniklas   { "ldub", LONG_L, 1, MU, SEQ, 0x39000000, 0x3f000000, { RDST, ATPAR, NUM16, RSRC } },
245fddef416Sniklas   { "ldub", SHORT_2, 1, MU, PAR|RMEM, 0x7200, 0x7e01, { RDST, ATSIGN, RSRC } },
246fddef416Sniklas   { "mac", SHORT_2, 1, IU, PAR, 0x2a00, 0x7e00, { ADST0, RSRC2, RSRC } },
247fddef416Sniklas   { "macsu", SHORT_2, 1, IU, PAR, 0x1a00, 0x7e00, { ADST0, RSRC2, RSRC } },
248fddef416Sniklas   { "macu", SHORT_2, 1, IU, PAR, 0x3a00, 0x7e00, { ADST0, RSRC2, RSRC } },
249fddef416Sniklas   { "max", SHORT_2, 1, IU, PAR|WF0, 0x2600, 0x7e01, { RDST, RSRC } },
250fddef416Sniklas   { "max", SHORT_2, 1, IU, PAR|WF0, 0x3600, 0x7ee3, { ADST, RSRCE } },
251fddef416Sniklas   { "max", SHORT_2, 1, IU, PAR|WF0, 0x3602, 0x7eef, { ADST, ASRC } },
252fddef416Sniklas   { "min", SHORT_2, 1, IU, PAR|WF0, 0x2601, 0x7e01 , { RDST, RSRC } },
253fddef416Sniklas   { "min", SHORT_2, 1, IU, PAR|WF0, 0x3601, 0x7ee3 , { ADST, RSRCE } },
254fddef416Sniklas   { "min", SHORT_2, 1, IU, PAR|WF0, 0x3603, 0x7eef, { ADST, ASRC } },
255fddef416Sniklas   { "msb", SHORT_2, 1, IU, PAR, 0x2800, 0x7e00, { ADST0, RSRC2, RSRC } },
256fddef416Sniklas   { "msbsu", SHORT_2, 1, IU, PAR, 0x1800, 0x7e00, { ADST0, RSRC2, RSRC } },
257fddef416Sniklas   { "msbu", SHORT_2, 1, IU, PAR, 0x3800, 0x7e00, { ADST0, RSRC2, RSRC } },
258fddef416Sniklas   { "mul", SHORT_2, 1, IU, PAR, 0x2e00, 0x7e01 , { RDST, RSRC } },
259fddef416Sniklas   { "mulx", SHORT_2, 1, IU, PAR, 0x2c00, 0x7e00, { ADST0, RSRC2, RSRC } },
260fddef416Sniklas   { "mulxsu", SHORT_2, 1, IU, PAR, 0x1c00, 0x7e00, { ADST0, RSRC2, RSRC } },
261fddef416Sniklas   { "mulxu", SHORT_2, 1, IU, PAR, 0x3c00, 0x7e00, { ADST0, RSRC2, RSRC } },
262fddef416Sniklas   { "mv", SHORT_2, 1, EITHER, PAR, 0x4000, 0x7e01, { RDST, RSRC } },
263fddef416Sniklas   { "mv2w", SHORT_2, 1, IU, PAR, 0x5000, 0x7e23, { RDSTE, RSRCE } },
264fddef416Sniklas   { "mv2wfac", SHORT_2, 1, IU, PAR, 0x3e00, 0x7e2f, { RDSTE, ASRC } },
265fddef416Sniklas   { "mv2wtac", SHORT_2, 1, IU, PAR, 0x3e01, 0x7ee3, { RSRCE, ADST } },
266fddef416Sniklas   { "mvac", SHORT_2, 1, IU, PAR, 0x3e03, 0x7eef, { ADST, ASRC } },
267fddef416Sniklas   { "mvb", SHORT_2, 1, IU, PAR, 0x5400, 0x7e01, { RDST, RSRC } },
268fddef416Sniklas   { "mvf0f", SHORT_2, 1, EITHER, PAR|RF0, 0x4400, 0x7e01, { RDST, RSRC } },
269fddef416Sniklas   { "mvf0t", SHORT_2, 1, EITHER, PAR|RF0, 0x4401, 0x7e01, { RDST, RSRC } },
270fddef416Sniklas   { "mvfacg", SHORT_2, 1, IU, PAR, 0x1e04, 0x7e0f, { RDST, ASRC } },
271fddef416Sniklas   { "mvfachi", SHORT_2, 1, IU, PAR, 0x1e00, 0x7e0f, { RDST, ASRC } },
272fddef416Sniklas   { "mvfaclo", SHORT_2, 1, IU, PAR, 0x1e02, 0x7e0f, { RDST, ASRC } },
273fddef416Sniklas   { "mvfc", SHORT_2, 1, MU, PAR, 0x5200, 0x7e01, { RDST, CSRC } },
274fddef416Sniklas   { "mvtacg", SHORT_2, 1, IU, PAR, 0x1e41, 0x7ee1, { RSRC, ADST } },
275fddef416Sniklas   { "mvtachi", SHORT_2, 1, IU, PAR, 0x1e01, 0x7ee1, { RSRC, ADST } },
276fddef416Sniklas   { "mvtaclo", SHORT_2, 1, IU, PAR, 0x1e21, 0x7ee1, { RSRC, ADST } },
277fddef416Sniklas   { "mvtc", SHORT_2, 1, MU, PAR, 0x5600, 0x7e01, { RSRC, CDST } },
278fddef416Sniklas   { "mvub", SHORT_2, 1, IU, PAR, 0x5401, 0x7e01, { RDST, RSRC } },
279fddef416Sniklas   { "neg", SHORT_2, 1, EITHER, PAR, 0x4605, 0x7e1f, { RDST } },
280fddef416Sniklas   { "neg", SHORT_2, 1, IU, PAR, 0x5605, 0x7eff, { ADST } },
281fddef416Sniklas   { "nop", SHORT_2, 1, EITHER, PAR, 0x5e00, 0x7fff, { 0 } },
282fddef416Sniklas   { "not", SHORT_2, 1, EITHER, PAR, 0x4603, 0x7e1f, { RDST } },
283fddef416Sniklas   { "or", SHORT_2, 1, EITHER, PAR, 0x800, 0x7e01, { RDST, RSRC } },
284fddef416Sniklas   { "or3", LONG_L, 1, MU, SEQ, 0x4000000, 0x3f000000, { RDST, RSRC, NUM16 } },
285f7cc78ecSespie   /* Special case. sac&sachi must occur before rac&rachi because they have
286f7cc78ecSespie      intersecting masks! The masks for rac&rachi will match sac&sachi but
287f7cc78ecSespie      not the other way around.
288f7cc78ecSespie    */
289f7cc78ecSespie   { "sac", SHORT_2, 1, IU, PAR|RF0|WF0, 0x5209, 0x7e2f, { RDSTE, ASRC } },
290f7cc78ecSespie   { "sachi", SHORT_2, 1, IU, PAR|RF0|WF0, 0x4209, 0x7e0f, { RDST, ASRC } },
291f7cc78ecSespie   { "rac", SHORT_2, 1, IU, PAR|WF0, 0x5201, 0x7e21, { RDSTE, ASRC0ONLY, NUM3 } },
292fddef416Sniklas   { "rachi", SHORT_2, 1, IU, PAR|WF0, 0x4201, 0x7e01, { RDST, ASRC, NUM3 } },
293fddef416Sniklas   { "rep", LONG_L, 2, MU, SEQ, 0x27000000, 0x3ff00000, { RSRC, ANUM16 } },
294fddef416Sniklas   { "repi", LONG_L, 2, MU, SEQ, 0x2f000000, 0x3f000000, { UNUM8, ANUM16 } },
2955f210c2aSfgsch   { "rtd", SHORT_2, 3, MU, ALONE|PAR, 0x5f60, 0x7fff, { 0 } },
2965f210c2aSfgsch   { "rte", SHORT_2, 3, MU, ALONE|PAR, 0x5f40, 0x7fff, { 0 } },
297fddef416Sniklas   { "sadd", SHORT_2, 1, IU, PAR, 0x1223, 0x7eef, { ADST, ASRC } },
298fddef416Sniklas   { "setf0f", SHORT_2, 1, MU, PAR|RF0, 0x4611, 0x7e1f, { RDST } },
299fddef416Sniklas   { "setf0t", SHORT_2, 1, MU, PAR|RF0, 0x4613, 0x7e1f, { RDST } },
300f7cc78ecSespie   { "slae", SHORT_2, 1, IU, PAR, 0x3220, 0x7ee1, { ADST, RSRC } },
3015f210c2aSfgsch   { "sleep", SHORT_2, 1, MU, ALONE|PAR, 0x5fc0, 0x7fff, { 0 } },
302fddef416Sniklas   { "sll", SHORT_2, 1, IU, PAR, 0x2200, 0x7e01, { RDST, RSRC } },
303fddef416Sniklas   { "sll", SHORT_2, 1, IU, PAR, 0x3200, 0x7ee1, { ADST, RSRC } },
304fddef416Sniklas   { "slli", SHORT_2, 1, IU, PAR, 0x2201, 0x7e01, { RDST, UNUM4 } },
305fddef416Sniklas   { "slli", SHORT_2, 1, IU, PAR, 0x3201, 0x7ee1, { ADST, UNUM4S } },
306fddef416Sniklas   { "slx", SHORT_2, 1, IU, PAR|RF0, 0x460b, 0x7e1f, { RDST } },
307fddef416Sniklas   { "sra", SHORT_2, 1, IU, PAR, 0x2400, 0x7e01, { RDST, RSRC } },
308fddef416Sniklas   { "sra", SHORT_2, 1, IU, PAR, 0x3400, 0x7ee1, { ADST, RSRC } },
309fddef416Sniklas   { "srai", SHORT_2, 1, IU, PAR, 0x2401, 0x7e01, { RDST, UNUM4 } },
310fddef416Sniklas   { "srai", SHORT_2, 1, IU, PAR, 0x3401, 0x7ee1, { ADST, UNUM4S } },
311fddef416Sniklas   { "srl", SHORT_2, 1, IU, PAR, 0x2000, 0x7e01, { RDST, RSRC } },
312fddef416Sniklas   { "srl", SHORT_2, 1, IU, PAR, 0x3000, 0x7ee1, { ADST, RSRC } },
313fddef416Sniklas   { "srli", SHORT_2, 1, IU, PAR, 0x2001, 0x7e01, { RDST, UNUM4 } },
314fddef416Sniklas   { "srli", SHORT_2, 1, IU, PAR, 0x3001, 0x7ee1, { ADST, UNUM4S } },
315fddef416Sniklas   { "srx", SHORT_2, 1, IU, PAR|RF0, 0x4609, 0x7e1f, { RDST } },
316fddef416Sniklas   { "st", LONG_L, 1, MU, SEQ, 0x34000000, 0x3f000000, { RSRC2, ATPAR, NUM16, RSRC } },
317fddef416Sniklas   { "st", SHORT_2, 1, MU, PAR|WMEM, 0x6800, 0x7e01, { RSRC2, ATSIGN, RSRC } },
318*d2201f2fSdrahn   { "st", SHORT_2, 1, MU, PAR|WMEM, 0x6c1f, 0x7e1f, { RSRC2, ATMINUS, RSRC_SP } },
319fddef416Sniklas   { "st", SHORT_2, 1, MU, PAR|WMEM, 0x6801, 0x7e01, { RSRC2, ATSIGN, RSRC, PLUS } },
320*d2201f2fSdrahn   { "st", SHORT_2, 1, MU, PAR|WMEM, 0x6c01, 0x7e01, { RSRC2, ATSIGN, RSRC_NOSP, MINUS } },
321f7cc78ecSespie   { "st", LONG_L, 1, MU, SEQ, 0x36010000, 0x3f0f0000, { RSRC2, ATSIGN, NUM16 } },
322fddef416Sniklas   { "st2w", LONG_L, 1, MU, SEQ, 0x35000000, 0x3f100000, { RSRC2E, ATPAR, NUM16, RSRC } },
323fddef416Sniklas   { "st2w", SHORT_2, 1, MU, PAR|WMEM, 0x6a00, 0x7e21, { RSRC2E, ATSIGN, RSRC } },
324*d2201f2fSdrahn   { "st2w", SHORT_2, 1, MU, PAR|WMEM, 0x6e1f, 0x7e3f, { RSRC2E, ATMINUS, RSRC_SP } },
325fddef416Sniklas   { "st2w", SHORT_2, 1, MU, PAR|WMEM, 0x6a01, 0x7e21, { RSRC2E, ATSIGN, RSRC, PLUS } },
326*d2201f2fSdrahn   { "st2w", SHORT_2, 1, MU, PAR|WMEM, 0x6e01, 0x7e21, { RSRC2E, ATSIGN, RSRC_NOSP, MINUS } },
327f7cc78ecSespie   { "st2w", LONG_L, 1, MU, SEQ, 0x37010000, 0x3f1f0000, { RSRC2E, ATSIGN, NUM16 } },
328fddef416Sniklas   { "stb", LONG_L, 1, MU, SEQ, 0x3c000000, 0x3f000000, { RSRC2, ATPAR, NUM16, RSRC } },
329fddef416Sniklas   { "stb", SHORT_2, 1, MU, PAR|WMEM, 0x7800, 0x7e01, { RSRC2, ATSIGN, RSRC } },
3305f210c2aSfgsch   { "stop", SHORT_2, 1, MU, ALONE|PAR, 0x5fe0, 0x7fff, { 0 } },
331fddef416Sniklas   { "sub", SHORT_2, 1, EITHER, PAR|WCAR, 0x0, 0x7e01, { RDST, RSRC } },
332fddef416Sniklas   { "sub", SHORT_2, 1, IU, PAR, 0x1001, 0x7ee3, { ADST, RSRC } },
333fddef416Sniklas   { "sub", SHORT_2, 1, IU, PAR, 0x1003, 0x7eef, { ADST, ASRC } },
334fddef416Sniklas   { "sub2w", SHORT_2, 1, IU, PAR|WCAR, 0x1000, 0x7e23, { RDSTE, RSRCE } },
335fddef416Sniklas   { "subac3", LONG_R, 1, IU, SEQ, 0x17000000, 0x3ffffe22, { RDSTE, RSRCE, ASRC0 } },
336fddef416Sniklas   { "subac3", LONG_R, 1, IU, SEQ, 0x17000002, 0x3ffffe2e, { RDSTE, ASRC, ASRC0 } },
337fddef416Sniklas   { "subac3s", LONG_R, 1, IU, SEQ, 0x17001000, 0x3ffffe22, { RDSTE, RSRCE, ASRC0 } },
338fddef416Sniklas   { "subac3s", LONG_R, 1, IU, SEQ, 0x17001002, 0x3ffffe2e, { RDSTE, ASRC, ASRC0 } },
339fddef416Sniklas   { "subi", SHORT_2, 1, EITHER, PAR, 0x1, 0x7e01, { RDST, UNUM4S } },
3405f210c2aSfgsch   { "trap", SHORT_2, 5, MU, ALONE|BRANCH_LINK|PAR, 0x5f00, 0x7fe1, { UNUM4 } },
341fddef416Sniklas   { "tst0i", LONG_L, 1, MU, SEQ, 0x7000000, 0x3f0f0000, { RSRC2, NUM16 } },
342fddef416Sniklas   { "tst1i", LONG_L, 1, MU, SEQ, 0xf000000, 0x3f0f0000, { RSRC2, NUM16 } },
3435f210c2aSfgsch   { "wait", SHORT_2, 1, MU, ALONE|PAR, 0x5f80, 0x7fff, { 0 } },
344fddef416Sniklas   { "xor", SHORT_2, 1, EITHER, PAR, 0xa00, 0x7e01, { RDST, RSRC } },
345fddef416Sniklas   { "xor3", LONG_L, 1, MU, SEQ, 0x5000000, 0x3f000000, { RDST, RSRC, NUM16 } },
346fddef416Sniklas   { 0, 0, 0, 0, 0, 0, 0, { 0 } },
347fddef416Sniklas };
348fddef416Sniklas 
349fddef416Sniklas 
350