OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [sim/] [iq2000/] [decode.c] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
/* Simulator instruction decoder for iq2000bf.
2
 
3
THIS FILE IS MACHINE GENERATED WITH CGEN.
4
 
5
Copyright 1996-2010 Free Software Foundation, Inc.
6
 
7
This file is part of the GNU simulators.
8
 
9
   This file 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 3, or (at your option)
12
   any later version.
13
 
14
   It is distributed in the hope that it will be useful, but WITHOUT
15
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17
   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
   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 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__MAX];
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_ADD },
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
{
197
  VIRTUAL_INSN_X_INVALID, IQ2000BF_INSN_X_INVALID, IQ2000BF_SFMT_EMPTY
198
};
199
 
200
/* Initialize an IDESC from the compile-time computable parts.  */
201
 
202
static INLINE void
203
init_idesc (SIM_CPU *cpu, IDESC *id, const struct insn_sem *t)
204
{
205
  const CGEN_INSN *insn_table = CGEN_CPU_INSN_TABLE (CPU_CPU_DESC (cpu))->init_entries;
206
 
207
  id->num = t->index;
208
  id->sfmt = t->sfmt;
209
  if ((int) t->type <= 0)
210
    id->idata = & cgen_virtual_insn_table[- (int) t->type];
211
  else
212
    id->idata = & insn_table[t->type];
213
  id->attrs = CGEN_INSN_ATTRS (id->idata);
214
  /* Oh my god, a magic number.  */
215
  id->length = CGEN_INSN_BITSIZE (id->idata) / 8;
216
 
217
#if WITH_PROFILE_MODEL_P
218
  id->timing = & MODEL_TIMING (CPU_MODEL (cpu)) [t->index];
219
  {
220
    SIM_DESC sd = CPU_STATE (cpu);
221
    SIM_ASSERT (t->index == id->timing->num);
222
  }
223
#endif
224
 
225
  /* Semantic pointers are initialized elsewhere.  */
226
}
227
 
228
/* Initialize the instruction descriptor table.  */
229
 
230
void
231
iq2000bf_init_idesc_table (SIM_CPU *cpu)
232
{
233
  IDESC *id,*tabend;
234
  const struct insn_sem *t,*tend;
235
  int tabsize = IQ2000BF_INSN__MAX;
236
  IDESC *table = iq2000bf_insn_data;
237
 
238
  memset (table, 0, tabsize * sizeof (IDESC));
239
 
240
  /* First set all entries to the `invalid insn'.  */
241
  t = & iq2000bf_insn_sem_invalid;
242
  for (id = table, tabend = table + tabsize; id < tabend; ++id)
243
    init_idesc (cpu, id, t);
244
 
245
  /* Now fill in the values for the chosen cpu.  */
246
  for (t = iq2000bf_insn_sem, tend = t + sizeof (iq2000bf_insn_sem) / sizeof (*t);
247
       t != tend; ++t)
248
    {
249
      init_idesc (cpu, & table[t->index], t);
250
    }
251
 
252
  /* Link the IDESC table into the cpu.  */
253
  CPU_IDESC (cpu) = table;
254
}
255
 
256
/* Given an instruction, return a pointer to its IDESC entry.  */
257
 
258
const IDESC *
259
iq2000bf_decode (SIM_CPU *current_cpu, IADDR pc,
260
              CGEN_INSN_WORD base_insn, CGEN_INSN_WORD entire_insn,
261
              ARGBUF *abuf)
