OSDN Git Service

b1c2603ee7a81bc934c3f6bd1e9c85942a561f8a
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / m32r / m32r-decode.cxx
1 /* Simulator instruction decoder for m32rbf.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000-2009 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 "m32rbf.h"
17
18 using namespace m32rbf; // FIXME: namespace organization still wip
19
20
21 // The instruction descriptor array. 
22
23 m32rbf_idesc m32rbf_idesc::idesc_table[M32RBF_INSN_BTST + 1] =
24 {
25   { m32rbf_sem_x_invalid, "X_INVALID", M32RBF_INSN_X_INVALID, { 0|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), PIPE_NONE } },
26   { m32rbf_sem_add, "ADD", M32RBF_INSN_ADD, { 0, (1<<MACH_BASE), PIPE_OS } },
27   { m32rbf_sem_add3, "ADD3", M32RBF_INSN_ADD3, { 0, (1<<MACH_BASE), PIPE_NONE } },
28   { m32rbf_sem_and, "AND", M32RBF_INSN_AND, { 0, (1<<MACH_BASE), PIPE_OS } },
29   { m32rbf_sem_and3, "AND3", M32RBF_INSN_AND3, { 0, (1<<MACH_BASE), PIPE_NONE } },
30   { m32rbf_sem_or, "OR", M32RBF_INSN_OR, { 0, (1<<MACH_BASE), PIPE_OS } },
31   { m32rbf_sem_or3, "OR3", M32RBF_INSN_OR3, { 0, (1<<MACH_BASE), PIPE_NONE } },
32   { m32rbf_sem_xor, "XOR", M32RBF_INSN_XOR, { 0, (1<<MACH_BASE), PIPE_OS } },
33   { m32rbf_sem_xor3, "XOR3", M32RBF_INSN_XOR3, { 0, (1<<MACH_BASE), PIPE_NONE } },
34   { m32rbf_sem_addi, "ADDI", M32RBF_INSN_ADDI, { 0, (1<<MACH_BASE), PIPE_OS } },
35   { m32rbf_sem_addv, "ADDV", M32RBF_INSN_ADDV, { 0, (1<<MACH_BASE), PIPE_OS } },
36   { m32rbf_sem_addv3, "ADDV3", M32RBF_INSN_ADDV3, { 0, (1<<MACH_BASE), PIPE_NONE } },
37   { m32rbf_sem_addx, "ADDX", M32RBF_INSN_ADDX, { 0, (1<<MACH_BASE), PIPE_OS } },
38   { m32rbf_sem_bc8, "BC8", M32RBF_INSN_BC8, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_O } },
39   { m32rbf_sem_bc24, "BC24", M32RBF_INSN_BC24, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
40   { m32rbf_sem_beq, "BEQ", M32RBF_INSN_BEQ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
41   { m32rbf_sem_beqz, "BEQZ", M32RBF_INSN_BEQZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
42   { m32rbf_sem_bgez, "BGEZ", M32RBF_INSN_BGEZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
43   { m32rbf_sem_bgtz, "BGTZ", M32RBF_INSN_BGTZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
44   { m32rbf_sem_blez, "BLEZ", M32RBF_INSN_BLEZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
45   { m32rbf_sem_bltz, "BLTZ", M32RBF_INSN_BLTZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
46   { m32rbf_sem_bnez, "BNEZ", M32RBF_INSN_BNEZ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
47   { m32rbf_sem_bl8, "BL8", M32RBF_INSN_BL8, { 0|(1<<CGEN_INSN_FILL_SLOT)|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
48   { m32rbf_sem_bl24, "BL24", M32RBF_INSN_BL24, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_NONE } },
49   { m32rbf_sem_bnc8, "BNC8", M32RBF_INSN_BNC8, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_O } },
50   { m32rbf_sem_bnc24, "BNC24", M32RBF_INSN_BNC24, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
51   { m32rbf_sem_bne, "BNE", M32RBF_INSN_BNE, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), PIPE_NONE } },
52   { m32rbf_sem_bra8, "BRA8", M32RBF_INSN_BRA8, { 0|(1<<CGEN_INSN_FILL_SLOT)|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
53   { m32rbf_sem_bra24, "BRA24", M32RBF_INSN_BRA24, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_NONE } },
54   { m32rbf_sem_cmp, "CMP", M32RBF_INSN_CMP, { 0, (1<<MACH_BASE), PIPE_OS } },
55   { m32rbf_sem_cmpi, "CMPI", M32RBF_INSN_CMPI, { 0, (1<<MACH_BASE), PIPE_NONE } },
56   { m32rbf_sem_cmpu, "CMPU", M32RBF_INSN_CMPU, { 0, (1<<MACH_BASE), PIPE_OS } },
57   { m32rbf_sem_cmpui, "CMPUI", M32RBF_INSN_CMPUI, { 0, (1<<MACH_BASE), PIPE_NONE } },
58   { m32rbf_sem_div, "DIV", M32RBF_INSN_DIV, { 0, (1<<MACH_BASE), PIPE_NONE } },
59   { m32rbf_sem_divu, "DIVU", M32RBF_INSN_DIVU, { 0, (1<<MACH_BASE), PIPE_NONE } },
60   { m32rbf_sem_rem, "REM", M32RBF_INSN_REM, { 0, (1<<MACH_BASE), PIPE_NONE } },
61   { m32rbf_sem_remu, "REMU", M32RBF_INSN_REMU, { 0, (1<<MACH_BASE), PIPE_NONE } },
62   { m32rbf_sem_jl, "JL", M32RBF_INSN_JL, { 0|(1<<CGEN_INSN_FILL_SLOT)|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
63   { m32rbf_sem_jmp, "JMP", M32RBF_INSN_JMP, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
64   { m32rbf_sem_ld, "LD", M32RBF_INSN_LD, { 0, (1<<MACH_BASE), PIPE_O } },
65   { m32rbf_sem_ld_d, "LD_D", M32RBF_INSN_LD_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
66   { m32rbf_sem_ldb, "LDB", M32RBF_INSN_LDB, { 0, (1<<MACH_BASE), PIPE_O } },
67   { m32rbf_sem_ldb_d, "LDB_D", M32RBF_INSN_LDB_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
68   { m32rbf_sem_ldh, "LDH", M32RBF_INSN_LDH, { 0, (1<<MACH_BASE), PIPE_O } },
69   { m32rbf_sem_ldh_d, "LDH_D", M32RBF_INSN_LDH_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
70   { m32rbf_sem_ldub, "LDUB", M32RBF_INSN_LDUB, { 0, (1<<MACH_BASE), PIPE_O } },
71   { m32rbf_sem_ldub_d, "LDUB_D", M32RBF_INSN_LDUB_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
72   { m32rbf_sem_lduh, "LDUH", M32RBF_INSN_LDUH, { 0, (1<<MACH_BASE), PIPE_O } },
73   { m32rbf_sem_lduh_d, "LDUH_D", M32RBF_INSN_LDUH_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
74   { m32rbf_sem_ld_plus, "LD_PLUS", M32RBF_INSN_LD_PLUS, { 0, (1<<MACH_BASE), PIPE_O } },
75   { m32rbf_sem_ld24, "LD24", M32RBF_INSN_LD24, { 0, (1<<MACH_BASE), PIPE_NONE } },
76   { m32rbf_sem_ldi8, "LDI8", M32RBF_INSN_LDI8, { 0, (1<<MACH_BASE), PIPE_OS } },
77   { m32rbf_sem_ldi16, "LDI16", M32RBF_INSN_LDI16, { 0, (1<<MACH_BASE), PIPE_NONE } },
78   { m32rbf_sem_lock, "LOCK", M32RBF_INSN_LOCK, { 0, (1<<MACH_BASE), PIPE_O } },
79   { m32rbf_sem_machi, "MACHI", M32RBF_INSN_MACHI, { 0, (1<<MACH_M32R), PIPE_S } },
80   { m32rbf_sem_maclo, "MACLO", M32RBF_INSN_MACLO, { 0, (1<<MACH_M32R), PIPE_S } },
81   { m32rbf_sem_macwhi, "MACWHI", M32RBF_INSN_MACWHI, { 0, (1<<MACH_M32R), PIPE_S } },
82   { m32rbf_sem_macwlo, "MACWLO", M32RBF_INSN_MACWLO, { 0, (1<<MACH_M32R), PIPE_S } },
83   { m32rbf_sem_mul, "MUL", M32RBF_INSN_MUL, { 0, (1<<MACH_BASE), PIPE_S } },
84   { m32rbf_sem_mulhi, "MULHI", M32RBF_INSN_MULHI, { 0, (1<<MACH_M32R), PIPE_S } },
85   { m32rbf_sem_mullo, "MULLO", M32RBF_INSN_MULLO, { 0, (1<<MACH_M32R), PIPE_S } },
86   { m32rbf_sem_mulwhi, "MULWHI", M32RBF_INSN_MULWHI, { 0, (1<<MACH_M32R), PIPE_S } },
87   { m32rbf_sem_mulwlo, "MULWLO", M32RBF_INSN_MULWLO, { 0, (1<<MACH_M32R), PIPE_S } },
88   { m32rbf_sem_mv, "MV", M32RBF_INSN_MV, { 0, (1<<MACH_BASE), PIPE_OS } },
89   { m32rbf_sem_mvfachi, "MVFACHI", M32RBF_INSN_MVFACHI, { 0, (1<<MACH_M32R), PIPE_S } },
90   { m32rbf_sem_mvfaclo, "MVFACLO", M32RBF_INSN_MVFACLO, { 0, (1<<MACH_M32R), PIPE_S } },
91   { m32rbf_sem_mvfacmi, "MVFACMI", M32RBF_INSN_MVFACMI, { 0, (1<<MACH_M32R), PIPE_S } },
92   { m32rbf_sem_mvfc, "MVFC", M32RBF_INSN_MVFC, { 0, (1<<MACH_BASE), PIPE_O } },
93   { m32rbf_sem_mvtachi, "MVTACHI", M32RBF_INSN_MVTACHI, { 0, (1<<MACH_M32R), PIPE_S } },
94   { m32rbf_sem_mvtaclo, "MVTACLO", M32RBF_INSN_MVTACLO, { 0, (1<<MACH_M32R), PIPE_S } },
95   { m32rbf_sem_mvtc, "MVTC", M32RBF_INSN_MVTC, { 0, (1<<MACH_BASE), PIPE_O } },
96   { m32rbf_sem_neg, "NEG", M32RBF_INSN_NEG, { 0, (1<<MACH_BASE), PIPE_OS } },
97   { m32rbf_sem_nop, "NOP", M32RBF_INSN_NOP, { 0, (1<<MACH_BASE), PIPE_OS } },
98   { m32rbf_sem_not, "NOT", M32RBF_INSN_NOT, { 0, (1<<MACH_BASE), PIPE_OS } },
99   { m32rbf_sem_rac, "RAC", M32RBF_INSN_RAC, { 0, (1<<MACH_M32R), PIPE_S } },
100   { m32rbf_sem_rach, "RACH", M32RBF_INSN_RACH, { 0, (1<<MACH_M32R), PIPE_S } },
101   { m32rbf_sem_rte, "RTE", M32RBF_INSN_RTE, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
102   { m32rbf_sem_seth, "SETH", M32RBF_INSN_SETH, { 0, (1<<MACH_BASE), PIPE_NONE } },
103   { m32rbf_sem_sll, "SLL", M32RBF_INSN_SLL, { 0, (1<<MACH_BASE), PIPE_O_OS } },
104   { m32rbf_sem_sll3, "SLL3", M32RBF_INSN_SLL3, { 0, (1<<MACH_BASE), PIPE_NONE } },
105   { m32rbf_sem_slli, "SLLI", M32RBF_INSN_SLLI, { 0, (1<<MACH_BASE), PIPE_O_OS } },
106   { m32rbf_sem_sra, "SRA", M32RBF_INSN_SRA, { 0, (1<<MACH_BASE), PIPE_O_OS } },
107   { m32rbf_sem_sra3, "SRA3", M32RBF_INSN_SRA3, { 0, (1<<MACH_BASE), PIPE_NONE } },
108   { m32rbf_sem_srai, "SRAI", M32RBF_INSN_SRAI, { 0, (1<<MACH_BASE), PIPE_O_OS } },
109   { m32rbf_sem_srl, "SRL", M32RBF_INSN_SRL, { 0, (1<<MACH_BASE), PIPE_O_OS } },
110   { m32rbf_sem_srl3, "SRL3", M32RBF_INSN_SRL3, { 0, (1<<MACH_BASE), PIPE_NONE } },
111   { m32rbf_sem_srli, "SRLI", M32RBF_INSN_SRLI, { 0, (1<<MACH_BASE), PIPE_O_OS } },
112   { m32rbf_sem_st, "ST", M32RBF_INSN_ST, { 0, (1<<MACH_BASE), PIPE_O } },
113   { m32rbf_sem_st_d, "ST_D", M32RBF_INSN_ST_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
114   { m32rbf_sem_stb, "STB", M32RBF_INSN_STB, { 0, (1<<MACH_BASE), PIPE_O } },
115   { m32rbf_sem_stb_d, "STB_D", M32RBF_INSN_STB_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
116   { m32rbf_sem_sth, "STH", M32RBF_INSN_STH, { 0, (1<<MACH_BASE), PIPE_O } },
117   { m32rbf_sem_sth_d, "STH_D", M32RBF_INSN_STH_D, { 0, (1<<MACH_BASE), PIPE_NONE } },
118   { m32rbf_sem_st_plus, "ST_PLUS", M32RBF_INSN_ST_PLUS, { 0, (1<<MACH_BASE), PIPE_O } },
119   { m32rbf_sem_st_minus, "ST_MINUS", M32RBF_INSN_ST_MINUS, { 0, (1<<MACH_BASE), PIPE_O } },
120   { m32rbf_sem_sub, "SUB", M32RBF_INSN_SUB, { 0, (1<<MACH_BASE), PIPE_OS } },
121   { m32rbf_sem_subv, "SUBV", M32RBF_INSN_SUBV, { 0, (1<<MACH_BASE), PIPE_OS } },
122   { m32rbf_sem_subx, "SUBX", M32RBF_INSN_SUBX, { 0, (1<<MACH_BASE), PIPE_OS } },
123   { m32rbf_sem_trap, "TRAP", M32RBF_INSN_TRAP, { 0|(1<<CGEN_INSN_FILL_SLOT)|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), PIPE_O } },
124   { m32rbf_sem_unlock, "UNLOCK", M32RBF_INSN_UNLOCK, { 0, (1<<MACH_BASE), PIPE_O } },
125   { m32rbf_sem_clrpsw, "CLRPSW", M32RBF_INSN_CLRPSW, { 0|(1<<CGEN_INSN_SPECIAL_M32R), (1<<MACH_BASE), PIPE_O } },
126   { m32rbf_sem_setpsw, "SETPSW", M32RBF_INSN_SETPSW, { 0|(1<<CGEN_INSN_SPECIAL_M32R), (1<<MACH_BASE), PIPE_O } },
127   { m32rbf_sem_bset, "BSET", M32RBF_INSN_BSET, { 0|(1<<CGEN_INSN_SPECIAL_M32R), (1<<MACH_BASE), PIPE_NONE } },
128   { m32rbf_sem_bclr, "BCLR", M32RBF_INSN_BCLR, { 0|(1<<CGEN_INSN_SPECIAL_M32R), (1<<MACH_BASE), PIPE_NONE } },
129   { m32rbf_sem_btst, "BTST", M32RBF_INSN_BTST, { 0|(1<<CGEN_INSN_SPECIAL_M32R), (1<<MACH_BASE), PIPE_O } },
130
131 };
132
133 // Given a canonical virtual insn id, return the target specific one.
134
135 m32rbf_insn_type
136 m32rbf_idesc::lookup_virtual (virtual_insn_type vit)
137 {
138   switch (vit)
139     {
140       case VIRTUAL_INSN_INVALID: return M32RBF_INSN_X_INVALID;
141       case VIRTUAL_INSN_COND: return M32RBF_INSN_X_INVALID;
142     }
143   abort ();
144 }
145
146
147 // Declare extractor functions
148
149 static void
150 m32rbf_extract_sfmt_empty (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
151 static void
152 m32rbf_extract_sfmt_add (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
153 static void
154 m32rbf_extract_sfmt_add3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
155 static void
156 m32rbf_extract_sfmt_and3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
157 static void
158 m32rbf_extract_sfmt_or3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
159 static void
160 m32rbf_extract_sfmt_addi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
161 static void
162 m32rbf_extract_sfmt_addv (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
163 static void
164 m32rbf_extract_sfmt_addv3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
165 static void
166 m32rbf_extract_sfmt_addx (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
167 static void
168 m32rbf_extract_sfmt_bc8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
169 static void
170 m32rbf_extract_sfmt_bc24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
171 static void
172 m32rbf_extract_sfmt_beq (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
173 static void
174 m32rbf_extract_sfmt_beqz (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
175 static void
176 m32rbf_extract_sfmt_bl8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
177 static void
178 m32rbf_extract_sfmt_bl24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
179 static void
180 m32rbf_extract_sfmt_bra8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
181 static void
182 m32rbf_extract_sfmt_bra24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
183 static void
184 m32rbf_extract_sfmt_cmp (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
185 static void
186 m32rbf_extract_sfmt_cmpi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
187 static void
188 m32rbf_extract_sfmt_div (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
189 static void
190 m32rbf_extract_sfmt_jl (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
191 static void
192 m32rbf_extract_sfmt_jmp (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
193 static void
194 m32rbf_extract_sfmt_ld (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
195 static void
196 m32rbf_extract_sfmt_ld_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
197 static void
198 m32rbf_extract_sfmt_ldb (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
199 static void
200 m32rbf_extract_sfmt_ldb_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
201 static void
202 m32rbf_extract_sfmt_ldh (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
203 static void
204 m32rbf_extract_sfmt_ldh_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
205 static void
206 m32rbf_extract_sfmt_ld_plus (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
207 static void
208 m32rbf_extract_sfmt_ld24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
209 static void
210 m32rbf_extract_sfmt_ldi8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
211 static void
212 m32rbf_extract_sfmt_ldi16 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
213 static void
214 m32rbf_extract_sfmt_lock (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
215 static void
216 m32rbf_extract_sfmt_machi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
217 static void
218 m32rbf_extract_sfmt_mulhi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
219 static void
220 m32rbf_extract_sfmt_mv (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
221 static void
222 m32rbf_extract_sfmt_mvfachi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
223 static void
224 m32rbf_extract_sfmt_mvfc (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
225 static void
226 m32rbf_extract_sfmt_mvtachi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
227 static void
228 m32rbf_extract_sfmt_mvtc (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
229 static void
230 m32rbf_extract_sfmt_nop (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
231 static void
232 m32rbf_extract_sfmt_rac (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
233 static void
234 m32rbf_extract_sfmt_rte (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
235 static void
236 m32rbf_extract_sfmt_seth (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
237 static void
238 m32rbf_extract_sfmt_sll3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
239 static void
240 m32rbf_extract_sfmt_slli (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
241 static void
242 m32rbf_extract_sfmt_st (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
243 static void
244 m32rbf_extract_sfmt_st_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
245 static void
246 m32rbf_extract_sfmt_stb (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
247 static void
248 m32rbf_extract_sfmt_stb_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
249 static void
250 m32rbf_extract_sfmt_sth (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
251 static void
252 m32rbf_extract_sfmt_sth_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
253 static void
254 m32rbf_extract_sfmt_st_plus (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
255 static void
256 m32rbf_extract_sfmt_trap (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
257 static void
258 m32rbf_extract_sfmt_unlock (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
259 static void
260 m32rbf_extract_sfmt_clrpsw (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
261 static void
262 m32rbf_extract_sfmt_setpsw (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
263 static void
264 m32rbf_extract_sfmt_bset (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
265 static void
266 m32rbf_extract_sfmt_btst (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn);
267
268 // Fetch & decode instruction
269 void
270 m32rbf_scache::decode (m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn)
271 {
272   /* Result of decoder.  */
273   M32RBF_INSN_TYPE itype;
274
275   {
276     m32rbf_insn_word insn = base_insn;
277
278     {
279       unsigned int val = (((insn >> 24) & (15 << 4)) | ((insn >> 20) & (15 << 0)));
280       switch (val)
281       {
282       case 0 :
283         entire_insn = entire_insn >> 16;
284         itype = M32RBF_INSN_SUBV; m32rbf_extract_sfmt_addv (this, current_cpu, pc, base_insn, entire_insn); goto done;
285       case 1 :
286         entire_insn = entire_insn >> 16;
287         itype = M32RBF_INSN_SUBX; m32rbf_extract_sfmt_addx (this, current_cpu, pc, base_insn, entire_insn); goto done;
288       case 2 :
289         entire_insn = entire_insn >> 16;
290         itype = M32RBF_INSN_SUB; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
291       case 3 :
292         entire_insn = entire_insn >> 16;
293         itype = M32RBF_INSN_NEG; m32rbf_extract_sfmt_mv (this, current_cpu, pc, base_insn, entire_insn); goto done;
294       case 4 :
295         entire_insn = entire_insn >> 16;
296         itype = M32RBF_INSN_CMP; m32rbf_extract_sfmt_cmp (this, current_cpu, pc, base_insn, entire_insn); goto done;
297       case 5 :
298         entire_insn = entire_insn >> 16;
299         itype = M32RBF_INSN_CMPU; m32rbf_extract_sfmt_cmp (this, current_cpu, pc, base_insn, entire_insn); goto done;
300       case 8 :
301         entire_insn = entire_insn >> 16;
302         itype = M32RBF_INSN_ADDV; m32rbf_extract_sfmt_addv (this, current_cpu, pc, base_insn, entire_insn); goto done;
303       case 9 :
304         entire_insn = entire_insn >> 16;
305         itype = M32RBF_INSN_ADDX; m32rbf_extract_sfmt_addx (this, current_cpu, pc, base_insn, entire_insn); goto done;
306       case 10 :
307         entire_insn = entire_insn >> 16;
308         itype = M32RBF_INSN_ADD; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
309       case 11 :
310         entire_insn = entire_insn >> 16;
311         itype = M32RBF_INSN_NOT; m32rbf_extract_sfmt_mv (this, current_cpu, pc, base_insn, entire_insn); goto done;
312       case 12 :
313         entire_insn = entire_insn >> 16;
314         itype = M32RBF_INSN_AND; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
315       case 13 :
316         entire_insn = entire_insn >> 16;
317         itype = M32RBF_INSN_XOR; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
318       case 14 :
319         entire_insn = entire_insn >> 16;
320         itype = M32RBF_INSN_OR; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
321       case 15 :
322         entire_insn = entire_insn >> 16;
323         if ((entire_insn & 0xf8f0) == 0xf0)
324           { itype = M32RBF_INSN_BTST; m32rbf_extract_sfmt_btst (this, current_cpu, pc, base_insn, entire_insn); goto done; }
325         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
326       case 16 :
327         entire_insn = entire_insn >> 16;
328         itype = M32RBF_INSN_SRL; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
329       case 18 :
330         entire_insn = entire_insn >> 16;
331         itype = M32RBF_INSN_SRA; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
332       case 20 :
333         entire_insn = entire_insn >> 16;
334         itype = M32RBF_INSN_SLL; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
335       case 22 :
336         entire_insn = entire_insn >> 16;
337         itype = M32RBF_INSN_MUL; m32rbf_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
338       case 24 :
339         entire_insn = entire_insn >> 16;
340         itype = M32RBF_INSN_MV; m32rbf_extract_sfmt_mv (this, current_cpu, pc, base_insn, entire_insn); goto done;
341       case 25 :
342         entire_insn = entire_insn >> 16;
343         itype = M32RBF_INSN_MVFC; m32rbf_extract_sfmt_mvfc (this, current_cpu, pc, base_insn, entire_insn); goto done;
344       case 26 :
345         entire_insn = entire_insn >> 16;
346         itype = M32RBF_INSN_MVTC; m32rbf_extract_sfmt_mvtc (this, current_cpu, pc, base_insn, entire_insn); goto done;
347       case 28 :
348         {
349           unsigned int val = (((insn >> 24) & (1 << 0)));
350           switch (val)
351           {
352           case 0 :
353             entire_insn = entire_insn >> 16;
354             if ((entire_insn & 0xfff0) == 0x1ec0)
355               { itype = M32RBF_INSN_JL; m32rbf_extract_sfmt_jl (this, current_cpu, pc, base_insn, entire_insn); goto done; }
356             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
357           case 1 :
358             entire_insn = entire_insn >> 16;
359             if ((entire_insn & 0xfff0) == 0x1fc0)
360               { itype = M32RBF_INSN_JMP; m32rbf_extract_sfmt_jmp (this, current_cpu, pc, base_insn, entire_insn); goto done; }
361             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
362           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
363           }
364         }
365       case 29 :
366         entire_insn = entire_insn >> 16;
367         if ((entire_insn & 0xffff) == 0x10d6)
368           { itype = M32RBF_INSN_RTE; m32rbf_extract_sfmt_rte (this, current_cpu, pc, base_insn, entire_insn); goto done; }
369         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
370       case 31 :
371         entire_insn = entire_insn >> 16;
372         if ((entire_insn & 0xfff0) == 0x10f0)
373           { itype = M32RBF_INSN_TRAP; m32rbf_extract_sfmt_trap (this, current_cpu, pc, base_insn, entire_insn); goto done; }
374         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
375       case 32 :
376         entire_insn = entire_insn >> 16;
377         itype = M32RBF_INSN_STB; m32rbf_extract_sfmt_stb (this, current_cpu, pc, base_insn, entire_insn); goto done;
378       case 34 :
379         entire_insn = entire_insn >> 16;
380         itype = M32RBF_INSN_STH; m32rbf_extract_sfmt_sth (this, current_cpu, pc, base_insn, entire_insn); goto done;
381       case 36 :
382         entire_insn = entire_insn >> 16;
383         itype = M32RBF_INSN_ST; m32rbf_extract_sfmt_st (this, current_cpu, pc, base_insn, entire_insn); goto done;
384       case 37 :
385         entire_insn = entire_insn >> 16;
386         itype = M32RBF_INSN_UNLOCK; m32rbf_extract_sfmt_unlock (this, current_cpu, pc, base_insn, entire_insn); goto done;
387       case 38 :
388         entire_insn = entire_insn >> 16;
389         itype = M32RBF_INSN_ST_PLUS; m32rbf_extract_sfmt_st_plus (this, current_cpu, pc, base_insn, entire_insn); goto done;
390       case 39 :
391         entire_insn = entire_insn >> 16;
392         itype = M32RBF_INSN_ST_MINUS; m32rbf_extract_sfmt_st_plus (this, current_cpu, pc, base_insn, entire_insn); goto done;
393       case 40 :
394         entire_insn = entire_insn >> 16;
395         itype = M32RBF_INSN_LDB; m32rbf_extract_sfmt_ldb (this, current_cpu, pc, base_insn, entire_insn); goto done;
396       case 41 :
397         entire_insn = entire_insn >> 16;
398         itype = M32RBF_INSN_LDUB; m32rbf_extract_sfmt_ldb (this, current_cpu, pc, base_insn, entire_insn); goto done;
399       case 42 :
400         entire_insn = entire_insn >> 16;
401         itype = M32RBF_INSN_LDH; m32rbf_extract_sfmt_ldh (this, current_cpu, pc, base_insn, entire_insn); goto done;
402       case 43 :
403         entire_insn = entire_insn >> 16;
404         itype = M32RBF_INSN_LDUH; m32rbf_extract_sfmt_ldh (this, current_cpu, pc, base_insn, entire_insn); goto done;
405       case 44 :
406         entire_insn = entire_insn >> 16;
407         itype = M32RBF_INSN_LD; m32rbf_extract_sfmt_ld (this, current_cpu, pc, base_insn, entire_insn); goto done;
408       case 45 :
409         entire_insn = entire_insn >> 16;
410         itype = M32RBF_INSN_LOCK; m32rbf_extract_sfmt_lock (this, current_cpu, pc, base_insn, entire_insn); goto done;
411       case 46 :
412         entire_insn = entire_insn >> 16;
413         itype = M32RBF_INSN_LD_PLUS; m32rbf_extract_sfmt_ld_plus (this, current_cpu, pc, base_insn, entire_insn); goto done;
414       case 48 :
415         entire_insn = entire_insn >> 16;
416         itype = M32RBF_INSN_MULHI; m32rbf_extract_sfmt_mulhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
417       case 49 :
418         entire_insn = entire_insn >> 16;
419         itype = M32RBF_INSN_MULLO; m32rbf_extract_sfmt_mulhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
420       case 50 :
421         entire_insn = entire_insn >> 16;
422         itype = M32RBF_INSN_MULWHI; m32rbf_extract_sfmt_mulhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
423       case 51 :
424         entire_insn = entire_insn >> 16;
425         itype = M32RBF_INSN_MULWLO; m32rbf_extract_sfmt_mulhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
426       case 52 :
427         entire_insn = entire_insn >> 16;
428         itype = M32RBF_INSN_MACHI; m32rbf_extract_sfmt_machi (this, current_cpu, pc, base_insn, entire_insn); goto done;
429       case 53 :
430         entire_insn = entire_insn >> 16;
431         itype = M32RBF_INSN_MACLO; m32rbf_extract_sfmt_machi (this, current_cpu, pc, base_insn, entire_insn); goto done;
432       case 54 :
433         entire_insn = entire_insn >> 16;
434         itype = M32RBF_INSN_MACWHI; m32rbf_extract_sfmt_machi (this, current_cpu, pc, base_insn, entire_insn); goto done;
435       case 55 :
436         entire_insn = entire_insn >> 16;
437         itype = M32RBF_INSN_MACWLO; m32rbf_extract_sfmt_machi (this, current_cpu, pc, base_insn, entire_insn); goto done;
438       case 64 : /* fall through */
439       case 65 : /* fall through */
440       case 66 : /* fall through */
441       case 67 : /* fall through */
442       case 68 : /* fall through */
443       case 69 : /* fall through */
444       case 70 : /* fall through */
445       case 71 : /* fall through */
446       case 72 : /* fall through */
447       case 73 : /* fall through */
448       case 74 : /* fall through */
449       case 75 : /* fall through */
450       case 76 : /* fall through */
451       case 77 : /* fall through */
452       case 78 : /* fall through */
453       case 79 :
454         entire_insn = entire_insn >> 16;
455         itype = M32RBF_INSN_ADDI; m32rbf_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
456       case 80 : /* fall through */
457       case 81 :
458         entire_insn = entire_insn >> 16;
459         itype = M32RBF_INSN_SRLI; m32rbf_extract_sfmt_slli (this, current_cpu, pc, base_insn, entire_insn); goto done;
460       case 82 : /* fall through */
461       case 83 :
462         entire_insn = entire_insn >> 16;
463         itype = M32RBF_INSN_SRAI; m32rbf_extract_sfmt_slli (this, current_cpu, pc, base_insn, entire_insn); goto done;
464       case 84 : /* fall through */
465       case 85 :
466         entire_insn = entire_insn >> 16;
467         itype = M32RBF_INSN_SLLI; m32rbf_extract_sfmt_slli (this, current_cpu, pc, base_insn, entire_insn); goto done;
468       case 87 :
469         {
470           unsigned int val = (((insn >> 16) & (1 << 0)));
471           switch (val)
472           {
473           case 0 :
474             entire_insn = entire_insn >> 16;
475             if ((entire_insn & 0xf0ff) == 0x5070)
476               { itype = M32RBF_INSN_MVTACHI; m32rbf_extract_sfmt_mvtachi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
477             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
478           case 1 :
479             entire_insn = entire_insn >> 16;
480             if ((entire_insn & 0xf0ff) == 0x5071)
481               { itype = M32RBF_INSN_MVTACLO; m32rbf_extract_sfmt_mvtachi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
482             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
483           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
484           }
485         }
486       case 88 :
487         entire_insn = entire_insn >> 16;
488         if ((entire_insn & 0xffff) == 0x5080)
489           { itype = M32RBF_INSN_RACH; m32rbf_extract_sfmt_rac (this, current_cpu, pc, base_insn, entire_insn); goto done; }
490         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
491       case 89 :
492         entire_insn = entire_insn >> 16;
493         if ((entire_insn & 0xffff) == 0x5090)
494           { itype = M32RBF_INSN_RAC; m32rbf_extract_sfmt_rac (this, current_cpu, pc, base_insn, entire_insn); goto done; }
495         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
496       case 95 :
497         {
498           unsigned int val = (((insn >> 16) & (3 << 0)));
499           switch (val)
500           {
501           case 0 :
502             entire_insn = entire_insn >> 16;
503             if ((entire_insn & 0xf0ff) == 0x50f0)
504               { itype = M32RBF_INSN_MVFACHI; m32rbf_extract_sfmt_mvfachi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
505             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
506           case 1 :
507             entire_insn = entire_insn >> 16;
508             if ((entire_insn & 0xf0ff) == 0x50f1)
509               { itype = M32RBF_INSN_MVFACLO; m32rbf_extract_sfmt_mvfachi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
510             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
511           case 2 :
512             entire_insn = entire_insn >> 16;
513             if ((entire_insn & 0xf0ff) == 0x50f2)
514               { itype = M32RBF_INSN_MVFACMI; m32rbf_extract_sfmt_mvfachi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
515             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
516           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
517           }
518         }
519       case 96 : /* fall through */
520       case 97 : /* fall through */
521       case 98 : /* fall through */
522       case 99 : /* fall through */
523       case 100 : /* fall through */
524       case 101 : /* fall through */
525       case 102 : /* fall through */
526       case 103 : /* fall through */
527       case 104 : /* fall through */
528       case 105 : /* fall through */
529       case 106 : /* fall through */
530       case 107 : /* fall through */
531       case 108 : /* fall through */
532       case 109 : /* fall through */
533       case 110 : /* fall through */
534       case 111 :
535         entire_insn = entire_insn >> 16;
536         itype = M32RBF_INSN_LDI8; m32rbf_extract_sfmt_ldi8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
537       case 112 :
538         {
539           unsigned int val = (((insn >> 24) & (15 << 0)));
540           switch (val)
541           {
542           case 0 :
543             entire_insn = entire_insn >> 16;
544             if ((entire_insn & 0xffff) == 0x7000)
545               { itype = M32RBF_INSN_NOP; m32rbf_extract_sfmt_nop (this, current_cpu, pc, base_insn, entire_insn); goto done; }
546             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
547           case 1 :
548             entire_insn = entire_insn >> 16;
549             itype = M32RBF_INSN_SETPSW; m32rbf_extract_sfmt_setpsw (this, current_cpu, pc, base_insn, entire_insn); goto done;
550           case 2 :
551             entire_insn = entire_insn >> 16;
552             itype = M32RBF_INSN_CLRPSW; m32rbf_extract_sfmt_clrpsw (this, current_cpu, pc, base_insn, entire_insn); goto done;
553           case 12 :
554             entire_insn = entire_insn >> 16;
555             itype = M32RBF_INSN_BC8; m32rbf_extract_sfmt_bc8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
556           case 13 :
557             entire_insn = entire_insn >> 16;
558             itype = M32RBF_INSN_BNC8; m32rbf_extract_sfmt_bc8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
559           case 14 :
560             entire_insn = entire_insn >> 16;
561             itype = M32RBF_INSN_BL8; m32rbf_extract_sfmt_bl8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
562           case 15 :
563             entire_insn = entire_insn >> 16;
564             itype = M32RBF_INSN_BRA8; m32rbf_extract_sfmt_bra8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
565           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
566           }
567         }
568       case 113 : /* fall through */
569       case 114 : /* fall through */
570       case 115 : /* fall through */
571       case 116 : /* fall through */
572       case 117 : /* fall through */
573       case 118 : /* fall through */
574       case 119 : /* fall through */
575       case 120 : /* fall through */
576       case 121 : /* fall through */
577       case 122 : /* fall through */
578       case 123 : /* fall through */
579       case 124 : /* fall through */
580       case 125 : /* fall through */
581       case 126 : /* fall through */
582       case 127 :
583         {
584           unsigned int val = (((insn >> 24) & (15 << 0)));
585           switch (val)
586           {
587           case 1 :
588             entire_insn = entire_insn >> 16;
589             itype = M32RBF_INSN_SETPSW; m32rbf_extract_sfmt_setpsw (this, current_cpu, pc, base_insn, entire_insn); goto done;
590           case 2 :
591             entire_insn = entire_insn >> 16;
592             itype = M32RBF_INSN_CLRPSW; m32rbf_extract_sfmt_clrpsw (this, current_cpu, pc, base_insn, entire_insn); goto done;
593           case 12 :
594             entire_insn = entire_insn >> 16;
595             itype = M32RBF_INSN_BC8; m32rbf_extract_sfmt_bc8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
596           case 13 :
597             entire_insn = entire_insn >> 16;
598             itype = M32RBF_INSN_BNC8; m32rbf_extract_sfmt_bc8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
599           case 14 :
600             entire_insn = entire_insn >> 16;
601             itype = M32RBF_INSN_BL8; m32rbf_extract_sfmt_bl8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
602           case 15 :
603             entire_insn = entire_insn >> 16;
604             itype = M32RBF_INSN_BRA8; m32rbf_extract_sfmt_bra8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
605           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
606           }
607         }
608       case 132 :
609         if ((entire_insn & 0xfff00000) == 0x80400000)
610           { itype = M32RBF_INSN_CMPI; m32rbf_extract_sfmt_cmpi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
611         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
612       case 133 :
613         if ((entire_insn & 0xfff00000) == 0x80500000)
614           { itype = M32RBF_INSN_CMPUI; m32rbf_extract_sfmt_cmpi (this, current_cpu, pc, base_insn, entire_insn); goto done; }
615         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
616       case 136 : itype = M32RBF_INSN_ADDV3; m32rbf_extract_sfmt_addv3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
617       case 138 : itype = M32RBF_INSN_ADD3; m32rbf_extract_sfmt_add3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
618       case 140 : itype = M32RBF_INSN_AND3; m32rbf_extract_sfmt_and3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
619       case 141 : itype = M32RBF_INSN_XOR3; m32rbf_extract_sfmt_and3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
620       case 142 : itype = M32RBF_INSN_OR3; m32rbf_extract_sfmt_or3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
621       case 144 :
622         if ((entire_insn & 0xf0f0ffff) == 0x90000000)
623           { itype = M32RBF_INSN_DIV; m32rbf_extract_sfmt_div (this, current_cpu, pc, base_insn, entire_insn); goto done; }
624         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
625       case 145 :
626         if ((entire_insn & 0xf0f0ffff) == 0x90100000)
627           { itype = M32RBF_INSN_DIVU; m32rbf_extract_sfmt_div (this, current_cpu, pc, base_insn, entire_insn); goto done; }
628         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
629       case 146 :
630         if ((entire_insn & 0xf0f0ffff) == 0x90200000)
631           { itype = M32RBF_INSN_REM; m32rbf_extract_sfmt_div (this, current_cpu, pc, base_insn, entire_insn); goto done; }
632         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
633       case 147 :
634         if ((entire_insn & 0xf0f0ffff) == 0x90300000)
635           { itype = M32RBF_INSN_REMU; m32rbf_extract_sfmt_div (this, current_cpu, pc, base_insn, entire_insn); goto done; }
636         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
637       case 152 : itype = M32RBF_INSN_SRL3; m32rbf_extract_sfmt_sll3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
638       case 154 : itype = M32RBF_INSN_SRA3; m32rbf_extract_sfmt_sll3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
639       case 156 : itype = M32RBF_INSN_SLL3; m32rbf_extract_sfmt_sll3 (this, current_cpu, pc, base_insn, entire_insn); goto done;
640       case 159 :
641         if ((entire_insn & 0xf0ff0000) == 0x90f00000)
642           { itype = M32RBF_INSN_LDI16; m32rbf_extract_sfmt_ldi16 (this, current_cpu, pc, base_insn, entire_insn); goto done; }
643         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
644       case 160 : itype = M32RBF_INSN_STB_D; m32rbf_extract_sfmt_stb_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
645       case 162 : itype = M32RBF_INSN_STH_D; m32rbf_extract_sfmt_sth_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
646       case 164 : itype = M32RBF_INSN_ST_D; m32rbf_extract_sfmt_st_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
647       case 166 :
648         if ((entire_insn & 0xf8f00000) == 0xa0600000)
649           { itype = M32RBF_INSN_BSET; m32rbf_extract_sfmt_bset (this, current_cpu, pc, base_insn, entire_insn); goto done; }
650         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
651       case 167 :
652         if ((entire_insn & 0xf8f00000) == 0xa0700000)
653           { itype = M32RBF_INSN_BCLR; m32rbf_extract_sfmt_bset (this, current_cpu, pc, base_insn, entire_insn); goto done; }
654         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
655       case 168 : itype = M32RBF_INSN_LDB_D; m32rbf_extract_sfmt_ldb_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
656       case 169 : itype = M32RBF_INSN_LDUB_D; m32rbf_extract_sfmt_ldb_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
657       case 170 : itype = M32RBF_INSN_LDH_D; m32rbf_extract_sfmt_ldh_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
658       case 171 : itype = M32RBF_INSN_LDUH_D; m32rbf_extract_sfmt_ldh_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
659       case 172 : itype = M32RBF_INSN_LD_D; m32rbf_extract_sfmt_ld_d (this, current_cpu, pc, base_insn, entire_insn); goto done;
660       case 176 : itype = M32RBF_INSN_BEQ; m32rbf_extract_sfmt_beq (this, current_cpu, pc, base_insn, entire_insn); goto done;
661       case 177 : itype = M32RBF_INSN_BNE; m32rbf_extract_sfmt_beq (this, current_cpu, pc, base_insn, entire_insn); goto done;
662       case 184 :
663         if ((entire_insn & 0xfff00000) == 0xb0800000)
664           { itype = M32RBF_INSN_BEQZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
665         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
666       case 185 :
667         if ((entire_insn & 0xfff00000) == 0xb0900000)
668           { itype = M32RBF_INSN_BNEZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
669         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
670       case 186 :
671         if ((entire_insn & 0xfff00000) == 0xb0a00000)
672           { itype = M32RBF_INSN_BLTZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
673         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
674       case 187 :
675         if ((entire_insn & 0xfff00000) == 0xb0b00000)
676           { itype = M32RBF_INSN_BGEZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
677         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
678       case 188 :
679         if ((entire_insn & 0xfff00000) == 0xb0c00000)
680           { itype = M32RBF_INSN_BLEZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
681         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
682       case 189 :
683         if ((entire_insn & 0xfff00000) == 0xb0d00000)
684           { itype = M32RBF_INSN_BGTZ; m32rbf_extract_sfmt_beqz (this, current_cpu, pc, base_insn, entire_insn); goto done; }
685         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
686       case 220 :
687         if ((entire_insn & 0xf0ff0000) == 0xd0c00000)
688           { itype = M32RBF_INSN_SETH; m32rbf_extract_sfmt_seth (this, current_cpu, pc, base_insn, entire_insn); goto done; }
689         itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
690       case 224 : /* fall through */
691       case 225 : /* fall through */
692       case 226 : /* fall through */
693       case 227 : /* fall through */
694       case 228 : /* fall through */
695       case 229 : /* fall through */
696       case 230 : /* fall through */
697       case 231 : /* fall through */
698       case 232 : /* fall through */
699       case 233 : /* fall through */
700       case 234 : /* fall through */
701       case 235 : /* fall through */
702       case 236 : /* fall through */
703       case 237 : /* fall through */
704       case 238 : /* fall through */
705       case 239 : itype = M32RBF_INSN_LD24; m32rbf_extract_sfmt_ld24 (this, current_cpu, pc, base_insn, entire_insn); goto done;
706       case 240 : /* fall through */
707       case 241 : /* fall through */
708       case 242 : /* fall through */
709       case 243 : /* fall through */
710       case 244 : /* fall through */
711       case 245 : /* fall through */
712       case 246 : /* fall through */
713       case 247 : /* fall through */
714       case 248 : /* fall through */
715       case 249 : /* fall through */
716       case 250 : /* fall through */
717       case 251 : /* fall through */
718       case 252 : /* fall through */
719       case 253 : /* fall through */
720       case 254 : /* fall through */
721       case 255 :
722         {
723           unsigned int val = (((insn >> 24) & (3 << 0)));
724           switch (val)
725           {
726           case 0 :
727             if ((entire_insn & 0xff000000) == 0xfc000000)
728               { itype = M32RBF_INSN_BC24; m32rbf_extract_sfmt_bc24 (this, current_cpu, pc, base_insn, entire_insn); goto done; }
729             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
730           case 1 :
731             if ((entire_insn & 0xff000000) == 0xfd000000)
732               { itype = M32RBF_INSN_BNC24; m32rbf_extract_sfmt_bc24 (this, current_cpu, pc, base_insn, entire_insn); goto done; }
733             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
734           case 2 :
735             if ((entire_insn & 0xff000000) == 0xfe000000)
736               { itype = M32RBF_INSN_BL24; m32rbf_extract_sfmt_bl24 (this, current_cpu, pc, base_insn, entire_insn); goto done; }
737             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
738           case 3 :
739             if ((entire_insn & 0xff000000) == 0xff000000)
740               { itype = M32RBF_INSN_BRA24; m32rbf_extract_sfmt_bra24 (this, current_cpu, pc, base_insn, entire_insn); goto done; }
741             itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
742           default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
743           }
744         }
745       default : itype = M32RBF_INSN_X_INVALID; m32rbf_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
746       }
747     }
748
749   }
750
751   /* The instruction has been decoded and fields extracted.  */
752   done:
753
754   this->addr = pc;
755   // FIXME: To be redone (to handle ISA variants).
756   this->idesc = & m32rbf_idesc::idesc_table[itype];
757   // ??? record semantic handler?
758   assert(this->idesc->sem_index == itype);
759 }
760
761 void
762 m32rbf_extract_sfmt_empty (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
763     m32rbf_insn_word insn = entire_insn;
764 #define FLD(f) abuf->fields.fmt_empty.f
765
766
767   /* Record the fields for the semantic handler.  */
768   if (UNLIKELY(current_cpu->trace_extract_p))
769     {
770       current_cpu->trace_stream 
771         << "0x" << hex << pc << dec << " (sfmt_empty)\t"
772         << endl;
773     }
774
775 #undef FLD
776 }
777
778 void
779 m32rbf_extract_sfmt_add (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
780     m32rbf_insn_word insn = entire_insn;
781 #define FLD(f) abuf->fields.sfmt_and3.f
782     UINT f_r1;
783     UINT f_r2;
784
785     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
786     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
787
788   /* Record the fields for the semantic handler.  */
789   FLD (f_r1) = f_r1;
790   FLD (f_r2) = f_r2;
791   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
792   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
793   if (UNLIKELY(current_cpu->trace_extract_p))
794     {
795       current_cpu->trace_stream 
796         << "0x" << hex << pc << dec << " (sfmt_add)\t"
797         << " f_r1:0x" << hex << f_r1 << dec
798         << " f_r2:0x" << hex << f_r2 << dec
799         << endl;
800     }
801
802 #undef FLD
803 }
804
805 void
806 m32rbf_extract_sfmt_add3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
807     m32rbf_insn_word insn = entire_insn;
808 #define FLD(f) abuf->fields.sfmt_add3.f
809     UINT f_r1;
810     UINT f_r2;
811     INT f_simm16;
812
813     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
814     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
815     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
816
817   /* Record the fields for the semantic handler.  */
818   FLD (f_simm16) = f_simm16;
819   FLD (f_r2) = f_r2;
820   FLD (f_r1) = f_r1;
821   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
822   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
823   if (UNLIKELY(current_cpu->trace_extract_p))
824     {
825       current_cpu->trace_stream 
826         << "0x" << hex << pc << dec << " (sfmt_add3)\t"
827         << " f_simm16:0x" << hex << f_simm16 << dec
828         << " f_r2:0x" << hex << f_r2 << dec
829         << " f_r1:0x" << hex << f_r1 << dec
830         << endl;
831     }
832
833 #undef FLD
834 }
835
836 void
837 m32rbf_extract_sfmt_and3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
838     m32rbf_insn_word insn = entire_insn;
839 #define FLD(f) abuf->fields.sfmt_and3.f
840     UINT f_r1;
841     UINT f_r2;
842     UINT f_uimm16;
843
844     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
845     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
846     f_uimm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16);
847
848   /* Record the fields for the semantic handler.  */
849   FLD (f_r2) = f_r2;
850   FLD (f_uimm16) = f_uimm16;
851   FLD (f_r1) = f_r1;
852   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
853   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
854   if (UNLIKELY(current_cpu->trace_extract_p))
855     {
856       current_cpu->trace_stream 
857         << "0x" << hex << pc << dec << " (sfmt_and3)\t"
858         << " f_r2:0x" << hex << f_r2 << dec
859         << " f_uimm16:0x" << hex << f_uimm16 << dec
860         << " f_r1:0x" << hex << f_r1 << dec
861         << endl;
862     }
863
864 #undef FLD
865 }
866
867 void
868 m32rbf_extract_sfmt_or3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
869     m32rbf_insn_word insn = entire_insn;
870 #define FLD(f) abuf->fields.sfmt_and3.f
871     UINT f_r1;
872     UINT f_r2;
873     UINT f_uimm16;
874
875     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
876     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
877     f_uimm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16);
878
879   /* Record the fields for the semantic handler.  */
880   FLD (f_r2) = f_r2;
881   FLD (f_uimm16) = f_uimm16;
882   FLD (f_r1) = f_r1;
883   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
884   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
885   if (UNLIKELY(current_cpu->trace_extract_p))
886     {
887       current_cpu->trace_stream 
888         << "0x" << hex << pc << dec << " (sfmt_or3)\t"
889         << " f_r2:0x" << hex << f_r2 << dec
890         << " f_uimm16:0x" << hex << f_uimm16 << dec
891         << " f_r1:0x" << hex << f_r1 << dec
892         << endl;
893     }
894
895 #undef FLD
896 }
897
898 void
899 m32rbf_extract_sfmt_addi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
900     m32rbf_insn_word insn = entire_insn;
901 #define FLD(f) abuf->fields.sfmt_addi.f
902     UINT f_r1;
903     INT f_simm8;
904
905     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
906     f_simm8 = EXTRACT_MSB0_SINT (insn, 16, 8, 8);
907
908   /* Record the fields for the semantic handler.  */
909   FLD (f_r1) = f_r1;
910   FLD (f_simm8) = f_simm8;
911   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
912   if (UNLIKELY(current_cpu->trace_extract_p))
913     {
914       current_cpu->trace_stream 
915         << "0x" << hex << pc << dec << " (sfmt_addi)\t"
916         << " f_r1:0x" << hex << f_r1 << dec
917         << " f_simm8:0x" << hex << f_simm8 << dec
918         << endl;
919     }
920
921 #undef FLD
922 }
923
924 void
925 m32rbf_extract_sfmt_addv (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
926     m32rbf_insn_word insn = entire_insn;
927 #define FLD(f) abuf->fields.sfmt_and3.f
928     UINT f_r1;
929     UINT f_r2;
930
931     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
932     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
933
934   /* Record the fields for the semantic handler.  */
935   FLD (f_r1) = f_r1;
936   FLD (f_r2) = f_r2;
937   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
938   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
939   if (UNLIKELY(current_cpu->trace_extract_p))
940     {
941       current_cpu->trace_stream 
942         << "0x" << hex << pc << dec << " (sfmt_addv)\t"
943         << " f_r1:0x" << hex << f_r1 << dec
944         << " f_r2:0x" << hex << f_r2 << dec
945         << endl;
946     }
947
948 #undef FLD
949 }
950
951 void
952 m32rbf_extract_sfmt_addv3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
953     m32rbf_insn_word insn = entire_insn;
954 #define FLD(f) abuf->fields.sfmt_add3.f
955     UINT f_r1;
956     UINT f_r2;
957     INT f_simm16;
958
959     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
960     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
961     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
962
963   /* Record the fields for the semantic handler.  */
964   FLD (f_simm16) = f_simm16;
965   FLD (f_r2) = f_r2;
966   FLD (f_r1) = f_r1;
967   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
968   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
969   if (UNLIKELY(current_cpu->trace_extract_p))
970     {
971       current_cpu->trace_stream 
972         << "0x" << hex << pc << dec << " (sfmt_addv3)\t"
973         << " f_simm16:0x" << hex << f_simm16 << dec
974         << " f_r2:0x" << hex << f_r2 << dec
975         << " f_r1:0x" << hex << f_r1 << dec
976         << endl;
977     }
978
979 #undef FLD
980 }
981
982 void
983 m32rbf_extract_sfmt_addx (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
984     m32rbf_insn_word insn = entire_insn;
985 #define FLD(f) abuf->fields.sfmt_and3.f
986     UINT f_r1;
987     UINT f_r2;
988
989     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
990     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
991
992   /* Record the fields for the semantic handler.  */
993   FLD (f_r1) = f_r1;
994   FLD (f_r2) = f_r2;
995   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
996   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
997   if (UNLIKELY(current_cpu->trace_extract_p))
998     {
999       current_cpu->trace_stream 
1000         << "0x" << hex << pc << dec << " (sfmt_addx)\t"
1001         << " f_r1:0x" << hex << f_r1 << dec
1002         << " f_r2:0x" << hex << f_r2 << dec
1003         << endl;
1004     }
1005
1006 #undef FLD
1007 }
1008
1009 void
1010 m32rbf_extract_sfmt_bc8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1011     m32rbf_insn_word insn = entire_insn;
1012 #define FLD(f) abuf->fields.sfmt_bc8.f
1013     SI f_disp8;
1014
1015     f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4))));
1016
1017   /* Record the fields for the semantic handler.  */
1018   FLD (i_disp8) = f_disp8;
1019   if (UNLIKELY(current_cpu->trace_extract_p))
1020     {
1021       current_cpu->trace_stream 
1022         << "0x" << hex << pc << dec << " (sfmt_bc8)\t"
1023         << endl;
1024     }
1025
1026 #undef FLD
1027 }
1028
1029 void
1030 m32rbf_extract_sfmt_bc24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1031     m32rbf_insn_word insn = entire_insn;
1032 #define FLD(f) abuf->fields.sfmt_bc24.f
1033     SI f_disp24;
1034
1035     f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc));
1036
1037   /* Record the fields for the semantic handler.  */
1038   FLD (i_disp24) = f_disp24;
1039   if (UNLIKELY(current_cpu->trace_extract_p))
1040     {
1041       current_cpu->trace_stream 
1042         << "0x" << hex << pc << dec << " (sfmt_bc24)\t"
1043         << endl;
1044     }
1045
1046 #undef FLD
1047 }
1048
1049 void
1050 m32rbf_extract_sfmt_beq (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1051     m32rbf_insn_word insn = entire_insn;
1052 #define FLD(f) abuf->fields.sfmt_beq.f
1053     UINT f_r1;
1054     UINT f_r2;
1055     SI f_disp16;
1056
1057     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1058     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1059     f_disp16 = ((((EXTRACT_MSB0_SINT (insn, 32, 16, 16)) << (2))) + (pc));
1060
1061   /* Record the fields for the semantic handler.  */
1062   FLD (f_r1) = f_r1;
1063   FLD (f_r2) = f_r2;
1064   FLD (i_disp16) = f_disp16;
1065   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1066   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1067   if (UNLIKELY(current_cpu->trace_extract_p))
1068     {
1069       current_cpu->trace_stream 
1070         << "0x" << hex << pc << dec << " (sfmt_beq)\t"
1071         << " f_r1:0x" << hex << f_r1 << dec
1072         << " f_r2:0x" << hex << f_r2 << dec
1073         << endl;
1074     }
1075
1076 #undef FLD
1077 }
1078
1079 void
1080 m32rbf_extract_sfmt_beqz (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1081     m32rbf_insn_word insn = entire_insn;
1082 #define FLD(f) abuf->fields.sfmt_beq.f
1083     UINT f_r2;
1084     SI f_disp16;
1085
1086     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1087     f_disp16 = ((((EXTRACT_MSB0_SINT (insn, 32, 16, 16)) << (2))) + (pc));
1088
1089   /* Record the fields for the semantic handler.  */
1090   FLD (f_r2) = f_r2;
1091   FLD (i_disp16) = f_disp16;
1092   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1093   if (UNLIKELY(current_cpu->trace_extract_p))
1094     {
1095       current_cpu->trace_stream 
1096         << "0x" << hex << pc << dec << " (sfmt_beqz)\t"
1097         << " f_r2:0x" << hex << f_r2 << dec
1098         << endl;
1099     }
1100
1101 #undef FLD
1102 }
1103
1104 void
1105 m32rbf_extract_sfmt_bl8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1106     m32rbf_insn_word insn = entire_insn;
1107 #define FLD(f) abuf->fields.sfmt_bc8.f
1108     SI f_disp8;
1109
1110     f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4))));
1111
1112   /* Record the fields for the semantic handler.  */
1113   FLD (i_disp8) = f_disp8;
1114   if (UNLIKELY(current_cpu->trace_extract_p))
1115     {
1116       current_cpu->trace_stream 
1117         << "0x" << hex << pc << dec << " (sfmt_bl8)\t"
1118         << endl;
1119     }
1120
1121 #undef FLD
1122 }
1123
1124 void
1125 m32rbf_extract_sfmt_bl24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1126     m32rbf_insn_word insn = entire_insn;
1127 #define FLD(f) abuf->fields.sfmt_bc24.f
1128     SI f_disp24;
1129
1130     f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc));
1131
1132   /* Record the fields for the semantic handler.  */
1133   FLD (i_disp24) = f_disp24;
1134   if (UNLIKELY(current_cpu->trace_extract_p))
1135     {
1136       current_cpu->trace_stream 
1137         << "0x" << hex << pc << dec << " (sfmt_bl24)\t"
1138         << endl;
1139     }
1140
1141 #undef FLD
1142 }
1143
1144 void
1145 m32rbf_extract_sfmt_bra8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1146     m32rbf_insn_word insn = entire_insn;
1147 #define FLD(f) abuf->fields.sfmt_bc8.f
1148     SI f_disp8;
1149
1150     f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4))));
1151
1152   /* Record the fields for the semantic handler.  */
1153   FLD (i_disp8) = f_disp8;
1154   if (UNLIKELY(current_cpu->trace_extract_p))
1155     {
1156       current_cpu->trace_stream 
1157         << "0x" << hex << pc << dec << " (sfmt_bra8)\t"
1158         << endl;
1159     }
1160
1161 #undef FLD
1162 }
1163
1164 void
1165 m32rbf_extract_sfmt_bra24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1166     m32rbf_insn_word insn = entire_insn;
1167 #define FLD(f) abuf->fields.sfmt_bc24.f
1168     SI f_disp24;
1169
1170     f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc));
1171
1172   /* Record the fields for the semantic handler.  */
1173   FLD (i_disp24) = f_disp24;
1174   if (UNLIKELY(current_cpu->trace_extract_p))
1175     {
1176       current_cpu->trace_stream 
1177         << "0x" << hex << pc << dec << " (sfmt_bra24)\t"
1178         << endl;
1179     }
1180
1181 #undef FLD
1182 }
1183
1184 void
1185 m32rbf_extract_sfmt_cmp (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1186     m32rbf_insn_word insn = entire_insn;
1187 #define FLD(f) abuf->fields.sfmt_st_d.f
1188     UINT f_r1;
1189     UINT f_r2;
1190
1191     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1192     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1193
1194   /* Record the fields for the semantic handler.  */
1195   FLD (f_r1) = f_r1;
1196   FLD (f_r2) = f_r2;
1197   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1198   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1199   if (UNLIKELY(current_cpu->trace_extract_p))
1200     {
1201       current_cpu->trace_stream 
1202         << "0x" << hex << pc << dec << " (sfmt_cmp)\t"
1203         << " f_r1:0x" << hex << f_r1 << dec
1204         << " f_r2:0x" << hex << f_r2 << dec
1205         << endl;
1206     }
1207
1208 #undef FLD
1209 }
1210
1211 void
1212 m32rbf_extract_sfmt_cmpi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1213     m32rbf_insn_word insn = entire_insn;
1214 #define FLD(f) abuf->fields.sfmt_st_d.f
1215     UINT f_r2;
1216     INT f_simm16;
1217
1218     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1219     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1220
1221   /* Record the fields for the semantic handler.  */
1222   FLD (f_simm16) = f_simm16;
1223   FLD (f_r2) = f_r2;
1224   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1225   if (UNLIKELY(current_cpu->trace_extract_p))
1226     {
1227       current_cpu->trace_stream 
1228         << "0x" << hex << pc << dec << " (sfmt_cmpi)\t"
1229         << " f_simm16:0x" << hex << f_simm16 << dec
1230         << " f_r2:0x" << hex << f_r2 << dec
1231         << endl;
1232     }
1233
1234 #undef FLD
1235 }
1236
1237 void
1238 m32rbf_extract_sfmt_div (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1239     m32rbf_insn_word insn = entire_insn;
1240 #define FLD(f) abuf->fields.sfmt_and3.f
1241     UINT f_r1;
1242     UINT f_r2;
1243
1244     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1245     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1246
1247   /* Record the fields for the semantic handler.  */
1248   FLD (f_r1) = f_r1;
1249   FLD (f_r2) = f_r2;
1250   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1251   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1252   if (UNLIKELY(current_cpu->trace_extract_p))
1253     {
1254       current_cpu->trace_stream 
1255         << "0x" << hex << pc << dec << " (sfmt_div)\t"
1256         << " f_r1:0x" << hex << f_r1 << dec
1257         << " f_r2:0x" << hex << f_r2 << dec
1258         << endl;
1259     }
1260
1261 #undef FLD
1262 }
1263
1264 void
1265 m32rbf_extract_sfmt_jl (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1266     m32rbf_insn_word insn = entire_insn;
1267 #define FLD(f) abuf->fields.sfmt_bset.f
1268     UINT f_r2;
1269
1270     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1271
1272   /* Record the fields for the semantic handler.  */
1273   FLD (f_r2) = f_r2;
1274   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1275   if (UNLIKELY(current_cpu->trace_extract_p))
1276     {
1277       current_cpu->trace_stream 
1278         << "0x" << hex << pc << dec << " (sfmt_jl)\t"
1279         << " f_r2:0x" << hex << f_r2 << dec
1280         << endl;
1281     }
1282
1283 #undef FLD
1284 }
1285
1286 void
1287 m32rbf_extract_sfmt_jmp (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1288     m32rbf_insn_word insn = entire_insn;
1289 #define FLD(f) abuf->fields.sfmt_bset.f
1290     UINT f_r2;
1291
1292     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1293
1294   /* Record the fields for the semantic handler.  */
1295   FLD (f_r2) = f_r2;
1296   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1297   if (UNLIKELY(current_cpu->trace_extract_p))
1298     {
1299       current_cpu->trace_stream 
1300         << "0x" << hex << pc << dec << " (sfmt_jmp)\t"
1301         << " f_r2:0x" << hex << f_r2 << dec
1302         << endl;
1303     }
1304
1305 #undef FLD
1306 }
1307
1308 void
1309 m32rbf_extract_sfmt_ld (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1310     m32rbf_insn_word insn = entire_insn;
1311 #define FLD(f) abuf->fields.sfmt_and3.f
1312     UINT f_r1;
1313     UINT f_r2;
1314
1315     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1316     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1317
1318   /* Record the fields for the semantic handler.  */
1319   FLD (f_r2) = f_r2;
1320   FLD (f_r1) = f_r1;
1321   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1322   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1323   if (UNLIKELY(current_cpu->trace_extract_p))
1324     {
1325       current_cpu->trace_stream 
1326         << "0x" << hex << pc << dec << " (sfmt_ld)\t"
1327         << " f_r2:0x" << hex << f_r2 << dec
1328         << " f_r1:0x" << hex << f_r1 << dec
1329         << endl;
1330     }
1331
1332 #undef FLD
1333 }
1334
1335 void
1336 m32rbf_extract_sfmt_ld_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1337     m32rbf_insn_word insn = entire_insn;
1338 #define FLD(f) abuf->fields.sfmt_add3.f
1339     UINT f_r1;
1340     UINT f_r2;
1341     INT f_simm16;
1342
1343     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1344     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1345     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1346
1347   /* Record the fields for the semantic handler.  */
1348   FLD (f_simm16) = f_simm16;
1349   FLD (f_r2) = f_r2;
1350   FLD (f_r1) = f_r1;
1351   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1352   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1353   if (UNLIKELY(current_cpu->trace_extract_p))
1354     {
1355       current_cpu->trace_stream 
1356         << "0x" << hex << pc << dec << " (sfmt_ld_d)\t"
1357         << " f_simm16:0x" << hex << f_simm16 << dec
1358         << " f_r2:0x" << hex << f_r2 << dec
1359         << " f_r1:0x" << hex << f_r1 << dec
1360         << endl;
1361     }
1362
1363 #undef FLD
1364 }
1365
1366 void
1367 m32rbf_extract_sfmt_ldb (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1368     m32rbf_insn_word insn = entire_insn;
1369 #define FLD(f) abuf->fields.sfmt_and3.f
1370     UINT f_r1;
1371     UINT f_r2;
1372
1373     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1374     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1375
1376   /* Record the fields for the semantic handler.  */
1377   FLD (f_r2) = f_r2;
1378   FLD (f_r1) = f_r1;
1379   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1380   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1381   if (UNLIKELY(current_cpu->trace_extract_p))
1382     {
1383       current_cpu->trace_stream 
1384         << "0x" << hex << pc << dec << " (sfmt_ldb)\t"
1385         << " f_r2:0x" << hex << f_r2 << dec
1386         << " f_r1:0x" << hex << f_r1 << dec
1387         << endl;
1388     }
1389
1390 #undef FLD
1391 }
1392
1393 void
1394 m32rbf_extract_sfmt_ldb_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1395     m32rbf_insn_word insn = entire_insn;
1396 #define FLD(f) abuf->fields.sfmt_add3.f
1397     UINT f_r1;
1398     UINT f_r2;
1399     INT f_simm16;
1400
1401     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1402     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1403     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1404
1405   /* Record the fields for the semantic handler.  */
1406   FLD (f_simm16) = f_simm16;
1407   FLD (f_r2) = f_r2;
1408   FLD (f_r1) = f_r1;
1409   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1410   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1411   if (UNLIKELY(current_cpu->trace_extract_p))
1412     {
1413       current_cpu->trace_stream 
1414         << "0x" << hex << pc << dec << " (sfmt_ldb_d)\t"
1415         << " f_simm16:0x" << hex << f_simm16 << dec
1416         << " f_r2:0x" << hex << f_r2 << dec
1417         << " f_r1:0x" << hex << f_r1 << dec
1418         << endl;
1419     }
1420
1421 #undef FLD
1422 }
1423
1424 void
1425 m32rbf_extract_sfmt_ldh (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1426     m32rbf_insn_word insn = entire_insn;
1427 #define FLD(f) abuf->fields.sfmt_and3.f
1428     UINT f_r1;
1429     UINT f_r2;
1430
1431     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1432     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1433
1434   /* Record the fields for the semantic handler.  */
1435   FLD (f_r2) = f_r2;
1436   FLD (f_r1) = f_r1;
1437   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1438   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1439   if (UNLIKELY(current_cpu->trace_extract_p))
1440     {
1441       current_cpu->trace_stream 
1442         << "0x" << hex << pc << dec << " (sfmt_ldh)\t"
1443         << " f_r2:0x" << hex << f_r2 << dec
1444         << " f_r1:0x" << hex << f_r1 << dec
1445         << endl;
1446     }
1447
1448 #undef FLD
1449 }
1450
1451 void
1452 m32rbf_extract_sfmt_ldh_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1453     m32rbf_insn_word insn = entire_insn;
1454 #define FLD(f) abuf->fields.sfmt_add3.f
1455     UINT f_r1;
1456     UINT f_r2;
1457     INT f_simm16;
1458
1459     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1460     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1461     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1462
1463   /* Record the fields for the semantic handler.  */
1464   FLD (f_simm16) = f_simm16;
1465   FLD (f_r2) = f_r2;
1466   FLD (f_r1) = f_r1;
1467   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1468   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1469   if (UNLIKELY(current_cpu->trace_extract_p))
1470     {
1471       current_cpu->trace_stream 
1472         << "0x" << hex << pc << dec << " (sfmt_ldh_d)\t"
1473         << " f_simm16:0x" << hex << f_simm16 << dec
1474         << " f_r2:0x" << hex << f_r2 << dec
1475         << " f_r1:0x" << hex << f_r1 << dec
1476         << endl;
1477     }
1478
1479 #undef FLD
1480 }
1481
1482 void
1483 m32rbf_extract_sfmt_ld_plus (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1484     m32rbf_insn_word insn = entire_insn;
1485 #define FLD(f) abuf->fields.sfmt_and3.f
1486     UINT f_r1;
1487     UINT f_r2;
1488
1489     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1490     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1491
1492   /* Record the fields for the semantic handler.  */
1493   FLD (f_r2) = f_r2;
1494   FLD (f_r1) = f_r1;
1495   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1496   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1497   if (UNLIKELY(current_cpu->trace_extract_p))
1498     {
1499       current_cpu->trace_stream 
1500         << "0x" << hex << pc << dec << " (sfmt_ld_plus)\t"
1501         << " f_r2:0x" << hex << f_r2 << dec
1502         << " f_r1:0x" << hex << f_r1 << dec
1503         << endl;
1504     }
1505
1506 #undef FLD
1507 }
1508
1509 void
1510 m32rbf_extract_sfmt_ld24 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1511     m32rbf_insn_word insn = entire_insn;
1512 #define FLD(f) abuf->fields.sfmt_ld24.f
1513     UINT f_r1;
1514     UINT f_uimm24;
1515
1516     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1517     f_uimm24 = EXTRACT_MSB0_UINT (insn, 32, 8, 24);
1518
1519   /* Record the fields for the semantic handler.  */
1520   FLD (f_r1) = f_r1;
1521   FLD (i_uimm24) = f_uimm24;
1522   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1523   if (UNLIKELY(current_cpu->trace_extract_p))
1524     {
1525       current_cpu->trace_stream 
1526         << "0x" << hex << pc << dec << " (sfmt_ld24)\t"
1527         << " f_r1:0x" << hex << f_r1 << dec
1528         << endl;
1529     }
1530
1531 #undef FLD
1532 }
1533
1534 void
1535 m32rbf_extract_sfmt_ldi8 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1536     m32rbf_insn_word insn = entire_insn;
1537 #define FLD(f) abuf->fields.sfmt_addi.f
1538     UINT f_r1;
1539     INT f_simm8;
1540
1541     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1542     f_simm8 = EXTRACT_MSB0_SINT (insn, 16, 8, 8);
1543
1544   /* Record the fields for the semantic handler.  */
1545   FLD (f_simm8) = f_simm8;
1546   FLD (f_r1) = f_r1;
1547   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1548   if (UNLIKELY(current_cpu->trace_extract_p))
1549     {
1550       current_cpu->trace_stream 
1551         << "0x" << hex << pc << dec << " (sfmt_ldi8)\t"
1552         << " f_simm8:0x" << hex << f_simm8 << dec
1553         << " f_r1:0x" << hex << f_r1 << dec
1554         << endl;
1555     }
1556
1557 #undef FLD
1558 }
1559
1560 void
1561 m32rbf_extract_sfmt_ldi16 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1562     m32rbf_insn_word insn = entire_insn;
1563 #define FLD(f) abuf->fields.sfmt_add3.f
1564     UINT f_r1;
1565     INT f_simm16;
1566
1567     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1568     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1569
1570   /* Record the fields for the semantic handler.  */
1571   FLD (f_simm16) = f_simm16;
1572   FLD (f_r1) = f_r1;
1573   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1574   if (UNLIKELY(current_cpu->trace_extract_p))
1575     {
1576       current_cpu->trace_stream 
1577         << "0x" << hex << pc << dec << " (sfmt_ldi16)\t"
1578         << " f_simm16:0x" << hex << f_simm16 << dec
1579         << " f_r1:0x" << hex << f_r1 << dec
1580         << endl;
1581     }
1582
1583 #undef FLD
1584 }
1585
1586 void
1587 m32rbf_extract_sfmt_lock (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1588     m32rbf_insn_word insn = entire_insn;
1589 #define FLD(f) abuf->fields.sfmt_and3.f
1590     UINT f_r1;
1591     UINT f_r2;
1592
1593     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1594     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1595
1596   /* Record the fields for the semantic handler.  */
1597   FLD (f_r2) = f_r2;
1598   FLD (f_r1) = f_r1;
1599   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1600   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1601   if (UNLIKELY(current_cpu->trace_extract_p))
1602     {
1603       current_cpu->trace_stream 
1604         << "0x" << hex << pc << dec << " (sfmt_lock)\t"
1605         << " f_r2:0x" << hex << f_r2 << dec
1606         << " f_r1:0x" << hex << f_r1 << dec
1607         << endl;
1608     }
1609
1610 #undef FLD
1611 }
1612
1613 void
1614 m32rbf_extract_sfmt_machi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1615     m32rbf_insn_word insn = entire_insn;
1616 #define FLD(f) abuf->fields.sfmt_st_d.f
1617     UINT f_r1;
1618     UINT f_r2;
1619
1620     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1621     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1622
1623   /* Record the fields for the semantic handler.  */
1624   FLD (f_r1) = f_r1;
1625   FLD (f_r2) = f_r2;
1626   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1627   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1628   if (UNLIKELY(current_cpu->trace_extract_p))
1629     {
1630       current_cpu->trace_stream 
1631         << "0x" << hex << pc << dec << " (sfmt_machi)\t"
1632         << " f_r1:0x" << hex << f_r1 << dec
1633         << " f_r2:0x" << hex << f_r2 << dec
1634         << endl;
1635     }
1636
1637 #undef FLD
1638 }
1639
1640 void
1641 m32rbf_extract_sfmt_mulhi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1642     m32rbf_insn_word insn = entire_insn;
1643 #define FLD(f) abuf->fields.sfmt_st_d.f
1644     UINT f_r1;
1645     UINT f_r2;
1646
1647     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1648     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1649
1650   /* Record the fields for the semantic handler.  */
1651   FLD (f_r1) = f_r1;
1652   FLD (f_r2) = f_r2;
1653   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1654   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1655   if (UNLIKELY(current_cpu->trace_extract_p))
1656     {
1657       current_cpu->trace_stream 
1658         << "0x" << hex << pc << dec << " (sfmt_mulhi)\t"
1659         << " f_r1:0x" << hex << f_r1 << dec
1660         << " f_r2:0x" << hex << f_r2 << dec
1661         << endl;
1662     }
1663
1664 #undef FLD
1665 }
1666
1667 void
1668 m32rbf_extract_sfmt_mv (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1669     m32rbf_insn_word insn = entire_insn;
1670 #define FLD(f) abuf->fields.sfmt_and3.f
1671     UINT f_r1;
1672     UINT f_r2;
1673
1674     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1675     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1676
1677   /* Record the fields for the semantic handler.  */
1678   FLD (f_r2) = f_r2;
1679   FLD (f_r1) = f_r1;
1680   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1681   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1682   if (UNLIKELY(current_cpu->trace_extract_p))
1683     {
1684       current_cpu->trace_stream 
1685         << "0x" << hex << pc << dec << " (sfmt_mv)\t"
1686         << " f_r2:0x" << hex << f_r2 << dec
1687         << " f_r1:0x" << hex << f_r1 << dec
1688         << endl;
1689     }
1690
1691 #undef FLD
1692 }
1693
1694 void
1695 m32rbf_extract_sfmt_mvfachi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1696     m32rbf_insn_word insn = entire_insn;
1697 #define FLD(f) abuf->fields.sfmt_slli.f
1698     UINT f_r1;
1699
1700     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1701
1702   /* Record the fields for the semantic handler.  */
1703   FLD (f_r1) = f_r1;
1704   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1705   if (UNLIKELY(current_cpu->trace_extract_p))
1706     {
1707       current_cpu->trace_stream 
1708         << "0x" << hex << pc << dec << " (sfmt_mvfachi)\t"
1709         << " f_r1:0x" << hex << f_r1 << dec
1710         << endl;
1711     }
1712
1713 #undef FLD
1714 }
1715
1716 void
1717 m32rbf_extract_sfmt_mvfc (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1718     m32rbf_insn_word insn = entire_insn;
1719 #define FLD(f) abuf->fields.sfmt_and3.f
1720     UINT f_r1;
1721     UINT f_r2;
1722
1723     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1724     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1725
1726   /* Record the fields for the semantic handler.  */
1727   FLD (f_r2) = f_r2;
1728   FLD (f_r1) = f_r1;
1729   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1730   if (UNLIKELY(current_cpu->trace_extract_p))
1731     {
1732       current_cpu->trace_stream 
1733         << "0x" << hex << pc << dec << " (sfmt_mvfc)\t"
1734         << " f_r2:0x" << hex << f_r2 << dec
1735         << " f_r1:0x" << hex << f_r1 << dec
1736         << endl;
1737     }
1738
1739 #undef FLD
1740 }
1741
1742 void
1743 m32rbf_extract_sfmt_mvtachi (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1744     m32rbf_insn_word insn = entire_insn;
1745 #define FLD(f) abuf->fields.sfmt_st_d.f
1746     UINT f_r1;
1747
1748     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1749
1750   /* Record the fields for the semantic handler.  */
1751   FLD (f_r1) = f_r1;
1752   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1753   if (UNLIKELY(current_cpu->trace_extract_p))
1754     {
1755       current_cpu->trace_stream 
1756         << "0x" << hex << pc << dec << " (sfmt_mvtachi)\t"
1757         << " f_r1:0x" << hex << f_r1 << dec
1758         << endl;
1759     }
1760
1761 #undef FLD
1762 }
1763
1764 void
1765 m32rbf_extract_sfmt_mvtc (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1766     m32rbf_insn_word insn = entire_insn;
1767 #define FLD(f) abuf->fields.sfmt_and3.f
1768     UINT f_r1;
1769     UINT f_r2;
1770
1771     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1772     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1773
1774   /* Record the fields for the semantic handler.  */
1775   FLD (f_r2) = f_r2;
1776   FLD (f_r1) = f_r1;
1777   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1778   if (UNLIKELY(current_cpu->trace_extract_p))
1779     {
1780       current_cpu->trace_stream 
1781         << "0x" << hex << pc << dec << " (sfmt_mvtc)\t"
1782         << " f_r2:0x" << hex << f_r2 << dec
1783         << " f_r1:0x" << hex << f_r1 << dec
1784         << endl;
1785     }
1786
1787 #undef FLD
1788 }
1789
1790 void
1791 m32rbf_extract_sfmt_nop (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1792     m32rbf_insn_word insn = entire_insn;
1793 #define FLD(f) abuf->fields.fmt_empty.f
1794
1795
1796   /* Record the fields for the semantic handler.  */
1797   if (UNLIKELY(current_cpu->trace_extract_p))
1798     {
1799       current_cpu->trace_stream 
1800         << "0x" << hex << pc << dec << " (sfmt_nop)\t"
1801         << endl;
1802     }
1803
1804 #undef FLD
1805 }
1806
1807 void
1808 m32rbf_extract_sfmt_rac (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1809     m32rbf_insn_word insn = entire_insn;
1810 #define FLD(f) abuf->fields.fmt_empty.f
1811
1812
1813   /* Record the fields for the semantic handler.  */
1814   if (UNLIKELY(current_cpu->trace_extract_p))
1815     {
1816       current_cpu->trace_stream 
1817         << "0x" << hex << pc << dec << " (sfmt_rac)\t"
1818         << endl;
1819     }
1820
1821 #undef FLD
1822 }
1823
1824 void
1825 m32rbf_extract_sfmt_rte (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1826     m32rbf_insn_word insn = entire_insn;
1827 #define FLD(f) abuf->fields.fmt_empty.f
1828
1829
1830   /* Record the fields for the semantic handler.  */
1831   if (UNLIKELY(current_cpu->trace_extract_p))
1832     {
1833       current_cpu->trace_stream 
1834         << "0x" << hex << pc << dec << " (sfmt_rte)\t"
1835         << endl;
1836     }
1837
1838 #undef FLD
1839 }
1840
1841 void
1842 m32rbf_extract_sfmt_seth (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1843     m32rbf_insn_word insn = entire_insn;
1844 #define FLD(f) abuf->fields.sfmt_seth.f
1845     UINT f_r1;
1846     UINT f_hi16;
1847
1848     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1849     f_hi16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16);
1850
1851   /* Record the fields for the semantic handler.  */
1852   FLD (f_hi16) = f_hi16;
1853   FLD (f_r1) = f_r1;
1854   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1855   if (UNLIKELY(current_cpu->trace_extract_p))
1856     {
1857       current_cpu->trace_stream 
1858         << "0x" << hex << pc << dec << " (sfmt_seth)\t"
1859         << " f_hi16:0x" << hex << f_hi16 << dec
1860         << " f_r1:0x" << hex << f_r1 << dec
1861         << endl;
1862     }
1863
1864 #undef FLD
1865 }
1866
1867 void
1868 m32rbf_extract_sfmt_sll3 (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1869     m32rbf_insn_word insn = entire_insn;
1870 #define FLD(f) abuf->fields.sfmt_add3.f
1871     UINT f_r1;
1872     UINT f_r2;
1873     INT f_simm16;
1874
1875     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1876     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1877     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1878
1879   /* Record the fields for the semantic handler.  */
1880   FLD (f_simm16) = f_simm16;
1881   FLD (f_r2) = f_r2;
1882   FLD (f_r1) = f_r1;
1883   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
1884   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1885   if (UNLIKELY(current_cpu->trace_extract_p))
1886     {
1887       current_cpu->trace_stream 
1888         << "0x" << hex << pc << dec << " (sfmt_sll3)\t"
1889         << " f_simm16:0x" << hex << f_simm16 << dec
1890         << " f_r2:0x" << hex << f_r2 << dec
1891         << " f_r1:0x" << hex << f_r1 << dec
1892         << endl;
1893     }
1894
1895 #undef FLD
1896 }
1897
1898 void
1899 m32rbf_extract_sfmt_slli (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1900     m32rbf_insn_word insn = entire_insn;
1901 #define FLD(f) abuf->fields.sfmt_slli.f
1902     UINT f_r1;
1903     UINT f_uimm5;
1904
1905     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1906     f_uimm5 = EXTRACT_MSB0_UINT (insn, 16, 11, 5);
1907
1908   /* Record the fields for the semantic handler.  */
1909   FLD (f_r1) = f_r1;
1910   FLD (f_uimm5) = f_uimm5;
1911   FLD (i_dr) = & current_cpu->hardware.h_gr[f_r1];
1912   if (UNLIKELY(current_cpu->trace_extract_p))
1913     {
1914       current_cpu->trace_stream 
1915         << "0x" << hex << pc << dec << " (sfmt_slli)\t"
1916         << " f_r1:0x" << hex << f_r1 << dec
1917         << " f_uimm5:0x" << hex << f_uimm5 << dec
1918         << endl;
1919     }
1920
1921 #undef FLD
1922 }
1923
1924 void
1925 m32rbf_extract_sfmt_st (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1926     m32rbf_insn_word insn = entire_insn;
1927 #define FLD(f) abuf->fields.sfmt_st_d.f
1928     UINT f_r1;
1929     UINT f_r2;
1930
1931     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1932     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1933
1934   /* Record the fields for the semantic handler.  */
1935   FLD (f_r1) = f_r1;
1936   FLD (f_r2) = f_r2;
1937   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1938   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1939   if (UNLIKELY(current_cpu->trace_extract_p))
1940     {
1941       current_cpu->trace_stream 
1942         << "0x" << hex << pc << dec << " (sfmt_st)\t"
1943         << " f_r1:0x" << hex << f_r1 << dec
1944         << " f_r2:0x" << hex << f_r2 << dec
1945         << endl;
1946     }
1947
1948 #undef FLD
1949 }
1950
1951 void
1952 m32rbf_extract_sfmt_st_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1953     m32rbf_insn_word insn = entire_insn;
1954 #define FLD(f) abuf->fields.sfmt_st_d.f
1955     UINT f_r1;
1956     UINT f_r2;
1957     INT f_simm16;
1958
1959     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
1960     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
1961     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
1962
1963   /* Record the fields for the semantic handler.  */
1964   FLD (f_simm16) = f_simm16;
1965   FLD (f_r1) = f_r1;
1966   FLD (f_r2) = f_r2;
1967   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1968   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1969   if (UNLIKELY(current_cpu->trace_extract_p))
1970     {
1971       current_cpu->trace_stream 
1972         << "0x" << hex << pc << dec << " (sfmt_st_d)\t"
1973         << " f_simm16:0x" << hex << f_simm16 << dec
1974         << " f_r1:0x" << hex << f_r1 << dec
1975         << " f_r2:0x" << hex << f_r2 << dec
1976         << endl;
1977     }
1978
1979 #undef FLD
1980 }
1981
1982 void
1983 m32rbf_extract_sfmt_stb (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
1984     m32rbf_insn_word insn = entire_insn;
1985 #define FLD(f) abuf->fields.sfmt_st_d.f
1986     UINT f_r1;
1987     UINT f_r2;
1988
1989     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
1990     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
1991
1992   /* Record the fields for the semantic handler.  */
1993   FLD (f_r1) = f_r1;
1994   FLD (f_r2) = f_r2;
1995   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
1996   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
1997   if (UNLIKELY(current_cpu->trace_extract_p))
1998     {
1999       current_cpu->trace_stream 
2000         << "0x" << hex << pc << dec << " (sfmt_stb)\t"
2001         << " f_r1:0x" << hex << f_r1 << dec
2002         << " f_r2:0x" << hex << f_r2 << dec
2003         << endl;
2004     }
2005
2006 #undef FLD
2007 }
2008
2009 void
2010 m32rbf_extract_sfmt_stb_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2011     m32rbf_insn_word insn = entire_insn;
2012 #define FLD(f) abuf->fields.sfmt_st_d.f
2013     UINT f_r1;
2014     UINT f_r2;
2015     INT f_simm16;
2016
2017     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
2018     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
2019     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
2020
2021   /* Record the fields for the semantic handler.  */
2022   FLD (f_simm16) = f_simm16;
2023   FLD (f_r1) = f_r1;
2024   FLD (f_r2) = f_r2;
2025   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
2026   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
2027   if (UNLIKELY(current_cpu->trace_extract_p))
2028     {
2029       current_cpu->trace_stream 
2030         << "0x" << hex << pc << dec << " (sfmt_stb_d)\t"
2031         << " f_simm16:0x" << hex << f_simm16 << dec
2032         << " f_r1:0x" << hex << f_r1 << dec
2033         << " f_r2:0x" << hex << f_r2 << dec
2034         << endl;
2035     }
2036
2037 #undef FLD
2038 }
2039
2040 void
2041 m32rbf_extract_sfmt_sth (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2042     m32rbf_insn_word insn = entire_insn;
2043 #define FLD(f) abuf->fields.sfmt_st_d.f
2044     UINT f_r1;
2045     UINT f_r2;
2046
2047     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
2048     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
2049
2050   /* Record the fields for the semantic handler.  */
2051   FLD (f_r1) = f_r1;
2052   FLD (f_r2) = f_r2;
2053   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
2054   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
2055   if (UNLIKELY(current_cpu->trace_extract_p))
2056     {
2057       current_cpu->trace_stream 
2058         << "0x" << hex << pc << dec << " (sfmt_sth)\t"
2059         << " f_r1:0x" << hex << f_r1 << dec
2060         << " f_r2:0x" << hex << f_r2 << dec
2061         << endl;
2062     }
2063
2064 #undef FLD
2065 }
2066
2067 void
2068 m32rbf_extract_sfmt_sth_d (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2069     m32rbf_insn_word insn = entire_insn;
2070 #define FLD(f) abuf->fields.sfmt_st_d.f
2071     UINT f_r1;
2072     UINT f_r2;
2073     INT f_simm16;
2074
2075     f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4);
2076     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
2077     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
2078
2079   /* Record the fields for the semantic handler.  */
2080   FLD (f_simm16) = f_simm16;
2081   FLD (f_r1) = f_r1;
2082   FLD (f_r2) = f_r2;
2083   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
2084   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
2085   if (UNLIKELY(current_cpu->trace_extract_p))
2086     {
2087       current_cpu->trace_stream 
2088         << "0x" << hex << pc << dec << " (sfmt_sth_d)\t"
2089         << " f_simm16:0x" << hex << f_simm16 << dec
2090         << " f_r1:0x" << hex << f_r1 << dec
2091         << " f_r2:0x" << hex << f_r2 << dec
2092         << endl;
2093     }
2094
2095 #undef FLD
2096 }
2097
2098 void
2099 m32rbf_extract_sfmt_st_plus (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2100     m32rbf_insn_word insn = entire_insn;
2101 #define FLD(f) abuf->fields.sfmt_st_d.f
2102     UINT f_r1;
2103     UINT f_r2;
2104
2105     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
2106     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
2107
2108   /* Record the fields for the semantic handler.  */
2109   FLD (f_r1) = f_r1;
2110   FLD (f_r2) = f_r2;
2111   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
2112   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
2113   if (UNLIKELY(current_cpu->trace_extract_p))
2114     {
2115       current_cpu->trace_stream 
2116         << "0x" << hex << pc << dec << " (sfmt_st_plus)\t"
2117         << " f_r1:0x" << hex << f_r1 << dec
2118         << " f_r2:0x" << hex << f_r2 << dec
2119         << endl;
2120     }
2121
2122 #undef FLD
2123 }
2124
2125 void
2126 m32rbf_extract_sfmt_trap (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2127     m32rbf_insn_word insn = entire_insn;
2128 #define FLD(f) abuf->fields.sfmt_trap.f
2129     UINT f_uimm4;
2130
2131     f_uimm4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
2132
2133   /* Record the fields for the semantic handler.  */
2134   FLD (f_uimm4) = f_uimm4;
2135   if (UNLIKELY(current_cpu->trace_extract_p))
2136     {
2137       current_cpu->trace_stream 
2138         << "0x" << hex << pc << dec << " (sfmt_trap)\t"
2139         << " f_uimm4:0x" << hex << f_uimm4 << dec
2140         << endl;
2141     }
2142
2143 #undef FLD
2144 }
2145
2146 void
2147 m32rbf_extract_sfmt_unlock (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2148     m32rbf_insn_word insn = entire_insn;
2149 #define FLD(f) abuf->fields.sfmt_st_d.f
2150     UINT f_r1;
2151     UINT f_r2;
2152
2153     f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4);
2154     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
2155
2156   /* Record the fields for the semantic handler.  */
2157   FLD (f_r1) = f_r1;
2158   FLD (f_r2) = f_r2;
2159   FLD (i_src1) = & current_cpu->hardware.h_gr[f_r1];
2160   FLD (i_src2) = & current_cpu->hardware.h_gr[f_r2];
2161   if (UNLIKELY(current_cpu->trace_extract_p))
2162     {
2163       current_cpu->trace_stream 
2164         << "0x" << hex << pc << dec << " (sfmt_unlock)\t"
2165         << " f_r1:0x" << hex << f_r1 << dec
2166         << " f_r2:0x" << hex << f_r2 << dec
2167         << endl;
2168     }
2169
2170 #undef FLD
2171 }
2172
2173 void
2174 m32rbf_extract_sfmt_clrpsw (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2175     m32rbf_insn_word insn = entire_insn;
2176 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2177     UINT f_uimm8;
2178
2179     f_uimm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8);
2180
2181   /* Record the fields for the semantic handler.  */
2182   FLD (f_uimm8) = f_uimm8;
2183   if (UNLIKELY(current_cpu->trace_extract_p))
2184     {
2185       current_cpu->trace_stream 
2186         << "0x" << hex << pc << dec << " (sfmt_clrpsw)\t"
2187         << " f_uimm8:0x" << hex << f_uimm8 << dec
2188         << endl;
2189     }
2190
2191 #undef FLD
2192 }
2193
2194 void
2195 m32rbf_extract_sfmt_setpsw (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2196     m32rbf_insn_word insn = entire_insn;
2197 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2198     UINT f_uimm8;
2199
2200     f_uimm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8);
2201
2202   /* Record the fields for the semantic handler.  */
2203   FLD (f_uimm8) = f_uimm8;
2204   if (UNLIKELY(current_cpu->trace_extract_p))
2205     {
2206       current_cpu->trace_stream 
2207         << "0x" << hex << pc << dec << " (sfmt_setpsw)\t"
2208         << " f_uimm8:0x" << hex << f_uimm8 << dec
2209         << endl;
2210     }
2211
2212 #undef FLD
2213 }
2214
2215 void
2216 m32rbf_extract_sfmt_bset (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2217     m32rbf_insn_word insn = entire_insn;
2218 #define FLD(f) abuf->fields.sfmt_bset.f
2219     UINT f_uimm3;
2220     UINT f_r2;
2221     INT f_simm16;
2222
2223     f_uimm3 = EXTRACT_MSB0_UINT (insn, 32, 5, 3);
2224     f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4);
2225     f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16);
2226
2227   /* Record the fields for the semantic handler.  */
2228   FLD (f_simm16) = f_simm16;
2229   FLD (f_r2) = f_r2;
2230   FLD (f_uimm3) = f_uimm3;
2231   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
2232   if (UNLIKELY(current_cpu->trace_extract_p))
2233     {
2234       current_cpu->trace_stream 
2235         << "0x" << hex << pc << dec << " (sfmt_bset)\t"
2236         << " f_simm16:0x" << hex << f_simm16 << dec
2237         << " f_r2:0x" << hex << f_r2 << dec
2238         << " f_uimm3:0x" << hex << f_uimm3 << dec
2239         << endl;
2240     }
2241
2242 #undef FLD
2243 }
2244
2245 void
2246 m32rbf_extract_sfmt_btst (m32rbf_scache* abuf, m32rbf_cpu* current_cpu, PCADDR pc, m32rbf_insn_word base_insn, m32rbf_insn_word entire_insn){
2247     m32rbf_insn_word insn = entire_insn;
2248 #define FLD(f) abuf->fields.sfmt_bset.f
2249     UINT f_uimm3;
2250     UINT f_r2;
2251
2252     f_uimm3 = EXTRACT_MSB0_UINT (insn, 16, 5, 3);
2253     f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4);
2254
2255   /* Record the fields for the semantic handler.  */
2256   FLD (f_r2) = f_r2;
2257   FLD (f_uimm3) = f_uimm3;
2258   FLD (i_sr) = & current_cpu->hardware.h_gr[f_r2];
2259   if (UNLIKELY(current_cpu->trace_extract_p))
2260     {
2261       current_cpu->trace_stream 
2262         << "0x" << hex << pc << dec << " (sfmt_btst)\t"
2263         << " f_r2:0x" << hex << f_r2 << dec
2264         << " f_uimm3:0x" << hex << f_uimm3 << dec
2265         << endl;
2266     }
2267
2268 #undef FLD
2269 }
2270