OSDN Git Service

Regenerate cgen files, update copyright year.
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cgen-cpu / arm7t / thumb-decode.cxx
1 /* Simulator instruction decoder for thumb.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 2000-2010 Red Hat, Inc.
6
7 This file is part of the Red Hat simulators.
8
9
10 */
11
12
13 #if HAVE_CONFIG_H
14 #include "config.h"
15 #endif
16 #include "arm7f.h"
17
18 using namespace arm7f; // FIXME: namespace organization still wip
19
20
21 // The instruction descriptor array. 
22
23 // Have label pointers been initialized?
24 // XXX: Note that this is also needed by when semantics are implemented as
25 // functions to handle machine variants.
26 bool thumb_idesc::idesc_table_initialized_p = false;
27
28 thumb_idesc thumb_idesc::idesc_table[THUMB_INSN_BL_LO + 1] =
29 {
30   { 0, 0, "X_AFTER", THUMB_INSN_X_AFTER, { 0|(1<<CGEN_INSN_PBB)|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
31   { 0, 0, "X_BEFORE", THUMB_INSN_X_BEFORE, { 0|(1<<CGEN_INSN_PBB)|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
32   { 0, 0, "X_CTI_CHAIN", THUMB_INSN_X_CTI_CHAIN, { 0|(1<<CGEN_INSN_PBB)|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
33   { 0, 0, "X_CHAIN", THUMB_INSN_X_CHAIN, { 0|(1<<CGEN_INSN_PBB)|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
34   { 0, 0, "X_BEGIN", THUMB_INSN_X_BEGIN, { 0|(1<<CGEN_INSN_PBB)|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
35   { 0, thumb_sem_x_invalid, "X_INVALID", THUMB_INSN_X_INVALID, { 0|(1<<CGEN_INSN_VIRTUAL), (1<<MACH_BASE), { 1, "\x40" } } },
36   { 0, thumb_sem_lsl, "LSL", THUMB_INSN_LSL, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
37   { 0, thumb_sem_lsr, "LSR", THUMB_INSN_LSR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
38   { 0, thumb_sem_asr, "ASR", THUMB_INSN_ASR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
39   { 0, thumb_sem_add, "ADD", THUMB_INSN_ADD, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
40   { 0, thumb_sem_addi, "ADDI", THUMB_INSN_ADDI, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
41   { 0, thumb_sem_sub, "SUB", THUMB_INSN_SUB, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
42   { 0, thumb_sem_subi, "SUBI", THUMB_INSN_SUBI, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
43   { 0, thumb_sem_mov, "MOV", THUMB_INSN_MOV, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
44   { 0, thumb_sem_cmp, "CMP", THUMB_INSN_CMP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
45   { 0, thumb_sem_addi8, "ADDI8", THUMB_INSN_ADDI8, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
46   { 0, thumb_sem_subi8, "SUBI8", THUMB_INSN_SUBI8, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
47   { 0, thumb_sem_alu_and, "ALU_AND", THUMB_INSN_ALU_AND, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
48   { 0, thumb_sem_alu_eor, "ALU_EOR", THUMB_INSN_ALU_EOR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
49   { 0, thumb_sem_alu_lsl, "ALU_LSL", THUMB_INSN_ALU_LSL, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
50   { 0, thumb_sem_alu_lsr, "ALU_LSR", THUMB_INSN_ALU_LSR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
51   { 0, thumb_sem_alu_asr, "ALU_ASR", THUMB_INSN_ALU_ASR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
52   { 0, thumb_sem_alu_ror, "ALU_ROR", THUMB_INSN_ALU_ROR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
53   { 0, thumb_sem_alu_adc, "ALU_ADC", THUMB_INSN_ALU_ADC, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
54   { 0, thumb_sem_alu_sbc, "ALU_SBC", THUMB_INSN_ALU_SBC, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
55   { 0, thumb_sem_alu_tst, "ALU_TST", THUMB_INSN_ALU_TST, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
56   { 0, thumb_sem_alu_neg, "ALU_NEG", THUMB_INSN_ALU_NEG, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
57   { 0, thumb_sem_alu_cmp, "ALU_CMP", THUMB_INSN_ALU_CMP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
58   { 0, thumb_sem_alu_cmn, "ALU_CMN", THUMB_INSN_ALU_CMN, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
59   { 0, thumb_sem_alu_orr, "ALU_ORR", THUMB_INSN_ALU_ORR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
60   { 0, thumb_sem_alu_mul, "ALU_MUL", THUMB_INSN_ALU_MUL, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
61   { 0, thumb_sem_alu_bic, "ALU_BIC", THUMB_INSN_ALU_BIC, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
62   { 0, thumb_sem_alu_mvn, "ALU_MVN", THUMB_INSN_ALU_MVN, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
63   { 0, thumb_sem_add_rd_hs, "ADD_RD_HS", THUMB_INSN_ADD_RD_HS, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
64   { 0, thumb_sem_add_hd_rs, "ADD_HD_RS", THUMB_INSN_ADD_HD_RS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
65   { 0, thumb_sem_add_hd_hs, "ADD_HD_HS", THUMB_INSN_ADD_HD_HS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
66   { 0, thumb_sem_cmp_rd_hs, "CMP_RD_HS", THUMB_INSN_CMP_RD_HS, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
67   { 0, thumb_sem_cmp_hd_rs, "CMP_HD_RS", THUMB_INSN_CMP_HD_RS, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
68   { 0, thumb_sem_cmp_hd_hs, "CMP_HD_HS", THUMB_INSN_CMP_HD_HS, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
69   { 0, thumb_sem_mov_rd_hs, "MOV_RD_HS", THUMB_INSN_MOV_RD_HS, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
70   { 0, thumb_sem_mov_hd_rs, "MOV_HD_RS", THUMB_INSN_MOV_HD_RS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
71   { 0, thumb_sem_mov_hd_hs, "MOV_HD_HS", THUMB_INSN_MOV_HD_HS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
72   { 0, thumb_sem_bx_rs, "BX_RS", THUMB_INSN_BX_RS, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
73   { 0, thumb_sem_bx_hs, "BX_HS", THUMB_INSN_BX_HS, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
74   { 0, thumb_sem_ldr_pc, "LDR_PC", THUMB_INSN_LDR_PC, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
75   { 0, thumb_sem_str, "STR", THUMB_INSN_STR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
76   { 0, thumb_sem_strb, "STRB", THUMB_INSN_STRB, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
77   { 0, thumb_sem_ldr, "LDR", THUMB_INSN_LDR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
78   { 0, thumb_sem_ldrb, "LDRB", THUMB_INSN_LDRB, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
79   { 0, thumb_sem_strh, "STRH", THUMB_INSN_STRH, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
80   { 0, thumb_sem_ldrh, "LDRH", THUMB_INSN_LDRH, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
81   { 0, thumb_sem_ldsb, "LDSB", THUMB_INSN_LDSB, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
82   { 0, thumb_sem_ldsh, "LDSH", THUMB_INSN_LDSH, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
83   { 0, thumb_sem_str_imm, "STR_IMM", THUMB_INSN_STR_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
84   { 0, thumb_sem_ldr_imm, "LDR_IMM", THUMB_INSN_LDR_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
85   { 0, thumb_sem_strb_imm, "STRB_IMM", THUMB_INSN_STRB_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
86   { 0, thumb_sem_ldrb_imm, "LDRB_IMM", THUMB_INSN_LDRB_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
87   { 0, thumb_sem_strh_imm, "STRH_IMM", THUMB_INSN_STRH_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
88   { 0, thumb_sem_ldrh_imm, "LDRH_IMM", THUMB_INSN_LDRH_IMM, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
89   { 0, thumb_sem_str_sprel, "STR_SPREL", THUMB_INSN_STR_SPREL, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
90   { 0, thumb_sem_ldr_sprel, "LDR_SPREL", THUMB_INSN_LDR_SPREL, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
91   { 0, thumb_sem_lda_pc, "LDA_PC", THUMB_INSN_LDA_PC, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
92   { 0, thumb_sem_lda_sp, "LDA_SP", THUMB_INSN_LDA_SP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
93   { 0, thumb_sem_add_sp, "ADD_SP", THUMB_INSN_ADD_SP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
94   { 0, thumb_sem_sub_sp, "SUB_SP", THUMB_INSN_SUB_SP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
95   { 0, thumb_sem_push, "PUSH", THUMB_INSN_PUSH, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
96   { 0, thumb_sem_push_lr, "PUSH_LR", THUMB_INSN_PUSH_LR, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
97   { 0, thumb_sem_pop, "POP", THUMB_INSN_POP, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
98   { 0, thumb_sem_pop_pc, "POP_PC", THUMB_INSN_POP_PC, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
99   { 0, thumb_sem_stmia, "STMIA", THUMB_INSN_STMIA, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
100   { 0, thumb_sem_ldmia, "LDMIA", THUMB_INSN_LDMIA, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
101   { 0, thumb_sem_beq, "BEQ", THUMB_INSN_BEQ, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
102   { 0, thumb_sem_bne, "BNE", THUMB_INSN_BNE, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
103   { 0, thumb_sem_bcs, "BCS", THUMB_INSN_BCS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
104   { 0, thumb_sem_bcc, "BCC", THUMB_INSN_BCC, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
105   { 0, thumb_sem_bmi, "BMI", THUMB_INSN_BMI, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
106   { 0, thumb_sem_bpl, "BPL", THUMB_INSN_BPL, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
107   { 0, thumb_sem_bvs, "BVS", THUMB_INSN_BVS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
108   { 0, thumb_sem_bvc, "BVC", THUMB_INSN_BVC, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
109   { 0, thumb_sem_bhi, "BHI", THUMB_INSN_BHI, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
110   { 0, thumb_sem_bls, "BLS", THUMB_INSN_BLS, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
111   { 0, thumb_sem_bge, "BGE", THUMB_INSN_BGE, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
112   { 0, thumb_sem_blt, "BLT", THUMB_INSN_BLT, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
113   { 0, thumb_sem_bgt, "BGT", THUMB_INSN_BGT, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
114   { 0, thumb_sem_ble, "BLE", THUMB_INSN_BLE, { 0|(1<<CGEN_INSN_COND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
115   { 0, thumb_sem_swi, "SWI", THUMB_INSN_SWI, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
116   { 0, thumb_sem_b, "B", THUMB_INSN_B, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
117   { 0, thumb_sem_bl_hi, "BL_HI", THUMB_INSN_BL_HI, { 0, (1<<MACH_BASE), { 1, "\x40" } } },
118   { 0, thumb_sem_bl_lo, "BL_LO", THUMB_INSN_BL_LO, { 0|(1<<CGEN_INSN_UNCOND_CTI), (1<<MACH_BASE), { 1, "\x40" } } },
119
120 };
121
122 // Given a canonical virtual insn id, return the target specific one.
123
124 thumb_insn_type
125 thumb_idesc::lookup_virtual (virtual_insn_type vit)
126 {
127   switch (vit)
128     {
129       case VIRTUAL_INSN_INVALID: return THUMB_INSN_X_INVALID;
130       case VIRTUAL_INSN_BEGIN: return THUMB_INSN_X_BEGIN;
131       case VIRTUAL_INSN_CHAIN: return THUMB_INSN_X_CHAIN;
132       case VIRTUAL_INSN_CTI_CHAIN: return THUMB_INSN_X_CTI_CHAIN;
133       case VIRTUAL_INSN_BEFORE: return THUMB_INSN_X_BEFORE;
134       case VIRTUAL_INSN_AFTER: return THUMB_INSN_X_AFTER;
135       case VIRTUAL_INSN_COND: return THUMB_INSN_X_INVALID;
136     }
137   abort ();
138 }
139
140
141 // Declare extractor functions
142
143 static void
144 thumb_extract_sfmt_empty (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
145 static void
146 thumb_extract_sfmt_lsl (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
147 static void
148 thumb_extract_sfmt_add (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
149 static void
150 thumb_extract_sfmt_addi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
151 static void
152 thumb_extract_sfmt_mov (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
153 static void
154 thumb_extract_sfmt_cmp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
155 static void
156 thumb_extract_sfmt_addi8 (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
157 static void
158 thumb_extract_sfmt_alu_and (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
159 static void
160 thumb_extract_sfmt_alu_lsl (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
161 static void
162 thumb_extract_sfmt_alu_adc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
163 static void
164 thumb_extract_sfmt_alu_tst (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
165 static void
166 thumb_extract_sfmt_alu_neg (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
167 static void
168 thumb_extract_sfmt_alu_cmp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
169 static void
170 thumb_extract_sfmt_add_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
171 static void
172 thumb_extract_sfmt_add_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
173 static void
174 thumb_extract_sfmt_add_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
175 static void
176 thumb_extract_sfmt_cmp_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
177 static void
178 thumb_extract_sfmt_cmp_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
179 static void
180 thumb_extract_sfmt_cmp_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
181 static void
182 thumb_extract_sfmt_mov_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
183 static void
184 thumb_extract_sfmt_mov_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
185 static void
186 thumb_extract_sfmt_mov_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
187 static void
188 thumb_extract_sfmt_bx_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
189 static void
190 thumb_extract_sfmt_bx_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
191 static void
192 thumb_extract_sfmt_ldr_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
193 static void
194 thumb_extract_sfmt_str (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
195 static void
196 thumb_extract_sfmt_strb (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
197 static void
198 thumb_extract_sfmt_ldr (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
199 static void
200 thumb_extract_sfmt_ldrb (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
201 static void
202 thumb_extract_sfmt_strh (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
203 static void
204 thumb_extract_sfmt_ldrh (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
205 static void
206 thumb_extract_sfmt_str_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
207 static void
208 thumb_extract_sfmt_ldr_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
209 static void
210 thumb_extract_sfmt_strb_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
211 static void
212 thumb_extract_sfmt_ldrb_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
213 static void
214 thumb_extract_sfmt_strh_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
215 static void
216 thumb_extract_sfmt_ldrh_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
217 static void
218 thumb_extract_sfmt_str_sprel (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
219 static void
220 thumb_extract_sfmt_ldr_sprel (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
221 static void
222 thumb_extract_sfmt_lda_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
223 static void
224 thumb_extract_sfmt_lda_sp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
225 static void
226 thumb_extract_sfmt_add_sp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
227 static void
228 thumb_extract_sfmt_push (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
229 static void
230 thumb_extract_sfmt_push_lr (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
231 static void
232 thumb_extract_sfmt_pop (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
233 static void
234 thumb_extract_sfmt_pop_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
235 static void
236 thumb_extract_sfmt_stmia (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
237 static void
238 thumb_extract_sfmt_ldmia (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
239 static void
240 thumb_extract_sfmt_beq (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
241 static void
242 thumb_extract_sfmt_bcs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
243 static void
244 thumb_extract_sfmt_bmi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
245 static void
246 thumb_extract_sfmt_bvs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
247 static void
248 thumb_extract_sfmt_bhi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
249 static void
250 thumb_extract_sfmt_bge (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
251 static void
252 thumb_extract_sfmt_bgt (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
253 static void
254 thumb_extract_sfmt_swi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
255 static void
256 thumb_extract_sfmt_b (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
257 static void
258 thumb_extract_sfmt_bl_hi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
259 static void
260 thumb_extract_sfmt_bl_lo (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn);
261
262 // Fetch & decode instruction
263 void
264 thumb_scache::decode (arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn)
265 {
266   /* Result of decoder.  */
267   THUMB_INSN_TYPE itype;
268
269   {
270     thumb_insn_word insn = base_insn;
271
272     {
273       unsigned int val = (((insn >> 8) & (255 << 0)));
274       switch (val)
275       {
276       case 0 : /* fall through */
277       case 1 : /* fall through */
278       case 2 : /* fall through */
279       case 3 : /* fall through */
280       case 4 : /* fall through */
281       case 5 : /* fall through */
282       case 6 : /* fall through */
283       case 7 :
284         entire_insn = entire_insn >> 16;
285         itype = THUMB_INSN_LSL; thumb_extract_sfmt_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
286       case 8 : /* fall through */
287       case 9 : /* fall through */
288       case 10 : /* fall through */
289       case 11 : /* fall through */
290       case 12 : /* fall through */
291       case 13 : /* fall through */
292       case 14 : /* fall through */
293       case 15 :
294         entire_insn = entire_insn >> 16;
295         itype = THUMB_INSN_LSR; thumb_extract_sfmt_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
296       case 16 : /* fall through */
297       case 17 : /* fall through */
298       case 18 : /* fall through */
299       case 19 : /* fall through */
300       case 20 : /* fall through */
301       case 21 : /* fall through */
302       case 22 : /* fall through */
303       case 23 :
304         entire_insn = entire_insn >> 16;
305         itype = THUMB_INSN_ASR; thumb_extract_sfmt_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
306       case 24 : /* fall through */
307       case 25 :
308         entire_insn = entire_insn >> 16;
309         itype = THUMB_INSN_ADD; thumb_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
310       case 26 : /* fall through */
311       case 27 :
312         entire_insn = entire_insn >> 16;
313         itype = THUMB_INSN_SUB; thumb_extract_sfmt_add (this, current_cpu, pc, base_insn, entire_insn); goto done;
314       case 28 : /* fall through */
315       case 29 :
316         entire_insn = entire_insn >> 16;
317         itype = THUMB_INSN_ADDI; thumb_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
318       case 30 : /* fall through */
319       case 31 :
320         entire_insn = entire_insn >> 16;
321         itype = THUMB_INSN_SUBI; thumb_extract_sfmt_addi (this, current_cpu, pc, base_insn, entire_insn); goto done;
322       case 32 : /* fall through */
323       case 33 : /* fall through */
324       case 34 : /* fall through */
325       case 35 : /* fall through */
326       case 36 : /* fall through */
327       case 37 : /* fall through */
328       case 38 : /* fall through */
329       case 39 :
330         entire_insn = entire_insn >> 16;
331         itype = THUMB_INSN_MOV; thumb_extract_sfmt_mov (this, current_cpu, pc, base_insn, entire_insn); goto done;
332       case 40 : /* fall through */
333       case 41 : /* fall through */
334       case 42 : /* fall through */
335       case 43 : /* fall through */
336       case 44 : /* fall through */
337       case 45 : /* fall through */
338       case 46 : /* fall through */
339       case 47 :
340         entire_insn = entire_insn >> 16;
341         itype = THUMB_INSN_CMP; thumb_extract_sfmt_cmp (this, current_cpu, pc, base_insn, entire_insn); goto done;
342       case 48 : /* fall through */
343       case 49 : /* fall through */
344       case 50 : /* fall through */
345       case 51 : /* fall through */
346       case 52 : /* fall through */
347       case 53 : /* fall through */
348       case 54 : /* fall through */
349       case 55 :
350         entire_insn = entire_insn >> 16;
351         itype = THUMB_INSN_ADDI8; thumb_extract_sfmt_addi8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
352       case 56 : /* fall through */
353       case 57 : /* fall through */
354       case 58 : /* fall through */
355       case 59 : /* fall through */
356       case 60 : /* fall through */
357       case 61 : /* fall through */
358       case 62 : /* fall through */
359       case 63 :
360         entire_insn = entire_insn >> 16;
361         itype = THUMB_INSN_SUBI8; thumb_extract_sfmt_addi8 (this, current_cpu, pc, base_insn, entire_insn); goto done;
362       case 64 :
363         {
364           unsigned int val = (((insn >> 6) & (3 << 0)));
365           switch (val)
366           {
367           case 0 :
368             entire_insn = entire_insn >> 16;
369             itype = THUMB_INSN_ALU_AND; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
370           case 1 :
371             entire_insn = entire_insn >> 16;
372             itype = THUMB_INSN_ALU_EOR; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
373           case 2 :
374             entire_insn = entire_insn >> 16;
375             itype = THUMB_INSN_ALU_LSL; thumb_extract_sfmt_alu_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
376           case 3 :
377             entire_insn = entire_insn >> 16;
378             itype = THUMB_INSN_ALU_LSR; thumb_extract_sfmt_alu_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
379           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
380           }
381         }
382       case 65 :
383         {
384           unsigned int val = (((insn >> 6) & (3 << 0)));
385           switch (val)
386           {
387           case 0 :
388             entire_insn = entire_insn >> 16;
389             itype = THUMB_INSN_ALU_ASR; thumb_extract_sfmt_alu_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
390           case 1 :
391             entire_insn = entire_insn >> 16;
392             itype = THUMB_INSN_ALU_ADC; thumb_extract_sfmt_alu_adc (this, current_cpu, pc, base_insn, entire_insn); goto done;
393           case 2 :
394             entire_insn = entire_insn >> 16;
395             itype = THUMB_INSN_ALU_SBC; thumb_extract_sfmt_alu_adc (this, current_cpu, pc, base_insn, entire_insn); goto done;
396           case 3 :
397             entire_insn = entire_insn >> 16;
398             itype = THUMB_INSN_ALU_ROR; thumb_extract_sfmt_alu_lsl (this, current_cpu, pc, base_insn, entire_insn); goto done;
399           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
400           }
401         }
402       case 66 :
403         {
404           unsigned int val = (((insn >> 6) & (3 << 0)));
405           switch (val)
406           {
407           case 0 :
408             entire_insn = entire_insn >> 16;
409             itype = THUMB_INSN_ALU_TST; thumb_extract_sfmt_alu_tst (this, current_cpu, pc, base_insn, entire_insn); goto done;
410           case 1 :
411             entire_insn = entire_insn >> 16;
412             itype = THUMB_INSN_ALU_NEG; thumb_extract_sfmt_alu_neg (this, current_cpu, pc, base_insn, entire_insn); goto done;
413           case 2 :
414             entire_insn = entire_insn >> 16;
415             itype = THUMB_INSN_ALU_CMP; thumb_extract_sfmt_alu_cmp (this, current_cpu, pc, base_insn, entire_insn); goto done;
416           case 3 :
417             entire_insn = entire_insn >> 16;
418             itype = THUMB_INSN_ALU_CMN; thumb_extract_sfmt_alu_cmp (this, current_cpu, pc, base_insn, entire_insn); goto done;
419           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
420           }
421         }
422       case 67 :
423         {
424           unsigned int val = (((insn >> 6) & (3 << 0)));
425           switch (val)
426           {
427           case 0 :
428             entire_insn = entire_insn >> 16;
429             itype = THUMB_INSN_ALU_ORR; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
430           case 1 :
431             entire_insn = entire_insn >> 16;
432             itype = THUMB_INSN_ALU_MUL; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
433           case 2 :
434             entire_insn = entire_insn >> 16;
435             itype = THUMB_INSN_ALU_BIC; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
436           case 3 :
437             entire_insn = entire_insn >> 16;
438             itype = THUMB_INSN_ALU_MVN; thumb_extract_sfmt_alu_and (this, current_cpu, pc, base_insn, entire_insn); goto done;
439           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
440           }
441         }
442       case 68 :
443         {
444           unsigned int val = (((insn >> 6) & (3 << 0)));
445           switch (val)
446           {
447           case 1 :
448             entire_insn = entire_insn >> 16;
449             itype = THUMB_INSN_ADD_RD_HS; thumb_extract_sfmt_add_rd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
450           case 2 :
451             entire_insn = entire_insn >> 16;
452             itype = THUMB_INSN_ADD_HD_RS; thumb_extract_sfmt_add_hd_rs (this, current_cpu, pc, base_insn, entire_insn); goto done;
453           case 3 :
454             entire_insn = entire_insn >> 16;
455             itype = THUMB_INSN_ADD_HD_HS; thumb_extract_sfmt_add_hd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
456           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
457           }
458         }
459       case 69 :
460         {
461           unsigned int val = (((insn >> 6) & (3 << 0)));
462           switch (val)
463           {
464           case 1 :
465             entire_insn = entire_insn >> 16;
466             itype = THUMB_INSN_CMP_RD_HS; thumb_extract_sfmt_cmp_rd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
467           case 2 :
468             entire_insn = entire_insn >> 16;
469             itype = THUMB_INSN_CMP_HD_RS; thumb_extract_sfmt_cmp_hd_rs (this, current_cpu, pc, base_insn, entire_insn); goto done;
470           case 3 :
471             entire_insn = entire_insn >> 16;
472             itype = THUMB_INSN_CMP_HD_HS; thumb_extract_sfmt_cmp_hd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
473           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
474           }
475         }
476       case 70 :
477         {
478           unsigned int val = (((insn >> 6) & (3 << 0)));
479           switch (val)
480           {
481           case 1 :
482             entire_insn = entire_insn >> 16;
483             itype = THUMB_INSN_MOV_RD_HS; thumb_extract_sfmt_mov_rd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
484           case 2 :
485             entire_insn = entire_insn >> 16;
486             itype = THUMB_INSN_MOV_HD_RS; thumb_extract_sfmt_mov_hd_rs (this, current_cpu, pc, base_insn, entire_insn); goto done;
487           case 3 :
488             entire_insn = entire_insn >> 16;
489             itype = THUMB_INSN_MOV_HD_HS; thumb_extract_sfmt_mov_hd_hs (this, current_cpu, pc, base_insn, entire_insn); goto done;
490           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
491           }
492         }
493       case 71 :
494         {
495           unsigned int val = (((insn >> 6) & (1 << 0)));
496           switch (val)
497           {
498           case 0 :
499             entire_insn = entire_insn >> 16;
500             if ((entire_insn & 0xffc7) == 0x4700)
501               { itype = THUMB_INSN_BX_RS; thumb_extract_sfmt_bx_rs (this, current_cpu, pc, base_insn, entire_insn); goto done; }
502             itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
503           case 1 :
504             entire_insn = entire_insn >> 16;
505             if ((entire_insn & 0xffc7) == 0x4740)
506               { itype = THUMB_INSN_BX_HS; thumb_extract_sfmt_bx_hs (this, current_cpu, pc, base_insn, entire_insn); goto done; }
507             itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
508           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
509           }
510         }
511       case 72 : /* fall through */
512       case 73 : /* fall through */
513       case 74 : /* fall through */
514       case 75 : /* fall through */
515       case 76 : /* fall through */
516       case 77 : /* fall through */
517       case 78 : /* fall through */
518       case 79 :
519         entire_insn = entire_insn >> 16;
520         itype = THUMB_INSN_LDR_PC; thumb_extract_sfmt_ldr_pc (this, current_cpu, pc, base_insn, entire_insn); goto done;
521       case 80 : /* fall through */
522       case 81 :
523         entire_insn = entire_insn >> 16;
524         itype = THUMB_INSN_STR; thumb_extract_sfmt_str (this, current_cpu, pc, base_insn, entire_insn); goto done;
525       case 82 : /* fall through */
526       case 83 :
527         entire_insn = entire_insn >> 16;
528         itype = THUMB_INSN_STRH; thumb_extract_sfmt_strh (this, current_cpu, pc, base_insn, entire_insn); goto done;
529       case 84 : /* fall through */
530       case 85 :
531         entire_insn = entire_insn >> 16;
532         itype = THUMB_INSN_STRB; thumb_extract_sfmt_strb (this, current_cpu, pc, base_insn, entire_insn); goto done;
533       case 86 : /* fall through */
534       case 87 :
535         entire_insn = entire_insn >> 16;
536         itype = THUMB_INSN_LDSB; thumb_extract_sfmt_ldrb (this, current_cpu, pc, base_insn, entire_insn); goto done;
537       case 88 : /* fall through */
538       case 89 :
539         entire_insn = entire_insn >> 16;
540         itype = THUMB_INSN_LDR; thumb_extract_sfmt_ldr (this, current_cpu, pc, base_insn, entire_insn); goto done;
541       case 90 : /* fall through */
542       case 91 :
543         entire_insn = entire_insn >> 16;
544         itype = THUMB_INSN_LDRH; thumb_extract_sfmt_ldrh (this, current_cpu, pc, base_insn, entire_insn); goto done;
545       case 92 : /* fall through */
546       case 93 :
547         entire_insn = entire_insn >> 16;
548         itype = THUMB_INSN_LDRB; thumb_extract_sfmt_ldrb (this, current_cpu, pc, base_insn, entire_insn); goto done;
549       case 94 : /* fall through */
550       case 95 :
551         entire_insn = entire_insn >> 16;
552         itype = THUMB_INSN_LDSH; thumb_extract_sfmt_ldrh (this, current_cpu, pc, base_insn, entire_insn); goto done;
553       case 96 : /* fall through */
554       case 97 : /* fall through */
555       case 98 : /* fall through */
556       case 99 : /* fall through */
557       case 100 : /* fall through */
558       case 101 : /* fall through */
559       case 102 : /* fall through */
560       case 103 :
561         entire_insn = entire_insn >> 16;
562         itype = THUMB_INSN_STR_IMM; thumb_extract_sfmt_str_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
563       case 104 : /* fall through */
564       case 105 : /* fall through */
565       case 106 : /* fall through */
566       case 107 : /* fall through */
567       case 108 : /* fall through */
568       case 109 : /* fall through */
569       case 110 : /* fall through */
570       case 111 :
571         entire_insn = entire_insn >> 16;
572         itype = THUMB_INSN_LDR_IMM; thumb_extract_sfmt_ldr_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
573       case 112 : /* fall through */
574       case 113 : /* fall through */
575       case 114 : /* fall through */
576       case 115 : /* fall through */
577       case 116 : /* fall through */
578       case 117 : /* fall through */
579       case 118 : /* fall through */
580       case 119 :
581         entire_insn = entire_insn >> 16;
582         itype = THUMB_INSN_STRB_IMM; thumb_extract_sfmt_strb_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
583       case 120 : /* fall through */
584       case 121 : /* fall through */
585       case 122 : /* fall through */
586       case 123 : /* fall through */
587       case 124 : /* fall through */
588       case 125 : /* fall through */
589       case 126 : /* fall through */
590       case 127 :
591         entire_insn = entire_insn >> 16;
592         itype = THUMB_INSN_LDRB_IMM; thumb_extract_sfmt_ldrb_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
593       case 128 : /* fall through */
594       case 129 : /* fall through */
595       case 130 : /* fall through */
596       case 131 : /* fall through */
597       case 132 : /* fall through */
598       case 133 : /* fall through */
599       case 134 : /* fall through */
600       case 135 :
601         entire_insn = entire_insn >> 16;
602         itype = THUMB_INSN_STRH_IMM; thumb_extract_sfmt_strh_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
603       case 136 : /* fall through */
604       case 137 : /* fall through */
605       case 138 : /* fall through */
606       case 139 : /* fall through */
607       case 140 : /* fall through */
608       case 141 : /* fall through */
609       case 142 : /* fall through */
610       case 143 :
611         entire_insn = entire_insn >> 16;
612         itype = THUMB_INSN_LDRH_IMM; thumb_extract_sfmt_ldrh_imm (this, current_cpu, pc, base_insn, entire_insn); goto done;
613       case 144 : /* fall through */
614       case 145 : /* fall through */
615       case 146 : /* fall through */
616       case 147 : /* fall through */
617       case 148 : /* fall through */
618       case 149 : /* fall through */
619       case 150 : /* fall through */
620       case 151 :
621         entire_insn = entire_insn >> 16;
622         itype = THUMB_INSN_STR_SPREL; thumb_extract_sfmt_str_sprel (this, current_cpu, pc, base_insn, entire_insn); goto done;
623       case 152 : /* fall through */
624       case 153 : /* fall through */
625       case 154 : /* fall through */
626       case 155 : /* fall through */
627       case 156 : /* fall through */
628       case 157 : /* fall through */
629       case 158 : /* fall through */
630       case 159 :
631         entire_insn = entire_insn >> 16;
632         itype = THUMB_INSN_LDR_SPREL; thumb_extract_sfmt_ldr_sprel (this, current_cpu, pc, base_insn, entire_insn); goto done;
633       case 160 : /* fall through */
634       case 161 : /* fall through */
635       case 162 : /* fall through */
636       case 163 : /* fall through */
637       case 164 : /* fall through */
638       case 165 : /* fall through */
639       case 166 : /* fall through */
640       case 167 :
641         entire_insn = entire_insn >> 16;
642         itype = THUMB_INSN_LDA_PC; thumb_extract_sfmt_lda_pc (this, current_cpu, pc, base_insn, entire_insn); goto done;
643       case 168 : /* fall through */
644       case 169 : /* fall through */
645       case 170 : /* fall through */
646       case 171 : /* fall through */
647       case 172 : /* fall through */
648       case 173 : /* fall through */
649       case 174 : /* fall through */
650       case 175 :
651         entire_insn = entire_insn >> 16;
652         itype = THUMB_INSN_LDA_SP; thumb_extract_sfmt_lda_sp (this, current_cpu, pc, base_insn, entire_insn); goto done;
653       case 176 :
654         {
655           unsigned int val = (((insn >> 7) & (1 << 0)));
656           switch (val)
657           {
658           case 0 :
659             entire_insn = entire_insn >> 16;
660             itype = THUMB_INSN_ADD_SP; thumb_extract_sfmt_add_sp (this, current_cpu, pc, base_insn, entire_insn); goto done;
661           case 1 :
662             entire_insn = entire_insn >> 16;
663             itype = THUMB_INSN_SUB_SP; thumb_extract_sfmt_add_sp (this, current_cpu, pc, base_insn, entire_insn); goto done;
664           default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
665           }
666         }
667       case 180 :
668         entire_insn = entire_insn >> 16;
669         itype = THUMB_INSN_PUSH; thumb_extract_sfmt_push (this, current_cpu, pc, base_insn, entire_insn); goto done;
670       case 181 :
671         entire_insn = entire_insn >> 16;
672         itype = THUMB_INSN_PUSH_LR; thumb_extract_sfmt_push_lr (this, current_cpu, pc, base_insn, entire_insn); goto done;
673       case 188 :
674         entire_insn = entire_insn >> 16;
675         itype = THUMB_INSN_POP; thumb_extract_sfmt_pop (this, current_cpu, pc, base_insn, entire_insn); goto done;
676       case 189 :
677         entire_insn = entire_insn >> 16;
678         itype = THUMB_INSN_POP_PC; thumb_extract_sfmt_pop_pc (this, current_cpu, pc, base_insn, entire_insn); goto done;
679       case 192 : /* fall through */
680       case 193 : /* fall through */
681       case 194 : /* fall through */
682       case 195 : /* fall through */
683       case 196 : /* fall through */
684       case 197 : /* fall through */
685       case 198 : /* fall through */
686       case 199 :
687         entire_insn = entire_insn >> 16;
688         itype = THUMB_INSN_STMIA; thumb_extract_sfmt_stmia (this, current_cpu, pc, base_insn, entire_insn); goto done;
689       case 200 : /* fall through */
690       case 201 : /* fall through */
691       case 202 : /* fall through */
692       case 203 : /* fall through */
693       case 204 : /* fall through */
694       case 205 : /* fall through */
695       case 206 : /* fall through */
696       case 207 :
697         entire_insn = entire_insn >> 16;
698         itype = THUMB_INSN_LDMIA; thumb_extract_sfmt_ldmia (this, current_cpu, pc, base_insn, entire_insn); goto done;
699       case 208 :
700         entire_insn = entire_insn >> 16;
701         itype = THUMB_INSN_BEQ; thumb_extract_sfmt_beq (this, current_cpu, pc, base_insn, entire_insn); goto done;
702       case 209 :
703         entire_insn = entire_insn >> 16;
704         itype = THUMB_INSN_BNE; thumb_extract_sfmt_beq (this, current_cpu, pc, base_insn, entire_insn); goto done;
705       case 210 :
706         entire_insn = entire_insn >> 16;
707         itype = THUMB_INSN_BCS; thumb_extract_sfmt_bcs (this, current_cpu, pc, base_insn, entire_insn); goto done;
708       case 211 :
709         entire_insn = entire_insn >> 16;
710         itype = THUMB_INSN_BCC; thumb_extract_sfmt_bcs (this, current_cpu, pc, base_insn, entire_insn); goto done;
711       case 212 :
712         entire_insn = entire_insn >> 16;
713         itype = THUMB_INSN_BMI; thumb_extract_sfmt_bmi (this, current_cpu, pc, base_insn, entire_insn); goto done;
714       case 213 :
715         entire_insn = entire_insn >> 16;
716         itype = THUMB_INSN_BPL; thumb_extract_sfmt_bmi (this, current_cpu, pc, base_insn, entire_insn); goto done;
717       case 214 :
718         entire_insn = entire_insn >> 16;
719         itype = THUMB_INSN_BVS; thumb_extract_sfmt_bvs (this, current_cpu, pc, base_insn, entire_insn); goto done;
720       case 215 :
721         entire_insn = entire_insn >> 16;
722         itype = THUMB_INSN_BVC; thumb_extract_sfmt_bvs (this, current_cpu, pc, base_insn, entire_insn); goto done;
723       case 216 :
724         entire_insn = entire_insn >> 16;
725         itype = THUMB_INSN_BHI; thumb_extract_sfmt_bhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
726       case 217 :
727         entire_insn = entire_insn >> 16;
728         itype = THUMB_INSN_BLS; thumb_extract_sfmt_bhi (this, current_cpu, pc, base_insn, entire_insn); goto done;
729       case 218 :
730         entire_insn = entire_insn >> 16;
731         itype = THUMB_INSN_BGE; thumb_extract_sfmt_bge (this, current_cpu, pc, base_insn, entire_insn); goto done;
732       case 219 :
733         entire_insn = entire_insn >> 16;
734         itype = THUMB_INSN_BLT; thumb_extract_sfmt_bge (this, current_cpu, pc, base_insn, entire_insn); goto done;
735       case 220 :
736         entire_insn = entire_insn >> 16;
737         itype = THUMB_INSN_BGT; thumb_extract_sfmt_bgt (this, current_cpu, pc, base_insn, entire_insn); goto done;
738       case 221 :
739         entire_insn = entire_insn >> 16;
740         itype = THUMB_INSN_BLE; thumb_extract_sfmt_bgt (this, current_cpu, pc, base_insn, entire_insn); goto done;
741       case 223 :
742         entire_insn = entire_insn >> 16;
743         itype = THUMB_INSN_SWI; thumb_extract_sfmt_swi (this, current_cpu, pc, base_insn, entire_insn); goto done;
744       case 224 : /* fall through */
745       case 225 : /* fall through */
746       case 226 : /* fall through */
747       case 227 : /* fall through */
748       case 228 : /* fall through */
749       case 229 : /* fall through */
750       case 230 : /* fall through */
751       case 231 :
752         entire_insn = entire_insn >> 16;
753         itype = THUMB_INSN_B; thumb_extract_sfmt_b (this, current_cpu, pc, base_insn, entire_insn); goto done;
754       case 240 : /* fall through */
755       case 241 : /* fall through */
756       case 242 : /* fall through */
757       case 243 : /* fall through */
758       case 244 : /* fall through */
759       case 245 : /* fall through */
760       case 246 : /* fall through */
761       case 247 :
762         entire_insn = entire_insn >> 16;
763         itype = THUMB_INSN_BL_HI; thumb_extract_sfmt_bl_hi (this, current_cpu, pc, base_insn, entire_insn); goto done;
764       case 248 : /* fall through */
765       case 249 : /* fall through */
766       case 250 : /* fall through */
767       case 251 : /* fall through */
768       case 252 : /* fall through */
769       case 253 : /* fall through */
770       case 254 : /* fall through */
771       case 255 :
772         entire_insn = entire_insn >> 16;
773         itype = THUMB_INSN_BL_LO; thumb_extract_sfmt_bl_lo (this, current_cpu, pc, base_insn, entire_insn); goto done;
774       default : itype = THUMB_INSN_X_INVALID; thumb_extract_sfmt_empty (this, current_cpu, pc, base_insn, entire_insn); goto done;
775       }
776     }
777
778   }
779
780   /* The instruction has been decoded and fields extracted.  */
781   done:
782
783   this->addr = pc;
784   // FIXME: To be redone (to handle ISA variants).
785   this->idesc = & thumb_idesc::idesc_table[itype];
786   // ??? record semantic handler?
787   assert(this->idesc->sem_index == itype);
788 }
789
790 void
791 thumb_extract_sfmt_empty (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
792     thumb_insn_word insn = entire_insn;
793 #define FLD(f) abuf->fields.fmt_empty.f
794
795
796   /* Record the fields for the semantic handler.  */
797   if (UNLIKELY(current_cpu->trace_extract_p))
798     {
799       current_cpu->trace_stream 
800         << "0x" << hex << pc << dec << " (sfmt_empty)\t"
801         << endl;
802     }
803
804 #undef FLD
805 }
806
807 void
808 thumb_extract_sfmt_lsl (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
809     thumb_insn_word insn = entire_insn;
810 #define FLD(f) abuf->fields.sfmt_lsl.f
811     UINT f_offset5;
812     UINT f_rs;
813     UINT f_rd;
814
815     f_offset5 = EXTRACT_LSB0_UINT (insn, 16, 10, 5);
816     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
817     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
818
819   /* Record the fields for the semantic handler.  */
820   FLD (f_offset5) = f_offset5;
821   FLD (f_rd) = f_rd;
822   FLD (f_rs) = f_rs;
823   if (UNLIKELY(current_cpu->trace_extract_p))
824     {
825       current_cpu->trace_stream 
826         << "0x" << hex << pc << dec << " (sfmt_lsl)\t"
827         << " f_offset5:0x" << hex << f_offset5 << dec
828         << " f_rd:0x" << hex << f_rd << dec
829         << " f_rs:0x" << hex << f_rs << dec
830         << endl;
831     }
832
833 #undef FLD
834 }
835
836 void
837 thumb_extract_sfmt_add (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
838     thumb_insn_word insn = entire_insn;
839 #define FLD(f) abuf->fields.sfmt_add.f
840     UINT f_rn;
841     UINT f_rs;
842     UINT f_rd;
843
844     f_rn = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
845     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
846     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
847
848   /* Record the fields for the semantic handler.  */
849   FLD (f_rn) = f_rn;
850   FLD (f_rs) = f_rs;
851   FLD (f_rd) = f_rd;
852   if (UNLIKELY(current_cpu->trace_extract_p))
853     {
854       current_cpu->trace_stream 
855         << "0x" << hex << pc << dec << " (sfmt_add)\t"
856         << " f_rn:0x" << hex << f_rn << dec
857         << " f_rs:0x" << hex << f_rs << dec
858         << " f_rd:0x" << hex << f_rd << dec
859         << endl;
860     }
861
862 #undef FLD
863 }
864
865 void
866 thumb_extract_sfmt_addi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
867     thumb_insn_word insn = entire_insn;
868 #define FLD(f) abuf->fields.sfmt_addi.f
869     UINT f_offset3;
870     UINT f_rs;
871     UINT f_rd;
872
873     f_offset3 = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
874     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
875     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
876
877   /* Record the fields for the semantic handler.  */
878   FLD (f_offset3) = f_offset3;
879   FLD (f_rs) = f_rs;
880   FLD (f_rd) = f_rd;
881   if (UNLIKELY(current_cpu->trace_extract_p))
882     {
883       current_cpu->trace_stream 
884         << "0x" << hex << pc << dec << " (sfmt_addi)\t"
885         << " f_offset3:0x" << hex << f_offset3 << dec
886         << " f_rs:0x" << hex << f_rs << dec
887         << " f_rd:0x" << hex << f_rd << dec
888         << endl;
889     }
890
891 #undef FLD
892 }
893
894 void
895 thumb_extract_sfmt_mov (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
896     thumb_insn_word insn = entire_insn;
897 #define FLD(f) abuf->fields.sfmt_mov.f
898     UINT f_bit10_rd;
899     UINT f_offset8;
900
901     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
902     f_offset8 = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
903
904   /* Record the fields for the semantic handler.  */
905   FLD (f_bit10_rd) = f_bit10_rd;
906   FLD (f_offset8) = f_offset8;
907   if (UNLIKELY(current_cpu->trace_extract_p))
908     {
909       current_cpu->trace_stream 
910         << "0x" << hex << pc << dec << " (sfmt_mov)\t"
911         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
912         << " f_offset8:0x" << hex << f_offset8 << dec
913         << endl;
914     }
915
916 #undef FLD
917 }
918
919 void
920 thumb_extract_sfmt_cmp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
921     thumb_insn_word insn = entire_insn;
922 #define FLD(f) abuf->fields.sfmt_mov.f
923     UINT f_bit10_rd;
924     UINT f_offset8;
925
926     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
927     f_offset8 = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
928
929   /* Record the fields for the semantic handler.  */
930   FLD (f_bit10_rd) = f_bit10_rd;
931   FLD (f_offset8) = f_offset8;
932   if (UNLIKELY(current_cpu->trace_extract_p))
933     {
934       current_cpu->trace_stream 
935         << "0x" << hex << pc << dec << " (sfmt_cmp)\t"
936         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
937         << " f_offset8:0x" << hex << f_offset8 << dec
938         << endl;
939     }
940
941 #undef FLD
942 }
943
944 void
945 thumb_extract_sfmt_addi8 (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
946     thumb_insn_word insn = entire_insn;
947 #define FLD(f) abuf->fields.sfmt_mov.f
948     UINT f_bit10_rd;
949     UINT f_offset8;
950
951     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
952     f_offset8 = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
953
954   /* Record the fields for the semantic handler.  */
955   FLD (f_bit10_rd) = f_bit10_rd;
956   FLD (f_offset8) = f_offset8;
957   if (UNLIKELY(current_cpu->trace_extract_p))
958     {
959       current_cpu->trace_stream 
960         << "0x" << hex << pc << dec << " (sfmt_addi8)\t"
961         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
962         << " f_offset8:0x" << hex << f_offset8 << dec
963         << endl;
964     }
965
966 #undef FLD
967 }
968
969 void
970 thumb_extract_sfmt_alu_and (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
971     thumb_insn_word insn = entire_insn;
972 #define FLD(f) abuf->fields.sfmt_addi.f
973     UINT f_rs;
974     UINT f_rd;
975
976     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
977     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
978
979   /* Record the fields for the semantic handler.  */
980   FLD (f_rd) = f_rd;
981   FLD (f_rs) = f_rs;
982   if (UNLIKELY(current_cpu->trace_extract_p))
983     {
984       current_cpu->trace_stream 
985         << "0x" << hex << pc << dec << " (sfmt_alu_and)\t"
986         << " f_rd:0x" << hex << f_rd << dec
987         << " f_rs:0x" << hex << f_rs << dec
988         << endl;
989     }
990
991 #undef FLD
992 }
993
994 void
995 thumb_extract_sfmt_alu_lsl (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
996     thumb_insn_word insn = entire_insn;
997 #define FLD(f) abuf->fields.sfmt_addi.f
998     UINT f_rs;
999     UINT f_rd;
1000
1001     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1002     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1003
1004   /* Record the fields for the semantic handler.  */
1005   FLD (f_rd) = f_rd;
1006   FLD (f_rs) = f_rs;
1007   if (UNLIKELY(current_cpu->trace_extract_p))
1008     {
1009       current_cpu->trace_stream 
1010         << "0x" << hex << pc << dec << " (sfmt_alu_lsl)\t"
1011         << " f_rd:0x" << hex << f_rd << dec
1012         << " f_rs:0x" << hex << f_rs << dec
1013         << endl;
1014     }
1015
1016 #undef FLD
1017 }
1018
1019 void
1020 thumb_extract_sfmt_alu_adc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1021     thumb_insn_word insn = entire_insn;
1022 #define FLD(f) abuf->fields.sfmt_addi.f
1023     UINT f_rs;
1024     UINT f_rd;
1025
1026     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1027     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1028
1029   /* Record the fields for the semantic handler.  */
1030   FLD (f_rd) = f_rd;
1031   FLD (f_rs) = f_rs;
1032   if (UNLIKELY(current_cpu->trace_extract_p))
1033     {
1034       current_cpu->trace_stream 
1035         << "0x" << hex << pc << dec << " (sfmt_alu_adc)\t"
1036         << " f_rd:0x" << hex << f_rd << dec
1037         << " f_rs:0x" << hex << f_rs << dec
1038         << endl;
1039     }
1040
1041 #undef FLD
1042 }
1043
1044 void
1045 thumb_extract_sfmt_alu_tst (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1046     thumb_insn_word insn = entire_insn;
1047 #define FLD(f) abuf->fields.sfmt_addi.f
1048     UINT f_rs;
1049     UINT f_rd;
1050
1051     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1052     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1053
1054   /* Record the fields for the semantic handler.  */
1055   FLD (f_rd) = f_rd;
1056   FLD (f_rs) = f_rs;
1057   if (UNLIKELY(current_cpu->trace_extract_p))
1058     {
1059       current_cpu->trace_stream 
1060         << "0x" << hex << pc << dec << " (sfmt_alu_tst)\t"
1061         << " f_rd:0x" << hex << f_rd << dec
1062         << " f_rs:0x" << hex << f_rs << dec
1063         << endl;
1064     }
1065
1066 #undef FLD
1067 }
1068
1069 void
1070 thumb_extract_sfmt_alu_neg (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1071     thumb_insn_word insn = entire_insn;
1072 #define FLD(f) abuf->fields.sfmt_addi.f
1073     UINT f_rs;
1074     UINT f_rd;
1075
1076     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1077     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1078
1079   /* Record the fields for the semantic handler.  */
1080   FLD (f_rs) = f_rs;
1081   FLD (f_rd) = f_rd;
1082   if (UNLIKELY(current_cpu->trace_extract_p))
1083     {
1084       current_cpu->trace_stream 
1085         << "0x" << hex << pc << dec << " (sfmt_alu_neg)\t"
1086         << " f_rs:0x" << hex << f_rs << dec
1087         << " f_rd:0x" << hex << f_rd << dec
1088         << endl;
1089     }
1090
1091 #undef FLD
1092 }
1093
1094 void
1095 thumb_extract_sfmt_alu_cmp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1096     thumb_insn_word insn = entire_insn;
1097 #define FLD(f) abuf->fields.sfmt_addi.f
1098     UINT f_rs;
1099     UINT f_rd;
1100
1101     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1102     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1103
1104   /* Record the fields for the semantic handler.  */
1105   FLD (f_rd) = f_rd;
1106   FLD (f_rs) = f_rs;
1107   if (UNLIKELY(current_cpu->trace_extract_p))
1108     {
1109       current_cpu->trace_stream 
1110         << "0x" << hex << pc << dec << " (sfmt_alu_cmp)\t"
1111         << " f_rd:0x" << hex << f_rd << dec
1112         << " f_rs:0x" << hex << f_rs << dec
1113         << endl;
1114     }
1115
1116 #undef FLD
1117 }
1118
1119 void
1120 thumb_extract_sfmt_add_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1121     thumb_insn_word insn = entire_insn;
1122 #define FLD(f) abuf->fields.sfmt_addi.f
1123     UINT f_rs;
1124     UINT f_rd;
1125
1126     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1127     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1128
1129   /* Record the fields for the semantic handler.  */
1130   FLD (f_rs) = f_rs;
1131   FLD (f_rd) = f_rd;
1132   if (UNLIKELY(current_cpu->trace_extract_p))
1133     {
1134       current_cpu->trace_stream 
1135         << "0x" << hex << pc << dec << " (sfmt_add_rd_hs)\t"
1136         << " f_rs:0x" << hex << f_rs << dec
1137         << " f_rd:0x" << hex << f_rd << dec
1138         << endl;
1139     }
1140
1141 #undef FLD
1142 }
1143
1144 void
1145 thumb_extract_sfmt_add_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1146     thumb_insn_word insn = entire_insn;
1147 #define FLD(f) abuf->fields.sfmt_addi.f
1148     UINT f_rs;
1149     UINT f_rd;
1150
1151     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1152     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1153
1154   /* Record the fields for the semantic handler.  */
1155   FLD (f_rd) = f_rd;
1156   FLD (f_rs) = f_rs;
1157   if (UNLIKELY(current_cpu->trace_extract_p))
1158     {
1159       current_cpu->trace_stream 
1160         << "0x" << hex << pc << dec << " (sfmt_add_hd_rs)\t"
1161         << " f_rd:0x" << hex << f_rd << dec
1162         << " f_rs:0x" << hex << f_rs << dec
1163         << endl;
1164     }
1165
1166 #undef FLD
1167 }
1168
1169 void
1170 thumb_extract_sfmt_add_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1171     thumb_insn_word insn = entire_insn;
1172 #define FLD(f) abuf->fields.sfmt_addi.f
1173     UINT f_rs;
1174     UINT f_rd;
1175
1176     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1177     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1178
1179   /* Record the fields for the semantic handler.  */
1180   FLD (f_rd) = f_rd;
1181   FLD (f_rs) = f_rs;
1182   if (UNLIKELY(current_cpu->trace_extract_p))
1183     {
1184       current_cpu->trace_stream 
1185         << "0x" << hex << pc << dec << " (sfmt_add_hd_hs)\t"
1186         << " f_rd:0x" << hex << f_rd << dec
1187         << " f_rs:0x" << hex << f_rs << dec
1188         << endl;
1189     }
1190
1191 #undef FLD
1192 }
1193
1194 void
1195 thumb_extract_sfmt_cmp_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1196     thumb_insn_word insn = entire_insn;
1197 #define FLD(f) abuf->fields.sfmt_addi.f
1198     UINT f_rs;
1199     UINT f_rd;
1200
1201     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1202     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1203
1204   /* Record the fields for the semantic handler.  */
1205   FLD (f_rs) = f_rs;
1206   FLD (f_rd) = f_rd;
1207   if (UNLIKELY(current_cpu->trace_extract_p))
1208     {
1209       current_cpu->trace_stream 
1210         << "0x" << hex << pc << dec << " (sfmt_cmp_rd_hs)\t"
1211         << " f_rs:0x" << hex << f_rs << dec
1212         << " f_rd:0x" << hex << f_rd << dec
1213         << endl;
1214     }
1215
1216 #undef FLD
1217 }
1218
1219 void
1220 thumb_extract_sfmt_cmp_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1221     thumb_insn_word insn = entire_insn;
1222 #define FLD(f) abuf->fields.sfmt_addi.f
1223     UINT f_rs;
1224     UINT f_rd;
1225
1226     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1227     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1228
1229   /* Record the fields for the semantic handler.  */
1230   FLD (f_rd) = f_rd;
1231   FLD (f_rs) = f_rs;
1232   if (UNLIKELY(current_cpu->trace_extract_p))
1233     {
1234       current_cpu->trace_stream 
1235         << "0x" << hex << pc << dec << " (sfmt_cmp_hd_rs)\t"
1236         << " f_rd:0x" << hex << f_rd << dec
1237         << " f_rs:0x" << hex << f_rs << dec
1238         << endl;
1239     }
1240
1241 #undef FLD
1242 }
1243
1244 void
1245 thumb_extract_sfmt_cmp_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1246     thumb_insn_word insn = entire_insn;
1247 #define FLD(f) abuf->fields.sfmt_addi.f
1248     UINT f_rs;
1249     UINT f_rd;
1250
1251     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1252     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1253
1254   /* Record the fields for the semantic handler.  */
1255   FLD (f_rd) = f_rd;
1256   FLD (f_rs) = f_rs;
1257   if (UNLIKELY(current_cpu->trace_extract_p))
1258     {
1259       current_cpu->trace_stream 
1260         << "0x" << hex << pc << dec << " (sfmt_cmp_hd_hs)\t"
1261         << " f_rd:0x" << hex << f_rd << dec
1262         << " f_rs:0x" << hex << f_rs << dec
1263         << endl;
1264     }
1265
1266 #undef FLD
1267 }
1268
1269 void
1270 thumb_extract_sfmt_mov_rd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1271     thumb_insn_word insn = entire_insn;
1272 #define FLD(f) abuf->fields.sfmt_addi.f
1273     UINT f_rs;
1274     UINT f_rd;
1275
1276     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1277     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1278
1279   /* Record the fields for the semantic handler.  */
1280   FLD (f_rs) = f_rs;
1281   FLD (f_rd) = f_rd;
1282   if (UNLIKELY(current_cpu->trace_extract_p))
1283     {
1284       current_cpu->trace_stream 
1285         << "0x" << hex << pc << dec << " (sfmt_mov_rd_hs)\t"
1286         << " f_rs:0x" << hex << f_rs << dec
1287         << " f_rd:0x" << hex << f_rd << dec
1288         << endl;
1289     }
1290
1291 #undef FLD
1292 }
1293
1294 void
1295 thumb_extract_sfmt_mov_hd_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1296     thumb_insn_word insn = entire_insn;
1297 #define FLD(f) abuf->fields.sfmt_addi.f
1298     UINT f_rs;
1299     UINT f_rd;
1300
1301     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1302     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1303
1304   /* Record the fields for the semantic handler.  */
1305   FLD (f_rd) = f_rd;
1306   FLD (f_rs) = f_rs;
1307   if (UNLIKELY(current_cpu->trace_extract_p))
1308     {
1309       current_cpu->trace_stream 
1310         << "0x" << hex << pc << dec << " (sfmt_mov_hd_rs)\t"
1311         << " f_rd:0x" << hex << f_rd << dec
1312         << " f_rs:0x" << hex << f_rs << dec
1313         << endl;
1314     }
1315
1316 #undef FLD
1317 }
1318
1319 void
1320 thumb_extract_sfmt_mov_hd_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1321     thumb_insn_word insn = entire_insn;
1322 #define FLD(f) abuf->fields.sfmt_addi.f
1323     UINT f_rs;
1324     UINT f_rd;
1325
1326     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1327     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1328
1329   /* Record the fields for the semantic handler.  */
1330   FLD (f_rd) = f_rd;
1331   FLD (f_rs) = f_rs;
1332   if (UNLIKELY(current_cpu->trace_extract_p))
1333     {
1334       current_cpu->trace_stream 
1335         << "0x" << hex << pc << dec << " (sfmt_mov_hd_hs)\t"
1336         << " f_rd:0x" << hex << f_rd << dec
1337         << " f_rs:0x" << hex << f_rs << dec
1338         << endl;
1339     }
1340
1341 #undef FLD
1342 }
1343
1344 void
1345 thumb_extract_sfmt_bx_rs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1346     thumb_insn_word insn = entire_insn;
1347 #define FLD(f) abuf->fields.sfmt_addi.f
1348     UINT f_rs;
1349
1350     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1351
1352   /* Record the fields for the semantic handler.  */
1353   FLD (f_rs) = f_rs;
1354   if (UNLIKELY(current_cpu->trace_extract_p))
1355     {
1356       current_cpu->trace_stream 
1357         << "0x" << hex << pc << dec << " (sfmt_bx_rs)\t"
1358         << " f_rs:0x" << hex << f_rs << dec
1359         << endl;
1360     }
1361
1362 #undef FLD
1363 }
1364
1365 void
1366 thumb_extract_sfmt_bx_hs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1367     thumb_insn_word insn = entire_insn;
1368 #define FLD(f) abuf->fields.sfmt_addi.f
1369     UINT f_rs;
1370
1371     f_rs = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1372
1373   /* Record the fields for the semantic handler.  */
1374   FLD (f_rs) = f_rs;
1375   if (UNLIKELY(current_cpu->trace_extract_p))
1376     {
1377       current_cpu->trace_stream 
1378         << "0x" << hex << pc << dec << " (sfmt_bx_hs)\t"
1379         << " f_rs:0x" << hex << f_rs << dec
1380         << endl;
1381     }
1382
1383 #undef FLD
1384 }
1385
1386 void
1387 thumb_extract_sfmt_ldr_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1388     thumb_insn_word insn = entire_insn;
1389 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1390     UINT f_bit10_rd;
1391     SI f_word8;
1392
1393     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1394     f_word8 = ((EXTRACT_LSB0_UINT (insn, 16, 7, 8)) << (2));
1395
1396   /* Record the fields for the semantic handler.  */
1397   FLD (f_word8) = f_word8;
1398   FLD (f_bit10_rd) = f_bit10_rd;
1399   if (UNLIKELY(current_cpu->trace_extract_p))
1400     {
1401       current_cpu->trace_stream 
1402         << "0x" << hex << pc << dec << " (sfmt_ldr_pc)\t"
1403         << " f_word8:0x" << hex << f_word8 << dec
1404         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
1405         << endl;
1406     }
1407
1408 #undef FLD
1409 }
1410
1411 void
1412 thumb_extract_sfmt_str (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1413     thumb_insn_word insn = entire_insn;
1414 #define FLD(f) abuf->fields.sfmt_str.f
1415     UINT f_ro;
1416     UINT f_rb;
1417     UINT f_rd;
1418
1419     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1420     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1421     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1422
1423   /* Record the fields for the semantic handler.  */
1424   FLD (f_rb) = f_rb;
1425   FLD (f_rd) = f_rd;
1426   FLD (f_ro) = f_ro;
1427   if (UNLIKELY(current_cpu->trace_extract_p))
1428     {
1429       current_cpu->trace_stream 
1430         << "0x" << hex << pc << dec << " (sfmt_str)\t"
1431         << " f_rb:0x" << hex << f_rb << dec
1432         << " f_rd:0x" << hex << f_rd << dec
1433         << " f_ro:0x" << hex << f_ro << dec
1434         << endl;
1435     }
1436
1437 #undef FLD
1438 }
1439
1440 void
1441 thumb_extract_sfmt_strb (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1442     thumb_insn_word insn = entire_insn;
1443 #define FLD(f) abuf->fields.sfmt_str.f
1444     UINT f_ro;
1445     UINT f_rb;
1446     UINT f_rd;
1447
1448     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1449     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1450     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1451
1452   /* Record the fields for the semantic handler.  */
1453   FLD (f_rb) = f_rb;
1454   FLD (f_rd) = f_rd;
1455   FLD (f_ro) = f_ro;
1456   if (UNLIKELY(current_cpu->trace_extract_p))
1457     {
1458       current_cpu->trace_stream 
1459         << "0x" << hex << pc << dec << " (sfmt_strb)\t"
1460         << " f_rb:0x" << hex << f_rb << dec
1461         << " f_rd:0x" << hex << f_rd << dec
1462         << " f_ro:0x" << hex << f_ro << dec
1463         << endl;
1464     }
1465
1466 #undef FLD
1467 }
1468
1469 void
1470 thumb_extract_sfmt_ldr (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1471     thumb_insn_word insn = entire_insn;
1472 #define FLD(f) abuf->fields.sfmt_str.f
1473     UINT f_ro;
1474     UINT f_rb;
1475     UINT f_rd;
1476
1477     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1478     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1479     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1480
1481   /* Record the fields for the semantic handler.  */
1482   FLD (f_rb) = f_rb;
1483   FLD (f_ro) = f_ro;
1484   FLD (f_rd) = f_rd;
1485   if (UNLIKELY(current_cpu->trace_extract_p))
1486     {
1487       current_cpu->trace_stream 
1488         << "0x" << hex << pc << dec << " (sfmt_ldr)\t"
1489         << " f_rb:0x" << hex << f_rb << dec
1490         << " f_ro:0x" << hex << f_ro << dec
1491         << " f_rd:0x" << hex << f_rd << dec
1492         << endl;
1493     }
1494
1495 #undef FLD
1496 }
1497
1498 void
1499 thumb_extract_sfmt_ldrb (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1500     thumb_insn_word insn = entire_insn;
1501 #define FLD(f) abuf->fields.sfmt_str.f
1502     UINT f_ro;
1503     UINT f_rb;
1504     UINT f_rd;
1505
1506     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1507     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1508     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1509
1510   /* Record the fields for the semantic handler.  */
1511   FLD (f_rb) = f_rb;
1512   FLD (f_ro) = f_ro;
1513   FLD (f_rd) = f_rd;
1514   if (UNLIKELY(current_cpu->trace_extract_p))
1515     {
1516       current_cpu->trace_stream 
1517         << "0x" << hex << pc << dec << " (sfmt_ldrb)\t"
1518         << " f_rb:0x" << hex << f_rb << dec
1519         << " f_ro:0x" << hex << f_ro << dec
1520         << " f_rd:0x" << hex << f_rd << dec
1521         << endl;
1522     }
1523
1524 #undef FLD
1525 }
1526
1527 void
1528 thumb_extract_sfmt_strh (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1529     thumb_insn_word insn = entire_insn;
1530 #define FLD(f) abuf->fields.sfmt_str.f
1531     UINT f_ro;
1532     UINT f_rb;
1533     UINT f_rd;
1534
1535     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1536     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1537     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1538
1539   /* Record the fields for the semantic handler.  */
1540   FLD (f_rb) = f_rb;
1541   FLD (f_rd) = f_rd;
1542   FLD (f_ro) = f_ro;
1543   if (UNLIKELY(current_cpu->trace_extract_p))
1544     {
1545       current_cpu->trace_stream 
1546         << "0x" << hex << pc << dec << " (sfmt_strh)\t"
1547         << " f_rb:0x" << hex << f_rb << dec
1548         << " f_rd:0x" << hex << f_rd << dec
1549         << " f_ro:0x" << hex << f_ro << dec
1550         << endl;
1551     }
1552
1553 #undef FLD
1554 }
1555
1556 void
1557 thumb_extract_sfmt_ldrh (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1558     thumb_insn_word insn = entire_insn;
1559 #define FLD(f) abuf->fields.sfmt_str.f
1560     UINT f_ro;
1561     UINT f_rb;
1562     UINT f_rd;
1563
1564     f_ro = EXTRACT_LSB0_UINT (insn, 16, 8, 3);
1565     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1566     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1567
1568   /* Record the fields for the semantic handler.  */
1569   FLD (f_rb) = f_rb;
1570   FLD (f_ro) = f_ro;
1571   FLD (f_rd) = f_rd;
1572   if (UNLIKELY(current_cpu->trace_extract_p))
1573     {
1574       current_cpu->trace_stream 
1575         << "0x" << hex << pc << dec << " (sfmt_ldrh)\t"
1576         << " f_rb:0x" << hex << f_rb << dec
1577         << " f_ro:0x" << hex << f_ro << dec
1578         << " f_rd:0x" << hex << f_rd << dec
1579         << endl;
1580     }
1581
1582 #undef FLD
1583 }
1584
1585 void
1586 thumb_extract_sfmt_str_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1587     thumb_insn_word insn = entire_insn;
1588 #define FLD(f) abuf->fields.sfmt_str_imm.f
1589     SI f_offset5_7;
1590     UINT f_rb;
1591     UINT f_rd;
1592
1593     f_offset5_7 = ((EXTRACT_LSB0_UINT (insn, 16, 10, 5)) << (2));
1594     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1595     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1596
1597   /* Record the fields for the semantic handler.  */
1598   FLD (f_offset5_7) = f_offset5_7;
1599   FLD (f_rb) = f_rb;
1600   FLD (f_rd) = f_rd;
1601   if (UNLIKELY(current_cpu->trace_extract_p))
1602     {
1603       current_cpu->trace_stream 
1604         << "0x" << hex << pc << dec << " (sfmt_str_imm)\t"
1605         << " f_offset5_7:0x" << hex << f_offset5_7 << dec
1606         << " f_rb:0x" << hex << f_rb << dec
1607         << " f_rd:0x" << hex << f_rd << dec
1608         << endl;
1609     }
1610
1611 #undef FLD
1612 }
1613
1614 void
1615 thumb_extract_sfmt_ldr_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1616     thumb_insn_word insn = entire_insn;
1617 #define FLD(f) abuf->fields.sfmt_str_imm.f
1618     SI f_offset5_7;
1619     UINT f_rb;
1620     UINT f_rd;
1621
1622     f_offset5_7 = ((EXTRACT_LSB0_UINT (insn, 16, 10, 5)) << (2));
1623     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1624     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1625
1626   /* Record the fields for the semantic handler.  */
1627   FLD (f_offset5_7) = f_offset5_7;
1628   FLD (f_rb) = f_rb;
1629   FLD (f_rd) = f_rd;
1630   if (UNLIKELY(current_cpu->trace_extract_p))
1631     {
1632       current_cpu->trace_stream 
1633         << "0x" << hex << pc << dec << " (sfmt_ldr_imm)\t"
1634         << " f_offset5_7:0x" << hex << f_offset5_7 << dec
1635         << " f_rb:0x" << hex << f_rb << dec
1636         << " f_rd:0x" << hex << f_rd << dec
1637         << endl;
1638     }
1639
1640 #undef FLD
1641 }
1642
1643 void
1644 thumb_extract_sfmt_strb_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1645     thumb_insn_word insn = entire_insn;
1646 #define FLD(f) abuf->fields.sfmt_strb_imm.f
1647     UINT f_offset5;
1648     UINT f_rb;
1649     UINT f_rd;
1650
1651     f_offset5 = EXTRACT_LSB0_UINT (insn, 16, 10, 5);
1652     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1653     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1654
1655   /* Record the fields for the semantic handler.  */
1656   FLD (f_offset5) = f_offset5;
1657   FLD (f_rb) = f_rb;
1658   FLD (f_rd) = f_rd;
1659   if (UNLIKELY(current_cpu->trace_extract_p))
1660     {
1661       current_cpu->trace_stream 
1662         << "0x" << hex << pc << dec << " (sfmt_strb_imm)\t"
1663         << " f_offset5:0x" << hex << f_offset5 << dec
1664         << " f_rb:0x" << hex << f_rb << dec
1665         << " f_rd:0x" << hex << f_rd << dec
1666         << endl;
1667     }
1668
1669 #undef FLD
1670 }
1671
1672 void
1673 thumb_extract_sfmt_ldrb_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1674     thumb_insn_word insn = entire_insn;
1675 #define FLD(f) abuf->fields.sfmt_strb_imm.f
1676     UINT f_offset5;
1677     UINT f_rb;
1678     UINT f_rd;
1679
1680     f_offset5 = EXTRACT_LSB0_UINT (insn, 16, 10, 5);
1681     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1682     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1683
1684   /* Record the fields for the semantic handler.  */
1685   FLD (f_offset5) = f_offset5;
1686   FLD (f_rb) = f_rb;
1687   FLD (f_rd) = f_rd;
1688   if (UNLIKELY(current_cpu->trace_extract_p))
1689     {
1690       current_cpu->trace_stream 
1691         << "0x" << hex << pc << dec << " (sfmt_ldrb_imm)\t"
1692         << " f_offset5:0x" << hex << f_offset5 << dec
1693         << " f_rb:0x" << hex << f_rb << dec
1694         << " f_rd:0x" << hex << f_rd << dec
1695         << endl;
1696     }
1697
1698 #undef FLD
1699 }
1700
1701 void
1702 thumb_extract_sfmt_strh_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1703     thumb_insn_word insn = entire_insn;
1704 #define FLD(f) abuf->fields.sfmt_strh_imm.f
1705     SI f_offset5_6;
1706     UINT f_rb;
1707     UINT f_rd;
1708
1709     f_offset5_6 = ((EXTRACT_LSB0_UINT (insn, 16, 10, 5)) << (1));
1710     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1711     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1712
1713   /* Record the fields for the semantic handler.  */
1714   FLD (f_offset5_6) = f_offset5_6;
1715   FLD (f_rb) = f_rb;
1716   FLD (f_rd) = f_rd;
1717   if (UNLIKELY(current_cpu->trace_extract_p))
1718     {
1719       current_cpu->trace_stream 
1720         << "0x" << hex << pc << dec << " (sfmt_strh_imm)\t"
1721         << " f_offset5_6:0x" << hex << f_offset5_6 << dec
1722         << " f_rb:0x" << hex << f_rb << dec
1723         << " f_rd:0x" << hex << f_rd << dec
1724         << endl;
1725     }
1726
1727 #undef FLD
1728 }
1729
1730 void
1731 thumb_extract_sfmt_ldrh_imm (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1732     thumb_insn_word insn = entire_insn;
1733 #define FLD(f) abuf->fields.sfmt_strh_imm.f
1734     SI f_offset5_6;
1735     UINT f_rb;
1736     UINT f_rd;
1737
1738     f_offset5_6 = ((EXTRACT_LSB0_UINT (insn, 16, 10, 5)) << (1));
1739     f_rb = EXTRACT_LSB0_UINT (insn, 16, 5, 3);
1740     f_rd = EXTRACT_LSB0_UINT (insn, 16, 2, 3);
1741
1742   /* Record the fields for the semantic handler.  */
1743   FLD (f_offset5_6) = f_offset5_6;
1744   FLD (f_rb) = f_rb;
1745   FLD (f_rd) = f_rd;
1746   if (UNLIKELY(current_cpu->trace_extract_p))
1747     {
1748       current_cpu->trace_stream 
1749         << "0x" << hex << pc << dec << " (sfmt_ldrh_imm)\t"
1750         << " f_offset5_6:0x" << hex << f_offset5_6 << dec
1751         << " f_rb:0x" << hex << f_rb << dec
1752         << " f_rd:0x" << hex << f_rd << dec
1753         << endl;
1754     }
1755
1756 #undef FLD
1757 }
1758
1759 void
1760 thumb_extract_sfmt_str_sprel (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1761     thumb_insn_word insn = entire_insn;
1762 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1763     UINT f_bit10_rd;
1764     SI f_word8;
1765
1766     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1767     f_word8 = ((EXTRACT_LSB0_UINT (insn, 16, 7, 8)) << (2));
1768
1769   /* Record the fields for the semantic handler.  */
1770   FLD (f_bit10_rd) = f_bit10_rd;
1771   FLD (f_word8) = f_word8;
1772   if (UNLIKELY(current_cpu->trace_extract_p))
1773     {
1774       current_cpu->trace_stream 
1775         << "0x" << hex << pc << dec << " (sfmt_str_sprel)\t"
1776         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
1777         << " f_word8:0x" << hex << f_word8 << dec
1778         << endl;
1779     }
1780
1781 #undef FLD
1782 }
1783
1784 void
1785 thumb_extract_sfmt_ldr_sprel (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1786     thumb_insn_word insn = entire_insn;
1787 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1788     UINT f_bit10_rd;
1789     SI f_word8;
1790
1791     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1792     f_word8 = ((EXTRACT_LSB0_UINT (insn, 16, 7, 8)) << (2));
1793
1794   /* Record the fields for the semantic handler.  */
1795   FLD (f_word8) = f_word8;
1796   FLD (f_bit10_rd) = f_bit10_rd;
1797   if (UNLIKELY(current_cpu->trace_extract_p))
1798     {
1799       current_cpu->trace_stream 
1800         << "0x" << hex << pc << dec << " (sfmt_ldr_sprel)\t"
1801         << " f_word8:0x" << hex << f_word8 << dec
1802         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
1803         << endl;
1804     }
1805
1806 #undef FLD
1807 }
1808
1809 void
1810 thumb_extract_sfmt_lda_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1811     thumb_insn_word insn = entire_insn;
1812 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1813     UINT f_bit10_rd;
1814     SI f_word8;
1815
1816     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1817     f_word8 = ((EXTRACT_LSB0_UINT (insn, 16, 7, 8)) << (2));
1818
1819   /* Record the fields for the semantic handler.  */
1820   FLD (f_word8) = f_word8;
1821   FLD (f_bit10_rd) = f_bit10_rd;
1822   if (UNLIKELY(current_cpu->trace_extract_p))
1823     {
1824       current_cpu->trace_stream 
1825         << "0x" << hex << pc << dec << " (sfmt_lda_pc)\t"
1826         << " f_word8:0x" << hex << f_word8 << dec
1827         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
1828         << endl;
1829     }
1830
1831 #undef FLD
1832 }
1833
1834 void
1835 thumb_extract_sfmt_lda_sp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1836     thumb_insn_word insn = entire_insn;
1837 #define FLD(f) abuf->fields.sfmt_ldr_pc.f
1838     UINT f_bit10_rd;
1839     SI f_word8;
1840
1841     f_bit10_rd = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1842     f_word8 = ((EXTRACT_LSB0_UINT (insn, 16, 7, 8)) << (2));
1843
1844   /* Record the fields for the semantic handler.  */
1845   FLD (f_word8) = f_word8;
1846   FLD (f_bit10_rd) = f_bit10_rd;
1847   if (UNLIKELY(current_cpu->trace_extract_p))
1848     {
1849       current_cpu->trace_stream 
1850         << "0x" << hex << pc << dec << " (sfmt_lda_sp)\t"
1851         << " f_word8:0x" << hex << f_word8 << dec
1852         << " f_bit10_rd:0x" << hex << f_bit10_rd << dec
1853         << endl;
1854     }
1855
1856 #undef FLD
1857 }
1858
1859 void
1860 thumb_extract_sfmt_add_sp (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1861     thumb_insn_word insn = entire_insn;
1862 #define FLD(f) abuf->fields.sfmt_add_sp.f
1863     SI f_sword7;
1864
1865     f_sword7 = ((EXTRACT_LSB0_UINT (insn, 16, 6, 7)) << (2));
1866
1867   /* Record the fields for the semantic handler.  */
1868   FLD (f_sword7) = f_sword7;
1869   if (UNLIKELY(current_cpu->trace_extract_p))
1870     {
1871       current_cpu->trace_stream 
1872         << "0x" << hex << pc << dec << " (sfmt_add_sp)\t"
1873         << " f_sword7:0x" << hex << f_sword7 << dec
1874         << endl;
1875     }
1876
1877 #undef FLD
1878 }
1879
1880 void
1881 thumb_extract_sfmt_push (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1882     thumb_insn_word insn = entire_insn;
1883 #define FLD(f) abuf->fields.sfmt_stmia.f
1884     UINT f_rlist;
1885
1886     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1887
1888   /* Record the fields for the semantic handler.  */
1889   FLD (f_rlist) = f_rlist;
1890   if (UNLIKELY(current_cpu->trace_extract_p))
1891     {
1892       current_cpu->trace_stream 
1893         << "0x" << hex << pc << dec << " (sfmt_push)\t"
1894         << " f_rlist:0x" << hex << f_rlist << dec
1895         << endl;
1896     }
1897
1898 #undef FLD
1899 }
1900
1901 void
1902 thumb_extract_sfmt_push_lr (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1903     thumb_insn_word insn = entire_insn;
1904 #define FLD(f) abuf->fields.sfmt_stmia.f
1905     UINT f_rlist;
1906
1907     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1908
1909   /* Record the fields for the semantic handler.  */
1910   FLD (f_rlist) = f_rlist;
1911   if (UNLIKELY(current_cpu->trace_extract_p))
1912     {
1913       current_cpu->trace_stream 
1914         << "0x" << hex << pc << dec << " (sfmt_push_lr)\t"
1915         << " f_rlist:0x" << hex << f_rlist << dec
1916         << endl;
1917     }
1918
1919 #undef FLD
1920 }
1921
1922 void
1923 thumb_extract_sfmt_pop (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1924     thumb_insn_word insn = entire_insn;
1925 #define FLD(f) abuf->fields.sfmt_stmia.f
1926     UINT f_rlist;
1927
1928     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1929
1930   /* Record the fields for the semantic handler.  */
1931   FLD (f_rlist) = f_rlist;
1932   if (UNLIKELY(current_cpu->trace_extract_p))
1933     {
1934       current_cpu->trace_stream 
1935         << "0x" << hex << pc << dec << " (sfmt_pop)\t"
1936         << " f_rlist:0x" << hex << f_rlist << dec
1937         << endl;
1938     }
1939
1940 #undef FLD
1941 }
1942
1943 void
1944 thumb_extract_sfmt_pop_pc (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1945     thumb_insn_word insn = entire_insn;
1946 #define FLD(f) abuf->fields.sfmt_stmia.f
1947     UINT f_rlist;
1948
1949     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1950
1951   /* Record the fields for the semantic handler.  */
1952   FLD (f_rlist) = f_rlist;
1953   if (UNLIKELY(current_cpu->trace_extract_p))
1954     {
1955       current_cpu->trace_stream 
1956         << "0x" << hex << pc << dec << " (sfmt_pop_pc)\t"
1957         << " f_rlist:0x" << hex << f_rlist << dec
1958         << endl;
1959     }
1960
1961 #undef FLD
1962 }
1963
1964 void
1965 thumb_extract_sfmt_stmia (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1966     thumb_insn_word insn = entire_insn;
1967 #define FLD(f) abuf->fields.sfmt_stmia.f
1968     UINT f_bit10_rb;
1969     UINT f_rlist;
1970
1971     f_bit10_rb = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1972     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1973
1974   /* Record the fields for the semantic handler.  */
1975   FLD (f_bit10_rb) = f_bit10_rb;
1976   FLD (f_rlist) = f_rlist;
1977   if (UNLIKELY(current_cpu->trace_extract_p))
1978     {
1979       current_cpu->trace_stream 
1980         << "0x" << hex << pc << dec << " (sfmt_stmia)\t"
1981         << " f_bit10_rb:0x" << hex << f_bit10_rb << dec
1982         << " f_rlist:0x" << hex << f_rlist << dec
1983         << endl;
1984     }
1985
1986 #undef FLD
1987 }
1988
1989 void
1990 thumb_extract_sfmt_ldmia (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
1991     thumb_insn_word insn = entire_insn;
1992 #define FLD(f) abuf->fields.sfmt_stmia.f
1993     UINT f_bit10_rb;
1994     UINT f_rlist;
1995
1996     f_bit10_rb = EXTRACT_LSB0_UINT (insn, 16, 10, 3);
1997     f_rlist = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
1998
1999   /* Record the fields for the semantic handler.  */
2000   FLD (f_bit10_rb) = f_bit10_rb;
2001   FLD (f_rlist) = f_rlist;
2002   if (UNLIKELY(current_cpu->trace_extract_p))
2003     {
2004       current_cpu->trace_stream 
2005         << "0x" << hex << pc << dec << " (sfmt_ldmia)\t"
2006         << " f_bit10_rb:0x" << hex << f_bit10_rb << dec
2007         << " f_rlist:0x" << hex << f_rlist << dec
2008         << endl;
2009     }
2010
2011 #undef FLD
2012 }
2013
2014 void
2015 thumb_extract_sfmt_beq (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2016     thumb_insn_word insn = entire_insn;
2017 #define FLD(f) abuf->fields.sfmt_beq.f
2018     SI f_soffset8;
2019
2020     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2021
2022   /* Record the fields for the semantic handler.  */
2023   FLD (i_soffset8) = f_soffset8;
2024   if (UNLIKELY(current_cpu->trace_extract_p))
2025     {
2026       current_cpu->trace_stream 
2027         << "0x" << hex << pc << dec << " (sfmt_beq)\t"
2028         << endl;
2029     }
2030
2031 #undef FLD
2032 }
2033
2034 void
2035 thumb_extract_sfmt_bcs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2036     thumb_insn_word insn = entire_insn;
2037 #define FLD(f) abuf->fields.sfmt_beq.f
2038     SI f_soffset8;
2039
2040     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2041
2042   /* Record the fields for the semantic handler.  */
2043   FLD (i_soffset8) = f_soffset8;
2044   if (UNLIKELY(current_cpu->trace_extract_p))
2045     {
2046       current_cpu->trace_stream 
2047         << "0x" << hex << pc << dec << " (sfmt_bcs)\t"
2048         << endl;
2049     }
2050
2051 #undef FLD
2052 }
2053
2054 void
2055 thumb_extract_sfmt_bmi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2056     thumb_insn_word insn = entire_insn;
2057 #define FLD(f) abuf->fields.sfmt_beq.f
2058     SI f_soffset8;
2059
2060     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2061
2062   /* Record the fields for the semantic handler.  */
2063   FLD (i_soffset8) = f_soffset8;
2064   if (UNLIKELY(current_cpu->trace_extract_p))
2065     {
2066       current_cpu->trace_stream 
2067         << "0x" << hex << pc << dec << " (sfmt_bmi)\t"
2068         << endl;
2069     }
2070
2071 #undef FLD
2072 }
2073
2074 void
2075 thumb_extract_sfmt_bvs (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2076     thumb_insn_word insn = entire_insn;
2077 #define FLD(f) abuf->fields.sfmt_beq.f
2078     SI f_soffset8;
2079
2080     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2081
2082   /* Record the fields for the semantic handler.  */
2083   FLD (i_soffset8) = f_soffset8;
2084   if (UNLIKELY(current_cpu->trace_extract_p))
2085     {
2086       current_cpu->trace_stream 
2087         << "0x" << hex << pc << dec << " (sfmt_bvs)\t"
2088         << endl;
2089     }
2090
2091 #undef FLD
2092 }
2093
2094 void
2095 thumb_extract_sfmt_bhi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2096     thumb_insn_word insn = entire_insn;
2097 #define FLD(f) abuf->fields.sfmt_beq.f
2098     SI f_soffset8;
2099
2100     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2101
2102   /* Record the fields for the semantic handler.  */
2103   FLD (i_soffset8) = f_soffset8;
2104   if (UNLIKELY(current_cpu->trace_extract_p))
2105     {
2106       current_cpu->trace_stream 
2107         << "0x" << hex << pc << dec << " (sfmt_bhi)\t"
2108         << endl;
2109     }
2110
2111 #undef FLD
2112 }
2113
2114 void
2115 thumb_extract_sfmt_bge (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2116     thumb_insn_word insn = entire_insn;
2117 #define FLD(f) abuf->fields.sfmt_beq.f
2118     SI f_soffset8;
2119
2120     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2121
2122   /* Record the fields for the semantic handler.  */
2123   FLD (i_soffset8) = f_soffset8;
2124   if (UNLIKELY(current_cpu->trace_extract_p))
2125     {
2126       current_cpu->trace_stream 
2127         << "0x" << hex << pc << dec << " (sfmt_bge)\t"
2128         << endl;
2129     }
2130
2131 #undef FLD
2132 }
2133
2134 void
2135 thumb_extract_sfmt_bgt (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2136     thumb_insn_word insn = entire_insn;
2137 #define FLD(f) abuf->fields.sfmt_beq.f
2138     SI f_soffset8;
2139
2140     f_soffset8 = ((((EXTRACT_LSB0_SINT (insn, 16, 7, 8)) << (1))) + (((pc) + (4))));
2141
2142   /* Record the fields for the semantic handler.  */
2143   FLD (i_soffset8) = f_soffset8;
2144   if (UNLIKELY(current_cpu->trace_extract_p))
2145     {
2146       current_cpu->trace_stream 
2147         << "0x" << hex << pc << dec << " (sfmt_bgt)\t"
2148         << endl;
2149     }
2150
2151 #undef FLD
2152 }
2153
2154 void
2155 thumb_extract_sfmt_swi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2156     thumb_insn_word insn = entire_insn;
2157 #define FLD(f) abuf->fields.sfmt_swi.f
2158     UINT f_value8;
2159
2160     f_value8 = EXTRACT_LSB0_UINT (insn, 16, 7, 8);
2161
2162   /* Record the fields for the semantic handler.  */
2163   FLD (f_value8) = f_value8;
2164   if (UNLIKELY(current_cpu->trace_extract_p))
2165     {
2166       current_cpu->trace_stream 
2167         << "0x" << hex << pc << dec << " (sfmt_swi)\t"
2168         << " f_value8:0x" << hex << f_value8 << dec
2169         << endl;
2170     }
2171
2172 #undef FLD
2173 }
2174
2175 void
2176 thumb_extract_sfmt_b (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2177     thumb_insn_word insn = entire_insn;
2178 #define FLD(f) abuf->fields.sfmt_b.f
2179     SI f_offset11;
2180
2181     f_offset11 = ((((EXTRACT_LSB0_SINT (insn, 16, 10, 11)) << (1))) + (((pc) + (4))));
2182
2183   /* Record the fields for the semantic handler.  */
2184   FLD (i_offset11) = f_offset11;
2185   if (UNLIKELY(current_cpu->trace_extract_p))
2186     {
2187       current_cpu->trace_stream 
2188         << "0x" << hex << pc << dec << " (sfmt_b)\t"
2189         << endl;
2190     }
2191
2192 #undef FLD
2193 }
2194
2195 void
2196 thumb_extract_sfmt_bl_hi (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2197     thumb_insn_word insn = entire_insn;
2198 #define FLD(f) abuf->fields.sfmt_bl_hi.f
2199     INT f_lbwl_hi;
2200
2201     f_lbwl_hi = EXTRACT_LSB0_SINT (insn, 16, 10, 11);
2202
2203   /* Record the fields for the semantic handler.  */
2204   FLD (f_lbwl_hi) = f_lbwl_hi;
2205   if (UNLIKELY(current_cpu->trace_extract_p))
2206     {
2207       current_cpu->trace_stream 
2208         << "0x" << hex << pc << dec << " (sfmt_bl_hi)\t"
2209         << " f_lbwl_hi:0x" << hex << f_lbwl_hi << dec
2210         << endl;
2211     }
2212
2213 #undef FLD
2214 }
2215
2216 void
2217 thumb_extract_sfmt_bl_lo (thumb_scache* abuf, arm7f_cpu* current_cpu, PCADDR pc, thumb_insn_word base_insn, thumb_insn_word entire_insn){
2218     thumb_insn_word insn = entire_insn;
2219 #define FLD(f) abuf->fields.sfmt_bl_lo.f
2220     UINT f_lbwl_lo;
2221
2222     f_lbwl_lo = EXTRACT_LSB0_UINT (insn, 16, 10, 11);
2223
2224   /* Record the fields for the semantic handler.  */
2225   FLD (f_lbwl_lo) = f_lbwl_lo;
2226   if (UNLIKELY(current_cpu->trace_extract_p))
2227     {
2228       current_cpu->trace_stream 
2229         << "0x" << hex << pc << dec << " (sfmt_bl_lo)\t"
2230         << " f_lbwl_lo:0x" << hex << f_lbwl_lo << dec
2231         << endl;
2232     }
2233
2234 #undef FLD
2235 }
2236