1 /* Table of opcodes for the Motorola M88k family.
2 Copyright 1989, 1990, 1991, 1993, 2001 Free Software Foundation, Inc.
4 This file is part of GDB and GAS.
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 2 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21 * Disassembler Instruction Table
23 * The first field of the table is the opcode field. If an opcode
24 * is specified which has any non-opcode bits on, a system error
25 * will occur when the system attempts the install it into the
26 * instruction table. The second parameter is a pointer to the
27 * instruction mnemonic. Each operand is specified by offset, width,
28 * and type. The offset is the bit number of the least significant
29 * bit of the operand with bit 0 being the least significant bit of
30 * the instruction. The width is the number of bits used to specify
31 * the operand. The type specifies the output format to be used for
32 * the operand. The valid formats are: register, register indirect,
33 * hex constant, and bit field specification. The last field is a
34 * pointer to the next instruction in the linked list. These pointers
35 * are initialized by init_disasm().
39 * Revision 1.0 11/08/85 Creation date
40 * 1.1 02/05/86 Updated instruction mnemonic table MD
41 * 1.2 06/16/86 Updated SIM_FLAGS for floating point
42 * 1.3 09/20/86 Updated for new encoding
43 * 05/11/89 R. Trawick adapted from Motorola disassembler
48 /* Define the number of bits in the primary opcode field of the instruction,
49 the destination field, the source 1 and source 2 fields. */
51 /* Size of opcode field. */
54 /* Size of destination. */
57 /* Size of source1. */
60 /* Size of source2. */
63 /* Number of registers. */
66 /* Type definitions. */
68 typedef unsigned int UINT
;
73 /* The next four equates define the priorities that the various classes
74 * of instructions have regarding writing results back into registers and
75 * signalling exceptions. */
77 /* PMEM is also defined in <sys/param.h> on Delta 88's. Sigh! */
80 /* Integer priority. */
83 /* Floating point priority. */
86 /* Memory priority. */
89 /* Not applicable, instruction doesn't write to regs. */
92 /* Highest of these priorities. */
95 /* The instruction registers are an artificial mechanism to speed up
96 * simulator execution. In the real processor, an instruction register
97 * is 32 bits wide. In the simulator, the 32 bit instruction is kept in
98 * a structure field called rawop, and the instruction is partially decoded,
99 * and split into various fields and flags which make up the other fields
101 * The partial decode is done when the instructions are initially loaded
102 * into simulator memory. The simulator code memory is not an array of
103 * 32 bit words, but is an array of instruction register structures.
104 * Yes this wastes memory, but it executes much quicker.
115 /* Writeback priority. */
117 /* Immediate size. */
118 unsigned imm_flags
:2,
119 /* Register source 1 used. */
121 /* Register source 2 used. */
123 /* Register source/dest. used. */
127 /* Upper half word. */
131 /* Uses writeback slot. */
140 /* Scaled register. */
146 /* Pointer (returned by calloc) to segment. */
149 /* Base load address from file headers. */
150 unsigned long baseaddr
;
152 /* Ending address of segment. */
153 unsigned long endaddr
;
155 /* Segment control flags (none defined). */
159 #define MAXSEGS (10) /* max number of segment allowed */
160 #define MEMSEGSIZE (sizeof(struct mem_segs))/* size of mem_segs structure */
163 #define BRK_RD (0x01) /* break on memory read */
164 #define BRK_WR (0x02) /* break on memory write */
165 #define BRK_EXEC (0x04) /* break on execution */
166 #define BRK_CNT (0x08) /* break on terminal count */
171 /* Simulator instruction break down. */
172 struct IR_FIELDS opcode
;
174 /* Memory element break down. */
181 /* Size of each 32 bit memory model. */
182 #define MEMWRDSIZE (sizeof (struct mem_wrd))
184 extern struct mem_segs memory
[];
185 extern struct PROCESSOR m78000
;
190 /* Execute instruction pointer. */
192 /* Vector base register. */
194 /* Processor status register. */
203 /* Data address bus. */
206 /* Data registers. */
208 /* Max clocks before reg is available. */
210 /* Writeback priority of reg. */
212 /* Integer unit control regs. */
214 /* Floating point control regs. */
218 unsigned WORD scoreboard
,
221 /* Waiting for a jump instruction. */
225 /* Size of immediate field. */
231 /* Definitions for fields in psr. */
250 /* The 1 clock operations. */
290 #define XMEMBU LDHU+5
327 /* Control register manipulations. */
339 /* Floating point instructions. */
356 #define UEXT(src,off,wid) \
357 ((((unsigned int)(src)) >> (off)) & ((1 << (wid)) - 1))
359 #define SEXT(src,off,wid) \
360 (((((int)(src))<<(32 - ((off) + (wid)))) >>(32 - (wid))) )
362 #define MAKE(src,off,wid) \
363 ((((unsigned int)(src)) & ((1 << (wid)) - 1)) << (off))
365 #define opword(n) (unsigned long) (memaddr->mem.l)
367 /* Constants and masks. */
369 #define SFU0 0x80000000
370 #define SFU1 0x84000000
371 #define SFU7 0x9c000000
372 #define RRI10 0xf0000000
373 #define RRR 0xf4000000
374 #define SFUMASK 0xfc00ffe0
375 #define RRRMASK 0xfc00ffe0
376 #define RRI10MASK 0xfc00fc00
377 #define DEFMASK 0xfc000000
378 #define CTRL 0x0000f000
379 #define CTRLMASK 0xfc00f800
381 /* Operands types. */
390 /* Scaled register. */
392 /* Control register. */
394 /* Floating point control register. */
398 /* Extended register. */
404 /* Hashing specification. */
408 /* Structure templates. */
414 enum operand_type type
;
419 int ltncy
, /* latency (max number of clocks needed to execute). */
420 extime
, /* execution time (min number of clocks needed to execute). */
421 wb_pri
; /* writeback slot priority. */
422 unsigned op
:OP
, /* simulator version of opcode. */
423 imm_flags
:2, /* 10,16 or 26 bit immediate flags. */
424 rs1_used
:1, /* register source 1 used. */
425 rs2_used
:1, /* register source 2 used. */
426 rsd_used
:1, /* register source/dest used. */
427 c_flag
:1, /* complement. */
428 u_flag
:1, /* upper half word. */
429 n_flag
:1, /* execute next. */
430 wb_flag
:1, /* uses writeback slot. */
431 dest_64
:1, /* double precision dest. */
432 s1_64
:1, /* double precision source 1. */
433 s2_64
:1, /* double precision source 2. */
434 scale_flag
:1; /* register is scaled. */
437 typedef struct INSTRUCTAB
{
441 struct SIM_FLAGS flgs
;
445 #define NO_OPERAND {0,0,0}
447 extern const INSTAB instructions
[];