262
{
263
  /* Result of decoder.  */
264
  IQ2000BF_INSN_TYPE itype;
265
 
266
  {
267
    CGEN_INSN_WORD insn = base_insn;
268
 
269
    {
270
      unsigned int val = (((insn >> 26) & (63 << 0)));
271
      switch (val)
272
      {
273
      case 0 :
274
        {
275
          unsigned int val = (((insn >> 1) & (1 << 4)) | ((insn >> 0) & (15 << 0)));
276
          switch (val)
277
          {
278
          case 0 :
279
            if ((entire_insn & 0xffe0003f) == 0x0)
280
              { itype = IQ2000BF_INSN_SLL; goto extract_sfmt_sll; }
281
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
282
          case 1 :
283
            if ((entire_insn & 0xfc00003f) == 0x1)
284
              { itype = IQ2000BF_INSN_SLMV; goto extract_sfmt_slmv; }
285
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
286
          case 2 :
287
            if ((entire_insn & 0xffe0003f) == 0x2)
288
              { itype = IQ2000BF_INSN_SRL; goto extract_sfmt_sll; }
289
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
290
          case 3 :
291
            if ((entire_insn & 0xffe0003f) == 0x3)
292
              { itype = IQ2000BF_INSN_SRA; goto extract_sfmt_sll; }
293
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
294
          case 4 :
295
            if ((entire_insn & 0xfc0007ff) == 0x4)
296
              { itype = IQ2000BF_INSN_SLLV; goto extract_sfmt_add; }
297
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
298
          case 5 :
299
            if ((entire_insn & 0xfc00003f) == 0x5)
300
              { itype = IQ2000BF_INSN_SRMV; goto extract_sfmt_slmv; }
301
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
302
          case 6 :
303
            if ((entire_insn & 0xfc0007ff) == 0x6)
304
              { itype = IQ2000BF_INSN_SRLV; goto extract_sfmt_add; }
305
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
306
          case 7 :
307
            if ((entire_insn & 0xfc0007ff) == 0x7)
308
              { itype = IQ2000BF_INSN_SRAV; goto extract_sfmt_add; }
309
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
310
          case 8 :
311
            if ((entire_insn & 0xfc1fffff) == 0x8)
312
              { itype = IQ2000BF_INSN_JR; goto extract_sfmt_jr; }
313
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
314
          case 9 :
315
            if ((entire_insn & 0xfc1f07ff) == 0x9)
316
              { itype = IQ2000BF_INSN_JALR; goto extract_sfmt_jalr; }
317
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
318
          case 10 :
319
            if ((entire_insn & 0xfc1fffff) == 0xa)
320
              { itype = IQ2000BF_INSN_JCR; goto extract_sfmt_bctxt; }
321
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
322
          case 12 :
323
            if ((entire_insn & 0xfc00003f) == 0xc)
324
              { itype = IQ2000BF_INSN_SYSCALL; goto extract_sfmt_syscall; }
325
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
326
          case 13 :
327
            if ((entire_insn & 0xffffffff) == 0xd)
328
              { itype = IQ2000BF_INSN_BREAK; goto extract_sfmt_break; }
329
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
330
          case 14 :
331
            if ((entire_insn & 0xfc00003f) == 0xe)
332
              { itype = IQ2000BF_INSN_SLEEP; goto extract_sfmt_syscall; }
333
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
334
          case 16 :
335
            if ((entire_insn & 0xfc0007ff) == 0x20)
336
              { itype = IQ2000BF_INSN_ADD; goto extract_sfmt_add; }
337
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
338
          case 17 :
339
            if ((entire_insn & 0xfc0007ff) == 0x21)
340
              { itype = IQ2000BF_INSN_ADDU; goto extract_sfmt_add; }
341
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
342
          case 18 :
343
            if ((entire_insn & 0xfc0007ff) == 0x22)
344
              { itype = IQ2000BF_INSN_SUB; goto extract_sfmt_add; }
345
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
346
          case 19 :
347
            if ((entire_insn & 0xfc0007ff) == 0x23)
348
              { itype = IQ2000BF_INSN_SUBU; goto extract_sfmt_add; }
349
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
350
          case 20 :
351
            if ((entire_insn & 0xfc0007ff) == 0x24)
352
              { itype = IQ2000BF_INSN_AND; goto extract_sfmt_add; }
353
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
354
          case 21 :
355
            if ((entire_insn & 0xfc0007ff) == 0x25)
356
              { itype = IQ2000BF_INSN_OR; goto extract_sfmt_add; }
357
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
358
          case 22 :
359
            if ((entire_insn & 0xfc0007ff) == 0x26)
360
              { itype = IQ2000BF_INSN_XOR; goto extract_sfmt_add; }
361
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
362
          case 23 :
363
            if ((entire_insn & 0xfc0007ff) == 0x27)
364
              { itype = IQ2000BF_INSN_NOR; goto extract_sfmt_add; }
365
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
366
          case 25 :
367
            if ((entire_insn & 0xfc0007ff) == 0x29)
368
              { itype = IQ2000BF_INSN_ADO16; goto extract_sfmt_add; }
369
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
370
          case 26 :
371
            if ((entire_insn & 0xfc0007ff) == 0x2a)
372
              { itype = IQ2000BF_INSN_SLT; goto extract_sfmt_slt; }
373
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
374
          case 27 :
375
            if ((entire_insn & 0xfc0007ff) == 0x2b)
376
              { itype = IQ2000BF_INSN_SLTU; goto extract_sfmt_slt; }
377
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
378
          case 29 :
379
            if ((entire_insn & 0xfc00043f) == 0x2d)
380
              { itype = IQ2000BF_INSN_MRGB; goto extract_sfmt_mrgb; }
381
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
382
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
383
          }
384
        }
385
      case 1 :
386
        {
387
          unsigned int val = (((insn >> 17) & (1 << 3)) | ((insn >> 16) & (7 << 0)));
388
          switch (val)
389
          {
390
          case 0 :
391
            if ((entire_insn & 0xfc1f0000) == 0x4000000)
392
              { itype = IQ2000BF_INSN_BLTZ; goto extract_sfmt_bgez; }
393
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
394
          case 1 :
395
            if ((entire_insn & 0xfc1f0000) == 0x4010000)
396
              { itype = IQ2000BF_INSN_BGEZ; goto extract_sfmt_bgez; }
397
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
398
          case 2 :
399
            if ((entire_insn & 0xfc1f0000) == 0x4020000)
400
              { itype = IQ2000BF_INSN_BLTZL; goto extract_sfmt_bgez; }
401
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
402
          case 3 :
403
            if ((entire_insn & 0xfc1f0000) == 0x4030000)
404
              { itype = IQ2000BF_INSN_BGEZL; goto extract_sfmt_bgez; }
405
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
406
          case 6 :
407
            if ((entire_insn & 0xfc1f0000) == 0x4060000)
408
              { itype = IQ2000BF_INSN_BCTXT; goto extract_sfmt_bctxt; }
409
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
410
          case 8 :
411
            if ((entire_insn & 0xfc1f0000) == 0x4100000)
412
              { itype = IQ2000BF_INSN_BLTZAL; goto extract_sfmt_bgezal; }
413
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
414
          case 9 :
415
            if ((entire_insn & 0xfc1f0000) == 0x4110000)
416
              { itype = IQ2000BF_INSN_BGEZAL; goto extract_sfmt_bgezal; }
417
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
418
          case 10 :
419
            if ((entire_insn & 0xfc1f0000) == 0x4120000)
420
              { itype = IQ2000BF_INSN_BLTZALL; goto extract_sfmt_bgezal; }
421
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
422
          case 11 :
423
            if ((entire_insn & 0xfc1f0000) == 0x4130000)
424
              { itype = IQ2000BF_INSN_BGEZALL; goto extract_sfmt_bgezal; }
425
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
426
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
427
          }
428
        }
429
      case 2 :
430
        if ((entire_insn & 0xffff0000) == 0x8000000)
431
          { itype = IQ2000BF_INSN_J; goto extract_sfmt_j; }
432
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
433
      case 3 :
434
        if ((entire_insn & 0xffff0000) == 0xc000000)
435
          { itype = IQ2000BF_INSN_JAL; goto extract_sfmt_jal; }
436
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
437
      case 4 : itype = IQ2000BF_INSN_BEQ; goto extract_sfmt_bbv;
438
      case 5 : itype = IQ2000BF_INSN_BNE; goto extract_sfmt_bbv;
439
      case 6 :
440
        if ((entire_insn & 0xfc1f0000) == 0x18000000)
441
          { itype = IQ2000BF_INSN_BLEZ; goto extract_sfmt_bgez; }
442
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
443
      case 7 :
444
        if ((entire_insn & 0xfc1f0000) == 0x1c000000)
445
          { itype = IQ2000BF_INSN_BGTZ; goto extract_sfmt_bgez; }
446
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
447
      case 8 : itype = IQ2000BF_INSN_ADDI; goto extract_sfmt_addi;
448
      case 9 : itype = IQ2000BF_INSN_ADDIU; goto extract_sfmt_addi;
449
      case 10 : itype = IQ2000BF_INSN_SLTI; goto extract_sfmt_slti;
450
      case 11 : itype = IQ2000BF_INSN_SLTIU; goto extract_sfmt_slti;
451
      case 12 : itype = IQ2000BF_INSN_ANDI; goto extract_sfmt_addi;
452
      case 13 : itype = IQ2000BF_INSN_ORI; goto extract_sfmt_addi;
453
      case 14 : itype = IQ2000BF_INSN_XORI; goto extract_sfmt_addi;
454
      case 15 :
455
        if ((entire_insn & 0xffe00000) == 0x3c000000)
456
          { itype = IQ2000BF_INSN_LUI; goto extract_sfmt_lui; }
457
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
458
      case 16 :
459
        {
460
          unsigned int val = (((insn >> 19) & (15 << 3)) | ((insn >> 15) & (3 << 1)) | ((insn >> 4) & (1 << 0)));
461
          switch (val)
462
          {
463
          case 0 : /* fall through */
464
          case 2 : /* fall through */
465
          case 4 : /* fall through */
466
          case 6 :
467
            if ((entire_insn & 0xffe007ff) == 0x40000000)
468
              { itype = IQ2000BF_INSN_MFC0; goto extract_sfmt_syscall; }
469
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
470
          case 8 : /* fall through */
471
          case 10 : /* fall through */
472
          case 12 : /* fall through */
473
          case 14 :
474
            if ((entire_insn & 0xffe007ff) == 0x40400000)
475
              { itype = IQ2000BF_INSN_CFC0; goto extract_sfmt_syscall; }
476
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
477
          case 16 : /* fall through */
478
          case 18 : /* fall through */
479
          case 20 : /* fall through */
480
          case 22 :
481
            if ((entire_insn & 0xffe007ff) == 0x40800000)
482
              { itype = IQ2000BF_INSN_MTC0; goto extract_sfmt_syscall; }
483
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
484
          case 24 : /* fall through */
485
          case 26 : /* fall through */
486
          case 28 : /* fall through */
487
          case 30 :
488
            if ((entire_insn & 0xffe007ff) == 0x40c00000)
489
              { itype = IQ2000BF_INSN_CTC0; goto extract_sfmt_syscall; }
490
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
491
          case 32 : /* fall through */
492
          case 33 :
493
            if ((entire_insn & 0xffff0000) == 0x41000000)
494
              { itype = IQ2000BF_INSN_BC0F; goto extract_sfmt_bctxt; }
495
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
496
          case 34 : /* fall through */
497
          case 35 :
498
            if ((entire_insn & 0xffff0000) == 0x41010000)
499
              { itype = IQ2000BF_INSN_BC0T; goto extract_sfmt_bctxt; }
500
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
501
          case 36 : /* fall through */
502
          case 37 :
503
            if ((entire_insn & 0xffff0000) == 0x41020000)
504
              { itype = IQ2000BF_INSN_BC0FL; goto extract_sfmt_bctxt; }
505
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
506
          case 38 : /* fall through */
507
          case 39 :
508
            if ((entire_insn & 0xffff0000) == 0x41030000)
509
              { itype = IQ2000BF_INSN_BC0TL; goto extract_sfmt_bctxt; }
510
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
511
          case 65 :
512
            if ((entire_insn & 0xffffffff) == 0x42000010)
513
              { itype = IQ2000BF_INSN_RFE; goto extract_sfmt_syscall; }
514
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
515
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
516
          }
517
        }
518
      case 17 :
519
        {
520
          unsigned int val = (((insn >> 22) & (3 << 0)));
521
          switch (val)
522
          {
523
          case 0 :
524
            if ((entire_insn & 0xffe007ff) == 0x44000000)
525
              { itype = IQ2000BF_INSN_MFC1; goto extract_sfmt_syscall; }
526
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
527
          case 1 :
528
            if ((entire_insn & 0xffe007ff) == 0x44400000)
529
              { itype = IQ2000BF_INSN_CFC1; goto extract_sfmt_syscall; }
530
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
531
          case 2 :
532
            if ((entire_insn & 0xffe007ff) == 0x44800000)
533
              { itype = IQ2000BF_INSN_MTC1; goto extract_sfmt_syscall; }
534
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
535
          case 3 :
536
            if ((entire_insn & 0xffe007ff) == 0x44c00000)
537
              { itype = IQ2000BF_INSN_CTC1; goto extract_sfmt_syscall; }
538
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
539
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
540
          }
541
        }
542
      case 18 :
543
        {
544
          unsigned int val = (((insn >> 16) & (3 << 5)) | ((insn >> 0) & (31 << 0)));
545
          switch (val)
546
          {
547
          case 0 :
548
            {
549
              unsigned int val = (((insn >> 23) & (1 << 0)));
550
              switch (val)
551
              {
552
              case 0 :
553
                if ((entire_insn & 0xffe007ff) == 0x48000000)
554
                  { itype = IQ2000BF_INSN_MFC2; goto extract_sfmt_syscall; }
555
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
556
              case 1 :
557
                if ((entire_insn & 0xffe007ff) == 0x48800000)
558
                  { itype = IQ2000BF_INSN_MTC2; goto extract_sfmt_syscall; }
559
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
560
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
561
              }
562
            }
563
          case 32 :
564
            if ((entire_insn & 0xffe0ffff) == 0x48200000)
565
              { itype = IQ2000BF_INSN_LUULCK; goto extract_sfmt_syscall; }
566
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
567
          case 33 :
568
            if ((entire_insn & 0xffe007ff) == 0x48200001)
569
              { itype = IQ2000BF_INSN_LUR; goto extract_sfmt_syscall; }
570
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
571
          case 34 :
572
            if ((entire_insn & 0xffe007ff) == 0x48200002)
573
              { itype = IQ2000BF_INSN_LUM32; goto extract_sfmt_syscall; }
574
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
575
          case 35 :
576
            if ((entire_insn & 0xffe007ff) == 0x48200003)
577
              { itype = IQ2000BF_INSN_LUC32; goto extract_sfmt_syscall; }
578
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
579
          case 36 :
580
            if ((entire_insn & 0xffe0ffff) == 0x48200004)
581
              { itype = IQ2000BF_INSN_LULCK; goto extract_sfmt_syscall; }
582
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
583
          case 37 :
584
            if ((entire_insn & 0xffe007ff) == 0x48200005)
585
              { itype = IQ2000BF_INSN_LURL; goto extract_sfmt_syscall; }
586
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
587
          case 38 :
588
            if ((entire_insn & 0xffe007ff) == 0x48200006)
589
              { itype = IQ2000BF_INSN_LUM32L; goto extract_sfmt_syscall; }
590
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
591
          case 39 :
592
            if ((entire_insn & 0xffe007ff) == 0x48200007)
593
              { itype = IQ2000BF_INSN_LUC32L; goto extract_sfmt_syscall; }
594
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
595
          case 40 :
596
            if ((entire_insn & 0xffe007ff) == 0x48200008)
597
              { itype = IQ2000BF_INSN_LUK; goto extract_sfmt_syscall; }
598
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
599
          case 42 :
600
            if ((entire_insn & 0xffe007ff) == 0x4820000a)
601
              { itype = IQ2000BF_INSN_LUM64; goto extract_sfmt_syscall; }
602
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
603
          case 43 :
604
            if ((entire_insn & 0xffe007ff) == 0x4820000b)
605
              { itype = IQ2000BF_INSN_LUC64; goto extract_sfmt_syscall; }
606
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
607
          case 46 :
608
            if ((entire_insn & 0xffe007ff) == 0x4820000e)
609
              { itype = IQ2000BF_INSN_LUM64L; goto extract_sfmt_syscall; }
610
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
611
          case 47 :
612
            if ((entire_insn & 0xffe007ff) == 0x4820000f)
613
              { itype = IQ2000BF_INSN_LUC64L; goto extract_sfmt_syscall; }
614
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
615
          case 48 :
616
            if ((entire_insn & 0xffe0ffff) == 0x48200010)
617
              { itype = IQ2000BF_INSN_SRRD; goto extract_sfmt_syscall; }
618
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
619
          case 49 :
620
            if ((entire_insn & 0xffe007ff) == 0x48200011)
621
              { itype = IQ2000BF_INSN_SRWR; goto extract_sfmt_syscall; }
622
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
623
          case 52 :
624
            if ((entire_insn & 0xffe0ffff) == 0x48200014)
625
              { itype = IQ2000BF_INSN_SRRDL; goto extract_sfmt_syscall; }
626
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
627
          case 53 :
628
            if ((entire_insn & 0xffe007ff) == 0x48200015)
629
              { itype = IQ2000BF_INSN_SRWRU; goto extract_sfmt_syscall; }
630
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
631
          case 54 :
632
            if ((entire_insn & 0xffe0ffff) == 0x48200016)
633
              { itype = IQ2000BF_INSN_SRULCK; goto extract_sfmt_syscall; }
634
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
635
          case 64 :
636
            {
637
              unsigned int val = (((insn >> 23) & (1 << 0)));
638
              switch (val)
639
              {
640
              case 0 :
641
                if ((entire_insn & 0xffe007ff) == 0x48400000)
642
                  { itype = IQ2000BF_INSN_CFC2; goto extract_sfmt_syscall; }
643
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
644
              case 1 :
645
                if ((entire_insn & 0xffe007ff) == 0x48c00000)
646
                  { itype = IQ2000BF_INSN_CTC2; goto extract_sfmt_syscall; }
647
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
648
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
649
              }
650
            }
651
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
652
          }
653
        }
654
      case 19 :
655
        {
656
          unsigned int val = (((insn >> 19) & (31 << 2)) | ((insn >> 0) & (3 << 0)));
657
          switch (val)
658
          {
659
          case 0 :
660
            if ((entire_insn & 0xffe007ff) == 0x4c000000)
661
              { itype = IQ2000BF_INSN_MFC3; goto extract_sfmt_syscall; }
662
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
663
          case 4 :
664
            {
665
              unsigned int val = (((insn >> 2) & (3 << 0)));
666
              switch (val)
667
              {
668
              case 0 :
669
                if ((entire_insn & 0xffe007ff) == 0x4c200000)
670
                  { itype = IQ2000BF_INSN_WB; goto extract_sfmt_syscall; }
671
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
672
              case 1 :
673
                if ((entire_insn & 0xffe007ff) == 0x4c200004)
674
                  { itype = IQ2000BF_INSN_RB; goto extract_sfmt_syscall; }
675
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
676
              case 2 :
677
                if ((entire_insn & 0xffffffff) == 0x4c200008)
678
                  { itype = IQ2000BF_INSN_TRAPQFL; goto extract_sfmt_syscall; }
679
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
680
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
681
              }
682
            }
683
          case 5 :
684
            {
685
              unsigned int val = (((insn >> 3) & (1 << 0)));
686
              switch (val)
687
              {
688
              case 0 :
689
                if ((entire_insn & 0xffe007ff) == 0x4c200001)
690
                  { itype = IQ2000BF_INSN_WBU; goto extract_sfmt_syscall; }
691
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
692
              case 1 :
693
                if ((entire_insn & 0xffffffff) == 0x4c200009)
694
                  { itype = IQ2000BF_INSN_TRAPQNE; goto extract_sfmt_syscall; }
695
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
696
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
697
              }
698
            }
699
          case 6 :
700
            {
701
              unsigned int val = (((insn >> 2) & (3 << 0)));
702
              switch (val)
703
              {
704
              case 0 :
705
                if ((entire_insn & 0xffe007ff) == 0x4c200002)
706
                  { itype = IQ2000BF_INSN_WX; goto extract_sfmt_syscall; }
707
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
708
              case 1 :
709
                if ((entire_insn & 0xffe007ff) == 0x4c200006)
710
                  { itype = IQ2000BF_INSN_RX; goto extract_sfmt_syscall; }
711
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
712
              case 2 :
713
                if ((entire_insn & 0xffe0ffff) == 0x4c20000a)
714
                  { itype = IQ2000BF_INSN_TRAPREL; goto extract_sfmt_syscall; }
715
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
716
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
717
              }
718
            }
719
          case 7 :
720
            {
721
              unsigned int val = (((insn >> 2) & (1 << 0)));
722
              switch (val)
723
              {
724
              case 0 :
725
                if ((entire_insn & 0xffe007ff) == 0x4c200003)
726
                  { itype = IQ2000BF_INSN_WXU; goto extract_sfmt_syscall; }
727
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
728
              case 1 :
729
                if ((entire_insn & 0xffe007ff) == 0x4c200007)
730
                  { itype = IQ2000BF_INSN_PKRL; goto extract_sfmt_syscall; }
731
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
732
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
733
              }
734
            }
735
          case 8 :
736
            if ((entire_insn & 0xffe007ff) == 0x4c400000)
737
              { itype = IQ2000BF_INSN_CFC3; goto extract_sfmt_syscall; }
738
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
739
          case 16 :
740
            if ((entire_insn & 0xffe007ff) == 0x4c800000)
741
              { itype = IQ2000BF_INSN_MTC3; goto extract_sfmt_syscall; }
742
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
743
          case 24 :
744
            if ((entire_insn & 0xffe007ff) == 0x4cc00000)
745
              { itype = IQ2000BF_INSN_CTC3; goto extract_sfmt_syscall; }
746
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
747
          case 32 : /* fall through */
748
          case 33 : /* fall through */
749
          case 34 : /* fall through */
750
          case 35 :
751
            {
752
              unsigned int val = (((insn >> 16) & (3 << 0)));
753
              switch (val)
754
              {
755
              case 0 :
756
                if ((entire_insn & 0xffff0000) == 0x4d000000)
757
                  { itype = IQ2000BF_INSN_BC3F; goto extract_sfmt_bctxt; }
758
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
759
              case 1 :
760
                if ((entire_insn & 0xffff0000) == 0x4d010000)
761
                  { itype = IQ2000BF_INSN_BC3T; goto extract_sfmt_bctxt; }
762
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
763
              case 2 :
764
                if ((entire_insn & 0xffff0000) == 0x4d020000)
765
                  { itype = IQ2000BF_INSN_BC3FL; goto extract_sfmt_bctxt; }
766
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
767
              case 3 :
768
                if ((entire_insn & 0xffff0000) == 0x4d030000)
769
                  { itype = IQ2000BF_INSN_BC3TL; goto extract_sfmt_bctxt; }
770
                itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
771
              default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
772
              }
773
            }
774
          case 36 :
775
            if ((entire_insn & 0xffe007ff) == 0x4d200000)
776
              { itype = IQ2000BF_INSN_CHKHDR; goto extract_sfmt_syscall; }
777
            itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
778
          case 64 : /* fall through */
779
          case 65 : /* fall through */
780
          case 66 : /* fall through */
781
          case 67 : itype = IQ2000BF_INSN_WBR1; goto extract_sfmt_syscall;
782
          case 68 : /* fall through */
783
          case 69 : /* fall through */
784
          case 70 : /* fall through */
785
          case 71 : itype = IQ2000BF_INSN_WBR1U; goto extract_sfmt_syscall;
786
          case 72 : /* fall through */
787
          case 73 : /* fall through */
788
          case 74 : /* fall through */
789
          case 75 : itype = IQ2000BF_INSN_WBR30; goto extract_sfmt_syscall;
790
          case 76 : /* fall through */
791
          case 77 : /* fall through */
792
          case 78 : /* fall through */
793
          case 79 : itype = IQ2000BF_INSN_WBR30U; goto extract_sfmt_syscall;
794
          case 80 : /* fall through */
795
          case 81 : /* fall through */
796
          case 82 : /* fall through */
797
          case 83 : itype = IQ2000BF_INSN_WXR1; goto extract_sfmt_syscall;
798
          case 84 : /* fall through */
799
          case 85 : /* fall through */
800
          case 86 : /* fall through */
801
          case 87 : itype = IQ2000BF_INSN_WXR1U; goto extract_sfmt_syscall;
802
          case 88 : /* fall through */
803
          case 89 : /* fall through */
804
          case 90 : /* fall through */
805
          case 91 : itype = IQ2000BF_INSN_WXR30; goto extract_sfmt_syscall;
806
          case 92 : /* fall through */
807
          case 93 : /* fall through */
808
          case 94 : /* fall through */
809
          case 95 : itype = IQ2000BF_INSN_WXR30U; goto extract_sfmt_syscall;
810
          case 96 : /* fall through */
811
          case 97 : /* fall through */
812
          case 98 : /* fall through */
813
          case 99 : itype = IQ2000BF_INSN_RBR1; goto extract_sfmt_syscall;
814
          case 104 : /* fall through */
815
          case 105 : /* fall through */
816
          case 106 : /* fall through */
817
          case 107 : itype = IQ2000BF_INSN_RBR30; goto extract_sfmt_syscall;
818
          case 112 : /* fall through */
819
          case 113 : /* fall through */
820
          case 114 : /* fall through */
821
          case 115 : itype = IQ2000BF_INSN_RXR1; goto extract_sfmt_syscall;
822
          case 116 : /* fall through */
823
          case 117 : /* fall through */
824
          case 118 : /* fall through */
825
          case 119 : itype = IQ2000BF_INSN_PKRLR1; goto extract_sfmt_syscall;
826
          case 120 : /* fall through */
827
          case 121 : /* fall through */
828
          case 122 : /* fall through */
829
          case 123 : itype = IQ2000BF_INSN_RXR30; goto extract_sfmt_syscall;
830
          case 124 : /* fall through */
831
          case 125 : /* fall through */
832
          case 126 : /* fall through */
833
          case 127 : itype = IQ2000BF_INSN_PKRLR30; goto extract_sfmt_syscall;
834
          default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
835
          }
836
        }
837
      case 20 : itype = IQ2000BF_INSN_BEQL; goto extract_sfmt_bbv;
838
      case 21 : itype = IQ2000BF_INSN_BNEL; goto extract_sfmt_bbv;
839
      case 22 :
840
        if ((entire_insn & 0xfc1f0000) == 0x58000000)
841
          { itype = IQ2000BF_INSN_BLEZL; goto extract_sfmt_bgez; }
842
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
843
      case 23 :
844
        if ((entire_insn & 0xfc1f0000) == 0x5c000000)
845
          { itype = IQ2000BF_INSN_BGTZL; goto extract_sfmt_bgez; }
846
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
847
      case 24 : itype = IQ2000BF_INSN_BMB0; goto extract_sfmt_bbv;
848
      case 25 : itype = IQ2000BF_INSN_BMB1; goto extract_sfmt_bbv;
849
      case 26 : itype = IQ2000BF_INSN_BMB2; goto extract_sfmt_bbv;
850
      case 27 : itype = IQ2000BF_INSN_BMB3; goto extract_sfmt_bbv;
851
      case 28 : itype = IQ2000BF_INSN_BBI; goto extract_sfmt_bbi;
852
      case 29 : itype = IQ2000BF_INSN_BBV; goto extract_sfmt_bbv;
853
      case 30 : itype = IQ2000BF_INSN_BBIN; goto extract_sfmt_bbi;
854
      case 31 : itype = IQ2000BF_INSN_BBVN; goto extract_sfmt_bbv;
855
      case 32 : itype = IQ2000BF_INSN_LB; goto extract_sfmt_lb;
856
      case 33 : itype = IQ2000BF_INSN_LH; goto extract_sfmt_lh;
857
      case 35 : itype = IQ2000BF_INSN_LW; goto extract_sfmt_lw;
858
      case 36 : itype = IQ2000BF_INSN_LBU; goto extract_sfmt_lb;
859
      case 37 : itype = IQ2000BF_INSN_LHU; goto extract_sfmt_lh;
860
      case 39 :
861
        if ((entire_insn & 0xfc000020) == 0x9c000000)
862
          { itype = IQ2000BF_INSN_RAM; goto extract_sfmt_ram; }
863
        itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
864
      case 40 : itype = IQ2000BF_INSN_SB; goto extract_sfmt_sb;
865
      case 41 : itype = IQ2000BF_INSN_SH; goto extract_sfmt_sh;
866
      case 43 : itype = IQ2000BF_INSN_SW; goto extract_sfmt_sw;
867
      case 44 : itype = IQ2000BF_INSN_ANDOI; goto extract_sfmt_addi;
868
      case 45 : itype = IQ2000BF_INSN_BMB; goto extract_sfmt_bbv;
869
      case 47 : itype = IQ2000BF_INSN_ORUI; goto extract_sfmt_andoui;
870
      case 48 : itype = IQ2000BF_INSN_LDW; goto extract_sfmt_ldw;
871
      case 56 : itype = IQ2000BF_INSN_SDW; goto extract_sfmt_sdw;
872
      case 63 : itype = IQ2000BF_INSN_ANDOUI; goto extract_sfmt_andoui;
873
      default : itype = IQ2000BF_INSN_X_INVALID; goto extract_sfmt_empty;
874
      }
875
    }
876
  }
877
 
878
  /* The instruction has been decoded, now extract the fields.  */
879
 
880
 extract_sfmt_empty:
881
  {
882
    const IDESC *idesc = &iq2000bf_insn_data[itype];
883
#define FLD(f) abuf->fields.sfmt_empty.f
884
 
885
 
886
  /* Record the fields for the semantic handler.  */
887
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_empty", (char *) 0));
888
 
889
#undef FLD
890
    return idesc;
891
  }
892
 
893
 extract_sfmt_add:
894
  {
895
    const IDESC *idesc = &iq2000bf_insn_data[itype];
896
    CGEN_INSN_WORD insn = entire_insn;
897
#define FLD(f) abuf->fields.sfmt_mrgb.f
898
    UINT f_rs;
899
    UINT f_rt;
900
    UINT f_rd;
901
 
902
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
903
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
904
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
905
 
906
  /* Record the fields for the semantic handler.  */
907
  FLD (f_rs) = f_rs;
908
  FLD (f_rt) = f_rt;
909
  FLD (f_rd) = f_rd;
910
  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));
