1 /* Simulator instruction decoder for mt.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 2000-2010 Red Hat, Inc.
7 This file is part of the Red Hat simulators.
18 using namespace mt; // FIXME: namespace organization still wip
21 // The instruction descriptor array.
23 mt_idesc mt_idesc::idesc_table[MT_INSN_MFBCBINCRS + 1] =
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) } },
103 // Given a canonical virtual insn id, return the target specific one.
106 mt_idesc::lookup_virtual (virtual_insn_type vit)
110 case VIRTUAL_INSN_INVALID: return MT_INSN_X_INVALID;
111 case VIRTUAL_INSN_COND: return MT_INSN_X_INVALID;
117 // Declare extractor functions
120 mt_extract_sfmt_empty (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
122 mt_extract_sfmt_add (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
124 mt_extract_sfmt_addi (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
126 mt_extract_sfmt_addui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
128 mt_extract_sfmt_nop (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
130 mt_extract_sfmt_ldui (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
132 mt_extract_sfmt_brlt (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
134 mt_extract_sfmt_jmp (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
136 mt_extract_sfmt_jal (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
138 mt_extract_sfmt_dbnz (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
140 mt_extract_sfmt_si (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
142 mt_extract_sfmt_reti (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
144 mt_extract_sfmt_ldw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
146 mt_extract_sfmt_stw (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
148 mt_extract_sfmt_break (mt_scache* abuf, mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn);
150 // Fetch & decode instruction
152 mt_scache::decode (mt_cpu* current_cpu, PCADDR pc, mt_insn_word base_insn, mt_insn_word entire_insn)
154 /* Result of decoder. */
158 mt_insn_word insn = base_insn;
161 unsigned int val = (((insn >> 24) & (255 << 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;
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;
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;
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;
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;
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;
196 unsigned int val = (((insn >> 12) & (127 << 0)));
201 unsigned int val = (((insn >> 19) & (31 << 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 */
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;
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 */
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;
378 case 19 : itype = MT_INSN_ORI; mt_extract_sfmt_addui (this, current_cpu, pc, base_insn, entire_insn); goto done;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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 */
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 */
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 */
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 */
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 */
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;
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 */
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 */
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 */
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 */
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;
609 /* The instruction has been decoded and fields extracted. */
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);
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
625 /* Record the fields for the semantic handler. */
626 if (UNLIKELY(current_cpu->trace_extract_p))
628 current_cpu->trace_stream
629 << "0x" << hex << pc << dec << " (sfmt_empty)\t"
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
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);
648 /* Record the fields for the semantic handler. */
651 FLD (f_drrr) = f_drrr;
652 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
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));
677 /* Record the fields for the semantic handler. */
679 FLD (f_imm16s) = f_imm16s;
681 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
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);
706 /* Record the fields for the semantic handler. */
708 FLD (f_imm16u) = f_imm16u;
710 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
729 /* Record the fields for the semantic handler. */
730 if (UNLIKELY(current_cpu->trace_extract_p))
732 current_cpu->trace_stream
733 << "0x" << hex << pc << dec << " (sfmt_nop)\t"
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
747 f_dr = EXTRACT_LSB0_UINT (insn, 32, 19, 4);
748 f_imm16u = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
750 /* Record the fields for the semantic handler. */
751 FLD (f_imm16u) = f_imm16u;
753 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
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));
777 /* Record the fields for the semantic handler. */
780 FLD (f_imm16s) = f_imm16s;
781 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
800 f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
802 /* Record the fields for the semantic handler. */
803 FLD (f_imm16s) = f_imm16s;
804 if (UNLIKELY(current_cpu->trace_extract_p))
806 current_cpu->trace_stream
807 << "0x" << hex << pc << dec << " (sfmt_jmp)\t"
808 << " f_imm16s:0x" << hex << f_imm16s << dec
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
822 f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
823 f_drrr = EXTRACT_LSB0_UINT (insn, 32, 15, 4);
825 /* Record the fields for the semantic handler. */
826 FLD (f_drrr) = f_drrr;
828 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
847 f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
848 f_imm16s = ((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) + (0));
850 /* Record the fields for the semantic handler. */
852 FLD (f_imm16s) = f_imm16s;
853 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
871 f_drrr = EXTRACT_LSB0_UINT (insn, 32, 15, 4);
873 /* Record the fields for the semantic handler. */
874 FLD (f_drrr) = f_drrr;
875 if (UNLIKELY(current_cpu->trace_extract_p))
877 current_cpu->trace_stream
878 << "0x" << hex << pc << dec << " (sfmt_si)\t"
879 << " f_drrr:0x" << hex << f_drrr << dec
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
892 f_sr1 = EXTRACT_LSB0_UINT (insn, 32, 23, 4);
894 /* Record the fields for the semantic handler. */
896 if (UNLIKELY(current_cpu->trace_extract_p))
898 current_cpu->trace_stream
899 << "0x" << hex << pc << dec << " (sfmt_reti)\t"
900 << " f_sr1:0x" << hex << f_sr1 << dec
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
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));
919 /* Record the fields for the semantic handler. */
921 FLD (f_imm16s) = f_imm16s;
923 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
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));
948 /* Record the fields for the semantic handler. */
951 FLD (f_imm16s) = f_imm16s;
952 if (UNLIKELY(current_cpu->trace_extract_p))
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
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
971 /* Record the fields for the semantic handler. */
972 if (UNLIKELY(current_cpu->trace_extract_p))
974 current_cpu->trace_stream
975 << "0x" << hex << pc << dec << " (sfmt_break)\t"