Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / opcode / m88k.h
1 /* m88k-opcode.h -- Instruction information for the Motorola 88000
2    Contributed by Devon Bowen of Buffalo University
3    and Torbjorn Granlund of the Swedish Institute of Computer Science.
4    Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
5
6 This file is part of GAS, the GNU Assembler.
7
8 GAS is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 1, or (at your option)
11 any later version.
12
13 GAS is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GAS; see the file COPYING.  If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22 #if !defined(__STDC__) && !defined(const)
23 #define const
24 #endif
25
26 /*
27   Character codes for op_spec field below.
28   Reserved for direct matching: x , [ ]
29
30   d = GRF Destination register (21:5)
31   1 = Source register 1 (16:5)
32   2 = Source register 2 (0:5)
33   3 = Both source registers (same value) (0:5 and 16:5)
34   I = IMM16 (0:16)
35   b = bit field spec. (0:10)
36   p = 16 bit pc displ. (0:16)
37   P = 26 bit pc displ. (0:26)
38   B = bb0/bb1 condition (21:5)
39   M = bcnd condition (21:5)
40   f = fcr (5:6)
41   c = cr (5:6)
42   V = VEC9 (0:9)
43   ? = Give warning for this insn/operand combination
44  */
45
46 /* instruction descriptor structure */
47
48 struct m88k_opcode
49 {
50   unsigned int  opcode;
51   char          *name;
52   char          *op_spec;
53 };
54
55 /* and introducing... the Motorola 88100 instruction sets... */
56
57 /* These macros may seem silly, but they are in preparation
58    for future versions of the 88000 family.  */
59
60 #define _MC88100(OPCODE,MNEM,OP_SPEC) {OPCODE,MNEM,OP_SPEC},
61 #define _MC88xxx(OPCODE,MNEM,OP_SPEC) {OPCODE,MNEM,OP_SPEC},
62
63 /* Equal mnemonics must be adjacent.
64    More specific operand specification must go before more general.
65    For example, "d,1,2" must go before "d,1,I" as a register for s2
66    would otherwise be considered a variable name.  */
67
68 static struct m88k_opcode m88k_opcodes[] =
69 {
70   /*  Opcode     Mnemonic         Opspec */
71
72   _MC88xxx(0xf4007000, "add",           "d,1,2")
73   _MC88xxx(0x70000000, "add",           "d,1,I")
74   _MC88xxx(0xf4007200, "add.ci",        "d,1,2")
75   _MC88xxx(0xf4007300, "add.cio",       "d,1,2")
76   _MC88xxx(0xf4007100, "add.co",        "d,1,2")
77   _MC88xxx(0xf4006000, "addu",          "d,1,2")
78   _MC88xxx(0x60000000, "addu",          "d,1,I")
79   _MC88xxx(0xf4006200, "addu.ci",       "d,1,2")
80   _MC88xxx(0xf4006300, "addu.cio",      "d,1,2")
81   _MC88xxx(0xf4006100, "addu.co",       "d,1,2")
82   _MC88xxx(0xf4004000, "and",           "d,1,2")
83   _MC88xxx(0x40000000, "and",           "d,1,I")
84   _MC88xxx(0xf4004400, "and.c",         "d,1,2")
85   _MC88xxx(0x44000000, "and.u",         "d,1,I")
86   _MC88xxx(0xd0000000, "bb0",           "B,1,p")
87   _MC88xxx(0xd4000000, "bb0.n",         "B,1,p")
88   _MC88xxx(0xd8000000, "bb1",           "B,1,p")
89   _MC88xxx(0xdc000000, "bb1.n",         "B,1,p")
90   _MC88xxx(0xe8000000, "bcnd",          "M,1,p")
91   _MC88xxx(0xec000000, "bcnd.n",        "M,1,p")
92   _MC88xxx(0xc0000000, "br",            "P")
93   _MC88xxx(0xc4000000, "br.n",          "P")
94   _MC88xxx(0xc8000000, "bsr",           "P")
95   _MC88xxx(0xcc000000, "bsr.n",         "P")
96   _MC88xxx(0xf4008000, "clr",           "d,1,2")
97   _MC88xxx(0xf0008000, "clr",           "d,1,b")
98   _MC88xxx(0xf4007c00, "cmp",           "d,1,2")
99   _MC88xxx(0x7c000000, "cmp",           "d,1,I")
100   _MC88xxx(0xf4007800, "div",           "d,1,2")
101   _MC88xxx(0x78000000, "div",           "d,1,I")
102   _MC88xxx(0xf4007800, "divs",          "d,1,2")
103   _MC88xxx(0x78000000, "divs",          "d,1,I")
104   _MC88xxx(0xf4006800, "divu",          "d,1,2")
105   _MC88xxx(0x68000000, "divu",          "d,1,I")
106   _MC88xxx(0xf4009000, "ext",           "d,1,2")
107   _MC88xxx(0xf0009000, "ext",           "d,1,b")
108   _MC88xxx(0xf4009800, "extu",          "d,1,2")
109   _MC88xxx(0xf0009800, "extu",          "d,1,b")
110   _MC88xxx(0x84002800, "fadd.sss",      "d,1,2")
111   _MC88xxx(0x84002880, "fadd.ssd",      "d,1,2")
112   _MC88xxx(0x84002a00, "fadd.sds",      "d,1,2")
113   _MC88xxx(0x84002a80, "fadd.sdd",      "d,1,2")
114   _MC88xxx(0x84002820, "fadd.dss",      "d,1,2")
115   _MC88xxx(0x840028a0, "fadd.dsd",      "d,1,2")
116   _MC88xxx(0x84002a20, "fadd.dds",      "d,1,2")
117   _MC88xxx(0x84002aa0, "fadd.ddd",      "d,1,2")
118   _MC88xxx(0x84003a80, "fcmp.sdd",      "d,1,2")
119   _MC88xxx(0x84003a00, "fcmp.sds",      "d,1,2")
120   _MC88xxx(0x84003880, "fcmp.ssd",      "d,1,2")
121   _MC88xxx(0x84003800, "fcmp.sss",      "d,1,2")
122   _MC88xxx(0x84007000, "fdiv.sss",      "d,1,2")
123   _MC88xxx(0x84007080, "fdiv.ssd",      "d,1,2")
124   _MC88xxx(0x84007200, "fdiv.sds",      "d,1,2")
125   _MC88xxx(0x84007280, "fdiv.sdd",      "d,1,2")
126   _MC88xxx(0x84007020, "fdiv.dss",      "d,1,2")
127   _MC88xxx(0x840070a0, "fdiv.dsd",      "d,1,2")
128   _MC88xxx(0x84007220, "fdiv.dds",      "d,1,2")
129   _MC88xxx(0x840072a0, "fdiv.ddd",      "d,1,2")
130   _MC88xxx(0xf400ec00, "ff0",           "d,2")
131   _MC88xxx(0xf400e800, "ff1",           "d,2")
132   _MC88xxx(0x80004800, "fldcr",         "d,f")
133   _MC88xxx(0x84002020, "flt.ds",        "d,2")
134   _MC88xxx(0x84002000, "flt.ss",        "d,2")
135   _MC88xxx(0x84000000, "fmul.sss",      "d,1,2")
136   _MC88xxx(0x84000080, "fmul.ssd",      "d,1,2")
137   _MC88xxx(0x84000200, "fmul.sds",      "d,1,2")
138   _MC88xxx(0x84000280, "fmul.sdd",      "d,1,2")
139   _MC88xxx(0x84000020, "fmul.dss",      "d,1,2")
140   _MC88xxx(0x840000a0, "fmul.dsd",      "d,1,2")
141   _MC88xxx(0x84000220, "fmul.dds",      "d,1,2")
142   _MC88xxx(0x840002a0, "fmul.ddd",      "d,1,2")
143   _MC88xxx(0x80008800, "fstcr",         "3,f")
144   _MC88xxx(0x84003000, "fsub.sss",      "d,1,2")
145   _MC88xxx(0x84003080, "fsub.ssd",      "d,1,2")
146   _MC88xxx(0x84003200, "fsub.sds",      "d,1,2")
147   _MC88xxx(0x84003280, "fsub.sdd",      "d,1,2")
148   _MC88xxx(0x84003020, "fsub.dss",      "d,1,2")
149   _MC88xxx(0x840030a0, "fsub.dsd",      "d,1,2")
150   _MC88xxx(0x84003220, "fsub.dds",      "d,1,2")
151   _MC88xxx(0x840032a0, "fsub.ddd",      "d,1,2")
152   _MC88xxx(0x8000c800, "fxcr",          "d,3,f")
153   _MC88xxx(0x8400fc01, "illop1",        "")
154   _MC88xxx(0x8400fc02, "illop2",        "")
155   _MC88xxx(0x8400fc03, "illop3",        "")
156   _MC88xxx(0x84004880, "int.sd",        "d,2")
157   _MC88xxx(0x84004800, "int.ss",        "d,2")
158   _MC88xxx(0xf400c000, "jmp",           "2")
159   _MC88xxx(0xf400c400, "jmp.n",         "2")
160   _MC88xxx(0xf400c800, "jsr",           "2")
161   _MC88xxx(0xf400cc00, "jsr.n",         "2")
162   _MC88xxx(0xf4001400, "ld",            "d,1,2")
163   _MC88xxx(0xf4001600, "ld",            "d,1[2]")
164   _MC88xxx(0x14000000, "ld",            "d,1,I")
165   _MC88xxx(0xf4001e00, "ld.b",          "d,1[2]")
166   _MC88xxx(0xf4001c00, "ld.b",          "d,1,2")
167   _MC88xxx(0x1c000000, "ld.b",          "d,1,I")
168   _MC88xxx(0xf4001d00, "ld.b.usr",      "d,1,2")
169   _MC88xxx(0xf4001f00, "ld.b.usr",      "d,1[2]")
170   _MC88xxx(0xf4000e00, "ld.bu",         "d,1[2]")
171   _MC88xxx(0xf4000c00, "ld.bu",         "d,1,2")
172   _MC88xxx(0x0c000000, "ld.bu",         "d,1,I")
173   _MC88xxx(0xf4000d00, "ld.bu.usr",     "d,1,2")
174   _MC88xxx(0xf4000f00, "ld.bu.usr",     "d,1[2]")
175   _MC88xxx(0xf4001200, "ld.d",          "d,1[2]")
176   _MC88xxx(0xf4001000, "ld.d",          "d,1,2")
177   _MC88xxx(0x10000000, "ld.d",          "d,1,I")
178   _MC88xxx(0xf4001100, "ld.d.usr",      "d,1,2")
179   _MC88xxx(0xf4001300, "ld.d.usr",      "d,1[2]")
180   _MC88xxx(0xf4001a00, "ld.h",          "d,1[2]")
181   _MC88xxx(0xf4001800, "ld.h",          "d,1,2")
182   _MC88xxx(0x18000000, "ld.h",          "d,1,I")
183   _MC88xxx(0xf4001900, "ld.h.usr",      "d,1,2")
184   _MC88xxx(0xf4001b00, "ld.h.usr",      "d,1[2]")
185   _MC88xxx(0xf4000a00, "ld.hu",         "d,1[2]")
186   _MC88xxx(0xf4000800, "ld.hu",         "d,1,2")
187   _MC88xxx(0x08000000, "ld.hu",         "d,1,I")
188   _MC88xxx(0xf4000900, "ld.hu.usr",     "d,1,2")
189   _MC88xxx(0xf4000b00, "ld.hu.usr",     "d,1[2]")
190   _MC88xxx(0xf4001500, "ld.usr",        "d,1,2")
191   _MC88xxx(0xf4001700, "ld.usr",        "d,1[2]")
192   _MC88xxx(0xf4003600, "lda",           "d,1[2]")
193   _MC88xxx(0xf4006000, "lda",           "?d,1,2")       /* Output addu */
194   _MC88xxx(0x60000000, "lda",           "?d,1,I")       /* Output addu */
195   _MC88xxx(0xf4006000, "lda.b",         "?d,1[2]")      /* Output addu */
196   _MC88xxx(0xf4006000, "lda.b",         "?d,1,2")       /* Output addu */
197   _MC88xxx(0x60000000, "lda.b",         "?d,1,I")       /* Output addu */
198   _MC88xxx(0xf4003200, "lda.d",         "d,1[2]")
199   _MC88xxx(0xf4006000, "lda.d",         "?d,1,2")       /* Output addu */
200   _MC88xxx(0x60000000, "lda.d",         "?d,1,I")       /* Output addu */
201   _MC88xxx(0xf4003a00, "lda.h",         "d,1[2]")
202   _MC88xxx(0xf4006000, "lda.h",         "?d,1,2")       /* Output addu */
203   _MC88xxx(0x60000000, "lda.h",         "?d,1,I")       /* Output addu */
204   _MC88xxx(0x80004000, "ldcr",          "d,c")
205   _MC88xxx(0xf400a000, "mak",           "d,1,2")
206   _MC88xxx(0xf000a000, "mak",           "d,1,b")
207   _MC88xxx(0x48000000, "mask",          "d,1,I")
208   _MC88xxx(0x4c000000, "mask.u",        "d,1,I")
209   _MC88xxx(0xf4006c00, "mul",           "d,1,2")
210   _MC88xxx(0x6c000000, "mul",           "d,1,I")
211   _MC88xxx(0xf4006c00, "mulu",          "d,1,2")        /* synonym for mul */
212   _MC88xxx(0x6c000000, "mulu",          "d,1,I")        /* synonym for mul */
213   _MC88xxx(0x84005080, "nint.sd",       "d,2")
214   _MC88xxx(0x84005000, "nint.ss",       "d,2")
215   _MC88xxx(0xf4005800, "or",            "d,1,2")
216   _MC88xxx(0x58000000, "or",            "d,1,I")
217   _MC88xxx(0xf4005c00, "or.c",          "d,1,2")
218   _MC88xxx(0x5c000000, "or.u",          "d,1,I")
219   _MC88xxx(0xf000a800, "rot",           "d,1,b")
220   _MC88xxx(0xf400a800, "rot",           "d,1,2")
221   _MC88xxx(0xf400fc00, "rte",           "")
222   _MC88xxx(0xf4008800, "set",           "d,1,2")
223   _MC88xxx(0xf0008800, "set",           "d,1,b")
224   _MC88xxx(0xf4002600, "st",            "d,1[2]")
225   _MC88xxx(0xf4002400, "st",            "d,1,2")
226   _MC88xxx(0x24000000, "st",            "d,1,I")
227   _MC88xxx(0xf4002e00, "st.b",          "d,1[2]")
228   _MC88xxx(0xf4002c00, "st.b",          "d,1,2")
229   _MC88xxx(0x2c000000, "st.b",          "d,1,I")
230   _MC88xxx(0xf4002d00, "st.b.usr",      "d,1,2")
231   _MC88xxx(0xf4002f00, "st.b.usr",      "d,1[2]")
232   _MC88xxx(0xf4002200, "st.d",          "d,1[2]")
233   _MC88xxx(0xf4002000, "st.d",          "d,1,2")
234   _MC88xxx(0x20000000, "st.d",          "d,1,I")
235   _MC88xxx(0xf4002100, "st.d.usr",      "d,1,2")
236   _MC88xxx(0xf4002300, "st.d.usr",      "d,1[2]")
237   _MC88xxx(0xf4002a00, "st.h",          "d,1[2]")
238   _MC88xxx(0xf4002800, "st.h",          "d,1,2")
239   _MC88xxx(0x28000000, "st.h",          "d,1,I")
240   _MC88xxx(0xf4002900, "st.h.usr",      "d,1,2")
241   _MC88xxx(0xf4002b00, "st.h.usr",      "d,1[2]")
242   _MC88xxx(0xf4002500, "st.usr",        "d,1,2")
243   _MC88xxx(0xf4002700, "st.usr",        "d,1[2]")
244   _MC88xxx(0x80008000, "stcr",          "3,c")
245   _MC88xxx(0xf4007400, "sub",           "d,1,2")
246   _MC88xxx(0x74000000, "sub",           "d,1,I")
247   _MC88xxx(0xf4007600, "sub.ci",        "d,1,2")
248   _MC88xxx(0xf4007700, "sub.cio",       "d,1,2")
249   _MC88xxx(0xf4007500, "sub.co",        "d,1,2")
250   _MC88xxx(0xf4006400, "subu",          "d,1,2")
251   _MC88xxx(0x64000000, "subu",          "d,1,I")
252   _MC88xxx(0xf4006600, "subu.ci",       "d,1,2")
253   _MC88xxx(0xf4006700, "subu.cio",      "d,1,2")
254   _MC88xxx(0xf4006500, "subu.co",       "d,1,2")
255   _MC88xxx(0xf000d000, "tb0",           "B,1,V")
256   _MC88xxx(0xf000d800, "tb1",           "B,1,V")
257   _MC88xxx(0xf400f800, "tbnd",          "1,2")
258   _MC88xxx(0xf8000000, "tbnd",          "1,I")
259   _MC88xxx(0xf000e800, "tcnd",          "M,1,V")
260   _MC88xxx(0x84005880, "trnc.sd",       "d,2")
261   _MC88xxx(0x84005800, "trnc.ss",       "d,2")
262   _MC88xxx(0x8000c000, "xcr",           "d,1,c")
263   _MC88xxx(0xf4000600, "xmem",          "d,1[2]")
264   _MC88xxx(0xf4000400, "xmem",          "d,1,2")
265   _MC88100(0x04000000, "xmem",          "?d,1,I")
266   _MC88xxx(0xf4000200, "xmem.bu",       "d,1[2]")
267   _MC88xxx(0xf4000000, "xmem.bu",       "d,1,2")
268   _MC88100(0x00000000, "xmem.bu",       "?d,1,I")
269   _MC88xxx(0xf4000300, "xmem.bu.usr",   "d,1[2]")
270   _MC88xxx(0xf4000100, "xmem.bu.usr",   "d,1,2")
271   _MC88100(0x00000100, "xmem.bu.usr",   "?d,1,I")
272   _MC88xxx(0xf4000700, "xmem.usr",      "d,1[2]")
273   _MC88xxx(0xf4000500, "xmem.usr",      "d,1,2")
274   _MC88100(0x04000100, "xmem.usr",      "?d,1,I")
275   _MC88xxx(0xf4005000, "xor",           "d,1,2")
276   _MC88xxx(0x50000000, "xor",           "d,1,I")
277   _MC88xxx(0xf4005400, "xor.c",         "d,1,2")
278   _MC88xxx(0x54000000, "xor.u",         "d,1,I")
279   _MC88xxx(0x00000000, "",          0)
280 };
281
282 #define NUMOPCODES ((sizeof m88k_opcodes)/(sizeof m88k_opcodes[0]))