911
 
912
#undef FLD
913
    return idesc;
914
  }
915
 
916
 extract_sfmt_addi:
917
  {
918
    const IDESC *idesc = &iq2000bf_insn_data[itype];
919
    CGEN_INSN_WORD insn = entire_insn;
920
#define FLD(f) abuf->fields.sfmt_addi.f
921
    UINT f_rs;
922
    UINT f_rt;
923
    UINT f_imm;
924
 
925
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
926
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
927
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
928
 
929
  /* Record the fields for the semantic handler.  */
930
  FLD (f_imm) = f_imm;
931
  FLD (f_rs) = f_rs;
932
  FLD (f_rt) = f_rt;
933
  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));
934
 
935
#undef FLD
936
    return idesc;
937
  }
938
 
939
 extract_sfmt_ram:
940
  {
941
    const IDESC *idesc = &iq2000bf_insn_data[itype];
942
    CGEN_INSN_WORD insn = entire_insn;
943
#define FLD(f) abuf->fields.sfmt_ram.f
944
    UINT f_rs;
945
    UINT f_rt;
946
    UINT f_rd;
947
    UINT f_shamt;
948
    UINT f_maskl;
949
 
950
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
951
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
952
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
953
    f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
954
    f_maskl = EXTRACT_LSB0_UINT (insn, 32, 4, 5);
955
 
956
  /* Record the fields for the semantic handler.  */
957
  FLD (f_maskl) = f_maskl;
958
  FLD (f_rs) = f_rs;
959
  FLD (f_rd) = f_rd;
960
  FLD (f_rt) = f_rt;
961
  FLD (f_shamt) = f_shamt;
962
  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));
