This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / sim / iq2000 / decode.c
1 /* Simulator instruction decoder for iq2000bf.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
6
7 This file is part of the GNU simulators.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 */
24
25 #define WANT_CPU iq2000bf
26 #define WANT_CPU_IQ2000BF
27
28 #include "sim-main.h"
29 #include "sim-assert.h"
30
31 /* The instruction descriptor array.
32    This is computed at runtime.  Space for it is not malloc'd to save a
33    teensy bit of cpu in the decoder.  Moving it to malloc space is trivial
34    but won't be done until necessary (we don't currently support the runtime
35    addition of instructions nor an SMP machine with different cpus).  */
36 static IDESC iq2000bf_insn_data[IQ2000BF_INSN_BMB + 1];
37
38 /* Commas between elements are contained in the macros.
39    Some of these are conditionally compiled out.  */
40
41 static const struct insn_sem iq2000bf_insn_sem[] =
42 {
43   { VIRTUAL_INSN_X_INVALID, IQ2000BF_INSN_X_INVALID, IQ2000BF_SFMT_EMPTY },
44   { VIRTUAL_INSN_X_AFTER, IQ2000BF_INSN_X_AFTER, IQ2000BF_SFMT_EMPTY },
45   { VIRTUAL_INSN_X_BEFORE, IQ2000BF_INSN_X_BEFORE, IQ2000BF_SFMT_EMPTY },
46   { VIRTUAL_INSN_X_CTI_CHAIN, IQ2000BF_INSN_X_CTI_CHAIN, IQ2000BF_SFMT_EMPTY },
47   { VIRTUAL_INSN_X_CHAIN, IQ2000BF_INSN_X_CHAIN, IQ2000BF_SFMT_EMPTY },
48   { VIRTUAL_INSN_X_BEGIN, IQ2000BF_INSN_X_BEGIN, IQ2000BF_SFMT_EMPTY },
49   { IQ2000_INSN_ADD, IQ2000BF_INSN_ADD, IQ2000BF_SFMT_ADD },
50   { IQ2000_INSN_ADDI, IQ2000BF_INSN_ADDI, IQ2000BF_SFMT_ADDI },
51   { IQ2000_INSN_ADDIU, IQ2000BF_INSN_ADDIU, IQ2000BF_SFMT_ADDI },
52   { IQ2000_INSN_ADDU, IQ2000BF_INSN_ADDU, IQ2000BF_SFMT_ADD },
53   { IQ2000_INSN_ADO16, IQ2000BF_INSN_ADO16, IQ2000BF_SFMT_ADO16 },
54   { IQ2000_INSN_AND, IQ2000BF_INSN_AND, IQ2000BF_SFMT_ADD },
55   { IQ2000_INSN_ANDI, IQ2000BF_INSN_ANDI, IQ2000BF_SFMT_ADDI },
56   { IQ2000_INSN_ANDOI, IQ2000BF_INSN_ANDOI, IQ2000BF_SFMT_ADDI },
57   { IQ2000_INSN_NOR, IQ2000BF_INSN_NOR, IQ2000BF_SFMT_ADD },
58   { IQ2000_INSN_OR, IQ2000BF_INSN_OR, IQ2000BF_SFMT_ADD },
59   { IQ2000_INSN_ORI, IQ2000BF_INSN_ORI, IQ2000BF_SFMT_ADDI },
60   { IQ2000_INSN_RAM, IQ2000BF_INSN_RAM, IQ2000BF_SFMT_RAM },
61   { IQ2000_INSN_SLL, IQ2000BF_INSN_SLL, IQ2000BF_SFMT_SLL },
62   { IQ2000_INSN_SLLV, IQ2000BF_INSN_SLLV, IQ2000BF_SFMT_ADD },
63   { IQ2000_INSN_SLMV, IQ2000BF_INSN_SLMV, IQ2000BF_SFMT_SLMV },
64   { IQ2000_INSN_SLT, IQ2000BF_INSN_SLT, IQ2000BF_SFMT_SLT },
65   { IQ2000_INSN_SLTI, IQ2000BF_INSN_SLTI, IQ2000BF_SFMT_SLTI },
66   { IQ2000_INSN_SLTIU, IQ2000BF_INSN_SLTIU, IQ2000BF_SFMT_SLTI },
67   { IQ2000_INSN_SLTU, IQ2000BF_INSN_SLTU, IQ2000BF_SFMT_SLT },
68   { IQ2000_INSN_SRA, IQ2000BF_INSN_SRA, IQ2000BF_SFMT_SLL },
69   { IQ2000_INSN_SRAV, IQ2000BF_INSN_SRAV, IQ2000BF_SFMT_ADD },
70   { IQ2000_INSN_SRL, IQ2000BF_INSN_SRL, IQ2000BF_SFMT_SLL },
71   { IQ2000_INSN_SRLV, IQ2000BF_INSN_SRLV, IQ2000BF_SFMT_ADD },
72   { IQ2000_INSN_SRMV, IQ2000BF_INSN_SRMV, IQ2000BF_SFMT_SLMV },
73   { IQ2000_INSN_SUB, IQ2000BF_INSN_SUB, IQ2000BF_SFMT_ADD },
74   { IQ2000_INSN_SUBU, IQ2000BF_INSN_SUBU, IQ2000BF_SFMT_ADD },
75   { IQ2000_INSN_XOR, IQ2000BF_INSN_XOR, IQ2000BF_SFMT_ADD },
76   { IQ2000_INSN_XORI, IQ2000BF_INSN_XORI, IQ2000BF_SFMT_ADDI },
77   { IQ2000_INSN_BBI, IQ2000BF_INSN_BBI, IQ2000BF_SFMT_BBI },
78   { IQ2000_INSN_BBIN, IQ2000BF_INSN_BBIN, IQ2000BF_SFMT_BBI },
79   { IQ2000_INSN_BBV, IQ2000BF_INSN_BBV, IQ2000BF_SFMT_BBV },
80   { IQ2000_INSN_BBVN, IQ2000BF_INSN_BBVN, IQ2000BF_SFMT_BBV },
81   { IQ2000_INSN_BEQ, IQ2000BF_INSN_BEQ, IQ2000BF_SFMT_BBV },
82   { IQ2000_INSN_BEQL, IQ2000BF_INSN_BEQL, IQ2000BF_SFMT_BBV },
83   { IQ2000_INSN_BGEZ, IQ2000BF_INSN_BGEZ, IQ2000BF_SFMT_BGEZ },
84   { IQ2000_INSN_BGEZAL, IQ2000BF_INSN_BGEZAL, IQ2000BF_SFMT_BGEZAL },
85   { IQ2000_INSN_BGEZALL, IQ2000BF_INSN_BGEZALL, IQ2000BF_SFMT_BGEZAL },
86   { IQ2000_INSN_BGEZL, IQ2000BF_INSN_BGEZL, IQ2000BF_SFMT_BGEZ },
87   { IQ2000_INSN_BLTZ, IQ2000BF_INSN_BLTZ, IQ2000BF_SFMT_BGEZ },
88   { IQ2000_INSN_BLTZL, IQ2000BF_INSN_BLTZL, IQ2000BF_SFMT_BGEZ },
89   { IQ2000_INSN_BLTZAL, IQ2000BF_INSN_BLTZAL, IQ2000BF_SFMT_BGEZAL },
90   { IQ2000_INSN_BLTZALL, IQ2000BF_INSN_BLTZALL, IQ2000BF_SFMT_BGEZAL },
91   { IQ2000_INSN_BMB0, IQ2000BF_INSN_BMB0, IQ2000BF_SFMT_BBV },
92   { IQ2000_INSN_BMB1, IQ2000BF_INSN_BMB1, IQ2000BF_SFMT_BBV },
93   { IQ2000_INSN_BMB2, IQ2000BF_INSN_BMB2, IQ2000BF_SFMT_BBV },
94   { IQ2000_INSN_BMB3, IQ2000BF_INSN_BMB3, IQ2000BF_SFMT_BBV },
95   { IQ2000_INSN_BNE, IQ2000BF_INSN_BNE, IQ2000BF_SFMT_BBV },
96   { IQ2000_INSN_BNEL, IQ2000BF_INSN_BNEL, IQ2000BF_SFMT_BBV },
97   { IQ2000_INSN_JALR, IQ2000BF_INSN_JALR, IQ2000BF_SFMT_JALR },
98   { IQ2000_INSN_JR, IQ2000BF_INSN_JR, IQ2000BF_SFMT_JR },
99   { IQ2000_INSN_LB, IQ2000BF_INSN_LB, IQ2000BF_SFMT_LB },
100   { IQ2000_INSN_LBU, IQ2000BF_INSN_LBU, IQ2000BF_SFMT_LB },
101   { IQ2000_INSN_LH, IQ2000BF_INSN_LH, IQ2000BF_SFMT_LH },
102   { IQ2000_INSN_LHU, IQ2000BF_INSN_LHU, IQ2000BF_SFMT_LH },
103   { IQ2000_INSN_LUI, IQ2000BF_INSN_LUI, IQ2000BF_SFMT_LUI },
104   { IQ2000_INSN_LW, IQ2000BF_INSN_LW, IQ2000BF_SFMT_LW },
105   { IQ2000_INSN_SB, IQ2000BF_INSN_SB, IQ2000BF_SFMT_SB },
106   { IQ2000_INSN_SH, IQ2000BF_INSN_SH, IQ2000BF_SFMT_SH },
107   { IQ2000_INSN_SW, IQ2000BF_INSN_SW, IQ2000BF_SFMT_SW },
108   { IQ2000_INSN_BREAK, IQ2000BF_INSN_BREAK, IQ2000BF_SFMT_BREAK },
109   { IQ2000_INSN_SYSCALL, IQ2000BF_INSN_SYSCALL, IQ2000BF_SFMT_SYSCALL },
110   { IQ2000_INSN_ANDOUI, IQ2000BF_INSN_ANDOUI, IQ2000BF_SFMT_ANDOUI },
111   { IQ2000_INSN_ORUI, IQ2000BF_INSN_ORUI, IQ2000BF_SFMT_ANDOUI },
112   { IQ2000_INSN_BGTZ, IQ2000BF_INSN_BGTZ, IQ2000BF_SFMT_BGEZ },
113   { IQ2000_INSN_BGTZL, IQ2000BF_INSN_BGTZL, IQ2000BF_SFMT_BGEZ },
114   { IQ2000_INSN_BLEZ, IQ2000BF_INSN_BLEZ, IQ2000BF_SFMT_BGEZ },
115   { IQ2000_INSN_BLEZL, IQ2000BF_INSN_BLEZL, IQ2000BF_SFMT_BGEZ },
116   { IQ2000_INSN_MRGB, IQ2000BF_INSN_MRGB, IQ2000BF_SFMT_MRGB },
117   { IQ2000_INSN_BCTXT, IQ2000BF_INSN_BCTXT, IQ2000BF_SFMT_BCTXT },
118   { IQ2000_INSN_BC0F, IQ2000BF_INSN_BC0F, IQ2000BF_SFMT_BCTXT },
119   { IQ2000_INSN_BC0FL, IQ2000BF_INSN_BC0FL, IQ2000BF_SFMT_BCTXT },
120   { IQ2000_INSN_BC3F, IQ2000BF_INSN_BC3F, IQ2000BF_SFMT_BCTXT },
121   { IQ2000_INSN_BC3FL, IQ2000BF_INSN_BC3FL, IQ2000BF_SFMT_BCTXT },
122   { IQ2000_INSN_BC0T, IQ2000BF_INSN_BC0T, IQ2000BF_SFMT_BCTXT },
123   { IQ2000_INSN_BC0TL, IQ2000BF_INSN_BC0TL, IQ2000BF_SFMT_BCTXT },
124   { IQ2000_INSN_BC3T, IQ2000BF_INSN_BC3T, IQ2000BF_SFMT_BCTXT },
125   { IQ2000_INSN_BC3TL, IQ2000BF_INSN_BC3TL, IQ2000BF_SFMT_BCTXT },
126   { IQ2000_INSN_CFC0, IQ2000BF_INSN_CFC0, IQ2000BF_SFMT_SYSCALL },
127   { IQ2000_INSN_CFC1, IQ2000BF_INSN_CFC1, IQ2000BF_SFMT_SYSCALL },
128   { IQ2000_INSN_CFC2, IQ2000BF_INSN_CFC2, IQ2000BF_SFMT_SYSCALL },
129   { IQ2000_INSN_CFC3, IQ2000BF_INSN_CFC3, IQ2000BF_SFMT_SYSCALL },
130   { IQ2000_INSN_CHKHDR, IQ2000BF_INSN_CHKHDR, IQ2000BF_SFMT_SYSCALL },
131   { IQ2000_INSN_CTC0, IQ2000BF_INSN_CTC0, IQ2000BF_SFMT_SYSCALL },
132   { IQ2000_INSN_CTC1, IQ2000BF_INSN_CTC1, IQ2000BF_SFMT_SYSCALL },
133   { IQ2000_INSN_CTC2, IQ2000BF_INSN_CTC2, IQ2000BF_SFMT_SYSCALL },
134   { IQ2000_INSN_CTC3, IQ2000BF_INSN_CTC3, IQ2000BF_SFMT_SYSCALL },
135   { IQ2000_INSN_JCR, IQ2000BF_INSN_JCR, IQ2000BF_SFMT_BCTXT },
136   { IQ2000_INSN_LUC32, IQ2000BF_INSN_LUC32, IQ2000BF_SFMT_SYSCALL },
137   { IQ2000_INSN_LUC32L, IQ2000BF_INSN_LUC32L, IQ2000BF_SFMT_SYSCALL },
138   { IQ2000_INSN_LUC64, IQ2000BF_INSN_LUC64, IQ2000BF_SFMT_SYSCALL },
139   { IQ2000_INSN_LUC64L, IQ2000BF_INSN_LUC64L, IQ2000BF_SFMT_SYSCALL },
140   { IQ2000_INSN_LUK, IQ2000BF_INSN_LUK, IQ2000BF_SFMT_SYSCALL },
141   { IQ2000_INSN_LULCK, IQ2000BF_INSN_LULCK, IQ2000BF_SFMT_SYSCALL },
142   { IQ2000_INSN_LUM32, IQ2000BF_INSN_LUM32, IQ2000BF_SFMT_SYSCALL },
143   { IQ2000_INSN_LUM32L, IQ2000BF_INSN_LUM32L, IQ2000BF_SFMT_SYSCALL },
144   { IQ2000_INSN_LUM64, IQ2000BF_INSN_LUM64, IQ2000BF_SFMT_SYSCALL },
145   { IQ2000_INSN_LUM64L, IQ2000BF_INSN_LUM64L, IQ2000BF_SFMT_SYSCALL },
146   { IQ2000_INSN_LUR, IQ2000BF_INSN_LUR, IQ2000BF_SFMT_SYSCALL },
147   { IQ2000_INSN_LURL, IQ2000BF_INSN_LURL, IQ2000BF_SFMT_SYSCALL },
148   { IQ2000_INSN_LUULCK, IQ2000BF_INSN_LUULCK, IQ2000BF_SFMT_SYSCALL },
149   { IQ2000_INSN_MFC0, IQ2000BF_INSN_MFC0, IQ2000BF_SFMT_SYSCALL },
150   { IQ2000_INSN_MFC1, IQ2000BF_INSN_MFC1, IQ2000BF_SFMT_SYSCALL },
151   { IQ2000_INSN_MFC2, IQ2000BF_INSN_MFC2, IQ2000BF_SFMT_SYSCALL },
152   { IQ2000_INSN_MFC3, IQ2000BF_INSN_MFC3, IQ2000BF_SFMT_SYSCALL },
153   { IQ2000_INSN_MTC0, IQ2000BF_INSN_MTC0, IQ2000BF_SFMT_SYSCALL },
154   { IQ2000_INSN_MTC1, IQ2000BF_INSN_MTC1, IQ2000BF_SFMT_SYSCALL },
155   { IQ2000_INSN_MTC2, IQ2000BF_INSN_MTC2, IQ2000BF_SFMT_SYSCALL },
156   { IQ2000_INSN_MTC3, IQ2000BF_INSN_MTC3, IQ2000BF_SFMT_SYSCALL },
157   { IQ2000_INSN_PKRL, IQ2000BF_INSN_PKRL, IQ2000BF_SFMT_SYSCALL },
158   { IQ2000_INSN_PKRLR1, IQ2000BF_INSN_PKRLR1, IQ2000BF_SFMT_SYSCALL },
159   { IQ2000_INSN_PKRLR30, IQ2000BF_INSN_PKRLR30, IQ2000BF_SFMT_SYSCALL },
160   { IQ2000_INSN_RB, IQ2000BF_INSN_RB, IQ2000BF_SFMT_SYSCALL },
161   { IQ2000_INSN_RBR1, IQ2000BF_INSN_RBR1, IQ2000BF_SFMT_SYSCALL },
162   { IQ2000_INSN_RBR30, IQ2000BF_INSN_RBR30, IQ2000BF_SFMT_SYSCALL },
163   { IQ2000_INSN_RFE, IQ2000BF_INSN_RFE, IQ2000BF_SFMT_SYSCALL },
164   { IQ2000_INSN_RX, IQ2000BF_INSN_RX, IQ2000BF_SFMT_SYSCALL },
165   { IQ2000_INSN_RXR1, IQ2000BF_INSN_RXR1, IQ2000BF_SFMT_SYSCALL },
166   { IQ2000_INSN_RXR30, IQ2000BF_INSN_RXR30, IQ2000BF_SFMT_SYSCALL },
167   { IQ2000_INSN_SLEEP, IQ2000BF_INSN_SLEEP, IQ2000BF_SFMT_SYSCALL },
168   { IQ2000_INSN_SRRD, IQ2000BF_INSN_SRRD, IQ2000BF_SFMT_SYSCALL },
169   { IQ2000_INSN_SRRDL, IQ2000BF_INSN_SRRDL, IQ2000BF_SFMT_SYSCALL },
170   { IQ2000_INSN_SRULCK, IQ2000BF_INSN_SRULCK, IQ2000BF_SFMT_SYSCALL },
171   { IQ2000_INSN_SRWR, IQ2000BF_INSN_SRWR, IQ2000BF_SFMT_SYSCALL },
172   { IQ2000_INSN_SRWRU, IQ2000BF_INSN_SRWRU, IQ2000BF_SFMT_SYSCALL },
173   { IQ2000_INSN_TRAPQFL, IQ2000BF_INSN_TRAPQFL, IQ2000BF_SFMT_SYSCALL },
174   { IQ2000_INSN_TRAPQNE, IQ2000BF_INSN_TRAPQNE, IQ2000BF_SFMT_SYSCALL },
175   { IQ2000_INSN_TRAPREL, IQ2000BF_INSN_TRAPREL, IQ2000BF_SFMT_SYSCALL },
176   { IQ2000_INSN_WB, IQ2000BF_INSN_WB, IQ2000BF_SFMT_SYSCALL },
177   { IQ2000_INSN_WBU, IQ2000BF_INSN_WBU, IQ2000BF_SFMT_SYSCALL },
178   { IQ2000_INSN_WBR1, IQ2000BF_INSN_WBR1, IQ2000BF_SFMT_SYSCALL },
179   { IQ2000_INSN_WBR1U, IQ2000BF_INSN_WBR1U, IQ2000BF_SFMT_SYSCALL },
180   { IQ2000_INSN_WBR30, IQ2000BF_INSN_WBR30, IQ2000BF_SFMT_SYSCALL },
181   { IQ2000_INSN_WBR30U, IQ2000BF_INSN_WBR30U, IQ2000BF_SFMT_SYSCALL },
182   { IQ2000_INSN_WX, IQ2000BF_INSN_WX, IQ2000BF_SFMT_SYSCALL },
183   { IQ2000_INSN_WXU, IQ2000BF_INSN_WXU, IQ2000BF_SFMT_SYSCALL },
184   { IQ2000_INSN_WXR1, IQ2000BF_INSN_WXR1, IQ2000BF_SFMT_SYSCALL },
185   { IQ2000_INSN_WXR1U, IQ2000BF_INSN_WXR1U, IQ2000BF_SFMT_SYSCALL },
186   { IQ2000_INSN_WXR30, IQ2000BF_INSN_WXR30, IQ2000BF_SFMT_SYSCALL },
187   { IQ2000_INSN_WXR30U, IQ2000BF_INSN_WXR30U, IQ2000BF_SFMT_SYSCALL },
188   { IQ2000_INSN_LDW, IQ2000BF_INSN_LDW, IQ2000BF_SFMT_LDW },
189   { IQ2000_INSN_SDW, IQ2000BF_INSN_SDW, IQ2000BF_SFMT_SDW },
190   { IQ2000_INSN_J, IQ2000BF_INSN_J, IQ2000BF_SFMT_J },
191   { IQ2000_INSN_JAL, IQ2000BF_INSN_JAL, IQ2000BF_SFMT_JAL },
192   { IQ2000_INSN_BMB, IQ2000BF_INSN_BMB, IQ2000BF_SFMT_BBV },
193 };
194
195 static const struct insn_sem iq2000bf_insn_sem_invalid = {
196   VIRTUAL_INSN_X_INVALID, IQ2000BF_INSN_X_INVALID, IQ2000BF_SFMT_EMPTY
197 };
198
199 /* Initialize an IDESC from the compile-time computable parts.  */
200
201 static INLINE void
202 init_idesc (SIM_CPU *cpu, IDESC *id, const struct insn_sem *t)
203 {
204   const CGEN_INSN *insn_table = CGEN_CPU_INSN_TABLE (CPU_CPU_DESC (cpu))->init_entries;
205
206   id->num = t->index;
207   id->sfmt = t->sfmt;
208   if ((int) t->type <= 0)
209     id->idata = & cgen_virtual_insn_table[- (int) t->type];
210   else
211     id->idata = & insn_table[t->type];
212   id->attrs = CGEN_INSN_ATTRS (id->idata);
213   /* Oh my god, a magic number.  */
214   id->length = CGEN_INSN_BITSIZE (id->idata) / 8;
215
216 #if WITH_PROFILE_MODEL_P
217   id->timing = & MODEL_TIMING (CPU_MODEL (cpu)) [t->index];
218   {
219     SIM_DESC sd = CPU_STATE (cpu);
220     SIM_ASSERT (t->index == id->timing->num);
221   }
222 #endif
223
224   /* Semantic pointers are initialized elsewhere.  */
225 }
226
227 /* Initialize the instruction descriptor table.  */
228
229 void
230 iq2000bf_init_idesc_table (SIM_CPU *cpu)
231 {
232   IDESC *id,*tabend;
233   const struct insn_sem *t,*tend;
234   int tabsize = sizeof (iq2000bf_insn_data) / sizeof (IDESC);
235   IDESC *table = iq2000bf_insn_data;
236
237   memset (table, 0, tabsize * sizeof (IDESC));
238
239   /* First set all entries to the `invalid insn'.  */
240   t = & iq2000bf_insn_sem_invalid;
241   for (id = table, tabend = table + tabsize; id < tabend; ++id)
242     init_idesc (cpu, id, t);
243
244   /* Now fill in the values for the chosen cpu.  */
245   for (t = iq2000bf_insn_sem, tend = t + sizeof (iq2000bf_insn_sem) / sizeof (*t);
246        t != tend; ++t)
247     {
248       init_idesc (cpu, & table[t->index], t);
249     }
250
251   /* Link the IDESC table into the cpu.  */
252   CPU_IDESC (cpu) = table;
253 }
254
255 /* Given an instruction, return a pointer to its IDESC entry.  */
256
257 const IDESC *
258 iq2000bf_decode (SIM_CPU *current_cpu, IADDR pc,
259               CGEN_INSN_INT base_insn, CGEN_INSN_INT entire_insn,
260               ARGBUF *abuf)
261 {
262   /* Result of decoder.  */
263   IQ2000BF_INSN_TYPE itype;
264
265   {
266     CGEN_INSN_INT insn = base_insn;
267
268     {
269       unsigned int val = (((insn >> 26) & (63 << 0)));
270       switch (val)
271       {
272       case 0 :
273         {
274           unsigned int val = (((insn >> 1) & (1 << 4)) | ((insn >> 0) & (15 << 0)));
275           switch (val)
276           {
277           case 0 : itype = IQ2000BF_INSN_SLL;goto extract_sfmt_sll;
278           case 1 : itype = IQ2000BF_INSN_SLMV;goto extract_sfmt_slmv;
279           case 2 : itype = IQ2000BF_INSN_SRL;goto extract_sfmt_sll;
280           case 3 : itype = IQ2000BF_INSN_SRA;goto extract_sfmt_sll;
281           case 4 : itype = IQ2000BF_INSN_SLLV;goto extract_sfmt_add;
282           case 5 : itype = IQ2000BF_INSN_SRMV;goto extract_sfmt_slmv;
283           case 6 : itype = IQ2000BF_INSN_SRLV;goto extract_sfmt_add;
284           case 7 : itype = IQ2000BF_INSN_SRAV;goto extract_sfmt_add;
285           case 8 : itype = IQ2000BF_INSN_JR;goto extract_sfmt_jr;
286           case 9 : itype = IQ2000BF_INSN_JALR;goto extract_sfmt_jalr;
287           case 10 : itype = IQ2000BF_INSN_JCR;goto extract_sfmt_bctxt;
288           case 12 : itype = IQ2000BF_INSN_SYSCALL;goto extract_sfmt_syscall;
289           case 13 : itype = IQ2000BF_INSN_BREAK;goto extract_sfmt_break;
290           case 14 : itype = IQ2000BF_INSN_SLEEP;goto extract_sfmt_syscall;
291           case 16 : itype = IQ2000BF_INSN_ADD;goto extract_sfmt_add;
292           case 17 : itype = IQ2000BF_INSN_ADDU;goto extract_sfmt_add;
293           case 18 : itype = IQ2000BF_INSN_SUB;goto extract_sfmt_add;
294           case 19 : itype = IQ2000BF_INSN_SUBU;goto extract_sfmt_add;
295           case 20 : itype = IQ2000BF_INSN_AND;goto extract_sfmt_add;
296           case 21 : itype = IQ2000BF_INSN_OR;goto extract_sfmt_add;
297           case 22 : itype = IQ2000BF_INSN_XOR;goto extract_sfmt_add;
298           case 23 : itype = IQ2000BF_INSN_NOR;goto extract_sfmt_add;
299           case 25 : itype = IQ2000BF_INSN_ADO16;goto extract_sfmt_ado16;
300           case 26 : itype = IQ2000BF_INSN_SLT;goto extract_sfmt_slt;
301           case 27 : itype = IQ2000BF_INSN_SLTU;goto extract_sfmt_slt;
302           case 29 : itype = IQ2000BF_INSN_MRGB;goto extract_sfmt_mrgb;
303           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
304           }
305         }
306       case 1 :
307         {
308           unsigned int val = (((insn >> 17) & (1 << 3)) | ((insn >> 16) & (7 << 0)));
309           switch (val)
310           {
311           case 0 : itype = IQ2000BF_INSN_BLTZ;goto extract_sfmt_bgez;
312           case 1 : itype = IQ2000BF_INSN_BGEZ;goto extract_sfmt_bgez;
313           case 2 : itype = IQ2000BF_INSN_BLTZL;goto extract_sfmt_bgez;
314           case 3 : itype = IQ2000BF_INSN_BGEZL;goto extract_sfmt_bgez;
315           case 6 : itype = IQ2000BF_INSN_BCTXT;goto extract_sfmt_bctxt;
316           case 8 : itype = IQ2000BF_INSN_BLTZAL;goto extract_sfmt_bgezal;
317           case 9 : itype = IQ2000BF_INSN_BGEZAL;goto extract_sfmt_bgezal;
318           case 10 : itype = IQ2000BF_INSN_BLTZALL;goto extract_sfmt_bgezal;
319           case 11 : itype = IQ2000BF_INSN_BGEZALL;goto extract_sfmt_bgezal;
320           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
321           }
322         }
323       case 2 : itype = IQ2000BF_INSN_J;goto extract_sfmt_j;
324       case 3 : itype = IQ2000BF_INSN_JAL;goto extract_sfmt_jal;
325       case 4 : itype = IQ2000BF_INSN_BEQ;goto extract_sfmt_bbv;
326       case 5 : itype = IQ2000BF_INSN_BNE;goto extract_sfmt_bbv;
327       case 6 : itype = IQ2000BF_INSN_BLEZ;goto extract_sfmt_bgez;
328       case 7 : itype = IQ2000BF_INSN_BGTZ;goto extract_sfmt_bgez;
329       case 8 : itype = IQ2000BF_INSN_ADDI;goto extract_sfmt_addi;
330       case 9 : itype = IQ2000BF_INSN_ADDIU;goto extract_sfmt_addi;
331       case 10 : itype = IQ2000BF_INSN_SLTI;goto extract_sfmt_slti;
332       case 11 : itype = IQ2000BF_INSN_SLTIU;goto extract_sfmt_slti;
333       case 12 : itype = IQ2000BF_INSN_ANDI;goto extract_sfmt_addi;
334       case 13 : itype = IQ2000BF_INSN_ORI;goto extract_sfmt_addi;
335       case 14 : itype = IQ2000BF_INSN_XORI;goto extract_sfmt_addi;
336       case 15 : itype = IQ2000BF_INSN_LUI;goto extract_sfmt_lui;
337       case 16 :
338         {
339           unsigned int val = (((insn >> 19) & (15 << 3)) | ((insn >> 15) & (3 << 1)) | ((insn >> 4) & (1 << 0)));
340           switch (val)
341           {
342           case 0 : /* fall through */
343           case 2 : /* fall through */
344           case 4 : /* fall through */
345           case 6 : itype = IQ2000BF_INSN_MFC0;goto extract_sfmt_syscall;
346           case 8 : /* fall through */
347           case 10 : /* fall through */
348           case 12 : /* fall through */
349           case 14 : itype = IQ2000BF_INSN_CFC0;goto extract_sfmt_syscall;
350           case 16 : /* fall through */
351           case 18 : /* fall through */
352           case 20 : /* fall through */
353           case 22 : itype = IQ2000BF_INSN_MTC0;goto extract_sfmt_syscall;
354           case 24 : /* fall through */
355           case 26 : /* fall through */
356           case 28 : /* fall through */
357           case 30 : itype = IQ2000BF_INSN_CTC0;goto extract_sfmt_syscall;
358           case 32 : /* fall through */
359           case 33 : itype = IQ2000BF_INSN_BC0F;goto extract_sfmt_bctxt;
360           case 34 : /* fall through */
361           case 35 : itype = IQ2000BF_INSN_BC0T;goto extract_sfmt_bctxt;
362           case 36 : /* fall through */
363           case 37 : itype = IQ2000BF_INSN_BC0FL;goto extract_sfmt_bctxt;
364           case 38 : /* fall through */
365           case 39 : itype = IQ2000BF_INSN_BC0TL;goto extract_sfmt_bctxt;
366           case 65 : itype = IQ2000BF_INSN_RFE;goto extract_sfmt_syscall;
367           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
368           }
369         }
370       case 17 :
371         {
372           unsigned int val = (((insn >> 22) & (3 << 0)));
373           switch (val)
374           {
375           case 0 : itype = IQ2000BF_INSN_MFC1;goto extract_sfmt_syscall;
376           case 1 : itype = IQ2000BF_INSN_CFC1;goto extract_sfmt_syscall;
377           case 2 : itype = IQ2000BF_INSN_MTC1;goto extract_sfmt_syscall;
378           case 3 : itype = IQ2000BF_INSN_CTC1;goto extract_sfmt_syscall;
379           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
380           }
381         }
382       case 18 :
383         {
384           unsigned int val = (((insn >> 16) & (3 << 5)) | ((insn >> 0) & (31 << 0)));
385           switch (val)
386           {
387           case 0 :
388             {
389               unsigned int val = (((insn >> 23) & (1 << 0)));
390               switch (val)
391               {
392               case 0 : itype = IQ2000BF_INSN_MFC2;goto extract_sfmt_syscall;
393               case 1 : itype = IQ2000BF_INSN_MTC2;goto extract_sfmt_syscall;
394               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
395               }
396             }
397           case 32 : itype = IQ2000BF_INSN_LUULCK;goto extract_sfmt_syscall;
398           case 33 : itype = IQ2000BF_INSN_LUR;goto extract_sfmt_syscall;
399           case 34 : itype = IQ2000BF_INSN_LUM32;goto extract_sfmt_syscall;
400           case 35 : itype = IQ2000BF_INSN_LUC32;goto extract_sfmt_syscall;
401           case 36 : itype = IQ2000BF_INSN_LULCK;goto extract_sfmt_syscall;
402           case 37 : itype = IQ2000BF_INSN_LURL;goto extract_sfmt_syscall;
403           case 38 : itype = IQ2000BF_INSN_LUM32L;goto extract_sfmt_syscall;
404           case 39 : itype = IQ2000BF_INSN_LUC32L;goto extract_sfmt_syscall;
405           case 40 : itype = IQ2000BF_INSN_LUK;goto extract_sfmt_syscall;
406           case 42 : itype = IQ2000BF_INSN_LUM64;goto extract_sfmt_syscall;
407           case 43 : itype = IQ2000BF_INSN_LUC64;goto extract_sfmt_syscall;
408           case 46 : itype = IQ2000BF_INSN_LUM64L;goto extract_sfmt_syscall;
409           case 47 : itype = IQ2000BF_INSN_LUC64L;goto extract_sfmt_syscall;
410           case 48 : itype = IQ2000BF_INSN_SRRD;goto extract_sfmt_syscall;
411           case 49 : itype = IQ2000BF_INSN_SRWR;goto extract_sfmt_syscall;
412           case 52 : itype = IQ2000BF_INSN_SRRDL;goto extract_sfmt_syscall;
413           case 53 : itype = IQ2000BF_INSN_SRWRU;goto extract_sfmt_syscall;
414           case 54 : itype = IQ2000BF_INSN_SRULCK;goto extract_sfmt_syscall;
415           case 64 :
416             {
417               unsigned int val = (((insn >> 23) & (1 << 0)));
418               switch (val)
419               {
420               case 0 : itype = IQ2000BF_INSN_CFC2;goto extract_sfmt_syscall;
421               case 1 : itype = IQ2000BF_INSN_CTC2;goto extract_sfmt_syscall;
422               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
423               }
424             }
425           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
426           }
427         }
428       case 19 :
429         {
430           unsigned int val = (((insn >> 19) & (31 << 2)) | ((insn >> 0) & (3 << 0)));
431           switch (val)
432           {
433           case 0 : itype = IQ2000BF_INSN_MFC3;goto extract_sfmt_syscall;
434           case 4 :
435             {
436               unsigned int val = (((insn >> 2) & (3 << 0)));
437               switch (val)
438               {
439               case 0 : itype = IQ2000BF_INSN_WB;goto extract_sfmt_syscall;
440               case 1 : itype = IQ2000BF_INSN_RB;goto extract_sfmt_syscall;
441               case 2 : itype = IQ2000BF_INSN_TRAPQFL;goto extract_sfmt_syscall;
442               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
443               }
444             }
445           case 5 :
446             {
447               unsigned int val = (((insn >> 3) & (1 << 0)));
448               switch (val)
449               {
450               case 0 : itype = IQ2000BF_INSN_WBU;goto extract_sfmt_syscall;
451               case 1 : itype = IQ2000BF_INSN_TRAPQNE;goto extract_sfmt_syscall;
452               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
453               }
454             }
455           case 6 :
456             {
457               unsigned int val = (((insn >> 2) & (3 << 0)));
458               switch (val)
459               {
460               case 0 : itype = IQ2000BF_INSN_WX;goto extract_sfmt_syscall;
461               case 1 : itype = IQ2000BF_INSN_RX;goto extract_sfmt_syscall;
462               case 2 : itype = IQ2000BF_INSN_TRAPREL;goto extract_sfmt_syscall;
463               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
464               }
465             }
466           case 7 :
467             {
468               unsigned int val = (((insn >> 2) & (1 << 0)));
469               switch (val)
470               {
471               case 0 : itype = IQ2000BF_INSN_WXU;goto extract_sfmt_syscall;
472               case 1 : itype = IQ2000BF_INSN_PKRL;goto extract_sfmt_syscall;
473               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
474               }
475             }
476           case 8 : itype = IQ2000BF_INSN_CFC3;goto extract_sfmt_syscall;
477           case 16 : itype = IQ2000BF_INSN_MTC3;goto extract_sfmt_syscall;
478           case 24 : itype = IQ2000BF_INSN_CTC3;goto extract_sfmt_syscall;
479           case 32 : /* fall through */
480           case 33 : /* fall through */
481           case 34 : /* fall through */
482           case 35 :
483             {
484               unsigned int val = (((insn >> 16) & (3 << 0)));
485               switch (val)
486               {
487               case 0 : itype = IQ2000BF_INSN_BC3F;goto extract_sfmt_bctxt;
488               case 1 : itype = IQ2000BF_INSN_BC3T;goto extract_sfmt_bctxt;
489               case 2 : itype = IQ2000BF_INSN_BC3FL;goto extract_sfmt_bctxt;
490               case 3 : itype = IQ2000BF_INSN_BC3TL;goto extract_sfmt_bctxt;
491               default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
492               }
493             }
494           case 36 : itype = IQ2000BF_INSN_CHKHDR;goto extract_sfmt_syscall;
495           case 64 : /* fall through */
496           case 65 : /* fall through */
497           case 66 : /* fall through */
498           case 67 : itype = IQ2000BF_INSN_WBR1;goto extract_sfmt_syscall;
499           case 68 : /* fall through */
500           case 69 : /* fall through */
501           case 70 : /* fall through */
502           case 71 : itype = IQ2000BF_INSN_WBR1U;goto extract_sfmt_syscall;
503           case 72 : /* fall through */
504           case 73 : /* fall through */
505           case 74 : /* fall through */
506           case 75 : itype = IQ2000BF_INSN_WBR30;goto extract_sfmt_syscall;
507           case 76 : /* fall through */
508           case 77 : /* fall through */
509           case 78 : /* fall through */
510           case 79 : itype = IQ2000BF_INSN_WBR30U;goto extract_sfmt_syscall;
511           case 80 : /* fall through */
512           case 81 : /* fall through */
513           case 82 : /* fall through */
514           case 83 : itype = IQ2000BF_INSN_WXR1;goto extract_sfmt_syscall;
515           case 84 : /* fall through */
516           case 85 : /* fall through */
517           case 86 : /* fall through */
518           case 87 : itype = IQ2000BF_INSN_WXR1U;goto extract_sfmt_syscall;
519           case 88 : /* fall through */
520           case 89 : /* fall through */
521           case 90 : /* fall through */
522           case 91 : itype = IQ2000BF_INSN_WXR30;goto extract_sfmt_syscall;
523           case 92 : /* fall through */
524           case 93 : /* fall through */
525           case 94 : /* fall through */
526           case 95 : itype = IQ2000BF_INSN_WXR30U;goto extract_sfmt_syscall;
527           case 96 : /* fall through */
528           case 97 : /* fall through */
529           case 98 : /* fall through */
530           case 99 : itype = IQ2000BF_INSN_RBR1;goto extract_sfmt_syscall;
531           case 104 : /* fall through */
532           case 105 : /* fall through */
533           case 106 : /* fall through */
534           case 107 : itype = IQ2000BF_INSN_RBR30;goto extract_sfmt_syscall;
535           case 112 : /* fall through */
536           case 113 : /* fall through */
537           case 114 : /* fall through */
538           case 115 : itype = IQ2000BF_INSN_RXR1;goto extract_sfmt_syscall;
539           case 116 : /* fall through */
540           case 117 : /* fall through */
541           case 118 : /* fall through */
542           case 119 : itype = IQ2000BF_INSN_PKRLR1;goto extract_sfmt_syscall;
543           case 120 : /* fall through */
544           case 121 : /* fall through */
545           case 122 : /* fall through */
546           case 123 : itype = IQ2000BF_INSN_RXR30;goto extract_sfmt_syscall;
547           case 124 : /* fall through */
548           case 125 : /* fall through */
549           case 126 : /* fall through */
550           case 127 : itype = IQ2000BF_INSN_PKRLR30;goto extract_sfmt_syscall;
551           default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
552           }
553         }
554       case 20 : itype = IQ2000BF_INSN_BEQL;goto extract_sfmt_bbv;
555       case 21 : itype = IQ2000BF_INSN_BNEL;goto extract_sfmt_bbv;
556       case 22 : itype = IQ2000BF_INSN_BLEZL;goto extract_sfmt_bgez;
557       case 23 : itype = IQ2000BF_INSN_BGTZL;goto extract_sfmt_bgez;
558       case 24 : itype = IQ2000BF_INSN_BMB0;goto extract_sfmt_bbv;
559       case 25 : itype = IQ2000BF_INSN_BMB1;goto extract_sfmt_bbv;
560       case 26 : itype = IQ2000BF_INSN_BMB2;goto extract_sfmt_bbv;
561       case 27 : itype = IQ2000BF_INSN_BMB3;goto extract_sfmt_bbv;
562       case 28 : itype = IQ2000BF_INSN_BBI;goto extract_sfmt_bbi;
563       case 29 : itype = IQ2000BF_INSN_BBV;goto extract_sfmt_bbv;
564       case 30 : itype = IQ2000BF_INSN_BBIN;goto extract_sfmt_bbi;
565       case 31 : itype = IQ2000BF_INSN_BBVN;goto extract_sfmt_bbv;
566       case 32 : itype = IQ2000BF_INSN_LB;goto extract_sfmt_lb;
567       case 33 : itype = IQ2000BF_INSN_LH;goto extract_sfmt_lh;
568       case 35 : itype = IQ2000BF_INSN_LW;goto extract_sfmt_lw;
569       case 36 : itype = IQ2000BF_INSN_LBU;goto extract_sfmt_lb;
570       case 37 : itype = IQ2000BF_INSN_LHU;goto extract_sfmt_lh;
571       case 39 : itype = IQ2000BF_INSN_RAM;goto extract_sfmt_ram;
572       case 40 : itype = IQ2000BF_INSN_SB;goto extract_sfmt_sb;
573       case 41 : itype = IQ2000BF_INSN_SH;goto extract_sfmt_sh;
574       case 43 : itype = IQ2000BF_INSN_SW;goto extract_sfmt_sw;
575       case 44 : itype = IQ2000BF_INSN_ANDOI;goto extract_sfmt_addi;
576       case 45 : itype = IQ2000BF_INSN_BMB;goto extract_sfmt_bbv;
577       case 47 : itype = IQ2000BF_INSN_ORUI;goto extract_sfmt_andoui;
578       case 48 : itype = IQ2000BF_INSN_LDW;goto extract_sfmt_ldw;
579       case 56 : itype = IQ2000BF_INSN_SDW;goto extract_sfmt_sdw;
580       case 63 : itype = IQ2000BF_INSN_ANDOUI;goto extract_sfmt_andoui;
581       default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
582       }
583     }
584   }
585
586   /* The instruction has been decoded, now extract the fields.  */
587
588  extract_sfmt_empty:
589   {
590     const IDESC *idesc = &iq2000bf_insn_data[itype];
591 #define FLD(f) abuf->fields.fmt_empty.f
592
593
594   /* Record the fields for the semantic handler.  */
595   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_empty", (char *) 0));
596
597 #undef FLD
598     return idesc;
599   }
600
601  extract_sfmt_add:
602   {
603     const IDESC *idesc = &iq2000bf_insn_data[itype];
604     CGEN_INSN_INT insn = entire_insn;
605 #define FLD(f) abuf->fields.sfmt_mrgb.f
606     UINT f_rs;
607     UINT f_rt;
608     UINT f_rd;
609
610     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
611     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
612     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
613
614   /* Record the fields for the semantic handler.  */
615   FLD (f_rs) = f_rs;
616   FLD (f_rt) = f_rt;
617   FLD (f_rd) = f_rd;
618   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_add", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
619
620 #undef FLD
621     return idesc;
622   }
623
624  extract_sfmt_addi:
625   {
626     const IDESC *idesc = &iq2000bf_insn_data[itype];
627     CGEN_INSN_INT insn = entire_insn;
628 #define FLD(f) abuf->fields.sfmt_addi.f
629     UINT f_rs;
630     UINT f_rt;
631     UINT f_imm;
632
633     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
634     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
635     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
636
637   /* Record the fields for the semantic handler.  */
638   FLD (f_imm) = f_imm;
639   FLD (f_rs) = f_rs;
640   FLD (f_rt) = f_rt;
641   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_addi", "f_imm 0x%x", 'x', f_imm, "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, (char *) 0));
642
643 #undef FLD
644     return idesc;
645   }
646
647  extract_sfmt_ado16:
648   {
649     const IDESC *idesc = &iq2000bf_insn_data[itype];
650     CGEN_INSN_INT insn = entire_insn;
651 #define FLD(f) abuf->fields.sfmt_mrgb.f
652     UINT f_rs;
653     UINT f_rt;
654     UINT f_rd;
655
656     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
657     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
658     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
659
660   /* Record the fields for the semantic handler.  */
661   FLD (f_rs) = f_rs;
662   FLD (f_rt) = f_rt;
663   FLD (f_rd) = f_rd;
664   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ado16", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
665
666 #undef FLD
667     return idesc;
668   }
669
670  extract_sfmt_ram:
671   {
672     const IDESC *idesc = &iq2000bf_insn_data[itype];
673     CGEN_INSN_INT insn = entire_insn;
674 #define FLD(f) abuf->fields.sfmt_ram.f
675     UINT f_rs;
676     UINT f_rt;
677     UINT f_rd;
678     UINT f_shamt;
679     UINT f_maskl;
680
681     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
682     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
683     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
684     f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
685     f_maskl = EXTRACT_LSB0_UINT (insn, 32, 4, 5);
686
687   /* Record the fields for the semantic handler.  */
688   FLD (f_maskl) = f_maskl;
689   FLD (f_rs) = f_rs;
690   FLD (f_rd) = f_rd;
691   FLD (f_rt) = f_rt;
692   FLD (f_shamt) = f_shamt;
693   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ram", "f_maskl 0x%x", 'x', f_maskl, "f_rs 0x%x", 'x', f_rs, "f_rd 0x%x", 'x', f_rd, "f_rt 0x%x", 'x', f_rt, "f_shamt 0x%x", 'x', f_shamt, (char *) 0));
694
695 #undef FLD
696     return idesc;
697   }
698
699  extract_sfmt_sll:
700   {
701     const IDESC *idesc = &iq2000bf_insn_data[itype];
702     CGEN_INSN_INT insn = entire_insn;
703 #define FLD(f) abuf->fields.sfmt_ram.f
704     UINT f_rt;
705     UINT f_rd;
706     UINT f_shamt;
707
708     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
709     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
710     f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
711
712   /* Record the fields for the semantic handler.  */
713   FLD (f_rt) = f_rt;
714   FLD (f_shamt) = f_shamt;
715   FLD (f_rd) = f_rd;
716   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sll", "f_rt 0x%x", 'x', f_rt, "f_shamt 0x%x", 'x', f_shamt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
717
718 #undef FLD
719     return idesc;
720   }
721
722  extract_sfmt_slmv:
723   {
724     const IDESC *idesc = &iq2000bf_insn_data[itype];
725     CGEN_INSN_INT insn = entire_insn;
726 #define FLD(f) abuf->fields.sfmt_ram.f
727     UINT f_rs;
728     UINT f_rt;
729     UINT f_rd;
730     UINT f_shamt;
731
732     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
733     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
734     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
735     f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
736
737   /* Record the fields for the semantic handler.  */
738   FLD (f_rs) = f_rs;
739   FLD (f_rt) = f_rt;
740   FLD (f_shamt) = f_shamt;
741   FLD (f_rd) = f_rd;
742   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_slmv", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_shamt 0x%x", 'x', f_shamt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
743
744 #undef FLD
745     return idesc;
746   }
747
748  extract_sfmt_slt:
749   {
750     const IDESC *idesc = &iq2000bf_insn_data[itype];
751     CGEN_INSN_INT insn = entire_insn;
752 #define FLD(f) abuf->fields.sfmt_mrgb.f
753     UINT f_rs;
754     UINT f_rt;
755     UINT f_rd;
756
757     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
758     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
759     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
760
761   /* Record the fields for the semantic handler.  */
762   FLD (f_rs) = f_rs;
763   FLD (f_rt) = f_rt;
764   FLD (f_rd) = f_rd;
765   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_slt", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
766
767 #undef FLD
768     return idesc;
769   }
770
771  extract_sfmt_slti:
772   {
773     const IDESC *idesc = &iq2000bf_insn_data[itype];
774     CGEN_INSN_INT insn = entire_insn;
775 #define FLD(f) abuf->fields.sfmt_addi.f
776     UINT f_rs;
777     UINT f_rt;
778     UINT f_imm;
779
780     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
781     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
782     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
783
784   /* Record the fields for the semantic handler.  */
785   FLD (f_imm) = f_imm;
786   FLD (f_rs) = f_rs;
787   FLD (f_rt) = f_rt;
788   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_slti", "f_imm 0x%x", 'x', f_imm, "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, (char *) 0));
789
790 #undef FLD
791     return idesc;
792   }
793
794  extract_sfmt_bbi:
795   {
796     const IDESC *idesc = &iq2000bf_insn_data[itype];
797     CGEN_INSN_INT insn = entire_insn;
798 #define FLD(f) abuf->fields.sfmt_bbi.f
799     UINT f_rs;
800     UINT f_rt;
801     SI f_offset;
802
803     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
804     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
805     f_offset = ((((EXTRACT_LSB0_INT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
806
807   /* Record the fields for the semantic handler.  */
808   FLD (f_rt) = f_rt;
809   FLD (f_rs) = f_rs;
810   FLD (i_offset) = f_offset;
811   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bbi", "f_rt 0x%x", 'x', f_rt, "f_rs 0x%x", 'x', f_rs, "offset 0x%x", 'x', f_offset, (char *) 0));
812
813 #if WITH_PROFILE_MODEL_P
814   /* Record the fields for profiling.  */
815   if (PROFILE_MODEL_P (current_cpu))
816     {
817     }
818 #endif
819 #undef FLD
820     return idesc;
821   }
822
823  extract_sfmt_bbv:
824   {
825     const IDESC *idesc = &iq2000bf_insn_data[itype];
826     CGEN_INSN_INT insn = entire_insn;
827 #define FLD(f) abuf->fields.sfmt_bbi.f
828     UINT f_rs;
829     UINT f_rt;
830     SI f_offset;
831
832     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
833     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
834     f_offset = ((((EXTRACT_LSB0_INT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
835
836   /* Record the fields for the semantic handler.  */
837   FLD (f_rs) = f_rs;
838   FLD (f_rt) = f_rt;
839   FLD (i_offset) = f_offset;
840   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bbv", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "offset 0x%x", 'x', f_offset, (char *) 0));
841
842 #if WITH_PROFILE_MODEL_P
843   /* Record the fields for profiling.  */
844   if (PROFILE_MODEL_P (current_cpu))
845     {
846     }
847 #endif
848 #undef FLD
849     return idesc;
850   }
851
852  extract_sfmt_bgez:
853   {
854     const IDESC *idesc = &iq2000bf_insn_data[itype];
855     CGEN_INSN_INT insn = entire_insn;
856 #define FLD(f) abuf->fields.sfmt_bbi.f
857     UINT f_rs;
858     SI f_offset;
859
860     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
861     f_offset = ((((EXTRACT_LSB0_INT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
862
863   /* Record the fields for the semantic handler.  */
864   FLD (f_rs) = f_rs;
865   FLD (i_offset) = f_offset;
866   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bgez", "f_rs 0x%x", 'x', f_rs, "offset 0x%x", 'x', f_offset, (char *) 0));
867
868 #if WITH_PROFILE_MODEL_P
869   /* Record the fields for profiling.  */
870   if (PROFILE_MODEL_P (current_cpu))
871     {
872     }
873 #endif
874 #undef FLD
875     return idesc;
876   }
877
878  extract_sfmt_bgezal:
879   {
880     const IDESC *idesc = &iq2000bf_insn_data[itype];
881     CGEN_INSN_INT insn = entire_insn;
882 #define FLD(f) abuf->fields.sfmt_bbi.f
883     UINT f_rs;
884     SI f_offset;
885
886     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
887     f_offset = ((((EXTRACT_LSB0_INT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
888
889   /* Record the fields for the semantic handler.  */
890   FLD (f_rs) = f_rs;
891   FLD (i_offset) = f_offset;
892   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bgezal", "f_rs 0x%x", 'x', f_rs, "offset 0x%x", 'x', f_offset, (char *) 0));
893
894 #if WITH_PROFILE_MODEL_P
895   /* Record the fields for profiling.  */
896   if (PROFILE_MODEL_P (current_cpu))
897     {
898     }
899 #endif
900 #undef FLD
901     return idesc;
902   }
903
904  extract_sfmt_jalr:
905   {
906     const IDESC *idesc = &iq2000bf_insn_data[itype];
907     CGEN_INSN_INT insn = entire_insn;
908 #define FLD(f) abuf->fields.sfmt_mrgb.f
909     UINT f_rs;
910     UINT f_rd;
911
912     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
913     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
914
915   /* Record the fields for the semantic handler.  */
916   FLD (f_rs) = f_rs;
917   FLD (f_rd) = f_rd;
918   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jalr", "f_rs 0x%x", 'x', f_rs, "f_rd 0x%x", 'x', f_rd, (char *) 0));
919
920 #if WITH_PROFILE_MODEL_P
921   /* Record the fields for profiling.  */
922   if (PROFILE_MODEL_P (current_cpu))
923     {
924     }
925 #endif
926 #undef FLD
927     return idesc;
928   }
929
930  extract_sfmt_jr:
931   {
932     const IDESC *idesc = &iq2000bf_insn_data[itype];
933     CGEN_INSN_INT insn = entire_insn;
934 #define FLD(f) abuf->fields.sfmt_bbi.f
935     UINT f_rs;
936
937     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
938
939   /* Record the fields for the semantic handler.  */
940   FLD (f_rs) = f_rs;
941   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jr", "f_rs 0x%x", 'x', f_rs, (char *) 0));
942
943 #if WITH_PROFILE_MODEL_P
944   /* Record the fields for profiling.  */
945   if (PROFILE_MODEL_P (current_cpu))
946     {
947     }
948 #endif
949 #undef FLD
950     return idesc;
951   }
952
953  extract_sfmt_lb:
954   {
955     const IDESC *idesc = &iq2000bf_insn_data[itype];
956     CGEN_INSN_INT insn = entire_insn;
957 #define FLD(f) abuf->fields.sfmt_addi.f
958     UINT f_rs;
959     UINT f_rt;
960     UINT f_imm;
961
962     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
963     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
964     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
965
966   /* Record the fields for the semantic handler.  */
967   FLD (f_rs) = f_rs;
968   FLD (f_imm) = f_imm;
969   FLD (f_rt) = f_rt;
970   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_lb", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
971
972 #undef FLD
973     return idesc;
974   }
975
976  extract_sfmt_lh:
977   {
978     const IDESC *idesc = &iq2000bf_insn_data[itype];
979     CGEN_INSN_INT insn = entire_insn;
980 #define FLD(f) abuf->fields.sfmt_addi.f
981     UINT f_rs;
982     UINT f_rt;
983     UINT f_imm;
984
985     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
986     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
987     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
988
989   /* Record the fields for the semantic handler.  */
990   FLD (f_rs) = f_rs;
991   FLD (f_imm) = f_imm;
992   FLD (f_rt) = f_rt;
993   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_lh", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
994
995 #undef FLD
996     return idesc;
997   }
998
999  extract_sfmt_lui:
1000   {
1001     const IDESC *idesc = &iq2000bf_insn_data[itype];
1002     CGEN_INSN_INT insn = entire_insn;
1003 #define FLD(f) abuf->fields.sfmt_addi.f
1004     UINT f_rt;
1005     UINT f_imm;
1006
1007     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1008     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1009
1010   /* Record the fields for the semantic handler.  */
1011   FLD (f_imm) = f_imm;
1012   FLD (f_rt) = f_rt;
1013   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_lui", "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1014
1015 #undef FLD
1016     return idesc;
1017   }
1018
1019  extract_sfmt_lw:
1020   {
1021     const IDESC *idesc = &iq2000bf_insn_data[itype];
1022     CGEN_INSN_INT insn = entire_insn;
1023 #define FLD(f) abuf->fields.sfmt_addi.f
1024     UINT f_rs;
1025     UINT f_rt;
1026     UINT f_imm;
1027
1028     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1029     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1030     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1031
1032   /* Record the fields for the semantic handler.  */
1033   FLD (f_rs) = f_rs;
1034   FLD (f_imm) = f_imm;
1035   FLD (f_rt) = f_rt;
1036   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_lw", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1037
1038 #undef FLD
1039     return idesc;
1040   }
1041
1042  extract_sfmt_sb:
1043   {
1044     const IDESC *idesc = &iq2000bf_insn_data[itype];
1045     CGEN_INSN_INT insn = entire_insn;
1046 #define FLD(f) abuf->fields.sfmt_addi.f
1047     UINT f_rs;
1048     UINT f_rt;
1049     UINT f_imm;
1050
1051     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1052     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1053     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1054
1055   /* Record the fields for the semantic handler.  */
1056   FLD (f_rs) = f_rs;
1057   FLD (f_imm) = f_imm;
1058   FLD (f_rt) = f_rt;
1059   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sb", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1060
1061 #undef FLD
1062     return idesc;
1063   }
1064
1065  extract_sfmt_sh:
1066   {
1067     const IDESC *idesc = &iq2000bf_insn_data[itype];
1068     CGEN_INSN_INT insn = entire_insn;
1069 #define FLD(f) abuf->fields.sfmt_addi.f
1070     UINT f_rs;
1071     UINT f_rt;
1072     UINT f_imm;
1073
1074     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1075     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1076     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1077
1078   /* Record the fields for the semantic handler.  */
1079   FLD (f_rs) = f_rs;
1080   FLD (f_imm) = f_imm;
1081   FLD (f_rt) = f_rt;
1082   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sh", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1083
1084 #undef FLD
1085     return idesc;
1086   }
1087
1088  extract_sfmt_sw:
1089   {
1090     const IDESC *idesc = &iq2000bf_insn_data[itype];
1091     CGEN_INSN_INT insn = entire_insn;
1092 #define FLD(f) abuf->fields.sfmt_addi.f
1093     UINT f_rs;
1094     UINT f_rt;
1095     UINT f_imm;
1096
1097     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1098     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1099     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1100
1101   /* Record the fields for the semantic handler.  */
1102   FLD (f_rs) = f_rs;
1103   FLD (f_imm) = f_imm;
1104   FLD (f_rt) = f_rt;
1105   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sw", "f_rs 0x%x", 'x', f_rs, "f_imm 0x%x", 'x', f_imm, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1106
1107 #undef FLD
1108     return idesc;
1109   }
1110
1111  extract_sfmt_break:
1112   {
1113     const IDESC *idesc = &iq2000bf_insn_data[itype];
1114 #define FLD(f) abuf->fields.fmt_empty.f
1115
1116
1117   /* Record the fields for the semantic handler.  */
1118   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_break", (char *) 0));
1119
1120 #if WITH_PROFILE_MODEL_P
1121   /* Record the fields for profiling.  */
1122   if (PROFILE_MODEL_P (current_cpu))
1123     {
1124     }
1125 #endif
1126 #undef FLD
1127     return idesc;
1128   }
1129
1130  extract_sfmt_syscall:
1131   {
1132     const IDESC *idesc = &iq2000bf_insn_data[itype];
1133 #define FLD(f) abuf->fields.fmt_empty.f
1134
1135
1136   /* Record the fields for the semantic handler.  */
1137   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_syscall", (char *) 0));
1138
1139 #undef FLD
1140     return idesc;
1141   }
1142
1143  extract_sfmt_andoui:
1144   {
1145     const IDESC *idesc = &iq2000bf_insn_data[itype];
1146     CGEN_INSN_INT insn = entire_insn;
1147 #define FLD(f) abuf->fields.sfmt_addi.f
1148     UINT f_rs;
1149     UINT f_rt;
1150     UINT f_imm;
1151
1152     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1153     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1154     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1155
1156   /* Record the fields for the semantic handler.  */
1157   FLD (f_imm) = f_imm;
1158   FLD (f_rs) = f_rs;
1159   FLD (f_rt) = f_rt;
1160   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_andoui", "f_imm 0x%x", 'x', f_imm, "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, (char *) 0));
1161
1162 #undef FLD
1163     return idesc;
1164   }
1165
1166  extract_sfmt_mrgb:
1167   {
1168     const IDESC *idesc = &iq2000bf_insn_data[itype];
1169     CGEN_INSN_INT insn = entire_insn;
1170 #define FLD(f) abuf->fields.sfmt_mrgb.f
1171     UINT f_rs;
1172     UINT f_rt;
1173     UINT f_rd;
1174     UINT f_mask;
1175
1176     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1177     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1178     f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
1179     f_mask = EXTRACT_LSB0_UINT (insn, 32, 9, 4);
1180
1181   /* Record the fields for the semantic handler.  */
1182   FLD (f_mask) = f_mask;
1183   FLD (f_rs) = f_rs;
1184   FLD (f_rt) = f_rt;
1185   FLD (f_rd) = f_rd;
1186   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mrgb", "f_mask 0x%x", 'x', f_mask, "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_rd 0x%x", 'x', f_rd, (char *) 0));
1187
1188 #undef FLD
1189     return idesc;
1190   }
1191
1192  extract_sfmt_bctxt:
1193   {
1194     const IDESC *idesc = &iq2000bf_insn_data[itype];
1195 #define FLD(f) abuf->fields.fmt_empty.f
1196
1197
1198   /* Record the fields for the semantic handler.  */
1199   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bctxt", (char *) 0));
1200
1201 #undef FLD
1202     return idesc;
1203   }
1204
1205  extract_sfmt_ldw:
1206   {
1207     const IDESC *idesc = &iq2000bf_insn_data[itype];
1208     CGEN_INSN_INT insn = entire_insn;
1209 #define FLD(f) abuf->fields.sfmt_addi.f
1210     UINT f_rs;
1211     UINT f_rt;
1212     UINT f_imm;
1213
1214     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1215     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1216     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1217
1218   /* Record the fields for the semantic handler.  */
1219   FLD (f_rs) = f_rs;
1220   FLD (f_rt) = f_rt;
1221   FLD (f_imm) = f_imm;
1222   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldw", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_imm 0x%x", 'x', f_imm, (char *) 0));
1223
1224 #undef FLD
1225     return idesc;
1226   }
1227
1228  extract_sfmt_sdw:
1229   {
1230     const IDESC *idesc = &iq2000bf_insn_data[itype];
1231     CGEN_INSN_INT insn = entire_insn;
1232 #define FLD(f) abuf->fields.sfmt_addi.f
1233     UINT f_rs;
1234     UINT f_rt;
1235     UINT f_imm;
1236
1237     f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1238     f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1239     f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1240
1241   /* Record the fields for the semantic handler.  */
1242   FLD (f_rs) = f_rs;
1243   FLD (f_rt) = f_rt;
1244   FLD (f_imm) = f_imm;
1245   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sdw", "f_rs 0x%x", 'x', f_rs, "f_rt 0x%x", 'x', f_rt, "f_imm 0x%x", 'x', f_imm, (char *) 0));
1246
1247 #undef FLD
1248     return idesc;
1249   }
1250
1251  extract_sfmt_j:
1252   {
1253     const IDESC *idesc = &iq2000bf_insn_data[itype];
1254     CGEN_INSN_INT insn = entire_insn;
1255 #define FLD(f) abuf->fields.sfmt_j.f
1256     USI f_jtarg;
1257
1258     f_jtarg = ((((pc) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn, 32, 15, 16)) << (2))));
1259
1260   /* Record the fields for the semantic handler.  */
1261   FLD (i_jmptarg) = f_jtarg;
1262   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_j", "jmptarg 0x%x", 'x', f_jtarg, (char *) 0));
1263
1264 #if WITH_PROFILE_MODEL_P
1265   /* Record the fields for profiling.  */
1266   if (PROFILE_MODEL_P (current_cpu))
1267     {
1268     }
1269 #endif
1270 #undef FLD
1271     return idesc;
1272   }
1273
1274  extract_sfmt_jal:
1275   {
1276     const IDESC *idesc = &iq2000bf_insn_data[itype];
1277     CGEN_INSN_INT insn = entire_insn;
1278 #define FLD(f) abuf->fields.sfmt_j.f
1279     USI f_jtarg;
1280
1281     f_jtarg = ((((pc) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn, 32, 15, 16)) << (2))));
1282
1283   /* Record the fields for the semantic handler.  */
1284   FLD (i_jmptarg) = f_jtarg;
1285   TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jal", "jmptarg 0x%x", 'x', f_jtarg, (char *) 0));
1286
1287 #if WITH_PROFILE_MODEL_P
1288   /* Record the fields for profiling.  */
1289   if (PROFILE_MODEL_P (current_cpu))
1290     {
1291     }
1292 #endif
1293 #undef FLD
1294     return idesc;
1295   }
1296
1297 }