Initial import from FreeBSD RELENG_4:
[games.git] / gnu / usr.bin / as / opcode / a29k.h
1 /* Table of opcodes for the AMD 29000
2    Copyright (C) 1990, 1991 Free Software Foundation, Inc.
3
4 This file is part of GDB and GAS.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING.  If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
19
20 struct a29k_opcode {
21   /* Name of the instruction.  */
22   char *name;
23
24   /* Opcode word */
25   unsigned long opcode;
26
27   /* A string of characters which describe the operands.
28      Valid characters are:
29      ,        Itself.  The character appears in the assembly code.
30      a        RA.  The register number is in bits 8-15 of the instruction.
31      b        RB.  The register number is in bits 0-7 of the instruction.
32      c        RC.  The register number is in bits 16-23 of the instruction.
33      i        An immediate operand is in bits 0-7 of the instruction.
34      x        Bits 0-7 and 16-23 of the instruction are bits 0-7 and 8-15
35               (respectively) of the immediate operand.
36      h        Same as x but the instruction contains bits 16-31 of the
37               immediate operand.
38      X        Same as x but bits 16-31 of the signed immediate operand
39               are set to 1 (thus the operand is always negative).
40      P,A      Bits 0-7 and 16-23 of the instruction are bits 2-9 and 10-17
41               (respectively) of the immediate operand.
42               P=PC-relative, sign-extended to 32 bits.
43               A=Absolute, zero-extended to 32 bits.
44      e        CE bit (bit 23) for a load/store instruction.
45      n        Control field (bits 16-22) for a load/store instruction.
46      v        Immediate operand in bits 16-23 of the instruction.
47               (used for trap numbers).
48      s        SA.  Special-purpose register number in bits 8-15
49               of the instruction.
50      u        UI--bit 7 of the instruction.
51      r        RND--bits 4-6 of the instruction.
52      d        FD--bits 2-3 of the instruction.
53      f        FS--bits 0-1 of the instruction.
54
55      Extensions for 29050:
56
57      d        FMT--bits 2-3 of the instruction (not really new).
58      f        ACN--bits 0-1 of the instruction (not really new).
59      F        FUNC--Special function in bits 18-21 of the instruction.
60      C        ACN--bits 16-17 specifying the accumlator register.  */
61   char *args;
62 };
63
64 #ifndef CONST
65 #define CONST
66 #endif /* CONST */
67
68 static CONST struct a29k_opcode a29k_opcodes[] =
69 {
70
71 { "add", 0x14000000, "c,a,b" },
72 { "add", 0x15000000, "c,a,i" },
73 { "addc", 0x1c000000, "c,a,b" },
74 { "addc", 0x1d000000, "c,a,i" },
75 { "addcs", 0x18000000, "c,a,b" },
76 { "addcs", 0x19000000, "c,a,i" },
77 { "addcu", 0x1a000000, "c,a,b" },
78 { "addcu", 0x1b000000, "c,a,i" },
79 { "adds", 0x10000000, "c,a,b" },
80 { "adds", 0x11000000, "c,a,i" },
81 { "addu", 0x12000000, "c,a,b" },
82 { "addu", 0x13000000, "c,a,i" },
83 { "and", 0x90000000, "c,a,b" },
84 { "and", 0x91000000, "c,a,i" },
85 { "andn", 0x9c000000, "c,a,b" },
86 { "andn", 0x9d000000, "c,a,i" },
87 { "aseq", 0x70000000, "v,a,b" },
88 { "aseq", 0x71000000, "v,a,i" },
89 { "asge", 0x5c000000, "v,a,b" },
90 { "asge", 0x5d000000, "v,a,i" },
91 { "asgeu", 0x5e000000, "v,a,b" },
92 { "asgeu", 0x5f000000, "v,a,i" },
93 { "asgt", 0x58000000, "v,a,b" },
94 { "asgt", 0x59000000, "v,a,i" },
95 { "asgtu", 0x5a000000, "v,a,b" },
96 { "asgtu", 0x5b000000, "v,a,i" },
97 { "asle", 0x54000000, "v,a,b" },
98 { "asle", 0x55000000, "v,a,i" },
99 { "asleu", 0x56000000, "v,a,b" },
100 { "asleu", 0x57000000, "v,a,i" },
101 { "aslt", 0x50000000, "v,a,b" },
102 { "aslt", 0x51000000, "v,a,i" },
103 { "asltu", 0x52000000, "v,a,b" },
104 { "asltu", 0x53000000, "v,a,i" },
105 { "asneq", 0x72000000, "v,a,b" },
106 { "asneq", 0x73000000, "v,a,i" },
107 { "call", 0xa8000000, "a,P" },
108 { "call", 0xa9000000, "a,A" },
109 { "calli", 0xc8000000, "a,b" },
110 { "class", 0xe6000000, "c,a,f" },
111 { "clz", 0x08000000, "c,b" },
112 { "clz", 0x09000000, "c,i" },
113 { "const", 0x03000000, "a,x" },
114 { "consth", 0x02000000, "a,h" },
115 { "consthz", 0x05000000, "a,h" },
116 { "constn", 0x01000000, "a,X" },
117 { "convert", 0xe4000000, "c,a,u,r,d,f" },
118 { "cpbyte", 0x2e000000, "c,a,b" },
119 { "cpbyte", 0x2f000000, "c,a,i" },
120 { "cpeq", 0x60000000, "c,a,b" },
121 { "cpeq", 0x61000000, "c,a,i" },
122 { "cpge", 0x4c000000, "c,a,b" },
123 { "cpge", 0x4d000000, "c,a,i" },
124 { "cpgeu", 0x4e000000, "c,a,b" },
125 { "cpgeu", 0x4f000000, "c,a,i" },
126 { "cpgt", 0x48000000, "c,a,b" },
127 { "cpgt", 0x49000000, "c,a,i" },
128 { "cpgtu", 0x4a000000, "c,a,b" },
129 { "cpgtu", 0x4b000000, "c,a,i" },
130 { "cple", 0x44000000, "c,a,b" },
131 { "cple", 0x45000000, "c,a,i" },
132 { "cpleu", 0x46000000, "c,a,b" },
133 { "cpleu", 0x47000000, "c,a,i" },
134 { "cplt", 0x40000000, "c,a,b" },
135 { "cplt", 0x41000000, "c,a,i" },
136 { "cpltu", 0x42000000, "c,a,b" },
137 { "cpltu", 0x43000000, "c,a,i" },
138 { "cpneq", 0x62000000, "c,a,b" },
139 { "cpneq", 0x63000000, "c,a,i" },
140 { "dadd", 0xf1000000, "c,a,b" },
141 { "ddiv", 0xf7000000, "c,a,b" },
142 { "deq", 0xeb000000, "c,a,b" },
143 { "dge", 0xef000000, "c,a,b" },
144 { "dgt", 0xed000000, "c,a,b" },
145 { "div", 0x6a000000, "c,a,b" },
146 { "div", 0x6b000000, "c,a,i" },
147 { "div0", 0x68000000, "c,b" },
148 { "div0", 0x69000000, "c,i" },
149 { "divide", 0xe1000000, "c,a,b" },
150 { "dividu", 0xe3000000, "c,a,b" },
151 { "divl", 0x6c000000, "c,a,b" },
152 { "divl", 0x6d000000, "c,a,i" },
153 { "divrem", 0x6e000000, "c,a,b" },
154 { "divrem", 0x6f000000, "c,a,i" },
155 { "dmac", 0xd9000000, "F,C,a,b" },
156 { "dmsm", 0xdb000000, "c,a,b" },
157 { "dmul", 0xf5000000, "c,a,b" },
158 { "dsub", 0xf3000000, "c,a,b" },
159 { "emulate", 0xd7000000, "v,a,b" },
160 { "exbyte", 0x0a000000, "c,a,b" },
161 { "exbyte", 0x0b000000, "c,a,i" },
162 { "exhw", 0x7c000000, "c,a,b" },
163 { "exhw", 0x7d000000, "c,a,i" },
164 { "exhws", 0x7e000000, "c,a" },
165 { "extract", 0x7a000000, "c,a,b" },
166 { "extract", 0x7b000000, "c,a,i" },
167 { "fadd", 0xf0000000, "c,a,b" },
168 { "fdiv", 0xf6000000, "c,a,b" },
169 { "fdmul", 0xf9000000, "c,a,b" },
170 { "feq", 0xea000000, "c,a,b" },
171 { "fge", 0xee000000, "c,a,b" },
172 { "fgt", 0xec000000, "c,a,b" },
173 { "fmac", 0xd8000000, "F,C,a,b" },
174 { "fmsm", 0xda000000, "c,a,b" },
175 { "fmul", 0xf4000000, "c,a,b" },
176 { "fsub", 0xf2000000, "c,a,b" },
177 { "halt", 0x89000000, "" },
178 { "inbyte", 0x0c000000, "c,a,b" },
179 { "inbyte", 0x0d000000, "c,a,i" },
180 { "inhw", 0x78000000, "c,a,b" },
181 { "inhw", 0x79000000, "c,a,i" },
182 { "inv", 0x9f000000, "" },
183 { "iret", 0x88000000, "" },
184 { "iretinv", 0x8c000000, "" },
185 { "jmp", 0xa0000000, "P" },
186 { "jmp", 0xa1000000, "A" },
187 { "jmpf", 0xa4000000, "a,P" },
188 { "jmpf", 0xa5000000, "a,A" },
189 { "jmpfdec", 0xb4000000, "a,P" },
190 { "jmpfdec", 0xb5000000, "a,A" },
191 { "jmpfi", 0xc4000000, "a,b" },
192 { "jmpi", 0xc0000000, "b" },
193 { "jmpt", 0xac000000, "a,P" },
194 { "jmpt", 0xad000000, "a,A" },
195 { "jmpti", 0xcc000000, "a,b" },
196 { "load", 0x16000000, "e,n,a,b" },
197 { "load", 0x17000000, "e,n,a,i" },
198 { "loadl", 0x06000000, "e,n,a,b" },
199 { "loadl", 0x07000000, "e,n,a,i" },
200 { "loadm", 0x36000000, "e,n,a,b" },
201 { "loadm", 0x37000000, "e,n,a,i" },
202 { "loadset", 0x26000000, "e,n,a,b" },
203 { "loadset", 0x27000000, "e,n,a,i" },
204 { "mfacc", 0xe9000100, "c,d,f" },
205 { "mfsr", 0xc6000000, "c,s" },
206 { "mftlb", 0xb6000000, "c,a" },
207 { "mtacc", 0xe8010000, "a,d,f" },
208 { "mtsr", 0xce000000, "s,b" },
209 { "mtsrim", 0x04000000, "s,x" },
210 { "mttlb", 0xbe000000, "a,b" },
211 { "mul", 0x64000000, "c,a,b" },
212 { "mul", 0x65000000, "c,a,i" },
213 { "mull", 0x66000000, "c,a,b" },
214 { "mull", 0x67000000, "c,a,i" },
215 { "multiplu", 0xe2000000, "c,a,b" },
216 { "multiply", 0xe0000000, "c,a,b" },
217 { "multm", 0xde000000, "c,a,b" },
218 { "multmu", 0xdf000000, "c,a,b" },
219 { "mulu", 0x74000000, "c,a,b" },
220 { "mulu", 0x75000000, "c,a,i" },
221 { "nand", 0x9a000000, "c,a,b" },
222 { "nand", 0x9b000000, "c,a,i" },
223 { "nop", 0x70400101, "" },
224 { "nor", 0x98000000, "c,a,b" },
225 { "nor", 0x99000000, "c,a,i" },
226 { "or", 0x92000000, "c,a,b" },
227 { "or", 0x93000000, "c,a,i" },
228 { "orn", 0xaa000000, "c,a,b" },
229 { "orn", 0xab000000, "c,a,i" },
230
231 /* The description of "setip" in Chapter 8 ("instruction set") of the user's
232    manual claims that these are absolute register numbers.  But section
233    7.2.1 explains that they are not.  The latter is correct, so print
234    these normally ("lr0", "lr5", etc.).  */
235 { "setip", 0x9e000000, "c,a,b" },
236
237 { "sll", 0x80000000, "c,a,b" },
238 { "sll", 0x81000000, "c,a,i" },
239 { "sqrt", 0xe5000000, "c,a,f" },
240 { "sra", 0x86000000, "c,a,b" },
241 { "sra", 0x87000000, "c,a,i" },
242 { "srl", 0x82000000, "c,a,b" },
243 { "srl", 0x83000000, "c,a,i" },
244 { "store", 0x1e000000, "e,n,a,b" },
245 { "store", 0x1f000000, "e,n,a,i" },
246 { "storel", 0x0e000000, "e,n,a,b" },
247 { "storel", 0x0f000000, "e,n,a,i" },
248 { "storem", 0x3e000000, "e,n,a,b" },
249 { "storem", 0x3f000000, "e,n,a,i" },
250 { "sub", 0x24000000, "c,a,b" },
251 { "sub", 0x25000000, "c,a,i" },
252 { "subc", 0x2c000000, "c,a,b" },
253 { "subc", 0x2d000000, "c,a,i" },
254 { "subcs", 0x28000000, "c,a,b" },
255 { "subcs", 0x29000000, "c,a,i" },
256 { "subcu", 0x2a000000, "c,a,b" },
257 { "subcu", 0x2b000000, "c,a,i" },
258 { "subr", 0x34000000, "c,a,b" },
259 { "subr", 0x35000000, "c,a,i" },
260 { "subrc", 0x3c000000, "c,a,b" },
261 { "subrc", 0x3d000000, "c,a,i" },
262 { "subrcs", 0x38000000, "c,a,b" },
263 { "subrcs", 0x39000000, "c,a,i" },
264 { "subrcu", 0x3a000000, "c,a,b" },
265 { "subrcu", 0x3b000000, "c,a,i" },
266 { "subrs", 0x30000000, "c,a,b" },
267 { "subrs", 0x31000000, "c,a,i" },
268 { "subru", 0x32000000, "c,a,b" },
269 { "subru", 0x33000000, "c,a,i" },
270 { "subs", 0x20000000, "c,a,b" },
271 { "subs", 0x21000000, "c,a,i" },
272 { "subu", 0x22000000, "c,a,b" },
273 { "subu", 0x23000000, "c,a,i" },
274 { "xnor", 0x96000000, "c,a,b" },
275 { "xnor", 0x97000000, "c,a,i" },
276 { "xor", 0x94000000, "c,a,b" },
277 { "xor", 0x95000000, "c,a,i" },
278
279 { "", 0x0, "" }         /* Dummy entry, not included in NUM_OPCODES.  This
280                            lets code examine entry i+1 without checking
281                            if we've run off the end of the table.  */
282 };
283
284 CONST unsigned int num_opcodes = (((sizeof a29k_opcodes) / (sizeof a29k_opcodes[0])) - 1);
285
286 /*
287  * $Log: a29k.h,v $
288  * Revision 1.1  1993/10/02  21:00:40  pk
289  * GNU gas 1.92.3 based assembler supporting PIC code (for i386 and sparc).
290  *
291  * Revision 1.2  1992/02/29  17:10:43  rich
292  * various smallish fixes from mail archives
293  *
294  * Revision 1.1.1.1  1992/02/24  02:34:30  rich
295  * devo fork
296  *
297  * Revision 1.1  1991/12/01  02:22:19  sac
298  * Initial revision
299  *
300  * Revision 1.5  1991/11/07  16:59:19  sac
301  * Fixed encoding of mtacc instruction.
302  *
303  * Revision 1.4  1991/08/06  07:20:27  rich
304  * Fixing CONST declarations.
305  *
306  * Revision 1.3  1991/08/05  22:31:05  rich
307  * *** empty log message ***
308  *
309  * Revision 1.2  1991/07/15  23:34:04  steve
310  * *** empty log message ***
311  *
312  * Revision 1.1  1991/05/19  00:19:33  rich
313  * Initial revision
314  *
315  * Revision 1.1.1.1  1991/04/04  18:15:23  rich
316  * new gas main line
317  *
318  * Revision 1.1  1991/04/04  18:15:23  rich
319  * Initial revision
320  *
321  * Revision 1.2  1991/03/30  17:13:19  rich
322  * num_opcodes now unsigned.  Also, added rcsid and log.
323  *
324  *
325  */
326
327 /* end of a29k-opcode.h */