963
 
964
#undef FLD
965
    return idesc;
966
  }
967
 
968
 extract_sfmt_sll:
969
  {
970
    const IDESC *idesc = &iq2000bf_insn_data[itype];
971
    CGEN_INSN_WORD insn = entire_insn;
972
#define FLD(f) abuf->fields.sfmt_ram.f
973
    UINT f_rt;
974
    UINT f_rd;
975
    UINT f_shamt;
976
 
977
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
978
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
979
    f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
980
 
981
  /* Record the fields for the semantic handler.  */
982
  FLD (f_rt) = f_rt;
983
  FLD (f_shamt) = f_shamt;
984
  FLD (f_rd) = f_rd;
985
  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));
986
 
987
#undef FLD
988
    return idesc;
989
  }
990
 
991
 extract_sfmt_slmv:
992
  {
993
    const IDESC *idesc = &iq2000bf_insn_data[itype];
994
    CGEN_INSN_WORD insn = entire_insn;
995
#define FLD(f) abuf->fields.sfmt_ram.f
996
    UINT f_rs;
997
    UINT f_rt;
998
    UINT f_rd;
999
    UINT f_shamt;
1000
 
1001
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1002
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1003
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
1004
    f_shamt = EXTRACT_LSB0_UINT (insn, 32, 10, 5);
1005
 
1006
  /* Record the fields for the semantic handler.  */
1007
  FLD (f_rs) = f_rs;
1008
  FLD (f_rt) = f_rt;
1009
  FLD (f_shamt) = f_shamt;
1010
  FLD (f_rd) = f_rd;
1011
  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));
