1 /* Simulator instruction semantics for m32rbf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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 { M32RBF_INSN_X_INVALID
, && case_sem_INSN_X_INVALID
},
35 { M32RBF_INSN_X_AFTER
, && case_sem_INSN_X_AFTER
},
36 { M32RBF_INSN_X_BEFORE
, && case_sem_INSN_X_BEFORE
},
37 { M32RBF_INSN_X_CTI_CHAIN
, && case_sem_INSN_X_CTI_CHAIN
},
38 { M32RBF_INSN_X_CHAIN
, && case_sem_INSN_X_CHAIN
},
39 { M32RBF_INSN_X_BEGIN
, && case_sem_INSN_X_BEGIN
},
40 { M32RBF_INSN_ADD
, && case_sem_INSN_ADD
},
41 { M32RBF_INSN_ADD3
, && case_sem_INSN_ADD3
},
42 { M32RBF_INSN_AND
, && case_sem_INSN_AND
},
43 { M32RBF_INSN_AND3
, && case_sem_INSN_AND3
},
44 { M32RBF_INSN_OR
, && case_sem_INSN_OR
},
45 { M32RBF_INSN_OR3
, && case_sem_INSN_OR3
},
46 { M32RBF_INSN_XOR
, && case_sem_INSN_XOR
},
47 { M32RBF_INSN_XOR3
, && case_sem_INSN_XOR3
},
48 { M32RBF_INSN_ADDI
, && case_sem_INSN_ADDI
},
49 { M32RBF_INSN_ADDV
, && case_sem_INSN_ADDV
},
50 { M32RBF_INSN_ADDV3
, && case_sem_INSN_ADDV3
},
51 { M32RBF_INSN_ADDX
, && case_sem_INSN_ADDX
},
52 { M32RBF_INSN_BC8
, && case_sem_INSN_BC8
},
53 { M32RBF_INSN_BC24
, && case_sem_INSN_BC24
},
54 { M32RBF_INSN_BEQ
, && case_sem_INSN_BEQ
},
55 { M32RBF_INSN_BEQZ
, && case_sem_INSN_BEQZ
},
56 { M32RBF_INSN_BGEZ
, && case_sem_INSN_BGEZ
},
57 { M32RBF_INSN_BGTZ
, && case_sem_INSN_BGTZ
},
58 { M32RBF_INSN_BLEZ
, && case_sem_INSN_BLEZ
},
59 { M32RBF_INSN_BLTZ
, && case_sem_INSN_BLTZ
},
60 { M32RBF_INSN_BNEZ
, && case_sem_INSN_BNEZ
},
61 { M32RBF_INSN_BL8
, && case_sem_INSN_BL8
},
62 { M32RBF_INSN_BL24
, && case_sem_INSN_BL24
},
63 { M32RBF_INSN_BNC8
, && case_sem_INSN_BNC8
},
64 { M32RBF_INSN_BNC24
, && case_sem_INSN_BNC24
},
65 { M32RBF_INSN_BNE
, && case_sem_INSN_BNE
},
66 { M32RBF_INSN_BRA8
, && case_sem_INSN_BRA8
},
67 { M32RBF_INSN_BRA24
, && case_sem_INSN_BRA24
},
68 { M32RBF_INSN_CMP
, && case_sem_INSN_CMP
},
69 { M32RBF_INSN_CMPI
, && case_sem_INSN_CMPI
},
70 { M32RBF_INSN_CMPU
, && case_sem_INSN_CMPU
},
71 { M32RBF_INSN_CMPUI
, && case_sem_INSN_CMPUI
},
72 { M32RBF_INSN_DIV
, && case_sem_INSN_DIV
},
73 { M32RBF_INSN_DIVU
, && case_sem_INSN_DIVU
},
74 { M32RBF_INSN_REM
, && case_sem_INSN_REM
},
75 { M32RBF_INSN_REMU
, && case_sem_INSN_REMU
},
76 { M32RBF_INSN_JL
, && case_sem_INSN_JL
},
77 { M32RBF_INSN_JMP
, && case_sem_INSN_JMP
},
78 { M32RBF_INSN_LD
, && case_sem_INSN_LD
},
79 { M32RBF_INSN_LD_D
, && case_sem_INSN_LD_D
},
80 { M32RBF_INSN_LDB
, && case_sem_INSN_LDB
},
81 { M32RBF_INSN_LDB_D
, && case_sem_INSN_LDB_D
},
82 { M32RBF_INSN_LDH
, && case_sem_INSN_LDH
},
83 { M32RBF_INSN_LDH_D
, && case_sem_INSN_LDH_D
},
84 { M32RBF_INSN_LDUB
, && case_sem_INSN_LDUB
},
85 { M32RBF_INSN_LDUB_D
, && case_sem_INSN_LDUB_D
},
86 { M32RBF_INSN_LDUH
, && case_sem_INSN_LDUH
},
87 { M32RBF_INSN_LDUH_D
, && case_sem_INSN_LDUH_D
},
88 { M32RBF_INSN_LD_PLUS
, && case_sem_INSN_LD_PLUS
},
89 { M32RBF_INSN_LD24
, && case_sem_INSN_LD24
},
90 { M32RBF_INSN_LDI8
, && case_sem_INSN_LDI8
},
91 { M32RBF_INSN_LDI16
, && case_sem_INSN_LDI16
},
92 { M32RBF_INSN_LOCK
, && case_sem_INSN_LOCK
},
93 { M32RBF_INSN_MACHI
, && case_sem_INSN_MACHI
},
94 { M32RBF_INSN_MACLO
, && case_sem_INSN_MACLO
},
95 { M32RBF_INSN_MACWHI
, && case_sem_INSN_MACWHI
},
96 { M32RBF_INSN_MACWLO
, && case_sem_INSN_MACWLO
},
97 { M32RBF_INSN_MUL
, && case_sem_INSN_MUL
},
98 { M32RBF_INSN_MULHI
, && case_sem_INSN_MULHI
},
99 { M32RBF_INSN_MULLO
, && case_sem_INSN_MULLO
},
100 { M32RBF_INSN_MULWHI
, && case_sem_INSN_MULWHI
},
101 { M32RBF_INSN_MULWLO
, && case_sem_INSN_MULWLO
},
102 { M32RBF_INSN_MV
, && case_sem_INSN_MV
},
103 { M32RBF_INSN_MVFACHI
, && case_sem_INSN_MVFACHI
},
104 { M32RBF_INSN_MVFACLO
, && case_sem_INSN_MVFACLO
},
105 { M32RBF_INSN_MVFACMI
, && case_sem_INSN_MVFACMI
},
106 { M32RBF_INSN_MVFC
, && case_sem_INSN_MVFC
},
107 { M32RBF_INSN_MVTACHI
, && case_sem_INSN_MVTACHI
},
108 { M32RBF_INSN_MVTACLO
, && case_sem_INSN_MVTACLO
},
109 { M32RBF_INSN_MVTC
, && case_sem_INSN_MVTC
},
110 { M32RBF_INSN_NEG
, && case_sem_INSN_NEG
},
111 { M32RBF_INSN_NOP
, && case_sem_INSN_NOP
},
112 { M32RBF_INSN_NOT
, && case_sem_INSN_NOT
},
113 { M32RBF_INSN_RAC
, && case_sem_INSN_RAC
},
114 { M32RBF_INSN_RACH
, && case_sem_INSN_RACH
},
115 { M32RBF_INSN_RTE
, && case_sem_INSN_RTE
},
116 { M32RBF_INSN_SETH
, && case_sem_INSN_SETH
},
117 { M32RBF_INSN_SLL
, && case_sem_INSN_SLL
},
118 { M32RBF_INSN_SLL3
, && case_sem_INSN_SLL3
},
119 { M32RBF_INSN_SLLI
, && case_sem_INSN_SLLI
},
120 { M32RBF_INSN_SRA
, && case_sem_INSN_SRA
},
121 { M32RBF_INSN_SRA3
, && case_sem_INSN_SRA3
},
122 { M32RBF_INSN_SRAI
, && case_sem_INSN_SRAI
},
123 { M32RBF_INSN_SRL
, && case_sem_INSN_SRL
},
124 { M32RBF_INSN_SRL3
, && case_sem_INSN_SRL3
},
125 { M32RBF_INSN_SRLI
, && case_sem_INSN_SRLI
},
126 { M32RBF_INSN_ST
, && case_sem_INSN_ST
},
127 { M32RBF_INSN_ST_D
, && case_sem_INSN_ST_D
},
128 { M32RBF_INSN_STB
, && case_sem_INSN_STB
},
129 { M32RBF_INSN_STB_D
, && case_sem_INSN_STB_D
},
130 { M32RBF_INSN_STH
, && case_sem_INSN_STH
},
131 { M32RBF_INSN_STH_D
, && case_sem_INSN_STH_D
},
132 { M32RBF_INSN_ST_PLUS
, && case_sem_INSN_ST_PLUS
},
133 { M32RBF_INSN_ST_MINUS
, && case_sem_INSN_ST_MINUS
},
134 { M32RBF_INSN_SUB
, && case_sem_INSN_SUB
},
135 { M32RBF_INSN_SUBV
, && case_sem_INSN_SUBV
},
136 { M32RBF_INSN_SUBX
, && case_sem_INSN_SUBX
},
137 { M32RBF_INSN_TRAP
, && case_sem_INSN_TRAP
},
138 { M32RBF_INSN_UNLOCK
, && case_sem_INSN_UNLOCK
},
139 { M32RBF_INSN_CLRPSW
, && case_sem_INSN_CLRPSW
},
140 { M32RBF_INSN_SETPSW
, && case_sem_INSN_SETPSW
},
141 { M32RBF_INSN_BSET
, && case_sem_INSN_BSET
},
142 { M32RBF_INSN_BCLR
, && case_sem_INSN_BCLR
},
143 { M32RBF_INSN_BTST
, && case_sem_INSN_BTST
},
148 for (i
= 0; labels
[i
].label
!= 0; ++i
)
151 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_fast_lab
= labels
[i
].label
;
153 CPU_IDESC (current_cpu
) [labels
[i
].index
].sem_full_lab
= labels
[i
].label
;
158 #endif /* DEFINE_LABELS */
162 /* If hyper-fast [well not unnecessarily slow] execution is selected, turn
163 off frills like tracing and profiling. */
164 /* FIXME: A better way would be to have TRACE_RESULT check for something
165 that can cause it to be optimized out. Another way would be to emit
166 special handlers into the instruction "stream". */
170 #define TRACE_RESULT(cpu, abuf, name, type, val)
174 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
175 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
177 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
184 /* Branch to next handler without going around main loop. */
185 #define NEXT(vpc) goto * SEM_ARGBUF (vpc) -> semantic.sem_case
186 SWITCH (sem
, SEM_ARGBUF (vpc
) -> semantic
.sem_case
)
188 #else /* ! WITH_SCACHE_PBB */
190 #define NEXT(vpc) BREAK (sem)
193 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_fast_lab
)
195 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->sem_full_lab
)
198 SWITCH (sem
, SEM_ARGBUF (sc
) -> idesc
->num
)
201 #endif /* ! WITH_SCACHE_PBB */
205 CASE (sem
, INSN_X_INVALID
) : /* --invalid-- */
207 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
208 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
209 #define FLD(f) abuf->fields.fmt_empty.f
210 int UNUSED written
= 0;
211 IADDR UNUSED pc
= abuf
->addr
;
212 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
215 /* Update the recorded pc in the cpu state struct.
216 Only necessary for WITH_SCACHE case, but to avoid the
217 conditional compilation .... */
219 /* Virtual insns have zero size. Overwrite vpc with address of next insn
220 using the default-insn-bitsize spec. When executing insns in parallel
221 we may want to queue the fault and continue execution. */
222 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
223 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
230 CASE (sem
, INSN_X_AFTER
) : /* --after-- */
232 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
233 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
234 #define FLD(f) abuf->fields.fmt_empty.f
235 int UNUSED written
= 0;
236 IADDR UNUSED pc
= abuf
->addr
;
237 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
240 #if WITH_SCACHE_PBB_M32RBF
241 m32rbf_pbb_after (current_cpu
, sem_arg
);
249 CASE (sem
, INSN_X_BEFORE
) : /* --before-- */
251 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
252 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
253 #define FLD(f) abuf->fields.fmt_empty.f
254 int UNUSED written
= 0;
255 IADDR UNUSED pc
= abuf
->addr
;
256 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
259 #if WITH_SCACHE_PBB_M32RBF
260 m32rbf_pbb_before (current_cpu
, sem_arg
);
268 CASE (sem
, INSN_X_CTI_CHAIN
) : /* --cti-chain-- */
270 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
271 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
272 #define FLD(f) abuf->fields.fmt_empty.f
273 int UNUSED written
= 0;
274 IADDR UNUSED pc
= abuf
->addr
;
275 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
278 #if WITH_SCACHE_PBB_M32RBF
280 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
281 pbb_br_type
, pbb_br_npc
);
284 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
285 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
286 CPU_PBB_BR_TYPE (current_cpu
),
287 CPU_PBB_BR_NPC (current_cpu
));
296 CASE (sem
, INSN_X_CHAIN
) : /* --chain-- */
298 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
299 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
300 #define FLD(f) abuf->fields.fmt_empty.f
301 int UNUSED written
= 0;
302 IADDR UNUSED pc
= abuf
->addr
;
303 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
306 #if WITH_SCACHE_PBB_M32RBF
307 vpc
= m32rbf_pbb_chain (current_cpu
, sem_arg
);
318 CASE (sem
, INSN_X_BEGIN
) : /* --begin-- */
320 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
321 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
322 #define FLD(f) abuf->fields.fmt_empty.f
323 int UNUSED written
= 0;
324 IADDR UNUSED pc
= abuf
->addr
;
325 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
328 #if WITH_SCACHE_PBB_M32RBF
329 #if defined DEFINE_SWITCH || defined FAST_P
330 /* In the switch case FAST_P is a constant, allowing several optimizations
331 in any called inline functions. */
332 vpc
= m32rbf_pbb_begin (current_cpu
, FAST_P
);
334 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
335 vpc
= m32rbf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
337 vpc
= m32rbf_pbb_begin (current_cpu
, 0);
347 CASE (sem
, INSN_ADD
) : /* add $dr,$sr */
349 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
350 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
351 #define FLD(f) abuf->fields.sfmt_add.f
352 int UNUSED written
= 0;
353 IADDR UNUSED pc
= abuf
->addr
;
354 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
357 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
358 * FLD (i_dr
) = opval
;
359 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
366 CASE (sem
, INSN_ADD3
) : /* add3 $dr,$sr,$hash$slo16 */
368 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
369 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
370 #define FLD(f) abuf->fields.sfmt_add3.f
371 int UNUSED written
= 0;
372 IADDR UNUSED pc
= abuf
->addr
;
373 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
376 SI opval
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
377 * FLD (i_dr
) = opval
;
378 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
385 CASE (sem
, INSN_AND
) : /* and $dr,$sr */
387 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
388 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
389 #define FLD(f) abuf->fields.sfmt_add.f
390 int UNUSED written
= 0;
391 IADDR UNUSED pc
= abuf
->addr
;
392 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
395 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
396 * FLD (i_dr
) = opval
;
397 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
404 CASE (sem
, INSN_AND3
) : /* and3 $dr,$sr,$uimm16 */
406 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
408 #define FLD(f) abuf->fields.sfmt_and3.f
409 int UNUSED written
= 0;
410 IADDR UNUSED pc
= abuf
->addr
;
411 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
414 SI opval
= ANDSI (* FLD (i_sr
), FLD (f_uimm16
));
415 * FLD (i_dr
) = opval
;
416 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
423 CASE (sem
, INSN_OR
) : /* or $dr,$sr */
425 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
426 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
427 #define FLD(f) abuf->fields.sfmt_add.f
428 int UNUSED written
= 0;
429 IADDR UNUSED pc
= abuf
->addr
;
430 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
433 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
434 * FLD (i_dr
) = opval
;
435 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
442 CASE (sem
, INSN_OR3
) : /* or3 $dr,$sr,$hash$ulo16 */
444 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
445 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
446 #define FLD(f) abuf->fields.sfmt_and3.f
447 int UNUSED written
= 0;
448 IADDR UNUSED pc
= abuf
->addr
;
449 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
452 SI opval
= ORSI (* FLD (i_sr
), FLD (f_uimm16
));
453 * FLD (i_dr
) = opval
;
454 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
461 CASE (sem
, INSN_XOR
) : /* xor $dr,$sr */
463 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
464 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
465 #define FLD(f) abuf->fields.sfmt_add.f
466 int UNUSED written
= 0;
467 IADDR UNUSED pc
= abuf
->addr
;
468 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
471 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
472 * FLD (i_dr
) = opval
;
473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
480 CASE (sem
, INSN_XOR3
) : /* xor3 $dr,$sr,$uimm16 */
482 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
483 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
484 #define FLD(f) abuf->fields.sfmt_and3.f
485 int UNUSED written
= 0;
486 IADDR UNUSED pc
= abuf
->addr
;
487 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
490 SI opval
= XORSI (* FLD (i_sr
), FLD (f_uimm16
));
491 * FLD (i_dr
) = opval
;
492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
499 CASE (sem
, INSN_ADDI
) : /* addi $dr,$simm8 */
501 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
502 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
503 #define FLD(f) abuf->fields.sfmt_addi.f
504 int UNUSED written
= 0;
505 IADDR UNUSED pc
= abuf
->addr
;
506 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
509 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
510 * FLD (i_dr
) = opval
;
511 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
518 CASE (sem
, INSN_ADDV
) : /* addv $dr,$sr */
520 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
521 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
522 #define FLD(f) abuf->fields.sfmt_add.f
523 int UNUSED written
= 0;
524 IADDR UNUSED pc
= abuf
->addr
;
525 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
529 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
530 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
533 * FLD (i_dr
) = opval
;
534 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
538 CPU (h_cond
) = opval
;
539 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
547 CASE (sem
, INSN_ADDV3
) : /* addv3 $dr,$sr,$simm16 */
549 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
550 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
551 #define FLD(f) abuf->fields.sfmt_add3.f
552 int UNUSED written
= 0;
553 IADDR UNUSED pc
= abuf
->addr
;
554 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
558 temp0
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
559 temp1
= ADDOFSI (* FLD (i_sr
), FLD (f_simm16
), 0);
562 * FLD (i_dr
) = opval
;
563 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
567 CPU (h_cond
) = opval
;
568 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
576 CASE (sem
, INSN_ADDX
) : /* addx $dr,$sr */
578 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
579 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
580 #define FLD(f) abuf->fields.sfmt_add.f
581 int UNUSED written
= 0;
582 IADDR UNUSED pc
= abuf
->addr
;
583 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
587 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
588 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
591 * FLD (i_dr
) = opval
;
592 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
596 CPU (h_cond
) = opval
;
597 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
605 CASE (sem
, INSN_BC8
) : /* bc.s $disp8 */
607 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
608 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
609 #define FLD(f) abuf->fields.sfmt_bl8.f
610 int UNUSED written
= 0;
611 IADDR UNUSED pc
= abuf
->addr
;
613 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
617 USI opval
= FLD (i_disp8
);
618 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
620 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
624 abuf
->written
= written
;
625 SEM_BRANCH_FINI (vpc
);
630 CASE (sem
, INSN_BC24
) : /* bc.l $disp24 */
632 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
633 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
634 #define FLD(f) abuf->fields.sfmt_bl24.f
635 int UNUSED written
= 0;
636 IADDR UNUSED pc
= abuf
->addr
;
638 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
642 USI opval
= FLD (i_disp24
);
643 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
645 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
649 abuf
->written
= written
;
650 SEM_BRANCH_FINI (vpc
);
655 CASE (sem
, INSN_BEQ
) : /* beq $src1,$src2,$disp16 */
657 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
658 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
659 #define FLD(f) abuf->fields.sfmt_beq.f
660 int UNUSED written
= 0;
661 IADDR UNUSED pc
= abuf
->addr
;
663 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
665 if (EQSI (* FLD (i_src1
), * FLD (i_src2
))) {
667 USI opval
= FLD (i_disp16
);
668 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
670 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
674 abuf
->written
= written
;
675 SEM_BRANCH_FINI (vpc
);
680 CASE (sem
, INSN_BEQZ
) : /* beqz $src2,$disp16 */
682 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
683 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
684 #define FLD(f) abuf->fields.sfmt_beq.f
685 int UNUSED written
= 0;
686 IADDR UNUSED pc
= abuf
->addr
;
688 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
690 if (EQSI (* FLD (i_src2
), 0)) {
692 USI opval
= FLD (i_disp16
);
693 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
695 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
699 abuf
->written
= written
;
700 SEM_BRANCH_FINI (vpc
);
705 CASE (sem
, INSN_BGEZ
) : /* bgez $src2,$disp16 */
707 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
708 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
709 #define FLD(f) abuf->fields.sfmt_beq.f
710 int UNUSED written
= 0;
711 IADDR UNUSED pc
= abuf
->addr
;
713 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
715 if (GESI (* FLD (i_src2
), 0)) {
717 USI opval
= FLD (i_disp16
);
718 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
720 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
724 abuf
->written
= written
;
725 SEM_BRANCH_FINI (vpc
);
730 CASE (sem
, INSN_BGTZ
) : /* bgtz $src2,$disp16 */
732 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
733 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
734 #define FLD(f) abuf->fields.sfmt_beq.f
735 int UNUSED written
= 0;
736 IADDR UNUSED pc
= abuf
->addr
;
738 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
740 if (GTSI (* FLD (i_src2
), 0)) {
742 USI opval
= FLD (i_disp16
);
743 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
745 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
749 abuf
->written
= written
;
750 SEM_BRANCH_FINI (vpc
);
755 CASE (sem
, INSN_BLEZ
) : /* blez $src2,$disp16 */
757 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
759 #define FLD(f) abuf->fields.sfmt_beq.f
760 int UNUSED written
= 0;
761 IADDR UNUSED pc
= abuf
->addr
;
763 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
765 if (LESI (* FLD (i_src2
), 0)) {
767 USI opval
= FLD (i_disp16
);
768 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
770 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
774 abuf
->written
= written
;
775 SEM_BRANCH_FINI (vpc
);
780 CASE (sem
, INSN_BLTZ
) : /* bltz $src2,$disp16 */
782 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
784 #define FLD(f) abuf->fields.sfmt_beq.f
785 int UNUSED written
= 0;
786 IADDR UNUSED pc
= abuf
->addr
;
788 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
790 if (LTSI (* FLD (i_src2
), 0)) {
792 USI opval
= FLD (i_disp16
);
793 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
795 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
799 abuf
->written
= written
;
800 SEM_BRANCH_FINI (vpc
);
805 CASE (sem
, INSN_BNEZ
) : /* bnez $src2,$disp16 */
807 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
808 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
809 #define FLD(f) abuf->fields.sfmt_beq.f
810 int UNUSED written
= 0;
811 IADDR UNUSED pc
= abuf
->addr
;
813 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
815 if (NESI (* FLD (i_src2
), 0)) {
817 USI opval
= FLD (i_disp16
);
818 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
820 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
824 abuf
->written
= written
;
825 SEM_BRANCH_FINI (vpc
);
830 CASE (sem
, INSN_BL8
) : /* bl.s $disp8 */
832 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
833 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
834 #define FLD(f) abuf->fields.sfmt_bl8.f
835 int UNUSED written
= 0;
836 IADDR UNUSED pc
= abuf
->addr
;
838 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
842 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
843 CPU (h_gr
[((UINT
) 14)]) = opval
;
844 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
847 USI opval
= FLD (i_disp8
);
848 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
849 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
853 SEM_BRANCH_FINI (vpc
);
858 CASE (sem
, INSN_BL24
) : /* bl.l $disp24 */
860 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
861 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
862 #define FLD(f) abuf->fields.sfmt_bl24.f
863 int UNUSED written
= 0;
864 IADDR UNUSED pc
= abuf
->addr
;
866 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
870 SI opval
= ADDSI (pc
, 4);
871 CPU (h_gr
[((UINT
) 14)]) = opval
;
872 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
875 USI opval
= FLD (i_disp24
);
876 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
877 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
881 SEM_BRANCH_FINI (vpc
);
886 CASE (sem
, INSN_BNC8
) : /* bnc.s $disp8 */
888 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
889 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
890 #define FLD(f) abuf->fields.sfmt_bl8.f
891 int UNUSED written
= 0;
892 IADDR UNUSED pc
= abuf
->addr
;
894 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
896 if (NOTBI (CPU (h_cond
))) {
898 USI opval
= FLD (i_disp8
);
899 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
901 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
905 abuf
->written
= written
;
906 SEM_BRANCH_FINI (vpc
);
911 CASE (sem
, INSN_BNC24
) : /* bnc.l $disp24 */
913 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
915 #define FLD(f) abuf->fields.sfmt_bl24.f
916 int UNUSED written
= 0;
917 IADDR UNUSED pc
= abuf
->addr
;
919 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
921 if (NOTBI (CPU (h_cond
))) {
923 USI opval
= FLD (i_disp24
);
924 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
926 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
930 abuf
->written
= written
;
931 SEM_BRANCH_FINI (vpc
);
936 CASE (sem
, INSN_BNE
) : /* bne $src1,$src2,$disp16 */
938 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
939 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
940 #define FLD(f) abuf->fields.sfmt_beq.f
941 int UNUSED written
= 0;
942 IADDR UNUSED pc
= abuf
->addr
;
944 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
946 if (NESI (* FLD (i_src1
), * FLD (i_src2
))) {
948 USI opval
= FLD (i_disp16
);
949 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
951 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
955 abuf
->written
= written
;
956 SEM_BRANCH_FINI (vpc
);
961 CASE (sem
, INSN_BRA8
) : /* bra.s $disp8 */
963 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
964 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
965 #define FLD(f) abuf->fields.sfmt_bl8.f
966 int UNUSED written
= 0;
967 IADDR UNUSED pc
= abuf
->addr
;
969 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
972 USI opval
= FLD (i_disp8
);
973 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
974 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
977 SEM_BRANCH_FINI (vpc
);
982 CASE (sem
, INSN_BRA24
) : /* bra.l $disp24 */
984 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
985 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
986 #define FLD(f) abuf->fields.sfmt_bl24.f
987 int UNUSED written
= 0;
988 IADDR UNUSED pc
= abuf
->addr
;
990 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
993 USI opval
= FLD (i_disp24
);
994 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
995 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
998 SEM_BRANCH_FINI (vpc
);
1003 CASE (sem
, INSN_CMP
) : /* cmp $src1,$src2 */
1005 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1006 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1007 #define FLD(f) abuf->fields.sfmt_st_plus.f
1008 int UNUSED written
= 0;
1009 IADDR UNUSED pc
= abuf
->addr
;
1010 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1013 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
1014 CPU (h_cond
) = opval
;
1015 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1022 CASE (sem
, INSN_CMPI
) : /* cmpi $src2,$simm16 */
1024 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1025 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1026 #define FLD(f) abuf->fields.sfmt_st_d.f
1027 int UNUSED written
= 0;
1028 IADDR UNUSED pc
= abuf
->addr
;
1029 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1032 BI opval
= LTSI (* FLD (i_src2
), FLD (f_simm16
));
1033 CPU (h_cond
) = opval
;
1034 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1041 CASE (sem
, INSN_CMPU
) : /* cmpu $src1,$src2 */
1043 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1044 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1045 #define FLD(f) abuf->fields.sfmt_st_plus.f
1046 int UNUSED written
= 0;
1047 IADDR UNUSED pc
= abuf
->addr
;
1048 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1051 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
1052 CPU (h_cond
) = opval
;
1053 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1060 CASE (sem
, INSN_CMPUI
) : /* cmpui $src2,$simm16 */
1062 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1063 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1064 #define FLD(f) abuf->fields.sfmt_st_d.f
1065 int UNUSED written
= 0;
1066 IADDR UNUSED pc
= abuf
->addr
;
1067 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1070 BI opval
= LTUSI (* FLD (i_src2
), FLD (f_simm16
));
1071 CPU (h_cond
) = opval
;
1072 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
1079 CASE (sem
, INSN_DIV
) : /* div $dr,$sr */
1081 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1082 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1083 #define FLD(f) abuf->fields.sfmt_add.f
1084 int UNUSED written
= 0;
1085 IADDR UNUSED pc
= abuf
->addr
;
1086 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1088 if (NESI (* FLD (i_sr
), 0)) {
1090 SI opval
= DIVSI (* FLD (i_dr
), * FLD (i_sr
));
1091 * FLD (i_dr
) = opval
;
1092 written
|= (1 << 2);
1093 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1097 abuf
->written
= written
;
1102 CASE (sem
, INSN_DIVU
) : /* divu $dr,$sr */
1104 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1105 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1106 #define FLD(f) abuf->fields.sfmt_add.f
1107 int UNUSED written
= 0;
1108 IADDR UNUSED pc
= abuf
->addr
;
1109 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1111 if (NESI (* FLD (i_sr
), 0)) {
1113 SI opval
= UDIVSI (* FLD (i_dr
), * FLD (i_sr
));
1114 * FLD (i_dr
) = opval
;
1115 written
|= (1 << 2);
1116 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1120 abuf
->written
= written
;
1125 CASE (sem
, INSN_REM
) : /* rem $dr,$sr */
1127 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1128 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1129 #define FLD(f) abuf->fields.sfmt_add.f
1130 int UNUSED written
= 0;
1131 IADDR UNUSED pc
= abuf
->addr
;
1132 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1134 if (NESI (* FLD (i_sr
), 0)) {
1136 SI opval
= MODSI (* FLD (i_dr
), * FLD (i_sr
));
1137 * FLD (i_dr
) = opval
;
1138 written
|= (1 << 2);
1139 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1143 abuf
->written
= written
;
1148 CASE (sem
, INSN_REMU
) : /* remu $dr,$sr */
1150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1152 #define FLD(f) abuf->fields.sfmt_add.f
1153 int UNUSED written
= 0;
1154 IADDR UNUSED pc
= abuf
->addr
;
1155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1157 if (NESI (* FLD (i_sr
), 0)) {
1159 SI opval
= UMODSI (* FLD (i_dr
), * FLD (i_sr
));
1160 * FLD (i_dr
) = opval
;
1161 written
|= (1 << 2);
1162 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1166 abuf
->written
= written
;
1171 CASE (sem
, INSN_JL
) : /* jl $sr */
1173 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1175 #define FLD(f) abuf->fields.sfmt_jl.f
1176 int UNUSED written
= 0;
1177 IADDR UNUSED pc
= abuf
->addr
;
1179 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1183 temp0
= ADDSI (ANDSI (pc
, -4), 4);
1184 temp1
= ANDSI (* FLD (i_sr
), -4);
1187 CPU (h_gr
[((UINT
) 14)]) = opval
;
1188 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1192 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1193 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1197 SEM_BRANCH_FINI (vpc
);
1202 CASE (sem
, INSN_JMP
) : /* jmp $sr */
1204 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1206 #define FLD(f) abuf->fields.sfmt_jl.f
1207 int UNUSED written
= 0;
1208 IADDR UNUSED pc
= abuf
->addr
;
1210 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1213 USI opval
= ANDSI (* FLD (i_sr
), -4);
1214 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1215 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1218 SEM_BRANCH_FINI (vpc
);
1223 CASE (sem
, INSN_LD
) : /* ld $dr,@$sr */
1225 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1227 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1228 int UNUSED written
= 0;
1229 IADDR UNUSED pc
= abuf
->addr
;
1230 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1233 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1234 * FLD (i_dr
) = opval
;
1235 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1242 CASE (sem
, INSN_LD_D
) : /* ld $dr,@($slo16,$sr) */
1244 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1245 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1246 #define FLD(f) abuf->fields.sfmt_add3.f
1247 int UNUSED written
= 0;
1248 IADDR UNUSED pc
= abuf
->addr
;
1249 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1252 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)));
1253 * FLD (i_dr
) = opval
;
1254 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1261 CASE (sem
, INSN_LDB
) : /* ldb $dr,@$sr */
1263 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1264 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1265 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1266 int UNUSED written
= 0;
1267 IADDR UNUSED pc
= abuf
->addr
;
1268 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1271 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1272 * FLD (i_dr
) = opval
;
1273 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1280 CASE (sem
, INSN_LDB_D
) : /* ldb $dr,@($slo16,$sr) */
1282 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1283 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1284 #define FLD(f) abuf->fields.sfmt_add3.f
1285 int UNUSED written
= 0;
1286 IADDR UNUSED pc
= abuf
->addr
;
1287 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1290 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1291 * FLD (i_dr
) = opval
;
1292 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1299 CASE (sem
, INSN_LDH
) : /* ldh $dr,@$sr */
1301 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1302 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1303 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1304 int UNUSED written
= 0;
1305 IADDR UNUSED pc
= abuf
->addr
;
1306 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1309 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1310 * FLD (i_dr
) = opval
;
1311 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1318 CASE (sem
, INSN_LDH_D
) : /* ldh $dr,@($slo16,$sr) */
1320 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1321 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1322 #define FLD(f) abuf->fields.sfmt_add3.f
1323 int UNUSED written
= 0;
1324 IADDR UNUSED pc
= abuf
->addr
;
1325 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1328 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1329 * FLD (i_dr
) = opval
;
1330 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1337 CASE (sem
, INSN_LDUB
) : /* ldub $dr,@$sr */
1339 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1340 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1341 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1342 int UNUSED written
= 0;
1343 IADDR UNUSED pc
= abuf
->addr
;
1344 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1347 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1348 * FLD (i_dr
) = opval
;
1349 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1356 CASE (sem
, INSN_LDUB_D
) : /* ldub $dr,@($slo16,$sr) */
1358 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1359 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1360 #define FLD(f) abuf->fields.sfmt_add3.f
1361 int UNUSED written
= 0;
1362 IADDR UNUSED pc
= abuf
->addr
;
1363 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1366 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1367 * FLD (i_dr
) = opval
;
1368 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1375 CASE (sem
, INSN_LDUH
) : /* lduh $dr,@$sr */
1377 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1379 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1380 int UNUSED written
= 0;
1381 IADDR UNUSED pc
= abuf
->addr
;
1382 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1385 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1386 * FLD (i_dr
) = opval
;
1387 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1394 CASE (sem
, INSN_LDUH_D
) : /* lduh $dr,@($slo16,$sr) */
1396 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1398 #define FLD(f) abuf->fields.sfmt_add3.f
1399 int UNUSED written
= 0;
1400 IADDR UNUSED pc
= abuf
->addr
;
1401 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1404 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1405 * FLD (i_dr
) = opval
;
1406 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1413 CASE (sem
, INSN_LD_PLUS
) : /* ld $dr,@$sr+ */
1415 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1417 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1418 int UNUSED written
= 0;
1419 IADDR UNUSED pc
= abuf
->addr
;
1420 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1424 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1425 temp1
= ADDSI (* FLD (i_sr
), 4);
1428 * FLD (i_dr
) = opval
;
1429 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1433 * FLD (i_sr
) = opval
;
1434 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1442 CASE (sem
, INSN_LD24
) : /* ld24 $dr,$uimm24 */
1444 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1445 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1446 #define FLD(f) abuf->fields.sfmt_ld24.f
1447 int UNUSED written
= 0;
1448 IADDR UNUSED pc
= abuf
->addr
;
1449 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1452 SI opval
= FLD (i_uimm24
);
1453 * FLD (i_dr
) = opval
;
1454 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1461 CASE (sem
, INSN_LDI8
) : /* ldi8 $dr,$simm8 */
1463 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1464 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1465 #define FLD(f) abuf->fields.sfmt_addi.f
1466 int UNUSED written
= 0;
1467 IADDR UNUSED pc
= abuf
->addr
;
1468 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1471 SI opval
= FLD (f_simm8
);
1472 * FLD (i_dr
) = opval
;
1473 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1480 CASE (sem
, INSN_LDI16
) : /* ldi16 $dr,$hash$slo16 */
1482 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1483 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1484 #define FLD(f) abuf->fields.sfmt_add3.f
1485 int UNUSED written
= 0;
1486 IADDR UNUSED pc
= abuf
->addr
;
1487 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1490 SI opval
= FLD (f_simm16
);
1491 * FLD (i_dr
) = opval
;
1492 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1499 CASE (sem
, INSN_LOCK
) : /* lock $dr,@$sr */
1501 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1502 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1503 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1504 int UNUSED written
= 0;
1505 IADDR UNUSED pc
= abuf
->addr
;
1506 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1511 CPU (h_lock
) = opval
;
1512 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
1515 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1516 * FLD (i_dr
) = opval
;
1517 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1525 CASE (sem
, INSN_MACHI
) : /* machi $src1,$src2 */
1527 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1528 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1529 #define FLD(f) abuf->fields.sfmt_st_plus.f
1530 int UNUSED written
= 0;
1531 IADDR UNUSED pc
= abuf
->addr
;
1532 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1535 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1536 SET_H_ACCUM (opval
);
1537 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1544 CASE (sem
, INSN_MACLO
) : /* maclo $src1,$src2 */
1546 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1547 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1548 #define FLD(f) abuf->fields.sfmt_st_plus.f
1549 int UNUSED written
= 0;
1550 IADDR UNUSED pc
= abuf
->addr
;
1551 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1554 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1555 SET_H_ACCUM (opval
);
1556 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1563 CASE (sem
, INSN_MACWHI
) : /* macwhi $src1,$src2 */
1565 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1566 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1567 #define FLD(f) abuf->fields.sfmt_st_plus.f
1568 int UNUSED written
= 0;
1569 IADDR UNUSED pc
= abuf
->addr
;
1570 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1573 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1574 SET_H_ACCUM (opval
);
1575 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1582 CASE (sem
, INSN_MACWLO
) : /* macwlo $src1,$src2 */
1584 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1586 #define FLD(f) abuf->fields.sfmt_st_plus.f
1587 int UNUSED written
= 0;
1588 IADDR UNUSED pc
= abuf
->addr
;
1589 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1592 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1593 SET_H_ACCUM (opval
);
1594 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1601 CASE (sem
, INSN_MUL
) : /* mul $dr,$sr */
1603 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1605 #define FLD(f) abuf->fields.sfmt_add.f
1606 int UNUSED written
= 0;
1607 IADDR UNUSED pc
= abuf
->addr
;
1608 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1611 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
1612 * FLD (i_dr
) = opval
;
1613 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1620 CASE (sem
, INSN_MULHI
) : /* mulhi $src1,$src2 */
1622 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1623 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1624 #define FLD(f) abuf->fields.sfmt_st_plus.f
1625 int UNUSED written
= 0;
1626 IADDR UNUSED pc
= abuf
->addr
;
1627 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1630 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
1631 SET_H_ACCUM (opval
);
1632 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1639 CASE (sem
, INSN_MULLO
) : /* mullo $src1,$src2 */
1641 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1642 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1643 #define FLD(f) abuf->fields.sfmt_st_plus.f
1644 int UNUSED written
= 0;
1645 IADDR UNUSED pc
= abuf
->addr
;
1646 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1649 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
1650 SET_H_ACCUM (opval
);
1651 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1658 CASE (sem
, INSN_MULWHI
) : /* mulwhi $src1,$src2 */
1660 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1661 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1662 #define FLD(f) abuf->fields.sfmt_st_plus.f
1663 int UNUSED written
= 0;
1664 IADDR UNUSED pc
= abuf
->addr
;
1665 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1668 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 8), 8);
1669 SET_H_ACCUM (opval
);
1670 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1677 CASE (sem
, INSN_MULWLO
) : /* mulwlo $src1,$src2 */
1679 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1680 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1681 #define FLD(f) abuf->fields.sfmt_st_plus.f
1682 int UNUSED written
= 0;
1683 IADDR UNUSED pc
= abuf
->addr
;
1684 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1687 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 8), 8);
1688 SET_H_ACCUM (opval
);
1689 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1696 CASE (sem
, INSN_MV
) : /* mv $dr,$sr */
1698 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1699 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1700 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1701 int UNUSED written
= 0;
1702 IADDR UNUSED pc
= abuf
->addr
;
1703 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1706 SI opval
= * FLD (i_sr
);
1707 * FLD (i_dr
) = opval
;
1708 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1715 CASE (sem
, INSN_MVFACHI
) : /* mvfachi $dr */
1717 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1718 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1719 #define FLD(f) abuf->fields.sfmt_seth.f
1720 int UNUSED written
= 0;
1721 IADDR UNUSED pc
= abuf
->addr
;
1722 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1725 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 32));
1726 * FLD (i_dr
) = opval
;
1727 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1734 CASE (sem
, INSN_MVFACLO
) : /* mvfaclo $dr */
1736 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1737 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1738 #define FLD(f) abuf->fields.sfmt_seth.f
1739 int UNUSED written
= 0;
1740 IADDR UNUSED pc
= abuf
->addr
;
1741 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1744 SI opval
= TRUNCDISI (GET_H_ACCUM ());
1745 * FLD (i_dr
) = opval
;
1746 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1753 CASE (sem
, INSN_MVFACMI
) : /* mvfacmi $dr */
1755 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1756 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1757 #define FLD(f) abuf->fields.sfmt_seth.f
1758 int UNUSED written
= 0;
1759 IADDR UNUSED pc
= abuf
->addr
;
1760 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1763 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 16));
1764 * FLD (i_dr
) = opval
;
1765 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1772 CASE (sem
, INSN_MVFC
) : /* mvfc $dr,$scr */
1774 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1775 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1776 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1777 int UNUSED written
= 0;
1778 IADDR UNUSED pc
= abuf
->addr
;
1779 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1782 SI opval
= GET_H_CR (FLD (f_r2
));
1783 * FLD (i_dr
) = opval
;
1784 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1791 CASE (sem
, INSN_MVTACHI
) : /* mvtachi $src1 */
1793 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1794 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1795 #define FLD(f) abuf->fields.sfmt_st_plus.f
1796 int UNUSED written
= 0;
1797 IADDR UNUSED pc
= abuf
->addr
;
1798 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1801 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
1802 SET_H_ACCUM (opval
);
1803 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1810 CASE (sem
, INSN_MVTACLO
) : /* mvtaclo $src1 */
1812 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1814 #define FLD(f) abuf->fields.sfmt_st_plus.f
1815 int UNUSED written
= 0;
1816 IADDR UNUSED pc
= abuf
->addr
;
1817 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1820 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
1821 SET_H_ACCUM (opval
);
1822 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1829 CASE (sem
, INSN_MVTC
) : /* mvtc $sr,$dcr */
1831 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1832 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1833 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1834 int UNUSED written
= 0;
1835 IADDR UNUSED pc
= abuf
->addr
;
1836 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1839 USI opval
= * FLD (i_sr
);
1840 SET_H_CR (FLD (f_r1
), opval
);
1841 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
1848 CASE (sem
, INSN_NEG
) : /* neg $dr,$sr */
1850 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1852 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1853 int UNUSED written
= 0;
1854 IADDR UNUSED pc
= abuf
->addr
;
1855 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1858 SI opval
= NEGSI (* FLD (i_sr
));
1859 * FLD (i_dr
) = opval
;
1860 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1867 CASE (sem
, INSN_NOP
) : /* nop */
1869 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1870 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1871 #define FLD(f) abuf->fields.fmt_empty.f
1872 int UNUSED written
= 0;
1873 IADDR UNUSED pc
= abuf
->addr
;
1874 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1876 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
1882 CASE (sem
, INSN_NOT
) : /* not $dr,$sr */
1884 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1885 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1886 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1887 int UNUSED written
= 0;
1888 IADDR UNUSED pc
= abuf
->addr
;
1889 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1892 SI opval
= INVSI (* FLD (i_sr
));
1893 * FLD (i_dr
) = opval
;
1894 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1901 CASE (sem
, INSN_RAC
) : /* rac */
1903 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1904 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1905 #define FLD(f) abuf->fields.fmt_empty.f
1906 int UNUSED written
= 0;
1907 IADDR UNUSED pc
= abuf
->addr
;
1908 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1912 tmp_tmp1
= SLLDI (GET_H_ACCUM (), 1);
1913 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
1915 DI opval
= (GTDI (tmp_tmp1
, MAKEDI (32767, 0xffff0000))) ? (MAKEDI (32767, 0xffff0000)) : (LTDI (tmp_tmp1
, MAKEDI (0xffff8000, 0))) ? (MAKEDI (0xffff8000, 0)) : (ANDDI (tmp_tmp1
, MAKEDI (0xffffffff, 0xffff0000)));
1916 SET_H_ACCUM (opval
);
1917 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1925 CASE (sem
, INSN_RACH
) : /* rach */
1927 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1929 #define FLD(f) abuf->fields.fmt_empty.f
1930 int UNUSED written
= 0;
1931 IADDR UNUSED pc
= abuf
->addr
;
1932 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1936 tmp_tmp1
= ANDDI (GET_H_ACCUM (), MAKEDI (16777215, 0xffffffff));
1937 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (16383, 0x80000000)), LEDI (tmp_tmp1
, MAKEDI (8388607, 0xffffffff)))) {
1938 tmp_tmp1
= MAKEDI (16383, 0x80000000);
1940 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (8388608, 0)), LEDI (tmp_tmp1
, MAKEDI (16760832, 0)))) {
1941 tmp_tmp1
= MAKEDI (16760832, 0);
1943 tmp_tmp1
= ANDDI (ADDDI (GET_H_ACCUM (), MAKEDI (0, 1073741824)), MAKEDI (0xffffffff, 0x80000000));
1946 tmp_tmp1
= SLLDI (tmp_tmp1
, 1);
1948 DI opval
= SRADI (SLLDI (tmp_tmp1
, 7), 7);
1949 SET_H_ACCUM (opval
);
1950 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1958 CASE (sem
, INSN_RTE
) : /* rte */
1960 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1961 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1962 #define FLD(f) abuf->fields.fmt_empty.f
1963 int UNUSED written
= 0;
1964 IADDR UNUSED pc
= abuf
->addr
;
1966 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1970 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
1971 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1972 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1975 USI opval
= GET_H_CR (((UINT
) 14));
1976 SET_H_CR (((UINT
) 6), opval
);
1977 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
1980 UQI opval
= CPU (h_bpsw
);
1982 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
1985 UQI opval
= CPU (h_bbpsw
);
1986 CPU (h_bpsw
) = opval
;
1987 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
1991 SEM_BRANCH_FINI (vpc
);
1996 CASE (sem
, INSN_SETH
) : /* seth $dr,$hash$hi16 */
1998 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
1999 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2000 #define FLD(f) abuf->fields.sfmt_seth.f
2001 int UNUSED written
= 0;
2002 IADDR UNUSED pc
= abuf
->addr
;
2003 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2006 SI opval
= SLLSI (FLD (f_hi16
), 16);
2007 * FLD (i_dr
) = opval
;
2008 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2015 CASE (sem
, INSN_SLL
) : /* sll $dr,$sr */
2017 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2018 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2019 #define FLD(f) abuf->fields.sfmt_add.f
2020 int UNUSED written
= 0;
2021 IADDR UNUSED pc
= abuf
->addr
;
2022 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2025 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2026 * FLD (i_dr
) = opval
;
2027 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2034 CASE (sem
, INSN_SLL3
) : /* sll3 $dr,$sr,$simm16 */
2036 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2037 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2038 #define FLD(f) abuf->fields.sfmt_add3.f
2039 int UNUSED written
= 0;
2040 IADDR UNUSED pc
= abuf
->addr
;
2041 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2044 SI opval
= SLLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2045 * FLD (i_dr
) = opval
;
2046 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2053 CASE (sem
, INSN_SLLI
) : /* slli $dr,$uimm5 */
2055 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2056 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2057 #define FLD(f) abuf->fields.sfmt_slli.f
2058 int UNUSED written
= 0;
2059 IADDR UNUSED pc
= abuf
->addr
;
2060 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2063 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
2064 * FLD (i_dr
) = opval
;
2065 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2072 CASE (sem
, INSN_SRA
) : /* sra $dr,$sr */
2074 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2075 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2076 #define FLD(f) abuf->fields.sfmt_add.f
2077 int UNUSED written
= 0;
2078 IADDR UNUSED pc
= abuf
->addr
;
2079 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2082 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2083 * FLD (i_dr
) = opval
;
2084 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2091 CASE (sem
, INSN_SRA3
) : /* sra3 $dr,$sr,$simm16 */
2093 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2095 #define FLD(f) abuf->fields.sfmt_add3.f
2096 int UNUSED written
= 0;
2097 IADDR UNUSED pc
= abuf
->addr
;
2098 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2101 SI opval
= SRASI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2102 * FLD (i_dr
) = opval
;
2103 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2110 CASE (sem
, INSN_SRAI
) : /* srai $dr,$uimm5 */
2112 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2114 #define FLD(f) abuf->fields.sfmt_slli.f
2115 int UNUSED written
= 0;
2116 IADDR UNUSED pc
= abuf
->addr
;
2117 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2120 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
2121 * FLD (i_dr
) = opval
;
2122 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2129 CASE (sem
, INSN_SRL
) : /* srl $dr,$sr */
2131 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2133 #define FLD(f) abuf->fields.sfmt_add.f
2134 int UNUSED written
= 0;
2135 IADDR UNUSED pc
= abuf
->addr
;
2136 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2139 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2140 * FLD (i_dr
) = opval
;
2141 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2148 CASE (sem
, INSN_SRL3
) : /* srl3 $dr,$sr,$simm16 */
2150 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2152 #define FLD(f) abuf->fields.sfmt_add3.f
2153 int UNUSED written
= 0;
2154 IADDR UNUSED pc
= abuf
->addr
;
2155 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2158 SI opval
= SRLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2159 * FLD (i_dr
) = opval
;
2160 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2167 CASE (sem
, INSN_SRLI
) : /* srli $dr,$uimm5 */
2169 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2171 #define FLD(f) abuf->fields.sfmt_slli.f
2172 int UNUSED written
= 0;
2173 IADDR UNUSED pc
= abuf
->addr
;
2174 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2177 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
2178 * FLD (i_dr
) = opval
;
2179 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2186 CASE (sem
, INSN_ST
) : /* st $src1,@$src2 */
2188 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2189 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2190 #define FLD(f) abuf->fields.sfmt_st_plus.f
2191 int UNUSED written
= 0;
2192 IADDR UNUSED pc
= abuf
->addr
;
2193 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2196 SI opval
= * FLD (i_src1
);
2197 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2198 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2205 CASE (sem
, INSN_ST_D
) : /* st $src1,@($slo16,$src2) */
2207 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2208 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2209 #define FLD(f) abuf->fields.sfmt_st_d.f
2210 int UNUSED written
= 0;
2211 IADDR UNUSED pc
= abuf
->addr
;
2212 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2215 SI opval
= * FLD (i_src1
);
2216 SETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2217 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2224 CASE (sem
, INSN_STB
) : /* stb $src1,@$src2 */
2226 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2227 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2228 #define FLD(f) abuf->fields.sfmt_st_plus.f
2229 int UNUSED written
= 0;
2230 IADDR UNUSED pc
= abuf
->addr
;
2231 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2234 QI opval
= * FLD (i_src1
);
2235 SETMEMQI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2236 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2243 CASE (sem
, INSN_STB_D
) : /* stb $src1,@($slo16,$src2) */
2245 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2247 #define FLD(f) abuf->fields.sfmt_st_d.f
2248 int UNUSED written
= 0;
2249 IADDR UNUSED pc
= abuf
->addr
;
2250 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2253 QI opval
= * FLD (i_src1
);
2254 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2255 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2262 CASE (sem
, INSN_STH
) : /* sth $src1,@$src2 */
2264 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2265 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2266 #define FLD(f) abuf->fields.sfmt_st_plus.f
2267 int UNUSED written
= 0;
2268 IADDR UNUSED pc
= abuf
->addr
;
2269 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2272 HI opval
= * FLD (i_src1
);
2273 SETMEMHI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2274 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2281 CASE (sem
, INSN_STH_D
) : /* sth $src1,@($slo16,$src2) */
2283 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2284 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2285 #define FLD(f) abuf->fields.sfmt_st_d.f
2286 int UNUSED written
= 0;
2287 IADDR UNUSED pc
= abuf
->addr
;
2288 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2291 HI opval
= * FLD (i_src1
);
2292 SETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2293 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2300 CASE (sem
, INSN_ST_PLUS
) : /* st $src1,@+$src2 */
2302 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2303 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2304 #define FLD(f) abuf->fields.sfmt_st_plus.f
2305 int UNUSED written
= 0;
2306 IADDR UNUSED pc
= abuf
->addr
;
2307 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2311 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
2313 SI opval
= * FLD (i_src1
);
2314 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2315 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2318 SI opval
= tmp_new_src2
;
2319 * FLD (i_src2
) = opval
;
2320 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2328 CASE (sem
, INSN_ST_MINUS
) : /* st $src1,@-$src2 */
2330 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2331 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2332 #define FLD(f) abuf->fields.sfmt_st_plus.f
2333 int UNUSED written
= 0;
2334 IADDR UNUSED pc
= abuf
->addr
;
2335 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2339 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
2341 SI opval
= * FLD (i_src1
);
2342 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2343 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2346 SI opval
= tmp_new_src2
;
2347 * FLD (i_src2
) = opval
;
2348 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2356 CASE (sem
, INSN_SUB
) : /* sub $dr,$sr */
2358 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2359 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2360 #define FLD(f) abuf->fields.sfmt_add.f
2361 int UNUSED written
= 0;
2362 IADDR UNUSED pc
= abuf
->addr
;
2363 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2366 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2367 * FLD (i_dr
) = opval
;
2368 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2375 CASE (sem
, INSN_SUBV
) : /* subv $dr,$sr */
2377 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2379 #define FLD(f) abuf->fields.sfmt_add.f
2380 int UNUSED written
= 0;
2381 IADDR UNUSED pc
= abuf
->addr
;
2382 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2386 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2387 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
2390 * FLD (i_dr
) = opval
;
2391 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2395 CPU (h_cond
) = opval
;
2396 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2404 CASE (sem
, INSN_SUBX
) : /* subx $dr,$sr */
2406 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2408 #define FLD(f) abuf->fields.sfmt_add.f
2409 int UNUSED written
= 0;
2410 IADDR UNUSED pc
= abuf
->addr
;
2411 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2415 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2416 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2419 * FLD (i_dr
) = opval
;
2420 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2424 CPU (h_cond
) = opval
;
2425 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2433 CASE (sem
, INSN_TRAP
) : /* trap $uimm4 */
2435 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2436 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2437 #define FLD(f) abuf->fields.sfmt_trap.f
2438 int UNUSED written
= 0;
2439 IADDR UNUSED pc
= abuf
->addr
;
2441 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2445 USI opval
= GET_H_CR (((UINT
) 6));
2446 SET_H_CR (((UINT
) 14), opval
);
2447 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2450 USI opval
= ADDSI (pc
, 4);
2451 SET_H_CR (((UINT
) 6), opval
);
2452 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2455 UQI opval
= CPU (h_bpsw
);
2456 CPU (h_bbpsw
) = opval
;
2457 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
2460 UQI opval
= GET_H_PSW ();
2461 CPU (h_bpsw
) = opval
;
2462 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2465 UQI opval
= ANDQI (GET_H_PSW (), 128);
2467 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2470 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
2471 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2472 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2476 SEM_BRANCH_FINI (vpc
);
2481 CASE (sem
, INSN_UNLOCK
) : /* unlock $src1,@$src2 */
2483 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2484 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2485 #define FLD(f) abuf->fields.sfmt_st_plus.f
2486 int UNUSED written
= 0;
2487 IADDR UNUSED pc
= abuf
->addr
;
2488 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2493 SI opval
= * FLD (i_src1
);
2494 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2495 written
|= (1 << 4);
2496 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2501 CPU (h_lock
) = opval
;
2502 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
2506 abuf
->written
= written
;
2511 CASE (sem
, INSN_CLRPSW
) : /* clrpsw $uimm8 */
2513 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2514 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2515 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2516 int UNUSED written
= 0;
2517 IADDR UNUSED pc
= abuf
->addr
;
2518 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2521 SI opval
= ANDSI (GET_H_CR (((UINT
) 0)), ORSI (INVBI (FLD (f_uimm8
)), 65280));
2522 SET_H_CR (((UINT
) 0), opval
);
2523 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2530 CASE (sem
, INSN_SETPSW
) : /* setpsw $uimm8 */
2532 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2533 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2534 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2535 int UNUSED written
= 0;
2536 IADDR UNUSED pc
= abuf
->addr
;
2537 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2540 SI opval
= FLD (f_uimm8
);
2541 SET_H_CR (((UINT
) 0), opval
);
2542 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2549 CASE (sem
, INSN_BSET
) : /* bset $uimm3,@($slo16,$sr) */
2551 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2552 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2553 #define FLD(f) abuf->fields.sfmt_bset.f
2554 int UNUSED written
= 0;
2555 IADDR UNUSED pc
= abuf
->addr
;
2556 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2559 QI opval
= ORQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), SLLSI (1, SUBSI (7, FLD (f_uimm3
))));
2560 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
2561 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2568 CASE (sem
, INSN_BCLR
) : /* bclr $uimm3,@($slo16,$sr) */
2570 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2572 #define FLD(f) abuf->fields.sfmt_bset.f
2573 int UNUSED written
= 0;
2574 IADDR UNUSED pc
= abuf
->addr
;
2575 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2578 QI opval
= ANDQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), INVQI (SLLSI (1, SUBSI (7, FLD (f_uimm3
)))));
2579 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
2580 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2587 CASE (sem
, INSN_BTST
) : /* btst $uimm3,$sr */
2589 SEM_ARG sem_arg
= SEM_SEM_ARG (vpc
, sc
);
2590 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2591 #define FLD(f) abuf->fields.sfmt_bset.f
2592 int UNUSED written
= 0;
2593 IADDR UNUSED pc
= abuf
->addr
;
2594 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2597 BI opval
= ANDQI (SRLSI (* FLD (i_sr
), SUBSI (7, FLD (f_uimm3
))), 1);
2598 CPU (h_cond
) = opval
;
2599 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2608 ENDSWITCH (sem
) /* End of semantic switch. */
2610 /* At this point `vpc' contains the next insn to execute. */
2613 #undef DEFINE_SWITCH
2614 #endif /* DEFINE_SWITCH */