1 /* Simulator instruction semantics 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 3 of the License, or
12 (at your option) any later version.
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
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 /* The labels have the case they have because the enum of insn types
27 is all uppercase and in the non-stdc case the insn symbol is built
28 into the enum name. */
34 { IQ2000BF_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
35 { IQ2000BF_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
36 { IQ2000BF_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
37 { IQ2000BF_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
38 { IQ2000BF_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
39 { IQ2000BF_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
40 { IQ2000BF_INSN_ADD
, && case_sem_INSN_ADD
},
41 { IQ2000BF_INSN_ADDI
, && case_sem_INSN_ADDI
},
42 { IQ2000BF_INSN_ADDIU
, && case_sem_INSN_ADDIU
},
43 { IQ2000BF_INSN_ADDU
, && case_sem_INSN_ADDU
},
44 { IQ2000BF_INSN_ADO16
, && case_sem_INSN_ADO16
},
45 { IQ2000BF_INSN_AND
, && case_sem_INSN_AND
},
46 { IQ2000BF_INSN_ANDI
, && case_sem_INSN_ANDI
},
47 { IQ2000BF_INSN_ANDOI
, && case_sem_INSN_ANDOI
},
48 { IQ2000BF_INSN_NOR
, && case_sem_INSN_NOR
},
49 { IQ2000BF_INSN_OR
, && case_sem_INSN_OR
},
50 { IQ2000BF_INSN_ORI
, && case_sem_INSN_ORI
},
51 { IQ2000BF_INSN_RAM
, && case_sem_INSN_RAM
},
52 { IQ2000BF_INSN_SLL
, && case_sem_INSN_SLL
},
53 { IQ2000BF_INSN_SLLV
, && case_sem_INSN_SLLV
},
54 { IQ2000BF_INSN_SLMV
, && case_sem_INSN_SLMV
},
55 { IQ2000BF_INSN_SLT
, && case_sem_INSN_SLT
},
56 { IQ2000BF_INSN_SLTI
, && case_sem_INSN_SLTI
},
57 { IQ2000BF_INSN_SLTIU
, && case_sem_INSN_SLTIU
},
58 { IQ2000BF_INSN_SLTU
, && case_sem_INSN_SLTU
},
59 { IQ2000BF_INSN_SRA
, && case_sem_INSN_SRA
},
60 { IQ2000BF_INSN_SRAV
, && case_sem_INSN_SRAV
},
61 { IQ2000BF_INSN_SRL
, && case_sem_INSN_SRL
},
62 { IQ2000BF_INSN_SRLV
, && case_sem_INSN_SRLV
},
63 { IQ2000BF_INSN_SRMV
, && case_sem_INSN_SRMV
},
64 { IQ2000BF_INSN_SUB
, && case_sem_INSN_SUB
},
65 { IQ2000BF_INSN_SUBU
, && case_sem_INSN_SUBU
},
66 { IQ2000BF_INSN_XOR
, && case_sem_INSN_XOR
},
67 { IQ2000BF_INSN_XORI
, && case_sem_INSN_XORI
},
68 { IQ2000BF_INSN_BBI
, && case_sem_INSN_BBI
},
69 { IQ2000BF_INSN_BBIN
, && case_sem_INSN_BBIN
},
70 { IQ2000BF_INSN_BBV
, && case_sem_INSN_BBV
},
71 { IQ2000BF_INSN_BBVN
, && case_sem_INSN_BBVN
},
72 { IQ2000BF_INSN_BEQ
, && case_sem_INSN_BEQ
},
73 { IQ2000BF_INSN_BEQL
, && case_sem_INSN_BEQL
},
74 { IQ2000BF_INSN_BGEZ
, && case_sem_INSN_BGEZ
},
75 { IQ2000BF_INSN_BGEZAL
, && case_sem_INSN_BGEZAL
},
76 { IQ2000BF_INSN_BGEZALL
, && case_sem_INSN_BGEZALL
},
77 { IQ2000BF_INSN_BGEZL
, && case_sem_INSN_BGEZL
},
78 { IQ2000BF_INSN_BLTZ
, && case_sem_INSN_BLTZ
},
79 { IQ2000BF_INSN_BLTZL
, && case_sem_INSN_BLTZL
},
80 { IQ2000BF_INSN_BLTZAL
, && case_sem_INSN_BLTZAL
},
81 { IQ2000BF_INSN_BLTZALL
, && case_sem_INSN_BLTZALL
},
82 { IQ2000BF_INSN_BMB0
, && case_sem_INSN_BMB0
},
83 { IQ2000BF_INSN_BMB1
, && case_sem_INSN_BMB1
},
84 { IQ2000BF_INSN_BMB2
, && case_sem_INSN_BMB2
},
85 { IQ2000BF_INSN_BMB3
, && case_sem_INSN_BMB3
},
86 { IQ2000BF_INSN_BNE
, && case_sem_INSN_BNE
},
87 { IQ2000BF_INSN_BNEL
, && case_sem_INSN_BNEL
},
88 { IQ2000BF_INSN_JALR
, && case_sem_INSN_JALR
},
89 { IQ2000BF_INSN_JR
, && case_sem_INSN_JR
},
90 { IQ2000BF_INSN_LB
, && case_sem_INSN_LB
},
91 { IQ2000BF_INSN_LBU
, && case_sem_INSN_LBU
},
92 { IQ2000BF_INSN_LH
, && case_sem_INSN_LH
},
93 { IQ2000BF_INSN_LHU
, && case_sem_INSN_LHU
},
94 { IQ2000BF_INSN_LUI
, && case_sem_INSN_LUI
},
95 { IQ2000BF_INSN_LW
, && case_sem_INSN_LW
},
96 { IQ2000BF_INSN_SB
, && case_sem_INSN_SB
},
97 { IQ2000BF_INSN_SH
, && case_sem_INSN_SH
},
98 { IQ2000BF_INSN_SW
, && case_sem_INSN_SW
},
99 { IQ2000BF_INSN_BREAK
, && case_sem_INSN_BREAK
},
100 { IQ2000BF_INSN_SYSCALL
, && case_sem_INSN_SYSCALL
},
101 { IQ2000BF_INSN_ANDOUI
, && case_sem_INSN_ANDOUI
},
102 { IQ2000BF_INSN_ORUI
, && case_sem_INSN_ORUI
},
103 { IQ2000BF_INSN_BGTZ
, && case_sem_INSN_BGTZ
},
104 { IQ2000BF_INSN_BGTZL
, && case_sem_INSN_BGTZL
},
105 { IQ2000BF_INSN_BLEZ
, && case_sem_INSN_BLEZ
},
106 { IQ2000BF_INSN_BLEZL
, && case_sem_INSN_BLEZL
},
107 { IQ2000BF_INSN_MRGB
, && case_sem_INSN_MRGB
},
108 { IQ2000BF_INSN_BCTXT
, && case_sem_INSN_BCTXT
},
109 { IQ2000BF_INSN_BC0F
, && case_sem_INSN_BC0F
},
110 { IQ2000BF_INSN_BC0FL
, && case_sem_INSN_BC0FL
},
111 { IQ2000BF_INSN_BC3F
, && case_sem_INSN_BC3F
},
112 { IQ2000BF_INSN_BC3FL
, && case_sem_INSN_BC3FL
},
113 { IQ2000BF_INSN_BC0T
, && case_sem_INSN_BC0T
},
114 { IQ2000BF_INSN_BC0TL
, && case_sem_INSN_BC0TL
},
115 { IQ2000BF_INSN_BC3T
, && case_sem_INSN_BC3T
},
116 { IQ2000BF_INSN_BC3TL
, && case_sem_INSN_BC3TL
},
117 { IQ2000BF_INSN_CFC0
, && case_sem_INSN_CFC0
},
118 { IQ2000BF_INSN_CFC1
, && case_sem_INSN_CFC1
},
119 { IQ2000BF_INSN_CFC2
, && case_sem_INSN_CFC2
},
120 { IQ2000BF_INSN_CFC3
, && case_sem_INSN_CFC3
},
121 { IQ2000BF_INSN_CHKHDR
, && case_sem_INSN_CHKHDR
},
122 { IQ2000BF_INSN_CTC0
, && case_sem_INSN_CTC0
},
123 { IQ2000BF_INSN_CTC1
, && case_sem_INSN_CTC1
},
124 { IQ2000BF_INSN_CTC2
, && case_sem_INSN_CTC2
},
125 { IQ2000BF_INSN_CTC3
, && case_sem_INSN_CTC3
},
126 { IQ2000BF_INSN_JCR
, && case_sem_INSN_JCR
},
127 { IQ2000BF_INSN_LUC32
, && case_sem_INSN_LUC32
},
128 { IQ2000BF_INSN_LUC32L
, && case_sem_INSN_LUC32L
},
129 { IQ2000BF_INSN_LUC64
, && case_sem_INSN_LUC64
},
130 { IQ2000BF_INSN_LUC64L
, && case_sem_INSN_LUC64L
},
131 { IQ2000BF_INSN_LUK
, && case_sem_INSN_LUK
},
132 { IQ2000BF_INSN_LULCK
, && case_sem_INSN_LULCK
},
133 { IQ2000BF_INSN_LUM32
, && case_sem_INSN_LUM32
},
134 { IQ2000BF_INSN_LUM32L
, && case_sem_INSN_LUM32L
},
135 { IQ2000BF_INSN_LUM64
, && case_sem_INSN_LUM64
},
136 { IQ2000BF_INSN_LUM64L
, && case_sem_INSN_LUM64L
},
137 { IQ2000BF_INSN_LUR
, && case_sem_INSN_LUR
},
138 { IQ2000BF_INSN_LURL
, && case_sem_INSN_LURL
},
139 { IQ2000BF_INSN_LUULCK
, && case_sem_INSN_LUULCK
},
140 { IQ2000BF_INSN_MFC0
, && case_sem_INSN_MFC0
},
141 { IQ2000BF_INSN_MFC1
, && case_sem_INSN_MFC1
},
142 { IQ2000BF_INSN_MFC2
, && case_sem_INSN_MFC2
},
143 { IQ2000BF_INSN_MFC3
, && case_sem_INSN_MFC3
},
144 { IQ2000BF_INSN_MTC0
, && case_sem_INSN_MTC0
},
145 { IQ2000BF_INSN_MTC1
, && case_sem_INSN_MTC1
},
146 { IQ2000BF_INSN_MTC2
, && case_sem_INSN_MTC2
},
147 { IQ2000BF_INSN_MTC3
, && case_sem_INSN_MTC3
},
148 { IQ2000BF_INSN_PKRL
, && case_sem_INSN_PKRL
},
149 { IQ2000BF_INSN_PKRLR1
, && case_sem_INSN_PKRLR1
},
150 { IQ2000BF_INSN_PKRLR30
, && case_sem_INSN_PKRLR30
},
151 { IQ2000BF_INSN_RB
, && case_sem_INSN_RB
},
152 { IQ2000BF_INSN_RBR1
, && case_sem_INSN_RBR1
},
153 { IQ2000BF_INSN_RBR30
, && case_sem_INSN_RBR30
},
154 { IQ2000BF_INSN_RFE
, && case_sem_INSN_RFE
},
155 { IQ2000BF_INSN_RX
, && case_sem_INSN_RX
},
156 { IQ2000BF_INSN_RXR1
, && case_sem_INSN_RXR1
},
157 { IQ2000BF_INSN_RXR30
, && case_sem_INSN_RXR30
},
158 { IQ2000BF_INSN_SLEEP
, && case_sem_INSN_SLEEP
},
159 { IQ2000BF_INSN_SRRD
, && case_sem_INSN_SRRD
},
160 { IQ2000BF_INSN_SRRDL
, && case_sem_INSN_SRRDL
},
161 { IQ2000BF_INSN_SRULCK
, && case_sem_INSN_SRULCK
},
162 { IQ2000BF_INSN_SRWR
, && case_sem_INSN_SRWR
},
163 { IQ2000BF_INSN_SRWRU
, && case_sem_INSN_SRWRU
},
164 { IQ2000BF_INSN_TRAPQFL
, && case_sem_INSN_TRAPQFL
},
165 { IQ2000BF_INSN_TRAPQNE
, && case_sem_INSN_TRAPQNE
},
166 { IQ2000BF_INSN_TRAPREL
, && case_sem_INSN_TRAPREL
},
167 { IQ2000BF_INSN_WB
, && case_sem_INSN_WB
},
168 { IQ2000BF_INSN_WBU
, && case_sem_INSN_WBU
},
169 { IQ2000BF_INSN_WBR1
, && case_sem_INSN_WBR1
},
170 { IQ2000BF_INSN_WBR1U
, && case_sem_INSN_WBR1U
},
171 { IQ2000BF_INSN_WBR30
, && case_sem_INSN_WBR30
},
172 { IQ2000BF_INSN_WBR30U
, && case_sem_INSN_WBR30U
},
173 { IQ2000BF_INSN_WX
, && case_sem_INSN_WX
},
174 { IQ2000BF_INSN_WXU
, && case_sem_INSN_WXU
},
175 { IQ2000BF_INSN_WXR1
, && case_sem_INSN_WXR1
},
176 { IQ2000BF_INSN_WXR1U
, && case_sem_INSN_WXR1U
},
177 { IQ2000BF_INSN_WXR30
, && case_sem_INSN_WXR30
},
178 { IQ2000BF_INSN_WXR30U
, && case_sem_INSN_WXR30U
},
179 { IQ2000BF_INSN_LDW
, && case_sem_INSN_LDW
},
180 { IQ2000BF_INSN_SDW
, && case_sem_INSN_SDW
},
181 { IQ2000BF_INSN_J
, && case_sem_INSN_J
},
182 { IQ2000BF_INSN_JAL
, && case_sem_INSN_JAL
},
183 { IQ2000BF_INSN_BMB
, && case_sem_INSN_BMB
},
188 for (i
= 0; labels
[i
].label
!= 0; ++i
)
191 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
193 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
198 #endif /* DEFINE_LABELS */
202 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
203 off frills like tracing and profiling. */
204 /* FIXME: A better way would be to have TRACE_RESULT check for something
205 that can cause it to be optimized out. Another way would be to emit
206 special handlers into the instruction "stream". */
210 #define TRACE_RESULT(cpu, abuf, name, type, val)
214 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
215 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
217 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
224 /* Branch to next handler without going around main loop. */
225 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
226 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
228 #else /* ! WITH_SCACHE_PBB */
230 #define NEXT(vpc) BREAK (sem)
233 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
235 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
238 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
241 #endif /* ! WITH_SCACHE_PBB */
245 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
247 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
248 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
249 #define FLD(f) abuf->fields.fmt_empty.f
250 int UNUSED written
= 0;
251 IADDR UNUSED pc
= abuf
->addr
;
252 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
255 /* Update the recorded pc in the cpu state struct.
256 Only necessary for WITH_SCACHE case, but to avoid the
257 conditional compilation .... */
259 /* Virtual insns have zero size. Overwrite vpc with address of next insn
260 using the default-insn-bitsize spec. When executing insns in parallel
261 we may want to queue the fault and continue execution. */
262 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
263 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
270 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
272 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
273 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
274 #define FLD(f) abuf->fields.fmt_empty.f
275 int UNUSED written
= 0;
276 IADDR UNUSED pc
= abuf
->addr
;
277 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
280 #if WITH_SCACHE_PBB_IQ2000BF
281 iq2000bf_pbb_after (current_cpu
, sem_arg
);
289 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
291 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
292 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
293 #define FLD(f) abuf->fields.fmt_empty.f
294 int UNUSED written
= 0;
295 IADDR UNUSED pc
= abuf
->addr
;
296 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
299 #if WITH_SCACHE_PBB_IQ2000BF
300 iq2000bf_pbb_before (current_cpu
, sem_arg
);
308 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
310 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
311 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
312 #define FLD(f) abuf->fields.fmt_empty.f
313 int UNUSED written
= 0;
314 IADDR UNUSED pc
= abuf
->addr
;
315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
318 #if WITH_SCACHE_PBB_IQ2000BF
320 vpc
= iq2000bf_pbb_cti_chain (current_cpu
, sem_arg
,
321 pbb_br_type
, pbb_br_npc
);
324 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
325 vpc
= iq2000bf_pbb_cti_chain (current_cpu
, sem_arg
,
326 CPU_PBB_BR_TYPE (current_cpu
),
327 CPU_PBB_BR_NPC (current_cpu
));
336 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
338 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
339 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
340 #define FLD(f) abuf->fields.fmt_empty.f
341 int UNUSED written
= 0;
342 IADDR UNUSED pc
= abuf
->addr
;
343 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
346 #if WITH_SCACHE_PBB_IQ2000BF
347 vpc
= iq2000bf_pbb_chain (current_cpu
, sem_arg
);
358 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
360 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
361 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
362 #define FLD(f) abuf->fields.fmt_empty.f
363 int UNUSED written
= 0;
364 IADDR UNUSED pc
= abuf
->addr
;
365 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
368 #if WITH_SCACHE_PBB_IQ2000BF
369 #if defined DEFINE_SWITCH || defined FAST_P
370 /* In the switch case FAST_P is a constant, allowing several optimizations
371 in any called inline functions. */
372 vpc
= iq2000bf_pbb_begin (current_cpu
, FAST_P
);
374 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
375 vpc
= iq2000bf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
377 vpc
= iq2000bf_pbb_begin (current_cpu
, 0);
387 CASE (sem
, INSN_ADD
) : /* add $rd,$rs,$rt */
389 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
390 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
391 #define FLD(f) abuf->fields.sfmt_mrgb.f
392 int UNUSED written
= 0;
393 IADDR UNUSED pc
= abuf
->addr
;
394 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
397 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
398 SET_H_GR (FLD (f_rd
), opval
);
399 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
406 CASE (sem
, INSN_ADDI
) : /* addi $rt,$rs,$lo16 */
408 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
409 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
410 #define FLD(f) abuf->fields.sfmt_addi.f
411 int UNUSED written
= 0;
412 IADDR UNUSED pc
= abuf
->addr
;
413 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
416 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))));
417 SET_H_GR (FLD (f_rt
), opval
);
418 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
425 CASE (sem
, INSN_ADDIU
) : /* addiu $rt,$rs,$lo16 */
427 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
428 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
429 #define FLD(f) abuf->fields.sfmt_addi.f
430 int UNUSED written
= 0;
431 IADDR UNUSED pc
= abuf
->addr
;
432 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
435 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))));
436 SET_H_GR (FLD (f_rt
), opval
);
437 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
444 CASE (sem
, INSN_ADDU
) : /* addu $rd,$rs,$rt */
446 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
447 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
448 #define FLD(f) abuf->fields.sfmt_mrgb.f
449 int UNUSED written
= 0;
450 IADDR UNUSED pc
= abuf
->addr
;
451 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
454 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
455 SET_H_GR (FLD (f_rd
), opval
);
456 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
463 CASE (sem
, INSN_ADO16
) : /* ado16 $rd,$rs,$rt */
465 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
466 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
467 #define FLD(f) abuf->fields.sfmt_mrgb.f
468 int UNUSED written
= 0;
469 IADDR UNUSED pc
= abuf
->addr
;
470 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
475 tmp_low
= ADDHI (ANDHI (GET_H_GR (FLD (f_rs
)), 65535), ANDHI (GET_H_GR (FLD (f_rt
)), 65535));
476 tmp_high
= ADDHI (SRLSI (GET_H_GR (FLD (f_rs
)), 16), SRLSI (GET_H_GR (FLD (f_rt
)), 16));
478 SI opval
= ORSI (SLLSI (tmp_high
, 16), tmp_low
);
479 SET_H_GR (FLD (f_rd
), opval
);
480 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
488 CASE (sem
, INSN_AND
) : /* and $rd,$rs,$rt */
490 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
492 #define FLD(f) abuf->fields.sfmt_mrgb.f
493 int UNUSED written
= 0;
494 IADDR UNUSED pc
= abuf
->addr
;
495 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
498 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
499 SET_H_GR (FLD (f_rd
), opval
);
500 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
507 CASE (sem
, INSN_ANDI
) : /* andi $rt,$rs,$lo16 */
509 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
510 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
511 #define FLD(f) abuf->fields.sfmt_addi.f
512 int UNUSED written
= 0;
513 IADDR UNUSED pc
= abuf
->addr
;
514 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
517 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
518 SET_H_GR (FLD (f_rt
), opval
);
519 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
526 CASE (sem
, INSN_ANDOI
) : /* andoi $rt,$rs,$lo16 */
528 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
529 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
530 #define FLD(f) abuf->fields.sfmt_addi.f
531 int UNUSED written
= 0;
532 IADDR UNUSED pc
= abuf
->addr
;
533 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
536 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ORSI (0xffff0000, EXTHISI (TRUNCSIHI (FLD (f_imm
)))));
537 SET_H_GR (FLD (f_rt
), opval
);
538 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
545 CASE (sem
, INSN_NOR
) : /* nor $rd,$rs,$rt */
547 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
548 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
549 #define FLD(f) abuf->fields.sfmt_mrgb.f
550 int UNUSED written
= 0;
551 IADDR UNUSED pc
= abuf
->addr
;
552 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
555 SI opval
= INVSI (ORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
))));
556 SET_H_GR (FLD (f_rd
), opval
);
557 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
564 CASE (sem
, INSN_OR
) : /* or $rd,$rs,$rt */
566 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
567 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
568 #define FLD(f) abuf->fields.sfmt_mrgb.f
569 int UNUSED written
= 0;
570 IADDR UNUSED pc
= abuf
->addr
;
571 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
574 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
575 SET_H_GR (FLD (f_rd
), opval
);
576 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
583 CASE (sem
, INSN_ORI
) : /* ori $rt,$rs,$lo16 */
585 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
586 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
587 #define FLD(f) abuf->fields.sfmt_addi.f
588 int UNUSED written
= 0;
589 IADDR UNUSED pc
= abuf
->addr
;
590 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
593 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
594 SET_H_GR (FLD (f_rt
), opval
);
595 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
602 CASE (sem
, INSN_RAM
) : /* ram $rd,$rt,$shamt,$maskl,$maskr */
604 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
605 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
606 #define FLD(f) abuf->fields.sfmt_ram.f
607 int UNUSED written
= 0;
608 IADDR UNUSED pc
= abuf
->addr
;
609 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
613 SI opval
= RORSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
614 SET_H_GR (FLD (f_rd
), opval
);
615 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
618 SI opval
= ANDSI (GET_H_GR (FLD (f_rd
)), SRLSI (0xffffffff, FLD (f_maskl
)));
619 SET_H_GR (FLD (f_rd
), opval
);
620 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
623 SI opval
= ANDSI (GET_H_GR (FLD (f_rd
)), SLLSI (0xffffffff, FLD (f_rs
)));
624 SET_H_GR (FLD (f_rd
), opval
);
625 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
633 CASE (sem
, INSN_SLL
) : /* sll $rd,$rt,$shamt */
635 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
636 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
637 #define FLD(f) abuf->fields.sfmt_ram.f
638 int UNUSED written
= 0;
639 IADDR UNUSED pc
= abuf
->addr
;
640 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
643 SI opval
= SLLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
644 SET_H_GR (FLD (f_rd
), opval
);
645 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
652 CASE (sem
, INSN_SLLV
) : /* sllv $rd,$rt,$rs */
654 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
655 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
656 #define FLD(f) abuf->fields.sfmt_mrgb.f
657 int UNUSED written
= 0;
658 IADDR UNUSED pc
= abuf
->addr
;
659 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
662 SI opval
= SLLSI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
663 SET_H_GR (FLD (f_rd
), opval
);
664 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
671 CASE (sem
, INSN_SLMV
) : /* slmv $rd,$rt,$rs,$shamt */
673 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
674 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
675 #define FLD(f) abuf->fields.sfmt_ram.f
676 int UNUSED written
= 0;
677 IADDR UNUSED pc
= abuf
->addr
;
678 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
681 SI opval
= ANDSI (SLLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
)), SRLSI (0xffffffff, GET_H_GR (FLD (f_rs
))));
682 SET_H_GR (FLD (f_rd
), opval
);
683 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
690 CASE (sem
, INSN_SLT
) : /* slt $rd,$rs,$rt */
692 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
693 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
694 #define FLD(f) abuf->fields.sfmt_mrgb.f
695 int UNUSED written
= 0;
696 IADDR UNUSED pc
= abuf
->addr
;
697 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
699 if (LTSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
702 SET_H_GR (FLD (f_rd
), opval
);
704 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
709 SET_H_GR (FLD (f_rd
), opval
);
711 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
715 abuf
->written
= written
;
720 CASE (sem
, INSN_SLTI
) : /* slti $rt,$rs,$imm */
722 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
723 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
724 #define FLD(f) abuf->fields.sfmt_addi.f
725 int UNUSED written
= 0;
726 IADDR UNUSED pc
= abuf
->addr
;
727 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
729 if (LTSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))) {
732 SET_H_GR (FLD (f_rt
), opval
);
734 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
739 SET_H_GR (FLD (f_rt
), opval
);
741 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
745 abuf
->written
= written
;
750 CASE (sem
, INSN_SLTIU
) : /* sltiu $rt,$rs,$imm */
752 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
753 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
754 #define FLD(f) abuf->fields.sfmt_addi.f
755 int UNUSED written
= 0;
756 IADDR UNUSED pc
= abuf
->addr
;
757 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
759 if (LTUSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))) {
762 SET_H_GR (FLD (f_rt
), opval
);
764 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
769 SET_H_GR (FLD (f_rt
), opval
);
771 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
775 abuf
->written
= written
;
780 CASE (sem
, INSN_SLTU
) : /* sltu $rd,$rs,$rt */
782 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
784 #define FLD(f) abuf->fields.sfmt_mrgb.f
785 int UNUSED written
= 0;
786 IADDR UNUSED pc
= abuf
->addr
;
787 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
789 if (LTUSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
792 SET_H_GR (FLD (f_rd
), opval
);
794 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
799 SET_H_GR (FLD (f_rd
), opval
);
801 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
805 abuf
->written
= written
;
810 CASE (sem
, INSN_SRA
) : /* sra $rd,$rt,$shamt */
812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
814 #define FLD(f) abuf->fields.sfmt_ram.f
815 int UNUSED written
= 0;
816 IADDR UNUSED pc
= abuf
->addr
;
817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
820 SI opval
= SRASI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
821 SET_H_GR (FLD (f_rd
), opval
);
822 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
829 CASE (sem
, INSN_SRAV
) : /* srav $rd,$rt,$rs */
831 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
832 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
833 #define FLD(f) abuf->fields.sfmt_mrgb.f
834 int UNUSED written
= 0;
835 IADDR UNUSED pc
= abuf
->addr
;
836 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
839 SI opval
= SRASI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
840 SET_H_GR (FLD (f_rd
), opval
);
841 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
848 CASE (sem
, INSN_SRL
) : /* srl $rd,$rt,$shamt */
850 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
852 #define FLD(f) abuf->fields.sfmt_ram.f
853 int UNUSED written
= 0;
854 IADDR UNUSED pc
= abuf
->addr
;
855 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
858 SI opval
= SRLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
859 SET_H_GR (FLD (f_rd
), opval
);
860 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
867 CASE (sem
, INSN_SRLV
) : /* srlv $rd,$rt,$rs */
869 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
870 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
871 #define FLD(f) abuf->fields.sfmt_mrgb.f
872 int UNUSED written
= 0;
873 IADDR UNUSED pc
= abuf
->addr
;
874 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
877 SI opval
= SRLSI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
878 SET_H_GR (FLD (f_rd
), opval
);
879 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
886 CASE (sem
, INSN_SRMV
) : /* srmv $rd,$rt,$rs,$shamt */
888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
890 #define FLD(f) abuf->fields.sfmt_ram.f
891 int UNUSED written
= 0;
892 IADDR UNUSED pc
= abuf
->addr
;
893 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
896 SI opval
= ANDSI (SRLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
)), SLLSI (0xffffffff, GET_H_GR (FLD (f_rs
))));
897 SET_H_GR (FLD (f_rd
), opval
);
898 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
905 CASE (sem
, INSN_SUB
) : /* sub $rd,$rs,$rt */
907 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
908 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
909 #define FLD(f) abuf->fields.sfmt_mrgb.f
910 int UNUSED written
= 0;
911 IADDR UNUSED pc
= abuf
->addr
;
912 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
915 SI opval
= SUBSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
916 SET_H_GR (FLD (f_rd
), opval
);
917 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
924 CASE (sem
, INSN_SUBU
) : /* subu $rd,$rs,$rt */
926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
927 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
928 #define FLD(f) abuf->fields.sfmt_mrgb.f
929 int UNUSED written
= 0;
930 IADDR UNUSED pc
= abuf
->addr
;
931 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
934 SI opval
= SUBSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
935 SET_H_GR (FLD (f_rd
), opval
);
936 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
943 CASE (sem
, INSN_XOR
) : /* xor $rd,$rs,$rt */
945 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
946 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
947 #define FLD(f) abuf->fields.sfmt_mrgb.f
948 int UNUSED written
= 0;
949 IADDR UNUSED pc
= abuf
->addr
;
950 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
953 SI opval
= XORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
954 SET_H_GR (FLD (f_rd
), opval
);
955 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
962 CASE (sem
, INSN_XORI
) : /* xori $rt,$rs,$lo16 */
964 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
965 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
966 #define FLD(f) abuf->fields.sfmt_addi.f
967 int UNUSED written
= 0;
968 IADDR UNUSED pc
= abuf
->addr
;
969 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
972 SI opval
= XORSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
973 SET_H_GR (FLD (f_rt
), opval
);
974 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
981 CASE (sem
, INSN_BBI
) : /* bbi $rs($bitnum),$offset */
983 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
984 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
985 #define FLD(f) abuf->fields.sfmt_bbi.f
986 int UNUSED written
= 0;
987 IADDR UNUSED pc
= abuf
->addr
;
989 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
991 if (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, FLD (f_rt
)))) {
994 USI opval
= FLD (i_offset
);
995 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
997 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1002 abuf
->written
= written
;
1003 SEM_BRANCH_FINI (vpc
);
1008 CASE (sem
, INSN_BBIN
) : /* bbin $rs($bitnum),$offset */
1010 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1012 #define FLD(f) abuf->fields.sfmt_bbi.f
1013 int UNUSED written
= 0;
1014 IADDR UNUSED pc
= abuf
->addr
;
1016 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1018 if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, FLD (f_rt
))))) {
1021 USI opval
= FLD (i_offset
);
1022 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1023 written
|= (1 << 3);
1024 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1029 abuf
->written
= written
;
1030 SEM_BRANCH_FINI (vpc
);
1035 CASE (sem
, INSN_BBV
) : /* bbv $rs,$rt,$offset */
1037 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1038 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1039 #define FLD(f) abuf->fields.sfmt_bbi.f
1040 int UNUSED written
= 0;
1041 IADDR UNUSED pc
= abuf
->addr
;
1043 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1045 if (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt
)), 31)))) {
1048 USI opval
= FLD (i_offset
);
1049 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1050 written
|= (1 << 3);
1051 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1056 abuf
->written
= written
;
1057 SEM_BRANCH_FINI (vpc
);
1062 CASE (sem
, INSN_BBVN
) : /* bbvn $rs,$rt,$offset */
1064 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1065 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1066 #define FLD(f) abuf->fields.sfmt_bbi.f
1067 int UNUSED written
= 0;
1068 IADDR UNUSED pc
= abuf
->addr
;
1070 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1072 if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt
)), 31))))) {
1075 USI opval
= FLD (i_offset
);
1076 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1077 written
|= (1 << 3);
1078 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1083 abuf
->written
= written
;
1084 SEM_BRANCH_FINI (vpc
);
1089 CASE (sem
, INSN_BEQ
) : /* beq $rs,$rt,$offset */
1091 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1092 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1093 #define FLD(f) abuf->fields.sfmt_bbi.f
1094 int UNUSED written
= 0;
1095 IADDR UNUSED pc
= abuf
->addr
;
1097 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1099 if (EQSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1102 USI opval
= FLD (i_offset
);
1103 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1104 written
|= (1 << 3);
1105 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1110 abuf
->written
= written
;
1111 SEM_BRANCH_FINI (vpc
);
1116 CASE (sem
, INSN_BEQL
) : /* beql $rs,$rt,$offset */
1118 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1119 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1120 #define FLD(f) abuf->fields.sfmt_bbi.f
1121 int UNUSED written
= 0;
1122 IADDR UNUSED pc
= abuf
->addr
;
1124 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1126 if (EQSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1129 USI opval
= FLD (i_offset
);
1130 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1131 written
|= (1 << 3);
1132 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1137 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1140 abuf
->written
= written
;
1141 SEM_BRANCH_FINI (vpc
);
1146 CASE (sem
, INSN_BGEZ
) : /* bgez $rs,$offset */
1148 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1149 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1150 #define FLD(f) abuf->fields.sfmt_bbi.f
1151 int UNUSED written
= 0;
1152 IADDR UNUSED pc
= abuf
->addr
;
1154 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1156 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1159 USI opval
= FLD (i_offset
);
1160 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1161 written
|= (1 << 2);
1162 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1167 abuf
->written
= written
;
1168 SEM_BRANCH_FINI (vpc
);
1173 CASE (sem
, INSN_BGEZAL
) : /* bgezal $rs,$offset */
1175 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1176 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1177 #define FLD(f) abuf->fields.sfmt_bbi.f
1178 int UNUSED written
= 0;
1179 IADDR UNUSED pc
= abuf
->addr
;
1181 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1183 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1186 SI opval
= ADDSI (pc
, 8);
1187 SET_H_GR (((UINT
) 31), opval
);
1188 written
|= (1 << 3);
1189 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1193 USI opval
= FLD (i_offset
);
1194 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1195 written
|= (1 << 4);
1196 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1202 abuf
->written
= written
;
1203 SEM_BRANCH_FINI (vpc
);
1208 CASE (sem
, INSN_BGEZALL
) : /* bgezall $rs,$offset */
1210 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1211 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1212 #define FLD(f) abuf->fields.sfmt_bbi.f
1213 int UNUSED written
= 0;
1214 IADDR UNUSED pc
= abuf
->addr
;
1216 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1218 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1221 SI opval
= ADDSI (pc
, 8);
1222 SET_H_GR (((UINT
) 31), opval
);
1223 written
|= (1 << 3);
1224 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1228 USI opval
= FLD (i_offset
);
1229 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1230 written
|= (1 << 4);
1231 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1237 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1240 abuf
->written
= written
;
1241 SEM_BRANCH_FINI (vpc
);
1246 CASE (sem
, INSN_BGEZL
) : /* bgezl $rs,$offset */
1248 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1249 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1250 #define FLD(f) abuf->fields.sfmt_bbi.f
1251 int UNUSED written
= 0;
1252 IADDR UNUSED pc
= abuf
->addr
;
1254 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1256 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1259 USI opval
= FLD (i_offset
);
1260 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1261 written
|= (1 << 2);
1262 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1267 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1270 abuf
->written
= written
;
1271 SEM_BRANCH_FINI (vpc
);
1276 CASE (sem
, INSN_BLTZ
) : /* bltz $rs,$offset */
1278 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1279 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1280 #define FLD(f) abuf->fields.sfmt_bbi.f
1281 int UNUSED written
= 0;
1282 IADDR UNUSED pc
= abuf
->addr
;
1284 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1286 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1289 USI opval
= FLD (i_offset
);
1290 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1291 written
|= (1 << 2);
1292 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1297 abuf
->written
= written
;
1298 SEM_BRANCH_FINI (vpc
);
1303 CASE (sem
, INSN_BLTZL
) : /* bltzl $rs,$offset */
1305 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1306 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1307 #define FLD(f) abuf->fields.sfmt_bbi.f
1308 int UNUSED written
= 0;
1309 IADDR UNUSED pc
= abuf
->addr
;
1311 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1313 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1316 USI opval
= FLD (i_offset
);
1317 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1318 written
|= (1 << 2);
1319 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1324 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1327 abuf
->written
= written
;
1328 SEM_BRANCH_FINI (vpc
);
1333 CASE (sem
, INSN_BLTZAL
) : /* bltzal $rs,$offset */
1335 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1336 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1337 #define FLD(f) abuf->fields.sfmt_bbi.f
1338 int UNUSED written
= 0;
1339 IADDR UNUSED pc
= abuf
->addr
;
1341 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1343 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1346 SI opval
= ADDSI (pc
, 8);
1347 SET_H_GR (((UINT
) 31), opval
);
1348 written
|= (1 << 3);
1349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1353 USI opval
= FLD (i_offset
);
1354 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1355 written
|= (1 << 4);
1356 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1362 abuf
->written
= written
;
1363 SEM_BRANCH_FINI (vpc
);
1368 CASE (sem
, INSN_BLTZALL
) : /* bltzall $rs,$offset */
1370 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1371 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1372 #define FLD(f) abuf->fields.sfmt_bbi.f
1373 int UNUSED written
= 0;
1374 IADDR UNUSED pc
= abuf
->addr
;
1376 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1378 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1381 SI opval
= ADDSI (pc
, 8);
1382 SET_H_GR (((UINT
) 31), opval
);
1383 written
|= (1 << 3);
1384 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1388 USI opval
= FLD (i_offset
);
1389 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1390 written
|= (1 << 4);
1391 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1397 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1400 abuf
->written
= written
;
1401 SEM_BRANCH_FINI (vpc
);
1406 CASE (sem
, INSN_BMB0
) : /* bmb0 $rs,$rt,$offset */
1408 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1409 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1410 #define FLD(f) abuf->fields.sfmt_bbi.f
1411 int UNUSED written
= 0;
1412 IADDR UNUSED pc
= abuf
->addr
;
1414 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1416 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 255), ANDSI (GET_H_GR (FLD (f_rt
)), 255))) {
1419 USI opval
= FLD (i_offset
);
1420 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1421 written
|= (1 << 3);
1422 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1427 abuf
->written
= written
;
1428 SEM_BRANCH_FINI (vpc
);
1433 CASE (sem
, INSN_BMB1
) : /* bmb1 $rs,$rt,$offset */
1435 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1436 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1437 #define FLD(f) abuf->fields.sfmt_bbi.f
1438 int UNUSED written
= 0;
1439 IADDR UNUSED pc
= abuf
->addr
;
1441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1443 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 65280), ANDSI (GET_H_GR (FLD (f_rt
)), 65280))) {
1446 USI opval
= FLD (i_offset
);
1447 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1448 written
|= (1 << 3);
1449 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1454 abuf
->written
= written
;
1455 SEM_BRANCH_FINI (vpc
);
1460 CASE (sem
, INSN_BMB2
) : /* bmb2 $rs,$rt,$offset */
1462 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1463 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1464 #define FLD(f) abuf->fields.sfmt_bbi.f
1465 int UNUSED written
= 0;
1466 IADDR UNUSED pc
= abuf
->addr
;
1468 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1470 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 16711680), ANDSI (GET_H_GR (FLD (f_rt
)), 16711680))) {
1473 USI opval
= FLD (i_offset
);
1474 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1475 written
|= (1 << 3);
1476 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1481 abuf
->written
= written
;
1482 SEM_BRANCH_FINI (vpc
);
1487 CASE (sem
, INSN_BMB3
) : /* bmb3 $rs,$rt,$offset */
1489 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1490 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1491 #define FLD(f) abuf->fields.sfmt_bbi.f
1492 int UNUSED written
= 0;
1493 IADDR UNUSED pc
= abuf
->addr
;
1495 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1497 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000))) {
1500 USI opval
= FLD (i_offset
);
1501 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1502 written
|= (1 << 3);
1503 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1508 abuf
->written
= written
;
1509 SEM_BRANCH_FINI (vpc
);
1514 CASE (sem
, INSN_BNE
) : /* bne $rs,$rt,$offset */
1516 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1517 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1518 #define FLD(f) abuf->fields.sfmt_bbi.f
1519 int UNUSED written
= 0;
1520 IADDR UNUSED pc
= abuf
->addr
;
1522 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1524 if (NESI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1527 USI opval
= FLD (i_offset
);
1528 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1529 written
|= (1 << 3);
1530 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1535 abuf
->written
= written
;
1536 SEM_BRANCH_FINI (vpc
);
1541 CASE (sem
, INSN_BNEL
) : /* bnel $rs,$rt,$offset */
1543 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1544 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1545 #define FLD(f) abuf->fields.sfmt_bbi.f
1546 int UNUSED written
= 0;
1547 IADDR UNUSED pc
= abuf
->addr
;
1549 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1551 if (NESI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1554 USI opval
= FLD (i_offset
);
1555 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1556 written
|= (1 << 3);
1557 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1562 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1565 abuf
->written
= written
;
1566 SEM_BRANCH_FINI (vpc
);
1571 CASE (sem
, INSN_JALR
) : /* jalr $rd,$rs */
1573 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1574 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1575 #define FLD(f) abuf->fields.sfmt_mrgb.f
1576 int UNUSED written
= 0;
1577 IADDR UNUSED pc
= abuf
->addr
;
1579 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1584 SI opval
= ADDSI (pc
, 8);
1585 SET_H_GR (FLD (f_rd
), opval
);
1586 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1589 USI opval
= GET_H_GR (FLD (f_rs
));
1590 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1591 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1596 SEM_BRANCH_FINI (vpc
);
1601 CASE (sem
, INSN_JR
) : /* jr $rs */
1603 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1605 #define FLD(f) abuf->fields.sfmt_bbi.f
1606 int UNUSED written
= 0;
1607 IADDR UNUSED pc
= abuf
->addr
;
1609 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1613 USI opval
= GET_H_GR (FLD (f_rs
));
1614 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1615 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1619 SEM_BRANCH_FINI (vpc
);
1624 CASE (sem
, INSN_LB
) : /* lb $rt,$lo16($base) */
1626 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1628 #define FLD(f) abuf->fields.sfmt_addi.f
1629 int UNUSED written
= 0;
1630 IADDR UNUSED pc
= abuf
->addr
;
1631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1634 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1635 SET_H_GR (FLD (f_rt
), opval
);
1636 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1643 CASE (sem
, INSN_LBU
) : /* lbu $rt,$lo16($base) */
1645 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1647 #define FLD(f) abuf->fields.sfmt_addi.f
1648 int UNUSED written
= 0;
1649 IADDR UNUSED pc
= abuf
->addr
;
1650 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1653 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1654 SET_H_GR (FLD (f_rt
), opval
);
1655 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1662 CASE (sem
, INSN_LH
) : /* lh $rt,$lo16($base) */
1664 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1665 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1666 #define FLD(f) abuf->fields.sfmt_addi.f
1667 int UNUSED written
= 0;
1668 IADDR UNUSED pc
= abuf
->addr
;
1669 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1672 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1673 SET_H_GR (FLD (f_rt
), opval
);
1674 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1681 CASE (sem
, INSN_LHU
) : /* lhu $rt,$lo16($base) */
1683 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1684 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1685 #define FLD(f) abuf->fields.sfmt_addi.f
1686 int UNUSED written
= 0;
1687 IADDR UNUSED pc
= abuf
->addr
;
1688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1691 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1692 SET_H_GR (FLD (f_rt
), opval
);
1693 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1700 CASE (sem
, INSN_LUI
) : /* lui $rt,$hi16 */
1702 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1704 #define FLD(f) abuf->fields.sfmt_addi.f
1705 int UNUSED written
= 0;
1706 IADDR UNUSED pc
= abuf
->addr
;
1707 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1710 SI opval
= SLLSI (FLD (f_imm
), 16);
1711 SET_H_GR (FLD (f_rt
), opval
);
1712 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1719 CASE (sem
, INSN_LW
) : /* lw $rt,$lo16($base) */
1721 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1722 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1723 #define FLD(f) abuf->fields.sfmt_addi.f
1724 int UNUSED written
= 0;
1725 IADDR UNUSED pc
= abuf
->addr
;
1726 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1729 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))));
1730 SET_H_GR (FLD (f_rt
), opval
);
1731 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1738 CASE (sem
, INSN_SB
) : /* sb $rt,$lo16($base) */
1740 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1742 #define FLD(f) abuf->fields.sfmt_addi.f
1743 int UNUSED written
= 0;
1744 IADDR UNUSED pc
= abuf
->addr
;
1745 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1748 QI opval
= ANDQI (GET_H_GR (FLD (f_rt
)), 255);
1749 SETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1750 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1757 CASE (sem
, INSN_SH
) : /* sh $rt,$lo16($base) */
1759 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1760 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1761 #define FLD(f) abuf->fields.sfmt_addi.f
1762 int UNUSED written
= 0;
1763 IADDR UNUSED pc
= abuf
->addr
;
1764 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1767 HI opval
= ANDHI (GET_H_GR (FLD (f_rt
)), 65535);
1768 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1769 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1776 CASE (sem
, INSN_SW
) : /* sw $rt,$lo16($base) */
1778 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1779 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1780 #define FLD(f) abuf->fields.sfmt_addi.f
1781 int UNUSED written
= 0;
1782 IADDR UNUSED pc
= abuf
->addr
;
1783 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1786 SI opval
= GET_H_GR (FLD (f_rt
));
1787 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1788 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1795 CASE (sem
, INSN_BREAK
) : /* break */
1797 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1798 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1799 #define FLD(f) abuf->fields.fmt_empty.f
1800 int UNUSED written
= 0;
1801 IADDR UNUSED pc
= abuf
->addr
;
1802 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1804 do_break (current_cpu
, pc
);
1810 CASE (sem
, INSN_SYSCALL
) : /* syscall */
1812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1814 #define FLD(f) abuf->fields.fmt_empty.f
1815 int UNUSED written
= 0;
1816 IADDR UNUSED pc
= abuf
->addr
;
1817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1819 do_syscall (current_cpu
);
1825 CASE (sem
, INSN_ANDOUI
) : /* andoui $rt,$rs,$hi16 */
1827 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1828 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1829 #define FLD(f) abuf->fields.sfmt_addi.f
1830 int UNUSED written
= 0;
1831 IADDR UNUSED pc
= abuf
->addr
;
1832 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1835 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ORSI (SLLSI (FLD (f_imm
), 16), 65535));
1836 SET_H_GR (FLD (f_rt
), opval
);
1837 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1844 CASE (sem
, INSN_ORUI
) : /* orui $rt,$rs,$hi16 */
1846 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1847 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1848 #define FLD(f) abuf->fields.sfmt_addi.f
1849 int UNUSED written
= 0;
1850 IADDR UNUSED pc
= abuf
->addr
;
1851 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1854 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), SLLSI (FLD (f_imm
), 16));
1855 SET_H_GR (FLD (f_rt
), opval
);
1856 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1863 CASE (sem
, INSN_BGTZ
) : /* bgtz $rs,$offset */
1865 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1866 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1867 #define FLD(f) abuf->fields.sfmt_bbi.f
1868 int UNUSED written
= 0;
1869 IADDR UNUSED pc
= abuf
->addr
;
1871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1873 if (GTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1876 USI opval
= FLD (i_offset
);
1877 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1878 written
|= (1 << 2);
1879 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1884 abuf
->written
= written
;
1885 SEM_BRANCH_FINI (vpc
);
1890 CASE (sem
, INSN_BGTZL
) : /* bgtzl $rs,$offset */
1892 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1894 #define FLD(f) abuf->fields.sfmt_bbi.f
1895 int UNUSED written
= 0;
1896 IADDR UNUSED pc
= abuf
->addr
;
1898 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1900 if (GTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1903 USI opval
= FLD (i_offset
);
1904 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1905 written
|= (1 << 2);
1906 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1911 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1914 abuf
->written
= written
;
1915 SEM_BRANCH_FINI (vpc
);
1920 CASE (sem
, INSN_BLEZ
) : /* blez $rs,$offset */
1922 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1923 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1924 #define FLD(f) abuf->fields.sfmt_bbi.f
1925 int UNUSED written
= 0;
1926 IADDR UNUSED pc
= abuf
->addr
;
1928 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1930 if (LESI (GET_H_GR (FLD (f_rs
)), 0)) {
1933 USI opval
= FLD (i_offset
);
1934 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1935 written
|= (1 << 2);
1936 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1941 abuf
->written
= written
;
1942 SEM_BRANCH_FINI (vpc
);
1947 CASE (sem
, INSN_BLEZL
) : /* blezl $rs,$offset */
1949 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1950 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1951 #define FLD(f) abuf->fields.sfmt_bbi.f
1952 int UNUSED written
= 0;
1953 IADDR UNUSED pc
= abuf
->addr
;
1955 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1957 if (LESI (GET_H_GR (FLD (f_rs
)), 0)) {
1960 USI opval
= FLD (i_offset
);
1961 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1962 written
|= (1 << 2);
1963 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1968 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1971 abuf
->written
= written
;
1972 SEM_BRANCH_FINI (vpc
);
1977 CASE (sem
, INSN_MRGB
) : /* mrgb $rd,$rs,$rt,$mask */
1979 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1980 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1981 #define FLD(f) abuf->fields.sfmt_mrgb.f
1982 int UNUSED written
= 0;
1983 IADDR UNUSED pc
= abuf
->addr
;
1984 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1988 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 0)))) {
1989 tmp_temp
= ANDSI (GET_H_GR (FLD (f_rs
)), 255);
1991 tmp_temp
= ANDSI (GET_H_GR (FLD (f_rt
)), 255);
1993 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 1)))) {
1994 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 65280));
1996 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 65280));
1998 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 2)))) {
1999 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 16711680));
2001 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 16711680));
2003 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 3)))) {
2004 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000));
2006 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000));
2009 SI opval
= tmp_temp
;
2010 SET_H_GR (FLD (f_rd
), opval
);
2011 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2019 CASE (sem
, INSN_BCTXT
) : /* bctxt $rs,$offset */
2021 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2022 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2023 #define FLD(f) abuf->fields.fmt_empty.f
2024 int UNUSED written
= 0;
2025 IADDR UNUSED pc
= abuf
->addr
;
2027 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2031 SEM_BRANCH_FINI (vpc
);
2036 CASE (sem
, INSN_BC0F
) : /* bc0f $offset */
2038 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2039 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2040 #define FLD(f) abuf->fields.fmt_empty.f
2041 int UNUSED written
= 0;
2042 IADDR UNUSED pc
= abuf
->addr
;
2044 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2048 SEM_BRANCH_FINI (vpc
);
2053 CASE (sem
, INSN_BC0FL
) : /* bc0fl $offset */
2055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2057 #define FLD(f) abuf->fields.fmt_empty.f
2058 int UNUSED written
= 0;
2059 IADDR UNUSED pc
= abuf
->addr
;
2061 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2065 SEM_BRANCH_FINI (vpc
);
2070 CASE (sem
, INSN_BC3F
) : /* bc3f $offset */
2072 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2073 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2074 #define FLD(f) abuf->fields.fmt_empty.f
2075 int UNUSED written
= 0;
2076 IADDR UNUSED pc
= abuf
->addr
;
2078 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2082 SEM_BRANCH_FINI (vpc
);
2087 CASE (sem
, INSN_BC3FL
) : /* bc3fl $offset */
2089 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2090 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2091 #define FLD(f) abuf->fields.fmt_empty.f
2092 int UNUSED written
= 0;
2093 IADDR UNUSED pc
= abuf
->addr
;
2095 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2099 SEM_BRANCH_FINI (vpc
);
2104 CASE (sem
, INSN_BC0T
) : /* bc0t $offset */
2106 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2108 #define FLD(f) abuf->fields.fmt_empty.f
2109 int UNUSED written
= 0;
2110 IADDR UNUSED pc
= abuf
->addr
;
2112 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2116 SEM_BRANCH_FINI (vpc
);
2121 CASE (sem
, INSN_BC0TL
) : /* bc0tl $offset */
2123 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2125 #define FLD(f) abuf->fields.fmt_empty.f
2126 int UNUSED written
= 0;
2127 IADDR UNUSED pc
= abuf
->addr
;
2129 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2133 SEM_BRANCH_FINI (vpc
);
2138 CASE (sem
, INSN_BC3T
) : /* bc3t $offset */
2140 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2141 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2142 #define FLD(f) abuf->fields.fmt_empty.f
2143 int UNUSED written
= 0;
2144 IADDR UNUSED pc
= abuf
->addr
;
2146 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2150 SEM_BRANCH_FINI (vpc
);
2155 CASE (sem
, INSN_BC3TL
) : /* bc3tl $offset */
2157 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2158 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2159 #define FLD(f) abuf->fields.fmt_empty.f
2160 int UNUSED written
= 0;
2161 IADDR UNUSED pc
= abuf
->addr
;
2163 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2167 SEM_BRANCH_FINI (vpc
);
2172 CASE (sem
, INSN_CFC0
) : /* cfc0 $rt,$rd */
2174 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2175 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2176 #define FLD(f) abuf->fields.fmt_empty.f
2177 int UNUSED written
= 0;
2178 IADDR UNUSED pc
= abuf
->addr
;
2179 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2187 CASE (sem
, INSN_CFC1
) : /* cfc1 $rt,$rd */
2189 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2190 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2191 #define FLD(f) abuf->fields.fmt_empty.f
2192 int UNUSED written
= 0;
2193 IADDR UNUSED pc
= abuf
->addr
;
2194 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2202 CASE (sem
, INSN_CFC2
) : /* cfc2 $rt,$rd */
2204 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2206 #define FLD(f) abuf->fields.fmt_empty.f
2207 int UNUSED written
= 0;
2208 IADDR UNUSED pc
= abuf
->addr
;
2209 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2217 CASE (sem
, INSN_CFC3
) : /* cfc3 $rt,$rd */
2219 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2221 #define FLD(f) abuf->fields.fmt_empty.f
2222 int UNUSED written
= 0;
2223 IADDR UNUSED pc
= abuf
->addr
;
2224 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2232 CASE (sem
, INSN_CHKHDR
) : /* chkhdr $rd,$rt */
2234 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2235 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2236 #define FLD(f) abuf->fields.fmt_empty.f
2237 int UNUSED written
= 0;
2238 IADDR UNUSED pc
= abuf
->addr
;
2239 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2247 CASE (sem
, INSN_CTC0
) : /* ctc0 $rt,$rd */
2249 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2250 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2251 #define FLD(f) abuf->fields.fmt_empty.f
2252 int UNUSED written
= 0;
2253 IADDR UNUSED pc
= abuf
->addr
;
2254 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2262 CASE (sem
, INSN_CTC1
) : /* ctc1 $rt,$rd */
2264 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2265 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2266 #define FLD(f) abuf->fields.fmt_empty.f
2267 int UNUSED written
= 0;
2268 IADDR UNUSED pc
= abuf
->addr
;
2269 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2277 CASE (sem
, INSN_CTC2
) : /* ctc2 $rt,$rd */
2279 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2280 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2281 #define FLD(f) abuf->fields.fmt_empty.f
2282 int UNUSED written
= 0;
2283 IADDR UNUSED pc
= abuf
->addr
;
2284 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2292 CASE (sem
, INSN_CTC3
) : /* ctc3 $rt,$rd */
2294 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2295 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2296 #define FLD(f) abuf->fields.fmt_empty.f
2297 int UNUSED written
= 0;
2298 IADDR UNUSED pc
= abuf
->addr
;
2299 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2307 CASE (sem
, INSN_JCR
) : /* jcr $rs */
2309 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2310 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2311 #define FLD(f) abuf->fields.fmt_empty.f
2312 int UNUSED written
= 0;
2313 IADDR UNUSED pc
= abuf
->addr
;
2315 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2319 SEM_BRANCH_FINI (vpc
);
2324 CASE (sem
, INSN_LUC32
) : /* luc32 $rt,$rd */
2326 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2327 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2328 #define FLD(f) abuf->fields.fmt_empty.f
2329 int UNUSED written
= 0;
2330 IADDR UNUSED pc
= abuf
->addr
;
2331 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2339 CASE (sem
, INSN_LUC32L
) : /* luc32l $rt,$rd */
2341 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2342 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2343 #define FLD(f) abuf->fields.fmt_empty.f
2344 int UNUSED written
= 0;
2345 IADDR UNUSED pc
= abuf
->addr
;
2346 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2354 CASE (sem
, INSN_LUC64
) : /* luc64 $rt,$rd */
2356 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2357 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2358 #define FLD(f) abuf->fields.fmt_empty.f
2359 int UNUSED written
= 0;
2360 IADDR UNUSED pc
= abuf
->addr
;
2361 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2369 CASE (sem
, INSN_LUC64L
) : /* luc64l $rt,$rd */
2371 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2372 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2373 #define FLD(f) abuf->fields.fmt_empty.f
2374 int UNUSED written
= 0;
2375 IADDR UNUSED pc
= abuf
->addr
;
2376 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2384 CASE (sem
, INSN_LUK
) : /* luk $rt,$rd */
2386 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2387 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2388 #define FLD(f) abuf->fields.fmt_empty.f
2389 int UNUSED written
= 0;
2390 IADDR UNUSED pc
= abuf
->addr
;
2391 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2399 CASE (sem
, INSN_LULCK
) : /* lulck $rt */
2401 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2403 #define FLD(f) abuf->fields.fmt_empty.f
2404 int UNUSED written
= 0;
2405 IADDR UNUSED pc
= abuf
->addr
;
2406 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2414 CASE (sem
, INSN_LUM32
) : /* lum32 $rt,$rd */
2416 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2417 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2418 #define FLD(f) abuf->fields.fmt_empty.f
2419 int UNUSED written
= 0;
2420 IADDR UNUSED pc
= abuf
->addr
;
2421 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2429 CASE (sem
, INSN_LUM32L
) : /* lum32l $rt,$rd */
2431 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2432 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2433 #define FLD(f) abuf->fields.fmt_empty.f
2434 int UNUSED written
= 0;
2435 IADDR UNUSED pc
= abuf
->addr
;
2436 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2444 CASE (sem
, INSN_LUM64
) : /* lum64 $rt,$rd */
2446 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2447 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2448 #define FLD(f) abuf->fields.fmt_empty.f
2449 int UNUSED written
= 0;
2450 IADDR UNUSED pc
= abuf
->addr
;
2451 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2459 CASE (sem
, INSN_LUM64L
) : /* lum64l $rt,$rd */
2461 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2462 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2463 #define FLD(f) abuf->fields.fmt_empty.f
2464 int UNUSED written
= 0;
2465 IADDR UNUSED pc
= abuf
->addr
;
2466 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2474 CASE (sem
, INSN_LUR
) : /* lur $rt,$rd */
2476 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2477 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2478 #define FLD(f) abuf->fields.fmt_empty.f
2479 int UNUSED written
= 0;
2480 IADDR UNUSED pc
= abuf
->addr
;
2481 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2489 CASE (sem
, INSN_LURL
) : /* lurl $rt,$rd */
2491 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2492 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2493 #define FLD(f) abuf->fields.fmt_empty.f
2494 int UNUSED written
= 0;
2495 IADDR UNUSED pc
= abuf
->addr
;
2496 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2504 CASE (sem
, INSN_LUULCK
) : /* luulck $rt */
2506 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2508 #define FLD(f) abuf->fields.fmt_empty.f
2509 int UNUSED written
= 0;
2510 IADDR UNUSED pc
= abuf
->addr
;
2511 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2519 CASE (sem
, INSN_MFC0
) : /* mfc0 $rt,$rd */
2521 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2522 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2523 #define FLD(f) abuf->fields.fmt_empty.f
2524 int UNUSED written
= 0;
2525 IADDR UNUSED pc
= abuf
->addr
;
2526 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2534 CASE (sem
, INSN_MFC1
) : /* mfc1 $rt,$rd */
2536 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2537 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2538 #define FLD(f) abuf->fields.fmt_empty.f
2539 int UNUSED written
= 0;
2540 IADDR UNUSED pc
= abuf
->addr
;
2541 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2549 CASE (sem
, INSN_MFC2
) : /* mfc2 $rt,$rd */
2551 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2552 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2553 #define FLD(f) abuf->fields.fmt_empty.f
2554 int UNUSED written
= 0;
2555 IADDR UNUSED pc
= abuf
->addr
;
2556 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2564 CASE (sem
, INSN_MFC3
) : /* mfc3 $rt,$rd */
2566 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2567 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2568 #define FLD(f) abuf->fields.fmt_empty.f
2569 int UNUSED written
= 0;
2570 IADDR UNUSED pc
= abuf
->addr
;
2571 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2579 CASE (sem
, INSN_MTC0
) : /* mtc0 $rt,$rd */
2581 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2582 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2583 #define FLD(f) abuf->fields.fmt_empty.f
2584 int UNUSED written
= 0;
2585 IADDR UNUSED pc
= abuf
->addr
;
2586 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2594 CASE (sem
, INSN_MTC1
) : /* mtc1 $rt,$rd */
2596 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2597 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2598 #define FLD(f) abuf->fields.fmt_empty.f
2599 int UNUSED written
= 0;
2600 IADDR UNUSED pc
= abuf
->addr
;
2601 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2609 CASE (sem
, INSN_MTC2
) : /* mtc2 $rt,$rd */
2611 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2612 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2613 #define FLD(f) abuf->fields.fmt_empty.f
2614 int UNUSED written
= 0;
2615 IADDR UNUSED pc
= abuf
->addr
;
2616 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2624 CASE (sem
, INSN_MTC3
) : /* mtc3 $rt,$rd */
2626 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2628 #define FLD(f) abuf->fields.fmt_empty.f
2629 int UNUSED written
= 0;
2630 IADDR UNUSED pc
= abuf
->addr
;
2631 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2639 CASE (sem
, INSN_PKRL
) : /* pkrl $rd,$rt */
2641 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2642 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2643 #define FLD(f) abuf->fields.fmt_empty.f
2644 int UNUSED written
= 0;
2645 IADDR UNUSED pc
= abuf
->addr
;
2646 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2654 CASE (sem
, INSN_PKRLR1
) : /* pkrlr1 $rt,$index,$count */
2656 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2657 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2658 #define FLD(f) abuf->fields.fmt_empty.f
2659 int UNUSED written
= 0;
2660 IADDR UNUSED pc
= abuf
->addr
;
2661 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2669 CASE (sem
, INSN_PKRLR30
) : /* pkrlr30 $rt,$index,$count */
2671 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2672 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2673 #define FLD(f) abuf->fields.fmt_empty.f
2674 int UNUSED written
= 0;
2675 IADDR UNUSED pc
= abuf
->addr
;
2676 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2684 CASE (sem
, INSN_RB
) : /* rb $rd,$rt */
2686 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2688 #define FLD(f) abuf->fields.fmt_empty.f
2689 int UNUSED written
= 0;
2690 IADDR UNUSED pc
= abuf
->addr
;
2691 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2699 CASE (sem
, INSN_RBR1
) : /* rbr1 $rt,$index,$count */
2701 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2702 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2703 #define FLD(f) abuf->fields.fmt_empty.f
2704 int UNUSED written
= 0;
2705 IADDR UNUSED pc
= abuf
->addr
;
2706 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2714 CASE (sem
, INSN_RBR30
) : /* rbr30 $rt,$index,$count */
2716 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2717 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2718 #define FLD(f) abuf->fields.fmt_empty.f
2719 int UNUSED written
= 0;
2720 IADDR UNUSED pc
= abuf
->addr
;
2721 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2729 CASE (sem
, INSN_RFE
) : /* rfe */
2731 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2732 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2733 #define FLD(f) abuf->fields.fmt_empty.f
2734 int UNUSED written
= 0;
2735 IADDR UNUSED pc
= abuf
->addr
;
2736 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2744 CASE (sem
, INSN_RX
) : /* rx $rd,$rt */
2746 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2747 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2748 #define FLD(f) abuf->fields.fmt_empty.f
2749 int UNUSED written
= 0;
2750 IADDR UNUSED pc
= abuf
->addr
;
2751 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2759 CASE (sem
, INSN_RXR1
) : /* rxr1 $rt,$index,$count */
2761 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2763 #define FLD(f) abuf->fields.fmt_empty.f
2764 int UNUSED written
= 0;
2765 IADDR UNUSED pc
= abuf
->addr
;
2766 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2774 CASE (sem
, INSN_RXR30
) : /* rxr30 $rt,$index,$count */
2776 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2777 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2778 #define FLD(f) abuf->fields.fmt_empty.f
2779 int UNUSED written
= 0;
2780 IADDR UNUSED pc
= abuf
->addr
;
2781 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2789 CASE (sem
, INSN_SLEEP
) : /* sleep */
2791 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2793 #define FLD(f) abuf->fields.fmt_empty.f
2794 int UNUSED written
= 0;
2795 IADDR UNUSED pc
= abuf
->addr
;
2796 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2804 CASE (sem
, INSN_SRRD
) : /* srrd $rt */
2806 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2807 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2808 #define FLD(f) abuf->fields.fmt_empty.f
2809 int UNUSED written
= 0;
2810 IADDR UNUSED pc
= abuf
->addr
;
2811 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2819 CASE (sem
, INSN_SRRDL
) : /* srrdl $rt */
2821 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2823 #define FLD(f) abuf->fields.fmt_empty.f
2824 int UNUSED written
= 0;
2825 IADDR UNUSED pc
= abuf
->addr
;
2826 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2834 CASE (sem
, INSN_SRULCK
) : /* srulck $rt */
2836 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2837 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2838 #define FLD(f) abuf->fields.fmt_empty.f
2839 int UNUSED written
= 0;
2840 IADDR UNUSED pc
= abuf
->addr
;
2841 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2849 CASE (sem
, INSN_SRWR
) : /* srwr $rt,$rd */
2851 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2852 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2853 #define FLD(f) abuf->fields.fmt_empty.f
2854 int UNUSED written
= 0;
2855 IADDR UNUSED pc
= abuf
->addr
;
2856 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2864 CASE (sem
, INSN_SRWRU
) : /* srwru $rt,$rd */
2866 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2867 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2868 #define FLD(f) abuf->fields.fmt_empty.f
2869 int UNUSED written
= 0;
2870 IADDR UNUSED pc
= abuf
->addr
;
2871 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2879 CASE (sem
, INSN_TRAPQFL
) : /* trapqfl */
2881 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2883 #define FLD(f) abuf->fields.fmt_empty.f
2884 int UNUSED written
= 0;
2885 IADDR UNUSED pc
= abuf
->addr
;
2886 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2894 CASE (sem
, INSN_TRAPQNE
) : /* trapqne */
2896 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2898 #define FLD(f) abuf->fields.fmt_empty.f
2899 int UNUSED written
= 0;
2900 IADDR UNUSED pc
= abuf
->addr
;
2901 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2909 CASE (sem
, INSN_TRAPREL
) : /* traprel $rt */
2911 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2912 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2913 #define FLD(f) abuf->fields.fmt_empty.f
2914 int UNUSED written
= 0;
2915 IADDR UNUSED pc
= abuf
->addr
;
2916 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2924 CASE (sem
, INSN_WB
) : /* wb $rd,$rt */
2926 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2927 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2928 #define FLD(f) abuf->fields.fmt_empty.f
2929 int UNUSED written
= 0;
2930 IADDR UNUSED pc
= abuf
->addr
;
2931 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2939 CASE (sem
, INSN_WBU
) : /* wbu $rd,$rt */
2941 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2943 #define FLD(f) abuf->fields.fmt_empty.f
2944 int UNUSED written
= 0;
2945 IADDR UNUSED pc
= abuf
->addr
;
2946 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2954 CASE (sem
, INSN_WBR1
) : /* wbr1 $rt,$index,$count */
2956 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2957 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2958 #define FLD(f) abuf->fields.fmt_empty.f
2959 int UNUSED written
= 0;
2960 IADDR UNUSED pc
= abuf
->addr
;
2961 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2969 CASE (sem
, INSN_WBR1U
) : /* wbr1u $rt,$index,$count */
2971 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2972 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2973 #define FLD(f) abuf->fields.fmt_empty.f
2974 int UNUSED written
= 0;
2975 IADDR UNUSED pc
= abuf
->addr
;
2976 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2984 CASE (sem
, INSN_WBR30
) : /* wbr30 $rt,$index,$count */
2986 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2988 #define FLD(f) abuf->fields.fmt_empty.f
2989 int UNUSED written
= 0;
2990 IADDR UNUSED pc
= abuf
->addr
;
2991 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2999 CASE (sem
, INSN_WBR30U
) : /* wbr30u $rt,$index,$count */
3001 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3002 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3003 #define FLD(f) abuf->fields.fmt_empty.f
3004 int UNUSED written
= 0;
3005 IADDR UNUSED pc
= abuf
->addr
;
3006 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3014 CASE (sem
, INSN_WX
) : /* wx $rd,$rt */
3016 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3017 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3018 #define FLD(f) abuf->fields.fmt_empty.f
3019 int UNUSED written
= 0;
3020 IADDR UNUSED pc
= abuf
->addr
;
3021 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3029 CASE (sem
, INSN_WXU
) : /* wxu $rd,$rt */
3031 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3032 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3033 #define FLD(f) abuf->fields.fmt_empty.f
3034 int UNUSED written
= 0;
3035 IADDR UNUSED pc
= abuf
->addr
;
3036 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3044 CASE (sem
, INSN_WXR1
) : /* wxr1 $rt,$index,$count */
3046 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3048 #define FLD(f) abuf->fields.fmt_empty.f
3049 int UNUSED written
= 0;
3050 IADDR UNUSED pc
= abuf
->addr
;
3051 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3059 CASE (sem
, INSN_WXR1U
) : /* wxr1u $rt,$index,$count */
3061 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3062 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3063 #define FLD(f) abuf->fields.fmt_empty.f
3064 int UNUSED written
= 0;
3065 IADDR UNUSED pc
= abuf
->addr
;
3066 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3074 CASE (sem
, INSN_WXR30
) : /* wxr30 $rt,$index,$count */
3076 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3077 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3078 #define FLD(f) abuf->fields.fmt_empty.f
3079 int UNUSED written
= 0;
3080 IADDR UNUSED pc
= abuf
->addr
;
3081 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3089 CASE (sem
, INSN_WXR30U
) : /* wxr30u $rt,$index,$count */
3091 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3092 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3093 #define FLD(f) abuf->fields.fmt_empty.f
3094 int UNUSED written
= 0;
3095 IADDR UNUSED pc
= abuf
->addr
;
3096 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3104 CASE (sem
, INSN_LDW
) : /* ldw $rt,$lo16($base) */
3106 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3108 #define FLD(f) abuf->fields.sfmt_addi.f
3109 int UNUSED written
= 0;
3110 IADDR UNUSED pc
= abuf
->addr
;
3111 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3115 tmp_addr
= ANDSI (ADDSI (GET_H_GR (FLD (f_rs
)), FLD (f_imm
)), INVSI (3));
3117 SI opval
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3118 SET_H_GR (ADDSI (FLD (f_rt
), 1), opval
);
3119 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3122 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (tmp_addr
, 4));
3123 SET_H_GR (FLD (f_rt
), opval
);
3124 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3132 CASE (sem
, INSN_SDW
) : /* sdw $rt,$lo16($base) */
3134 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3135 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3136 #define FLD(f) abuf->fields.sfmt_addi.f
3137 int UNUSED written
= 0;
3138 IADDR UNUSED pc
= abuf
->addr
;
3139 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3143 tmp_addr
= ANDSI (ADDSI (GET_H_GR (FLD (f_rs
)), FLD (f_imm
)), INVSI (3));
3145 SI opval
= GET_H_GR (FLD (f_rt
));
3146 SETMEMSI (current_cpu
, pc
, ADDSI (tmp_addr
, 4), opval
);
3147 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3150 SI opval
= GET_H_GR (ADDSI (FLD (f_rt
), 1));
3151 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3152 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3160 CASE (sem
, INSN_J
) : /* j $jmptarg */
3162 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3163 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3164 #define FLD(f) abuf->fields.sfmt_j.f
3165 int UNUSED written
= 0;
3166 IADDR UNUSED pc
= abuf
->addr
;
3168 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3172 USI opval
= FLD (i_jmptarg
);
3173 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3174 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3178 SEM_BRANCH_FINI (vpc
);
3183 CASE (sem
, INSN_JAL
) : /* jal $jmptarg */
3185 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3186 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3187 #define FLD(f) abuf->fields.sfmt_j.f
3188 int UNUSED written
= 0;
3189 IADDR UNUSED pc
= abuf
->addr
;
3191 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3196 SI opval
= ADDSI (pc
, 8);
3197 SET_H_GR (((UINT
) 31), opval
);
3198 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3201 USI opval
= FLD (i_jmptarg
);
3202 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3203 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3208 SEM_BRANCH_FINI (vpc
);
3213 CASE (sem
, INSN_BMB
) : /* bmb $rs,$rt,$offset */
3215 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
3216 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3217 #define FLD(f) abuf->fields.sfmt_bbi.f
3218 int UNUSED written
= 0;
3219 IADDR UNUSED pc
= abuf
->addr
;
3221 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3226 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 255), ANDSI (GET_H_GR (FLD (f_rt
)), 255))) {
3229 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 65280), ANDSI (GET_H_GR (FLD (f_rt
)), 65280))) {
3232 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 16711680), ANDSI (GET_H_GR (FLD (f_rt
)), 16711680))) {
3235 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000))) {
3241 USI opval
= FLD (i_offset
);
3242 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3243 written
|= (1 << 3);
3244 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3250 abuf
->written
= written
;
3251 SEM_BRANCH_FINI (vpc
);
3258 ENDSWITCH (sem
) /* End of semantic switch. */
3261 /* At this point `vpc' contains the next insn to execute. */
3264 #undef DEFINE_SWITCH
3265 #endif /* DEFINE_SWITCH */