1012
 
1013
#undef FLD
1014
    return idesc;
1015
  }
1016
 
1017
 extract_sfmt_slt:
1018
  {
1019
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1020
    CGEN_INSN_WORD insn = entire_insn;
1021
#define FLD(f) abuf->fields.sfmt_mrgb.f
1022
    UINT f_rs;
1023
    UINT f_rt;
1024
    UINT f_rd;
1025
 
1026
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1027
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1028
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
1029
 
1030
  /* Record the fields for the semantic handler.  */
1031
  FLD (f_rs) = f_rs;
1032
  FLD (f_rt) = f_rt;
1033
  FLD (f_rd) = f_rd;
1034
  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));
1035
 
1036
#undef FLD
1037
    return idesc;
1038
  }
1039
 
1040
 extract_sfmt_slti:
1041
  {
1042
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1043
    CGEN_INSN_WORD insn = entire_insn;
1044
#define FLD(f) abuf->fields.sfmt_addi.f
1045
    UINT f_rs;
1046
    UINT f_rt;
1047
    UINT f_imm;
1048
 
1049
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1050
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1051
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1052
 
1053
  /* Record the fields for the semantic handler.  */
1054
  FLD (f_imm) = f_imm;
1055
  FLD (f_rs) = f_rs;
1056
  FLD (f_rt) = f_rt;
1057
  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));
