OSDN Git Service

Regenerate cgen files, update copyright year.
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / mt / mt-decode.cxx
1 /* Simulator instruction decoder for mt.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000-2010 Red Hat, Inc.
6
7 This file is part of the Red Hat simulators.
8
9
10 */
11
12
13 #if HAVE_CONFIG_H
14 #include "config.h"
15 #endif
16 #include "mt.h"
17
18 using namespace mt; // FIXME: namespace organization still wip
19
20
21 // The instruction descriptor array. 
22
23 mt_idesc mt_idesc::idesc_table[MT_INSN_MFBCBINCRS + 1] =
24 {
25   { mt_sem_x_invalid, "X_INVALID", MT_INSN_X_INVALID, { 0|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE) } },
26   { mt_sem_add, "ADD", MT_INSN_ADD, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
27   { mt_sem_addu, "ADDU", MT_INSN_ADDU, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
28   { mt_sem_addi, "ADDI", MT_INSN_ADDI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
29   { mt_sem_addui, "ADDUI", MT_INSN_ADDUI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
30   { mt_sem_sub, "SUB", MT_INSN_SUB, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
31   { mt_sem_subu, "SUBU", MT_INSN_SUBU, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
32   { mt_sem_subi, "SUBI", MT_INSN_SUBI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
33   { mt_sem_subui, "SUBUI", MT_INSN_SUBUI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
34   { mt_sem_mul, "MUL", MT_INSN_MUL, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
35   { mt_sem_muli, "MULI", MT_INSN_MULI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
36   { mt_sem_and, "AND", MT_INSN_AND, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
37   { mt_sem_andi, "ANDI", MT_INSN_ANDI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
38   { mt_sem_or, "OR", MT_INSN_OR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
39   { mt_sem_nop, "NOP", MT_INSN_NOP, { 0, (1<<MACH_BASE) } },
40   { mt_sem_ori, "ORI", MT_INSN_ORI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
41   { mt_sem_xor, "XOR", MT_INSN_XOR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
42   { mt_sem_xori, "XORI", MT_INSN_XORI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
43   { mt_sem_nand, "NAND", MT_INSN_NAND, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
44   { mt_sem_nandi, "NANDI", MT_INSN_NANDI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
45   { mt_sem_nor, "NOR", MT_INSN_NOR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
46   { mt_sem_nori, "NORI", MT_INSN_NORI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
47   { mt_sem_xnor, "XNOR", MT_INSN_XNOR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
48   { mt_sem_xnori, "XNORI", MT_INSN_XNORI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
49   { mt_sem_ldui, "LDUI", MT_INSN_LDUI, { 0|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_AL_INSN), (1<<MACH_BASE) } },
50   { mt_sem_lsl, "LSL", MT_INSN_LSL, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR), (1<<MACH_BASE) } },
51   { mt_sem_lsli, "LSLI", MT_INSN_LSLI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR), (1<<MACH_BASE) } },
52   { mt_sem_lsr, "LSR", MT_INSN_LSR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR), (1<<MACH_BASE) } },
53   { mt_sem_lsri, "LSRI", MT_INSN_LSRI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR), (1<<MACH_BASE) } },
54   { mt_sem_asr, "ASR", MT_INSN_ASR, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR), (1<<MACH_BASE) } },
55   { mt_sem_asri, "ASRI", MT_INSN_ASRI, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR), (1<<MACH_BASE) } },
56   { mt_sem_brlt, "BRLT", MT_INSN_BRLT, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDRRR)|(1<<CGEN_INSN_DELAY_SLOT)|(1<<CGEN_INSN_BR_INSN), (1<<MACH_BASE) } },
57   { mt_sem_brle, "BRLE", MT_INSN_BRLE, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_DELAY_SLOT)|(1<<CGEN_INSN_BR_INSN), (1<<MACH_BASE) } },
58   { mt_sem_breq, "BREQ", MT_INSN_BREQ, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_DELAY_SLOT)|(1<<CGEN_INSN_BR_INSN), (1<<MACH_BASE) } },
59   { mt_sem_brne, "BRNE", MT_INSN_BRNE, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_DELAY_SLOT)|(1<<CGEN_INSN_BR_INSN), (1<<MACH_BASE) } },
60   { mt_sem_jmp, "JMP", MT_INSN_JMP, { 0|(1<<CGEN_INSN_BR_INSN)|(1<<CGEN_INSN_DELAY_SLOT), (1<<MACH_BASE) } },
61   { mt_sem_jal, "JAL", MT_INSN_JAL, { 0|(1<<CGEN_INSN_JAL_HAZARD)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_BR_INSN)|(1<<CGEN_INSN_DELAY_SLOT), (1<<MACH_BASE) } },
62   { mt_sem_dbnz, "DBNZ", MT_INSN_DBNZ, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_DELAY_SLOT)|(1<<CGEN_INSN_BR_INSN), (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
63   { mt_sem_ei, "EI", MT_INSN_EI, { 0, (1<<MACH_BASE) } },
64   { mt_sem_di, "DI", MT_INSN_DI, { 0, (1<<MACH_BASE) } },
65   { mt_sem_si, "SI", MT_INSN_SI, { 0|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_BR_INSN)|(1<<CGEN_INSN_DELAY_SLOT), (1<<MACH_BASE) } },
66   { mt_sem_reti, "RETI", MT_INSN_RETI, { 0|(1<<CGEN_INSN_JAL_HAZARD)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_BR_INSN)|(1<<CGEN_INSN_DELAY_SLOT), (1<<MACH_BASE) } },
67   { mt_sem_ldw, "LDW", MT_INSN_LDW, { 0|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_USES_FRDR)|(1<<CGEN_INSN_MEMORY_ACCESS)|(1<<CGEN_INSN_LOAD_DELAY), (1<<MACH_BASE) } },
68   { mt_sem_stw, "STW", MT_INSN_STW, { 0|(1<<CGEN_INSN_USES_FRSR2)|(1<<CGEN_INSN_USES_FRSR1)|(1<<CGEN_INSN_MEMORY_ACCESS), (1<<MACH_BASE) } },
69   { mt_sem_break, "BREAK", MT_INSN_BREAK, { 0, (1<<MACH_BASE) } },
70   { mt_sem_iflush, "IFLUSH", MT_INSN_IFLUSH, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
71   { mt_sem_fbcb, "FBCB", MT_INSN_FBCB, { 0, (1<<MACH_MS1)|(1<<MACH_MS1_003) } },
72   { mt_sem_mfbcb, "MFBCB", MT_INSN_MFBCB, { 0, (1<<MACH_BASE) } },
73   { mt_sem_fbcci, "FBCCI", MT_INSN_FBCCI, { 0, (1<<MACH_BASE) } },
74   { mt_sem_fbrci, "FBRCI", MT_INSN_FBRCI, { 0, (1<<MACH_BASE) } },
75   { mt_sem_fbcri, "FBCRI", MT_INSN_FBCRI, { 0, (1<<MACH_BASE) } },
76   { mt_sem_fbrri, "FBRRI", MT_INSN_FBRRI, { 0, (1<<MACH_BASE) } },
77   { mt_sem_mfbcci, "MFBCCI", MT_INSN_MFBCCI, { 0, (1<<MACH_BASE) } },
78   { mt_sem_mfbrci, "MFBRCI", MT_INSN_MFBRCI, { 0, (1<<MACH_BASE) } },
79   { mt_sem_mfbcri, "MFBCRI", MT_INSN_MFBCRI, { 0, (1<<MACH_BASE) } },
80   { mt_sem_mfbrri, "MFBRRI", MT_INSN_MFBRRI, { 0, (1<<MACH_BASE) } },
81   { mt_sem_fbcbdr, "FBCBDR", MT_INSN_FBCBDR, { 0, (1<<MACH_BASE) } },
82   { mt_sem_rcfbcb, "RCFBCB", MT_INSN_RCFBCB, { 0, (1<<MACH_BASE) } },
83   { mt_sem_mrcfbcb, "MRCFBCB", MT_INSN_MRCFBCB, { 0, (1<<MACH_BASE) } },
84   { mt_sem_cbcast, "CBCAST", MT_INSN_CBCAST, { 0, (1<<MACH_BASE) } },
85   { mt_sem_dupcbcast, "DUPCBCAST", MT_INSN_DUPCBCAST, { 0, (1<<MACH_BASE) } },
86   { mt_sem_wfbi, "WFBI", MT_INSN_WFBI, { 0, (1<<MACH_BASE) } },
87   { mt_sem_wfb, "WFB", MT_INSN_WFB, { 0, (1<<MACH_BASE) } },
88   { mt_sem_rcrisc, "RCRISC", MT_INSN_RCRISC, { 0, (1<<MACH_BASE) } },
89   { mt_sem_fbcbinc, "FBCBINC", MT_INSN_FBCBINC, { 0, (1<<MACH_BASE) } },
90   { mt_sem_rcxmode, "RCXMODE", MT_INSN_RCXMODE, { 0, (1<<MACH_BASE) } },
91   { mt_sem_interleaver, "INTERLEAVER", MT_INSN_INTERLEAVER, { 0, (1<<MACH_BASE) } },
92   { mt_sem_wfbinc, "WFBINC", MT_INSN_WFBINC, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
93   { mt_sem_mwfbinc, "MWFBINC", MT_INSN_MWFBINC, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
94   { mt_sem_wfbincr, "WFBINCR", MT_INSN_WFBINCR, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
95   { mt_sem_mwfbincr, "MWFBINCR", MT_INSN_MWFBINCR, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
96   { mt_sem_fbcbincs, "FBCBINCS", MT_INSN_FBCBINCS, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
97   { mt_sem_mfbcbincs, "MFBCBINCS", MT_INSN_MFBCBINCS, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
98   { mt_sem_fbcbincrs, "FBCBINCRS", MT_INSN_FBCBINCRS, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
99   { mt_sem_mfbcbincrs, "MFBCBINCRS", MT_INSN_MFBCBINCRS, { 0, (1<<MACH_MS1_003)|(1<<MACH_MS2) } },
100
101 };
102
103 // Given a canonical virtual insn id, return the target specific one.
104
105 mt_insn_type
106 mt_idesc::lookup_virtual (virtual_insn_type vit)
107 {
108   switch (vit)
109     {
110       case VIRTUAL_INSN_INVALID: return MT_INSN_X_INVALID;
111       case VIRTUAL_INSN_COND: return MT_INSN_X_INVALID;
112     }
113   abort ();
114 }
115
116
117 // Declare extractor functions
118
119 static void
120 mt_extract_sfmt_empty (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
121 static void
122 mt_extract_sfmt_add (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
123 static void
124 mt_extract_sfmt_addi (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
125 static void
126 mt_extract_sfmt_addui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
127 static void
128 mt_extract_sfmt_nop (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
129 static void
130 mt_extract_sfmt_ldui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
131 static void
132 mt_extract_sfmt_brlt (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
133 static void
134 mt_extract_sfmt_jmp (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
135 static void
136 mt_extract_sfmt_jal (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
137 static void
138 mt_extract_sfmt_dbnz (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
139 static void
140 mt_extract_sfmt_si (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
141 static void
142 mt_extract_sfmt_reti (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
143 static void
144 mt_extract_sfmt_ldw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
145 static void
146 mt_extract_sfmt_stw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
147 static void
148 mt_extract_sfmt_break (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
149
150 // Fetch & decode instruction
151 void
152 mt_scache::decode (mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn)
153 {
154   /* Result of decoder.  */
155   MT_INSN_TYPE itype;
156
157   {
158     mt_insn_word insn = base_insn;
159
160     {
161       unsigned int val = (((insn >> 24) & (255 << 0)));
162       switch (val)
163       {
164       case 0 :
165         if ((entire_insn & 0xff000fff) == 0x0)
166           { itype = MT_INSN_ADD; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
167         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
168       case 1 : itype = MT_INSN_ADDI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
169       case 2 :
170         if ((entire_insn & 0xff000fff) == 0x2000000)
171           { itype = MT_INSN_ADDU; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
172         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
173       case 3 : itype = MT_INSN_ADDUI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
174       case 4 :
175         if ((entire_insn & 0xff000fff) == 0x4000000)
176           { itype = MT_INSN_SUB; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
177         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
178       case 5 : itype = MT_INSN_SUBI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
179       case 6 :
180         if ((entire_insn & 0xff000fff) == 0x6000000)
181           { itype = MT_INSN_SUBU; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
182         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
183       case 7 : itype = MT_INSN_SUBUI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
184       case 8 :
185         if ((entire_insn & 0xff000fff) == 0x8000000)
186           { itype = MT_INSN_MUL; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
187         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
188       case 9 : itype = MT_INSN_MULI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
189       case 16 :
190         if ((entire_insn & 0xff000fff) == 0x10000000)
191           { itype = MT_INSN_AND; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
192         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
193       case 17 : itype = MT_INSN_ANDI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
194       case 18 :
195         {
196           unsigned int val = (((insn >> 12) & (127 << 0)));
197           switch (val)
198           {
199           case 0 :
200             {
201               unsigned int val = (((insn >> 19) & (31 << 0)));
202               switch (val)
203               {
204               case 0 :
205                 if ((entire_insn & 0xffffffff) == 0x12000000)
206                   { itype = MT_INSN_NOP; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
207                 itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
208               case 1 : /* fall through */
209               case 2 : /* fall through */
210               case 3 : /* fall through */
211               case 4 : /* fall through */
212               case 5 : /* fall through */
213               case 6 : /* fall through */
214               case 7 : /* fall through */
215               case 8 : /* fall through */
216               case 9 : /* fall through */
217               case 10 : /* fall through */
218               case 11 : /* fall through */
219               case 12 : /* fall through */
220               case 13 : /* fall through */
221               case 14 : /* fall through */
222               case 15 : /* fall through */
223               case 16 : /* fall through */
224               case 17 : /* fall through */
225               case 18 : /* fall through */
226               case 19 : /* fall through */
227               case 20 : /* fall through */
228               case 21 : /* fall through */
229               case 22 : /* fall through */
230               case 23 : /* fall through */
231               case 24 : /* fall through */
232               case 25 : /* fall through */
233               case 26 : /* fall through */
234               case 27 : /* fall through */
235               case 28 : /* fall through */
236               case 29 : /* fall through */
237               case 30 : /* fall through */
238               case 31 :
239                 if ((entire_insn & 0xff000fff) == 0x12000000)
240                   { itype = MT_INSN_OR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
241                 itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
242               default : itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
243               }
244             }
245           case 1 : /* fall through */
246           case 2 : /* fall through */
247           case 3 : /* fall through */
248           case 4 : /* fall through */
249           case 5 : /* fall through */
250           case 6 : /* fall through */
251           case 7 : /* fall through */
252           case 8 : /* fall through */
253           case 9 : /* fall through */
254           case 10 : /* fall through */
255           case 11 : /* fall through */
256           case 12 : /* fall through */
257           case 13 : /* fall through */
258           case 14 : /* fall through */
259           case 15 : /* fall through */
260           case 16 : /* fall through */
261           case 17 : /* fall through */
262           case 18 : /* fall through */
263           case 19 : /* fall through */
264           case 20 : /* fall through */
265           case 21 : /* fall through */
266           case 22 : /* fall through */
267           case 23 : /* fall through */
268           case 24 : /* fall through */
269           case 25 : /* fall through */
270           case 26 : /* fall through */
271           case 27 : /* fall through */
272           case 28 : /* fall through */
273           case 29 : /* fall through */
274           case 30 : /* fall through */
275           case 31 : /* fall through */
276           case 32 : /* fall through */
277           case 33 : /* fall through */
278           case 34 : /* fall through */
279           case 35 : /* fall through */
280           case 36 : /* fall through */
281           case 37 : /* fall through */
282           case 38 : /* fall through */
283           case 39 : /* fall through */
284           case 40 : /* fall through */
285           case 41 : /* fall through */
286           case 42 : /* fall through */
287           case 43 : /* fall through */
288           case 44 : /* fall through */
289           case 45 : /* fall through */
290           case 46 : /* fall through */
291           case 47 : /* fall through */
292           case 48 : /* fall through */
293           case 49 : /* fall through */
294           case 50 : /* fall through */
295           case 51 : /* fall through */
296           case 52 : /* fall through */
297           case 53 : /* fall through */
298           case 54 : /* fall through */
299           case 55 : /* fall through */
300           case 56 : /* fall through */
301           case 57 : /* fall through */
302           case 58 : /* fall through */
303           case 59 : /* fall through */
304           case 60 : /* fall through */
305           case 61 : /* fall through */
306           case 62 : /* fall through */
307           case 63 : /* fall through */
308           case 64 : /* fall through */
309           case 65 : /* fall through */
310           case 66 : /* fall through */
311           case 67 : /* fall through */
312           case 68 : /* fall through */
313           case 69 : /* fall through */
314           case 70 : /* fall through */
315           case 71 : /* fall through */
316           case 72 : /* fall through */
317           case 73 : /* fall through */
318           case 74 : /* fall through */
319           case 75 : /* fall through */
320           case 76 : /* fall through */
321           case 77 : /* fall through */
322           case 78 : /* fall through */
323           case 79 : /* fall through */
324           case 80 : /* fall through */
325           case 81 : /* fall through */
326           case 82 : /* fall through */
327           case 83 : /* fall through */
328           case 84 : /* fall through */
329           case 85 : /* fall through */
330           case 86 : /* fall through */
331           case 87 : /* fall through */
332           case 88 : /* fall through */
333           case 89 : /* fall through */
334           case 90 : /* fall through */
335           case 91 : /* fall through */
336           case 92 : /* fall through */
337           case 93 : /* fall through */
338           case 94 : /* fall through */
339           case 95 : /* fall through */
340           case 96 : /* fall through */
341           case 97 : /* fall through */
342           case 98 : /* fall through */
343           case 99 : /* fall through */
344           case 100 : /* fall through */
345           case 101 : /* fall through */
346           case 102 : /* fall through */
347           case 103 : /* fall through */
348           case 104 : /* fall through */
349           case 105 : /* fall through */
350           case 106 : /* fall through */
351           case 107 : /* fall through */
352           case 108 : /* fall through */
353           case 109 : /* fall through */
354           case 110 : /* fall through */
355           case 111 : /* fall through */
356           case 112 : /* fall through */
357           case 113 : /* fall through */
358           case 114 : /* fall through */
359           case 115 : /* fall through */
360           case 116 : /* fall through */
361           case 117 : /* fall through */
362           case 118 : /* fall through */
363           case 119 : /* fall through */
364           case 120 : /* fall through */
365           case 121 : /* fall through */
366           case 122 : /* fall through */
367           case 123 : /* fall through */
368           case 124 : /* fall through */
369           case 125 : /* fall through */
370           case 126 : /* fall through */
371           case 127 :
372             if ((entire_insn & 0xff000fff) == 0x12000000)
373               { itype = MT_INSN_OR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
374             itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
375           default : itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
376           }
377         }
378       case 19 : itype = MT_INSN_ORI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
379       case 20 :
380         if ((entire_insn & 0xff000fff) == 0x14000000)
381           { itype = MT_INSN_XOR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
382         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
383       case 21 : itype = MT_INSN_XORI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
384       case 22 :
385         if ((entire_insn & 0xff000fff) == 0x16000000)
386           { itype = MT_INSN_NAND; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
387         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
388       case 23 : itype = MT_INSN_NANDI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
389       case 24 :
390         if ((entire_insn & 0xff000fff) == 0x18000000)
391           { itype = MT_INSN_NOR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
392         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
393       case 25 : itype = MT_INSN_NORI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
394       case 26 :
395         if ((entire_insn & 0xff000fff) == 0x1a000000)
396           { itype = MT_INSN_XNOR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
397         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
398       case 27 : itype = MT_INSN_XNORI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
399       case 29 :
400         if ((entire_insn & 0xfff00000) == 0x1d000000)
401           { itype = MT_INSN_LDUI; mt_extract_sfmt_ldui (this, current_cpu, pc, base_insn, entire_insn); goto done; }
402         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
403       case 32 :
404         if ((entire_insn & 0xff000fff) == 0x20000000)
405           { itype = MT_INSN_LSL; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
406         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
407       case 33 : itype = MT_INSN_LSLI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
408       case 34 :
409         if ((entire_insn & 0xff000fff) == 0x22000000)
410           { itype = MT_INSN_LSR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
411         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
412       case 35 : itype = MT_INSN_LSRI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
413       case 36 :
414         if ((entire_insn & 0xff000fff) == 0x24000000)
415           { itype = MT_INSN_ASR; mt_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done; }
416         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
417       case 37 : itype = MT_INSN_ASRI; mt_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
418       case 49 : itype = MT_INSN_BRLT; mt_extract_sfmt_brlt (this, current_cpu, pc, base_insn, entire_insn); goto done;
419       case 51 : itype = MT_INSN_BRLE; mt_extract_sfmt_brlt (this, current_cpu, pc, base_insn, entire_insn); goto done;
420       case 53 : itype = MT_INSN_BREQ; mt_extract_sfmt_brlt (this, current_cpu, pc, base_insn, entire_insn); goto done;
421       case 55 :
422         if ((entire_insn & 0xffff0000) == 0x37000000)
423           { itype = MT_INSN_JMP; mt_extract_sfmt_jmp (this, current_cpu, pc, base_insn, entire_insn); goto done; }
424         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
425       case 56 :
426         if ((entire_insn & 0xff0f0fff) == 0x38000000)
427           { itype = MT_INSN_JAL; mt_extract_sfmt_jal (this, current_cpu, pc, base_insn, entire_insn); goto done; }
428         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
429       case 59 : itype = MT_INSN_BRNE; mt_extract_sfmt_brlt (this, current_cpu, pc, base_insn, entire_insn); goto done;
430       case 61 :
431         if ((entire_insn & 0xff0f0000) == 0x3d000000)
432           { itype = MT_INSN_DBNZ; mt_extract_sfmt_dbnz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
433         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
434       case 65 : itype = MT_INSN_LDW; mt_extract_sfmt_ldw (this, current_cpu, pc, base_insn, entire_insn); goto done;
435       case 67 : itype = MT_INSN_STW; mt_extract_sfmt_stw (this, current_cpu, pc, base_insn, entire_insn); goto done;
436       case 96 :
437         if ((entire_insn & 0xffffffff) == 0x60000000)
438           { itype = MT_INSN_EI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
439         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
440       case 98 :
441         if ((entire_insn & 0xffffffff) == 0x62000000)
442           { itype = MT_INSN_DI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
443         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
444       case 100 :
445         if ((entire_insn & 0xffff0fff) == 0x64000000)
446           { itype = MT_INSN_SI; mt_extract_sfmt_si (this, current_cpu, pc, base_insn, entire_insn); goto done; }
447         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
448       case 102 :
449         if ((entire_insn & 0xff0fffff) == 0x66000000)
450           { itype = MT_INSN_RETI; mt_extract_sfmt_reti (this, current_cpu, pc, base_insn, entire_insn); goto done; }
451         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
452       case 104 :
453         if ((entire_insn & 0xffffffff) == 0x68000000)
454           { itype = MT_INSN_BREAK; mt_extract_sfmt_break (this, current_cpu, pc, base_insn, entire_insn); goto done; }
455         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
456       case 106 :
457         if ((entire_insn & 0xffffffff) == 0x6a000000)
458           { itype = MT_INSN_IFLUSH; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
459         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
460       case 140 : /* fall through */
461       case 141 : /* fall through */
462       case 142 : /* fall through */
463       case 143 :
464         if ((entire_insn & 0xfc00f000) == 0x8c000000)
465           { itype = MT_INSN_FBCB; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
466         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
467       case 144 : /* fall through */
468       case 145 : /* fall through */
469       case 146 : /* fall through */
470       case 147 :
471         if ((entire_insn & 0xfc00f000) == 0x90000000)
472           { itype = MT_INSN_MFBCB; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
473         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
474       case 148 : /* fall through */
475       case 149 : /* fall through */
476       case 150 : /* fall through */
477       case 151 : itype = MT_INSN_FBCCI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
478       case 152 : /* fall through */
479       case 153 : /* fall through */
480       case 154 : /* fall through */
481       case 155 : itype = MT_INSN_FBRCI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
482       case 156 : /* fall through */
483       case 157 : /* fall through */
484       case 158 : /* fall through */
485       case 159 : itype = MT_INSN_FBCRI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
486       case 160 : /* fall through */
487       case 161 : /* fall through */
488       case 162 : /* fall through */
489       case 163 : itype = MT_INSN_FBRRI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
490       case 164 : /* fall through */
491       case 165 : /* fall through */
492       case 166 : /* fall through */
493       case 167 : itype = MT_INSN_MFBCCI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
494       case 168 : /* fall through */
495       case 169 : /* fall through */
496       case 170 : /* fall through */
497       case 171 : itype = MT_INSN_MFBRCI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
498       case 172 : /* fall through */
499       case 173 : /* fall through */
500       case 174 : /* fall through */
501       case 175 : itype = MT_INSN_MFBCRI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
502       case 176 : /* fall through */
503       case 177 : /* fall through */
504       case 178 : /* fall through */
505       case 179 : itype = MT_INSN_MFBRRI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
506       case 180 : /* fall through */
507       case 181 : /* fall through */
508       case 182 : /* fall through */
509       case 183 : itype = MT_INSN_FBCBDR; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
510       case 184 : /* fall through */
511       case 185 : /* fall through */
512       case 186 : /* fall through */
513       case 187 :
514         if ((entire_insn & 0xfcc08000) == 0xb8000000)
515           { itype = MT_INSN_RCFBCB; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
516         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
517       case 188 : /* fall through */
518       case 189 : /* fall through */
519       case 190 : /* fall through */
520       case 191 :
521         if ((entire_insn & 0xfcc08000) == 0xbc000000)
522           { itype = MT_INSN_MRCFBCB; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
523         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
524       case 192 : /* fall through */
525       case 193 : /* fall through */
526       case 194 : /* fall through */
527       case 195 :
528         if ((entire_insn & 0xfc000380) == 0xc0000000)
529           { itype = MT_INSN_CBCAST; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
530         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
531       case 196 : /* fall through */
532       case 197 : /* fall through */
533       case 198 : /* fall through */
534       case 199 : itype = MT_INSN_DUPCBCAST; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
535       case 200 : /* fall through */
536       case 201 : /* fall through */
537       case 202 : /* fall through */
538       case 203 : itype = MT_INSN_WFBI; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
539       case 204 :
540         if ((entire_insn & 0xff000040) == 0xcc000000)
541           { itype = MT_INSN_WFB; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
542         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
543       case 208 : /* fall through */
544       case 209 : /* fall through */
545       case 210 : /* fall through */
546       case 211 :
547         if ((entire_insn & 0xfc080000) == 0xd0000000)
548           { itype = MT_INSN_RCRISC; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
549         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
550       case 212 : /* fall through */
551       case 213 : /* fall through */
552       case 214 : /* fall through */
553       case 215 : itype = MT_INSN_FBCBINC; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
554       case 216 : /* fall through */
555       case 217 : /* fall through */
556       case 218 : /* fall through */
557       case 219 : itype = MT_INSN_RCXMODE; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
558       case 220 : /* fall through */
559       case 221 : /* fall through */
560       case 222 : /* fall through */
561       case 223 :
562         if ((entire_insn & 0xfc008000) == 0xdc000000)
563           { itype = MT_INSN_INTERLEAVER; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
564         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
565       case 224 : /* fall through */
566       case 225 : /* fall through */
567       case 226 : /* fall through */
568       case 227 : itype = MT_INSN_WFBINC; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
569       case 228 : /* fall through */
570       case 229 : /* fall through */
571       case 230 : /* fall through */
572       case 231 : itype = MT_INSN_MWFBINC; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
573       case 232 : /* fall through */
574       case 233 : /* fall through */
575       case 234 : /* fall through */
576       case 235 : itype = MT_INSN_WFBINCR; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
577       case 236 : /* fall through */
578       case 237 : /* fall through */
579       case 238 : /* fall through */
580       case 239 : itype = MT_INSN_MWFBINCR; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
581       case 240 : /* fall through */
582       case 241 : /* fall through */
583       case 242 : /* fall through */
584       case 243 : itype = MT_INSN_FBCBINCS; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
585       case 244 : /* fall through */
586       case 245 : /* fall through */
587       case 246 : /* fall through */
588       case 247 : itype = MT_INSN_MFBCBINCS; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done;
589       case 248 : /* fall through */
590       case 249 : /* fall through */
591       case 250 : /* fall through */
592       case 251 :
593         if ((entire_insn & 0xfc008000) == 0xf8000000)
594           { itype = MT_INSN_FBCBINCRS; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
595         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
596       case 252 : /* fall through */
597       case 253 : /* fall through */
598       case 254 : /* fall through */
599       case 255 :
600         if ((entire_insn & 0xfc008000) == 0xfc000000)
601           { itype = MT_INSN_MFBCBINCRS; mt_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
602         itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
603       default : itype = MT_INSN_X_INVALID; mt_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
604       }
605     }
606
607   }
608
609   /* The instruction has been decoded and fields extracted.  */
610   done:
611
612   this->addr = pc;
613   // FIXME: To be redone (to handle ISA variants).
614   this->idesc = & mt_idesc::idesc_table[itype];
615   // ??? record semantic handler?
616   assert(this->idesc->sem_index == itype);
617 }
618
619 void
620 mt_extract_sfmt_empty (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
621     mt_insn_word insn = entire_insn;
622 #define FLD(f) abuf->fields.fmt_empty.f
623
624
625   /* Record the fields for the semantic handler.  */
626   if (UNLIKELY(current_cpu->trace_extract_p))
627     {
628       current_cpu->trace_stream 
629         << "0x" << hex << pc << dec << " (sfmt_empty)\t"
630         << endl;
631     }
632
633 #undef FLD
634 }
635
636 void
637 mt_extract_sfmt_add (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
638     mt_insn_word insn = entire_insn;
639 #define FLD(f) abuf->fields.sfmt_add.f
640     UINT f_sr1;
641     UINT f_sr2;
642     UINT f_drrr;
643
644     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
645     f_sr2 = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
646     f_drrr = EXTRACT_LSB0_UINT (insn, 32, 15, 4);
647
648   /* Record the fields for the semantic handler.  */
649   FLD (f_sr1) = f_sr1;
650   FLD (f_sr2) = f_sr2;
651   FLD (f_drrr) = f_drrr;
652   if (UNLIKELY(current_cpu->trace_extract_p))
653     {
654       current_cpu->trace_stream 
655         << "0x" << hex << pc << dec << " (sfmt_add)\t"
656         << " f_sr1:0x" << hex << f_sr1 << dec
657         << " f_sr2:0x" << hex << f_sr2 << dec
658         << " f_drrr:0x" << hex << f_drrr << dec
659         << endl;
660     }
661
662 #undef FLD
663 }
664
665 void
666 mt_extract_sfmt_addi (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
667     mt_insn_word insn = entire_insn;
668 #define FLD(f) abuf->fields.sfmt_addi.f
669     UINT f_sr1;
670     UINT f_dr;
671     HI f_imm16s;
672
673     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
674     f_dr = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
675     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
676
677   /* Record the fields for the semantic handler.  */
678   FLD (f_sr1) = f_sr1;
679   FLD (f_imm16s) = f_imm16s;
680   FLD (f_dr) = f_dr;
681   if (UNLIKELY(current_cpu->trace_extract_p))
682     {
683       current_cpu->trace_stream 
684         << "0x" << hex << pc << dec << " (sfmt_addi)\t"
685         << " f_sr1:0x" << hex << f_sr1 << dec
686         << " f_imm16s:0x" << hex << f_imm16s << dec
687         << " f_dr:0x" << hex << f_dr << dec
688         << endl;
689     }
690
691 #undef FLD
692 }
693
694 void
695 mt_extract_sfmt_addui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
696     mt_insn_word insn = entire_insn;
697 #define FLD(f) abuf->fields.sfmt_addui.f
698     UINT f_sr1;
699     UINT f_dr;
700     UINT f_imm16u;
701
702     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
703     f_dr = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
704     f_imm16u = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
705
706   /* Record the fields for the semantic handler.  */
707   FLD (f_sr1) = f_sr1;
708   FLD (f_imm16u) = f_imm16u;
709   FLD (f_dr) = f_dr;
710   if (UNLIKELY(current_cpu->trace_extract_p))
711     {
712       current_cpu->trace_stream 
713         << "0x" << hex << pc << dec << " (sfmt_addui)\t"
714         << " f_sr1:0x" << hex << f_sr1 << dec
715         << " f_imm16u:0x" << hex << f_imm16u << dec
716         << " f_dr:0x" << hex << f_dr << dec
717         << endl;
718     }
719
720 #undef FLD
721 }
722
723 void
724 mt_extract_sfmt_nop (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
725     mt_insn_word insn = entire_insn;
726 #define FLD(f) abuf->fields.fmt_empty.f
727
728
729   /* Record the fields for the semantic handler.  */
730   if (UNLIKELY(current_cpu->trace_extract_p))
731     {
732       current_cpu->trace_stream 
733         << "0x" << hex << pc << dec << " (sfmt_nop)\t"
734         << endl;
735     }
736
737 #undef FLD
738 }
739
740 void
741 mt_extract_sfmt_ldui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
742     mt_insn_word insn = entire_insn;
743 #define FLD(f) abuf->fields.sfmt_addui.f
744     UINT f_dr;
745     UINT f_imm16u;
746
747     f_dr = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
748     f_imm16u = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
749
750   /* Record the fields for the semantic handler.  */
751   FLD (f_imm16u) = f_imm16u;
752   FLD (f_dr) = f_dr;
753   if (UNLIKELY(current_cpu->trace_extract_p))
754     {
755       current_cpu->trace_stream 
756         << "0x" << hex << pc << dec << " (sfmt_ldui)\t"
757         << " f_imm16u:0x" << hex << f_imm16u << dec
758         << " f_dr:0x" << hex << f_dr << dec
759         << endl;
760     }
761
762 #undef FLD
763 }
764
765 void
766 mt_extract_sfmt_brlt (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
767     mt_insn_word insn = entire_insn;
768 #define FLD(f) abuf->fields.sfmt_brlt.f
769     UINT f_sr1;
770     UINT f_sr2;
771     HI f_imm16s;
772
773     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
774     f_sr2 = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
775     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
776
777   /* Record the fields for the semantic handler.  */
778   FLD (f_sr1) = f_sr1;
779   FLD (f_sr2) = f_sr2;
780   FLD (f_imm16s) = f_imm16s;
781   if (UNLIKELY(current_cpu->trace_extract_p))
782     {
783       current_cpu->trace_stream 
784         << "0x" << hex << pc << dec << " (sfmt_brlt)\t"
785         << " f_sr1:0x" << hex << f_sr1 << dec
786         << " f_sr2:0x" << hex << f_sr2 << dec
787         << " f_imm16s:0x" << hex << f_imm16s << dec
788         << endl;
789     }
790
791 #undef FLD
792 }
793
794 void
795 mt_extract_sfmt_jmp (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
796     mt_insn_word insn = entire_insn;
797 #define FLD(f) abuf->fields.sfmt_brlt.f
798     HI f_imm16s;
799
800     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
801
802   /* Record the fields for the semantic handler.  */
803   FLD (f_imm16s) = f_imm16s;
804   if (UNLIKELY(current_cpu->trace_extract_p))
805     {
806       current_cpu->trace_stream 
807         << "0x" << hex << pc << dec << " (sfmt_jmp)\t"
808         << " f_imm16s:0x" << hex << f_imm16s << dec
809         << endl;
810     }
811
812 #undef FLD
813 }
814
815 void
816 mt_extract_sfmt_jal (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
817     mt_insn_word insn = entire_insn;
818 #define FLD(f) abuf->fields.sfmt_add.f
819     UINT f_sr1;
820     UINT f_drrr;
821
822     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
823     f_drrr = EXTRACT_LSB0_UINT (insn, 32, 15, 4);
824
825   /* Record the fields for the semantic handler.  */
826   FLD (f_drrr) = f_drrr;
827   FLD (f_sr1) = f_sr1;
828   if (UNLIKELY(current_cpu->trace_extract_p))
829     {
830       current_cpu->trace_stream 
831         << "0x" << hex << pc << dec << " (sfmt_jal)\t"
832         << " f_drrr:0x" << hex << f_drrr << dec
833         << " f_sr1:0x" << hex << f_sr1 << dec
834         << endl;
835     }
836
837 #undef FLD
838 }
839
840 void
841 mt_extract_sfmt_dbnz (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
842     mt_insn_word insn = entire_insn;
843 #define FLD(f) abuf->fields.sfmt_brlt.f
844     UINT f_sr1;
845     HI f_imm16s;
846
847     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
848     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
849
850   /* Record the fields for the semantic handler.  */
851   FLD (f_sr1) = f_sr1;
852   FLD (f_imm16s) = f_imm16s;
853   if (UNLIKELY(current_cpu->trace_extract_p))
854     {
855       current_cpu->trace_stream 
856         << "0x" << hex << pc << dec << " (sfmt_dbnz)\t"
857         << " f_sr1:0x" << hex << f_sr1 << dec
858         << " f_imm16s:0x" << hex << f_imm16s << dec
859         << endl;
860     }
861
862 #undef FLD
863 }
864
865 void
866 mt_extract_sfmt_si (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
867     mt_insn_word insn = entire_insn;
868 #define FLD(f) abuf->fields.sfmt_add.f
869     UINT f_drrr;
870
871     f_drrr = EXTRACT_LSB0_UINT (insn, 32, 15, 4);
872
873   /* Record the fields for the semantic handler.  */
874   FLD (f_drrr) = f_drrr;
875   if (UNLIKELY(current_cpu->trace_extract_p))
876     {
877       current_cpu->trace_stream 
878         << "0x" << hex << pc << dec << " (sfmt_si)\t"
879         << " f_drrr:0x" << hex << f_drrr << dec
880         << endl;
881     }
882
883 #undef FLD
884 }
885
886 void
887 mt_extract_sfmt_reti (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
888     mt_insn_word insn = entire_insn;
889 #define FLD(f) abuf->fields.sfmt_brlt.f
890     UINT f_sr1;
891
892     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
893
894   /* Record the fields for the semantic handler.  */
895   FLD (f_sr1) = f_sr1;
896   if (UNLIKELY(current_cpu->trace_extract_p))
897     {
898       current_cpu->trace_stream 
899         << "0x" << hex << pc << dec << " (sfmt_reti)\t"
900         << " f_sr1:0x" << hex << f_sr1 << dec
901         << endl;
902     }
903
904 #undef FLD
905 }
906
907 void
908 mt_extract_sfmt_ldw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
909     mt_insn_word insn = entire_insn;
910 #define FLD(f) abuf->fields.sfmt_addi.f
911     UINT f_sr1;
912     UINT f_dr;
913     HI f_imm16s;
914
915     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
916     f_dr = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
917     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
918
919   /* Record the fields for the semantic handler.  */
920   FLD (f_sr1) = f_sr1;
921   FLD (f_imm16s) = f_imm16s;
922   FLD (f_dr) = f_dr;
923   if (UNLIKELY(current_cpu->trace_extract_p))
924     {
925       current_cpu->trace_stream 
926         << "0x" << hex << pc << dec << " (sfmt_ldw)\t"
927         << " f_sr1:0x" << hex << f_sr1 << dec
928         << " f_imm16s:0x" << hex << f_imm16s << dec
929         << " f_dr:0x" << hex << f_dr << dec
930         << endl;
931     }
932
933 #undef FLD
934 }
935
936 void
937 mt_extract_sfmt_stw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
938     mt_insn_word insn = entire_insn;
939 #define FLD(f) abuf->fields.sfmt_brlt.f
940     UINT f_sr1;
941     UINT f_sr2;
942     HI f_imm16s;
943
944     f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
945     f_sr2 = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
946     f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
947
948   /* Record the fields for the semantic handler.  */
949   FLD (f_sr1) = f_sr1;
950   FLD (f_sr2) = f_sr2;
951   FLD (f_imm16s) = f_imm16s;
952   if (UNLIKELY(current_cpu->trace_extract_p))
953     {
954       current_cpu->trace_stream 
955         << "0x" << hex << pc << dec << " (sfmt_stw)\t"
956         << " f_sr1:0x" << hex << f_sr1 << dec
957         << " f_sr2:0x" << hex << f_sr2 << dec
958         << " f_imm16s:0x" << hex << f_imm16s << dec
959         << endl;
960     }
961
962 #undef FLD
963 }
964
965 void
966 mt_extract_sfmt_break (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn){
967     mt_insn_word insn = entire_insn;
968 #define FLD(f) abuf->fields.fmt_empty.f
969
970
971   /* Record the fields for the semantic handler.  */
972   if (UNLIKELY(current_cpu->trace_extract_p))
973     {
974       current_cpu->trace_stream 
975         << "0x" << hex << pc << dec << " (sfmt_break)\t"
976         << endl;
977     }
978
979 #undef FLD
980 }
981