1 /* Simulator instruction decoder for iq2000bf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
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)
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.
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.
25 #define WANT_CPU iq2000bf
26 #define WANT_CPU_IQ2000BF
29 #include "sim-assert.h"
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];
38 /* Commas between elements are contained in the macros.
39 Some of these are conditionally compiled out. */
41 static const struct insn_sem iq2000bf_insn_sem
[] =
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
},
195 static const struct insn_sem iq2000bf_insn_sem_invalid
= {
196 VIRTUAL_INSN_X_INVALID
, IQ2000BF_INSN_X_INVALID
, IQ2000BF_SFMT_EMPTY
199 /* Initialize an IDESC from the compile-time computable parts. */
202 init_idesc (SIM_CPU
*cpu
, IDESC
*id
, const struct insn_sem
*t
)
204 const CGEN_INSN
*insn_table
= CGEN_CPU_INSN_TABLE (CPU_CPU_DESC (cpu
))->init_entries
;
208 if ((int) t
->type
<= 0)
209 id
->idata
= & cgen_virtual_insn_table
[- (int) t
->type
];
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;
216 #if WITH_PROFILE_MODEL_P
217 id
->timing
= & MODEL_TIMING (CPU_MODEL (cpu
)) [t
->index
];
219 SIM_DESC sd
= CPU_STATE (cpu
);
220 SIM_ASSERT (t
->index
== id
->timing
->num
);
224 /* Semantic pointers are initialized elsewhere. */
227 /* Initialize the instruction descriptor table. */
230 iq2000bf_init_idesc_table (SIM_CPU
*cpu
)
233 const struct insn_sem
*t
,*tend
;
234 int tabsize
= sizeof (iq2000bf_insn_data
) / sizeof (IDESC
);
235 IDESC
*table
= iq2000bf_insn_data
;
237 memset (table
, 0, tabsize
* sizeof (IDESC
));
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
);
244 /* Now fill in the values for the chosen cpu. */
245 for (t
= iq2000bf_insn_sem
, tend
= t
+ sizeof (iq2000bf_insn_sem
) / sizeof (*t
);
248 init_idesc (cpu
, & table
[t
->index
], t
);
251 /* Link the IDESC table into the cpu. */
252 CPU_IDESC (cpu
) = table
;
255 /* Given an instruction, return a pointer to its IDESC entry. */
258 iq2000bf_decode (SIM_CPU
*current_cpu
, IADDR pc
,
259 CGEN_INSN_INT base_insn
, CGEN_INSN_INT entire_insn
,
262 /* Result of decoder. */
263 IQ2000BF_INSN_TYPE itype
;
266 CGEN_INSN_INT insn
= base_insn
;
269 unsigned int val
= (((insn
>> 26) & (63 << 0)));
274 unsigned int val
= (((insn
>> 1) & (1 << 4)) | ((insn
>> 0) & (15 << 0)));
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
;
308 unsigned int val
= (((insn
>> 17) & (1 << 3)) | ((insn
>> 16) & (7 << 0)));
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
;
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
;
339 unsigned int val
= (((insn
>> 19) & (15 << 3)) | ((insn
>> 15) & (3 << 1)) | ((insn
>> 4) & (1 << 0)));
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
;
372 unsigned int val
= (((insn
>> 22) & (3 << 0)));
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
;
384 unsigned int val
= (((insn
>> 16) & (3 << 5)) | ((insn
>> 0) & (31 << 0)));
389 unsigned int val
= (((insn
>> 23) & (1 << 0)));
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
;
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
;
417 unsigned int val
= (((insn
>> 23) & (1 << 0)));
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
;
425 default : itype
= IQ2000BF_INSN_X_INVALID
; goto extract_sfmt_empty
;
430 unsigned int val
= (((insn
>> 19) & (31 << 2)) | ((insn
>> 0) & (3 << 0)));
433 case 0 : itype
= IQ2000BF_INSN_MFC3
;goto extract_sfmt_syscall
;
436 unsigned int val
= (((insn
>> 2) & (3 << 0)));
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
;
447 unsigned int val
= (((insn
>> 3) & (1 << 0)));
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
;
457 unsigned int val
= (((insn
>> 2) & (3 << 0)));
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
;
468 unsigned int val
= (((insn
>> 2) & (1 << 0)));
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
;
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 */
484 unsigned int val
= (((insn
>> 16) & (3 << 0)));
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
;
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
;
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
;
586 /* The instruction has been decoded, now extract the fields. */
590 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
591 #define FLD(f) abuf->fields.fmt_empty.f
594 /* Record the fields for the semantic handler. */
595 TRACE_EXTRACT (current_cpu
, abuf
, (current_cpu
, pc
, "sfmt_empty", (char *) 0));
603 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
604 CGEN_INSN_INT insn
= entire_insn
;
605 #define FLD(f) abuf->fields.sfmt_mrgb.f
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);
614 /* Record the fields for the semantic handler. */
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));
626 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
627 CGEN_INSN_INT insn
= entire_insn
;
628 #define FLD(f) abuf->fields.sfmt_addi.f
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);
637 /* Record the fields for the semantic handler. */
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));
649 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
650 CGEN_INSN_INT insn
= entire_insn
;
651 #define FLD(f) abuf->fields.sfmt_mrgb.f
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);
660 /* Record the fields for the semantic handler. */
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));
672 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
673 CGEN_INSN_INT insn
= entire_insn
;
674 #define FLD(f) abuf->fields.sfmt_ram.f
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);
687 /* Record the fields for the semantic handler. */
688 FLD (f_maskl
) = f_maskl
;
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));
701 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
702 CGEN_INSN_INT insn
= entire_insn
;
703 #define FLD(f) abuf->fields.sfmt_ram.f
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);
712 /* Record the fields for the semantic handler. */
714 FLD (f_shamt
) = f_shamt
;
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));
724 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
725 CGEN_INSN_INT insn
= entire_insn
;
726 #define FLD(f) abuf->fields.sfmt_ram.f
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);
737 /* Record the fields for the semantic handler. */
740 FLD (f_shamt
) = f_shamt
;
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));
750 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
751 CGEN_INSN_INT insn
= entire_insn
;
752 #define FLD(f) abuf->fields.sfmt_mrgb.f
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);
761 /* Record the fields for the semantic handler. */
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));
773 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
774 CGEN_INSN_INT insn
= entire_insn
;
775 #define FLD(f) abuf->fields.sfmt_addi.f
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);
784 /* Record the fields for the semantic handler. */
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));
796 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
797 CGEN_INSN_INT insn
= entire_insn
;
798 #define FLD(f) abuf->fields.sfmt_bbi.f
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))));
807 /* Record the fields for the semantic handler. */
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));
813 #if WITH_PROFILE_MODEL_P
814 /* Record the fields for profiling. */
815 if (PROFILE_MODEL_P (current_cpu
))
825 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
826 CGEN_INSN_INT insn
= entire_insn
;
827 #define FLD(f) abuf->fields.sfmt_bbi.f
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))));
836 /* Record the fields for the semantic handler. */
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));
842 #if WITH_PROFILE_MODEL_P
843 /* Record the fields for profiling. */
844 if (PROFILE_MODEL_P (current_cpu
))
854 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
855 CGEN_INSN_INT insn
= entire_insn
;
856 #define FLD(f) abuf->fields.sfmt_bbi.f
860 f_rs
= EXTRACT_LSB0_UINT (insn
, 32, 25, 5);
861 f_offset
= ((((EXTRACT_LSB0_INT (insn
, 32, 15, 16)) << (2))) + (((pc
) + (4))));
863 /* Record the fields for the semantic handler. */
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));
868 #if WITH_PROFILE_MODEL_P
869 /* Record the fields for profiling. */
870 if (PROFILE_MODEL_P (current_cpu
))
880 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
881 CGEN_INSN_INT insn
= entire_insn
;
882 #define FLD(f) abuf->fields.sfmt_bbi.f
886 f_rs
= EXTRACT_LSB0_UINT (insn
, 32, 25, 5);
887 f_offset
= ((((EXTRACT_LSB0_INT (insn
, 32, 15, 16)) << (2))) + (((pc
) + (4))));
889 /* Record the fields for the semantic handler. */
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));
894 #if WITH_PROFILE_MODEL_P
895 /* Record the fields for profiling. */
896 if (PROFILE_MODEL_P (current_cpu
))
906 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
907 CGEN_INSN_INT insn
= entire_insn
;
908 #define FLD(f) abuf->fields.sfmt_mrgb.f
912 f_rs
= EXTRACT_LSB0_UINT (insn
, 32, 25, 5);
913 f_rd
= EXTRACT_LSB0_UINT (insn
, 32, 15, 5);
915 /* Record the fields for the semantic handler. */
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));
920 #if WITH_PROFILE_MODEL_P
921 /* Record the fields for profiling. */
922 if (PROFILE_MODEL_P (current_cpu
))
932 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
933 CGEN_INSN_INT insn
= entire_insn
;
934 #define FLD(f) abuf->fields.sfmt_bbi.f
937 f_rs
= EXTRACT_LSB0_UINT (insn
, 32, 25, 5);
939 /* Record the fields for the semantic handler. */
941 TRACE_EXTRACT (current_cpu
, abuf
, (current_cpu
, pc
, "sfmt_jr", "f_rs 0x%x", 'x', f_rs
, (char *) 0));
943 #if WITH_PROFILE_MODEL_P
944 /* Record the fields for profiling. */
945 if (PROFILE_MODEL_P (current_cpu
))
955 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
956 CGEN_INSN_INT insn
= entire_insn
;
957 #define FLD(f) abuf->fields.sfmt_addi.f
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);
966 /* Record the fields for the semantic handler. */
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));
978 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
979 CGEN_INSN_INT insn
= entire_insn
;
980 #define FLD(f) abuf->fields.sfmt_addi.f
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);
989 /* Record the fields for the semantic handler. */
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));
1001 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1002 CGEN_INSN_INT insn
= entire_insn
;
1003 #define FLD(f) abuf->fields.sfmt_addi.f
1007 f_rt
= EXTRACT_LSB0_UINT (insn
, 32, 20, 5);
1008 f_imm
= EXTRACT_LSB0_UINT (insn
, 32, 15, 16);
1010 /* Record the fields for the semantic handler. */
1011 FLD (f_imm
) = f_imm
;
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));
1021 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1022 CGEN_INSN_INT insn
= entire_insn
;
1023 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1032 /* Record the fields for the semantic handler. */
1034 FLD (f_imm
) = f_imm
;
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));
1044 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1045 CGEN_INSN_INT insn
= entire_insn
;
1046 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1055 /* Record the fields for the semantic handler. */
1057 FLD (f_imm
) = f_imm
;
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));
1067 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1068 CGEN_INSN_INT insn
= entire_insn
;
1069 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1078 /* Record the fields for the semantic handler. */
1080 FLD (f_imm
) = f_imm
;
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));
1090 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1091 CGEN_INSN_INT insn
= entire_insn
;
1092 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1101 /* Record the fields for the semantic handler. */
1103 FLD (f_imm
) = f_imm
;
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));
1113 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1114 #define FLD(f) abuf->fields.fmt_empty.f
1117 /* Record the fields for the semantic handler. */
1118 TRACE_EXTRACT (current_cpu
, abuf
, (current_cpu
, pc
, "sfmt_break", (char *) 0));
1120 #if WITH_PROFILE_MODEL_P
1121 /* Record the fields for profiling. */
1122 if (PROFILE_MODEL_P (current_cpu
))
1130 extract_sfmt_syscall
:
1132 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1133 #define FLD(f) abuf->fields.fmt_empty.f
1136 /* Record the fields for the semantic handler. */
1137 TRACE_EXTRACT (current_cpu
, abuf
, (current_cpu
, pc
, "sfmt_syscall", (char *) 0));
1143 extract_sfmt_andoui
:
1145 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1146 CGEN_INSN_INT insn
= entire_insn
;
1147 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1156 /* Record the fields for the semantic handler. */
1157 FLD (f_imm
) = f_imm
;
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));
1168 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1169 CGEN_INSN_INT insn
= entire_insn
;
1170 #define FLD(f) abuf->fields.sfmt_mrgb.f
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);
1181 /* Record the fields for the semantic handler. */
1182 FLD (f_mask
) = f_mask
;
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));
1194 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1195 #define FLD(f) abuf->fields.fmt_empty.f
1198 /* Record the fields for the semantic handler. */
1199 TRACE_EXTRACT (current_cpu
, abuf
, (current_cpu
, pc
, "sfmt_bctxt", (char *) 0));
1207 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1208 CGEN_INSN_INT insn
= entire_insn
;
1209 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1218 /* Record the fields for the semantic handler. */
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));
1230 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1231 CGEN_INSN_INT insn
= entire_insn
;
1232 #define FLD(f) abuf->fields.sfmt_addi.f
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);
1241 /* Record the fields for the semantic handler. */
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));
1253 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1254 CGEN_INSN_INT insn
= entire_insn
;
1255 #define FLD(f) abuf->fields.sfmt_j.f
1258 f_jtarg
= ((((pc
) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn
, 32, 15, 16)) << (2))));
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));
1264 #if WITH_PROFILE_MODEL_P
1265 /* Record the fields for profiling. */
1266 if (PROFILE_MODEL_P (current_cpu
))
1276 const IDESC
*idesc
= &iq2000bf_insn_data
[itype
];
1277 CGEN_INSN_INT insn
= entire_insn
;
1278 #define FLD(f) abuf->fields.sfmt_j.f
1281 f_jtarg
= ((((pc
) & (0xf0000000))) | (((EXTRACT_LSB0_UINT (insn
, 32, 15, 16)) << (2))));
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));
1287 #if WITH_PROFILE_MODEL_P
1288 /* Record the fields for profiling. */
1289 if (PROFILE_MODEL_P (current_cpu
))