1058
 
1059
#undef FLD
1060
    return idesc;
1061
  }
1062
 
1063
 extract_sfmt_bbi:
1064
  {
1065
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1066
    CGEN_INSN_WORD insn = entire_insn;
1067
#define FLD(f) abuf->fields.sfmt_bbi.f
1068
    UINT f_rs;
1069
    UINT f_rt;
1070
    SI f_offset;
1071
 
1072
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1073
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1074
    f_offset = ((((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
1075
 
1076
  /* Record the fields for the semantic handler.  */
1077
  FLD (f_rt) = f_rt;
1078
  FLD (f_rs) = f_rs;
1079
  FLD (i_offset) = f_offset;
1080
  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));
1081
 
1082
#if WITH_PROFILE_MODEL_P
1083
  /* Record the fields for profiling.  */
1084
  if (PROFILE_MODEL_P (current_cpu))
1085
    {
1086
    }
1087
#endif
1088
#undef FLD
1089
    return idesc;
1090
  }
1091
 
1092
 extract_sfmt_bbv:
1093
  {
1094
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1095
    CGEN_INSN_WORD insn = entire_insn;
1096
#define FLD(f) abuf->fields.sfmt_bbi.f
1097
    UINT f_rs;
1098
    UINT f_rt;
1099
    SI f_offset;
1100
 
1101
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1102
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1103
    f_offset = ((((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
1104
 
1105
  /* Record the fields for the semantic handler.  */
1106
  FLD (f_rs) = f_rs;
1107
  FLD (f_rt) = f_rt;
1108
  FLD (i_offset) = f_offset;
1109
  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));
1110
 
1111
#if WITH_PROFILE_MODEL_P
1112
  /* Record the fields for profiling.  */
1113
  if (PROFILE_MODEL_P (current_cpu))
1114
    {
1115
    }
1116
#endif
1117
#undef FLD
1118
    return idesc;
1119
  }
1120
 
1121
 extract_sfmt_bgez:
1122
  {
1123
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1124
    CGEN_INSN_WORD insn = entire_insn;
1125
#define FLD(f) abuf->fields.sfmt_bbi.f
1126
    UINT f_rs;
1127
    SI f_offset;
1128
 
1129
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1130
    f_offset = ((((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
1131
 
1132
  /* Record the fields for the semantic handler.  */
1133
  FLD (f_rs) = f_rs;
1134
  FLD (i_offset) = f_offset;
1135
  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));
1136
 
1137
#if WITH_PROFILE_MODEL_P
1138
  /* Record the fields for profiling.  */
1139
  if (PROFILE_MODEL_P (current_cpu))
1140
    {
1141
    }
1142
#endif
1143
#undef FLD
1144
    return idesc;
1145
  }
1146
 
1147
 extract_sfmt_bgezal:
1148
  {
1149
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1150
    CGEN_INSN_WORD insn = entire_insn;
1151
#define FLD(f) abuf->fields.sfmt_bbi.f
1152
    UINT f_rs;
1153
    SI f_offset;
1154
 
1155
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1156
    f_offset = ((((EXTRACT_LSB0_SINT (insn, 32, 15, 16)) << (2))) + (((pc) + (4))));
1157
 
1158
  /* Record the fields for the semantic handler.  */
1159
  FLD (f_rs) = f_rs;
1160
  FLD (i_offset) = f_offset;
1161
  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));
1162
 
1163
#if WITH_PROFILE_MODEL_P
1164
  /* Record the fields for profiling.  */
1165
  if (PROFILE_MODEL_P (current_cpu))
1166
    {
1167
    }
1168
#endif
1169
#undef FLD
1170
    return idesc;
1171
  }
1172
 
1173
 extract_sfmt_jalr:
1174
  {
1175
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1176
    CGEN_INSN_WORD insn = entire_insn;
1177
#define FLD(f) abuf->fields.sfmt_mrgb.f
1178
    UINT f_rs;
1179
    UINT f_rd;
1180
 
1181
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1182
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
1183
 
1184
  /* Record the fields for the semantic handler.  */
1185
  FLD (f_rs) = f_rs;
1186
  FLD (f_rd) = f_rd;
1187
  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));
1188
 
1189
#if WITH_PROFILE_MODEL_P
1190
  /* Record the fields for profiling.  */
1191
  if (PROFILE_MODEL_P (current_cpu))
1192
    {
1193
    }
1194
#endif
1195
#undef FLD
1196
    return idesc;
1197
  }
1198
 
1199
 extract_sfmt_jr:
1200
  {
1201
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1202
    CGEN_INSN_WORD insn = entire_insn;
1203
#define FLD(f) abuf->fields.sfmt_bbi.f
1204
    UINT f_rs;
1205
 
1206
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1207
 
1208
  /* Record the fields for the semantic handler.  */
1209
  FLD (f_rs) = f_rs;
1210
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jr", "f_rs 0x%x", 'x', f_rs, (char *) 0));
1211
 
1212
#if WITH_PROFILE_MODEL_P
1213
  /* Record the fields for profiling.  */
1214
  if (PROFILE_MODEL_P (current_cpu))
1215
    {
1216
    }
1217
#endif
1218
#undef FLD
1219
    return idesc;
1220
  }
1221
 
1222
 extract_sfmt_lb:
1223
  {
1224
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1225
    CGEN_INSN_WORD insn = entire_insn;
1226
#define FLD(f) abuf->fields.sfmt_addi.f
1227
    UINT f_rs;
1228
    UINT f_rt;
1229
    UINT f_imm;
1230
 
1231
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1232
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1233
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1234
 
1235
  /* Record the fields for the semantic handler.  */
1236
  FLD (f_rs) = f_rs;
1237
  FLD (f_imm) = f_imm;
1238
  FLD (f_rt) = f_rt;
1239
  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));
1240
 
1241
#undef FLD
1242
    return idesc;
1243
  }
1244
 
1245
 extract_sfmt_lh:
1246
  {
1247
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1248
    CGEN_INSN_WORD insn = entire_insn;
1249
#define FLD(f) abuf->fields.sfmt_addi.f
1250
    UINT f_rs;
1251
    UINT f_rt;
1252
    UINT f_imm;
1253
 
1254
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1255
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1256
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1257
 
1258
  /* Record the fields for the semantic handler.  */
1259
  FLD (f_rs) = f_rs;
1260
  FLD (f_imm) = f_imm;
1261
  FLD (f_rt) = f_rt;
1262
  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));
1263
 
1264
#undef FLD
1265
    return idesc;
1266
  }
1267
 
1268
 extract_sfmt_lui:
1269
  {
1270
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1271
    CGEN_INSN_WORD insn = entire_insn;
1272
#define FLD(f) abuf->fields.sfmt_addi.f
1273
    UINT f_rt;
1274
    UINT f_imm;
1275
 
1276
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1277
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1278
 
1279
  /* Record the fields for the semantic handler.  */
1280
  FLD (f_imm) = f_imm;
1281
  FLD (f_rt) = f_rt;
1282
  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));
1283
 
1284
#undef FLD
1285
    return idesc;
1286
  }
1287
 
1288
 extract_sfmt_lw:
1289
  {
1290
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1291
    CGEN_INSN_WORD insn = entire_insn;
1292
#define FLD(f) abuf->fields.sfmt_addi.f
1293
    UINT f_rs;
1294
    UINT f_rt;
1295
    UINT f_imm;
1296
 
1297
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1298
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1299
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1300
 
1301
  /* Record the fields for the semantic handler.  */
1302
  FLD (f_rs) = f_rs;
1303
  FLD (f_imm) = f_imm;
1304
  FLD (f_rt) = f_rt;
1305
  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));
1306
 
1307
#undef FLD
1308
    return idesc;
1309
  }
1310
 
1311
 extract_sfmt_sb:
1312
  {
1313
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1314
    CGEN_INSN_WORD insn = entire_insn;
1315
#define FLD(f) abuf->fields.sfmt_addi.f
1316
    UINT f_rs;
1317
    UINT f_rt;
1318
    UINT f_imm;
1319
 
1320
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1321
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1322
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1323
 
1324
  /* Record the fields for the semantic handler.  */
1325
  FLD (f_rs) = f_rs;
1326
  FLD (f_imm) = f_imm;
1327
  FLD (f_rt) = f_rt;
1328
  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));
1329
 
1330
#undef FLD
1331
    return idesc;
1332
  }
1333
 
1334
 extract_sfmt_sh:
1335
  {
1336
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1337
    CGEN_INSN_WORD insn = entire_insn;
1338
#define FLD(f) abuf->fields.sfmt_addi.f
1339
    UINT f_rs;
1340
    UINT f_rt;
1341
    UINT f_imm;
1342
 
1343
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1344
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1345
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1346
 
1347
  /* Record the fields for the semantic handler.  */
1348
  FLD (f_rs) = f_rs;
1349
  FLD (f_imm) = f_imm;
1350
  FLD (f_rt) = f_rt;
1351
  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));
1352
 
1353
#undef FLD
1354
    return idesc;
1355
  }
1356
 
1357
 extract_sfmt_sw:
1358
  {
1359
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1360
    CGEN_INSN_WORD insn = entire_insn;
1361
#define FLD(f) abuf->fields.sfmt_addi.f
1362
    UINT f_rs;
1363
    UINT f_rt;
1364
    UINT f_imm;
1365
 
1366
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1367
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1368
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1369
 
1370
  /* Record the fields for the semantic handler.  */
1371
  FLD (f_rs) = f_rs;
1372
  FLD (f_imm) = f_imm;
1373
  FLD (f_rt) = f_rt;
1374
  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));
1375
 
1376
#undef FLD
1377
    return idesc;
1378
  }
1379
 
1380
 extract_sfmt_break:
1381
  {
1382
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1383
#define FLD(f) abuf->fields.sfmt_empty.f
1384
 
1385
 
1386
  /* Record the fields for the semantic handler.  */
1387
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_break", (char *) 0));
1388
 
1389
#if WITH_PROFILE_MODEL_P
1390
  /* Record the fields for profiling.  */
1391
  if (PROFILE_MODEL_P (current_cpu))
1392
    {
1393
    }
1394
#endif
1395
#undef FLD
1396
    return idesc;
1397
  }
1398
 
1399
 extract_sfmt_syscall:
1400
  {
1401
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1402
#define FLD(f) abuf->fields.sfmt_empty.f
1403
 
1404
 
1405
  /* Record the fields for the semantic handler.  */
1406
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_syscall", (char *) 0));
1407
 
1408
#undef FLD
1409
    return idesc;
1410
  }
1411
 
1412
 extract_sfmt_andoui:
1413
  {
1414
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1415
    CGEN_INSN_WORD insn = entire_insn;
1416
#define FLD(f) abuf->fields.sfmt_addi.f
1417
    UINT f_rs;
1418
    UINT f_rt;
1419
    UINT f_imm;
1420
 
1421
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1422
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1423
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1424
 
1425
  /* Record the fields for the semantic handler.  */
1426
  FLD (f_imm) = f_imm;
1427
  FLD (f_rs) = f_rs;
1428
  FLD (f_rt) = f_rt;
1429
  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));
1430
 
1431
#undef FLD
1432
    return idesc;
1433
  }
1434
 
1435
 extract_sfmt_mrgb:
1436
  {
1437
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1438
    CGEN_INSN_WORD insn = entire_insn;
1439
#define FLD(f) abuf->fields.sfmt_mrgb.f
1440
    UINT f_rs;
1441
    UINT f_rt;
1442
    UINT f_rd;
1443
    UINT f_mask;
1444
 
1445
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1446
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1447
    f_rd = EXTRACT_LSB0_UINT (insn, 32, 15, 5);
1448
    f_mask = EXTRACT_LSB0_UINT (insn, 32, 9, 4);
1449
 
1450
  /* Record the fields for the semantic handler.  */
1451
  FLD (f_mask) = f_mask;
1452
  FLD (f_rs) = f_rs;
1453
  FLD (f_rt) = f_rt;
1454
  FLD (f_rd) = f_rd;
1455
  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));
1456
 
1457
#undef FLD
1458
    return idesc;
1459
  }
1460
 
1461
 extract_sfmt_bctxt:
1462
  {
1463
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1464
#define FLD(f) abuf->fields.sfmt_empty.f
1465
 
1466
 
1467
  /* Record the fields for the semantic handler.  */
1468
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bctxt", (char *) 0));
1469
 
1470
#undef FLD
1471
    return idesc;
1472
  }
1473
 
1474
 extract_sfmt_ldw:
1475
  {
1476
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1477
    CGEN_INSN_WORD insn = entire_insn;
1478
#define FLD(f) abuf->fields.sfmt_addi.f
1479
    UINT f_rs;
1480
    UINT f_rt;
1481
    UINT f_imm;
1482
 
1483
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1484
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1485
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1486
 
1487
  /* Record the fields for the semantic handler.  */
1488
  FLD (f_rs) = f_rs;
1489
  FLD (f_rt) = f_rt;
1490
  FLD (f_imm) = f_imm;
1491
  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));
1492
 
1493
#undef FLD
1494
    return idesc;
1495
  }
1496
 
1497
 extract_sfmt_sdw:
1498
  {
1499
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1500
    CGEN_INSN_WORD insn = entire_insn;
1501
#define FLD(f) abuf->fields.sfmt_addi.f
1502
    UINT f_rs;
1503
    UINT f_rt;
1504
    UINT f_imm;
1505
 
1506
    f_rs = EXTRACT_LSB0_UINT (insn, 32, 25, 5);
1507
    f_rt = EXTRACT_LSB0_UINT (insn, 32, 20, 5);
1508
    f_imm = EXTRACT_LSB0_UINT (insn, 32, 15, 16);
1509
 
1510
  /* Record the fields for the semantic handler.  */
1511
  FLD (f_rs) = f_rs;
1512
  FLD (f_rt) = f_rt;
1513
  FLD (f_imm) = f_imm;
1514
  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));
1515
 
1516
#undef FLD
1517
    return idesc;
1518
  }
1519
 
1520
 extract_sfmt_j:
1521
  {
1522
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1523
    CGEN_INSN_WORD insn = entire_insn;
1524
#define FLD(f) abuf->fields.sfmt_j.f
1525
    USI f_jtarg;
1526
 
1527
    f_jtarg = ((((pc) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn, 32, 15, 16)) << (2))));
1528
 
1529
  /* Record the fields for the semantic handler.  */
1530
  FLD (i_jmptarg) = f_jtarg;
1531
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_j", "jmptarg 0x%x", 'x', f_jtarg, (char *) 0));
1532
 
1533
#if WITH_PROFILE_MODEL_P
1534
  /* Record the fields for profiling.  */
1535
  if (PROFILE_MODEL_P (current_cpu))
1536
    {
1537
    }
1538
#endif
1539
#undef FLD
1540
    return idesc;
1541
  }
1542
 
1543
 extract_sfmt_jal:
1544
  {
1545
    const IDESC *idesc = &iq2000bf_insn_data[itype];
1546
    CGEN_INSN_WORD insn = entire_insn;
1547
#define FLD(f) abuf->fields.sfmt_j.f
1548
    USI f_jtarg;
1549
 
1550
    f_jtarg = ((((pc) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn, 32, 15, 16)) << (2))));
1551
 
1552
  /* Record the fields for the semantic handler.  */
1553
  FLD (i_jmptarg) = f_jtarg;
1554
  TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jal", "jmptarg 0x%x", 'x', f_jtarg, (char *) 0));
1555
 
1556
#if WITH_PROFILE_MODEL_P
1557
  /* Record the fields for profiling.  */
1558
  if (PROFILE_MODEL_P (current_cpu))
1559
    {
1560
    }
1561
#endif
1562
#undef FLD
1563
    return idesc;
1564
  }
1565
 
1566
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.