1 /* Simulator instruction semantics for m32rbf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2010 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25 #define WANT_CPU m32rbf
26 #define WANT_CPU_M32RBF
33 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
34 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
36 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
39 /* This is used so that we can compile two copies of the semantic code,
40 one with full feature support and one without that runs fast(er).
41 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
43 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
45 #define TRACE_RESULT(cpu, abuf, name, type, val)
47 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
50 /* x-invalid: --invalid-- */
53 SEM_FN_NAME (m32rbf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
55 #define FLD(f) abuf->fields.fmt_empty.f
56 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
57 int UNUSED written = 0;
58 IADDR UNUSED pc = abuf->addr;
59 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
62 /* Update the recorded pc in the cpu state struct.
63 Only necessary for WITH_SCACHE case, but to avoid the
64 conditional compilation .... */
66 /* Virtual insns have zero size. Overwrite vpc with address of next insn
67 using the default-insn-bitsize spec. When executing insns in parallel
68 we may want to queue the fault and continue execution. */
69 vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
70 vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
77 /* x-after: --after-- */
80 SEM_FN_NAME (m32rbf,x_after) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
82 #define FLD(f) abuf->fields.fmt_empty.f
83 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
84 int UNUSED written = 0;
85 IADDR UNUSED pc = abuf->addr;
86 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
89 #if WITH_SCACHE_PBB_M32RBF
90 m32rbf_pbb_after (current_cpu, sem_arg);
98 /* x-before: --before-- */
101 SEM_FN_NAME (m32rbf,x_before) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
103 #define FLD(f) abuf->fields.fmt_empty.f
104 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
105 int UNUSED written = 0;
106 IADDR UNUSED pc = abuf->addr;
107 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
110 #if WITH_SCACHE_PBB_M32RBF
111 m32rbf_pbb_before (current_cpu, sem_arg);
119 /* x-cti-chain: --cti-chain-- */
122 SEM_FN_NAME (m32rbf,x_cti_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
124 #define FLD(f) abuf->fields.fmt_empty.f
125 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
126 int UNUSED written = 0;
127 IADDR UNUSED pc = abuf->addr;
128 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
131 #if WITH_SCACHE_PBB_M32RBF
133 vpc = m32rbf_pbb_cti_chain (current_cpu, sem_arg,
134 pbb_br_type, pbb_br_npc);
137 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
138 vpc = m32rbf_pbb_cti_chain (current_cpu, sem_arg,
139 CPU_PBB_BR_TYPE (current_cpu),
140 CPU_PBB_BR_NPC (current_cpu));
149 /* x-chain: --chain-- */
152 SEM_FN_NAME (m32rbf,x_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
154 #define FLD(f) abuf->fields.fmt_empty.f
155 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
156 int UNUSED written = 0;
157 IADDR UNUSED pc = abuf->addr;
158 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
161 #if WITH_SCACHE_PBB_M32RBF
162 vpc = m32rbf_pbb_chain (current_cpu, sem_arg);
173 /* x-begin: --begin-- */
176 SEM_FN_NAME (m32rbf,x_begin) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
178 #define FLD(f) abuf->fields.fmt_empty.f
179 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
180 int UNUSED written = 0;
181 IADDR UNUSED pc = abuf->addr;
182 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
185 #if WITH_SCACHE_PBB_M32RBF
186 #if defined DEFINE_SWITCH || defined FAST_P
187 /* In the switch case FAST_P is a constant, allowing several optimizations
188 in any called inline functions. */
189 vpc = m32rbf_pbb_begin (current_cpu, FAST_P);
191 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
192 vpc = m32rbf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
194 vpc = m32rbf_pbb_begin (current_cpu, 0);
204 /* add: add $dr,$sr */
207 SEM_FN_NAME (m32rbf,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
209 #define FLD(f) abuf->fields.sfmt_add.f
210 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
211 int UNUSED written = 0;
212 IADDR UNUSED pc = abuf->addr;
213 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
216 SI opval = ADDSI (* FLD (i_dr), * FLD (i_sr));
217 * FLD (i_dr) = opval;
218 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
225 /* add3: add3 $dr,$sr,$hash$slo16 */
228 SEM_FN_NAME (m32rbf,add3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
230 #define FLD(f) abuf->fields.sfmt_add3.f
231 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
232 int UNUSED written = 0;
233 IADDR UNUSED pc = abuf->addr;
234 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
237 SI opval = ADDSI (* FLD (i_sr), FLD (f_simm16));
238 * FLD (i_dr) = opval;
239 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
246 /* and: and $dr,$sr */
249 SEM_FN_NAME (m32rbf,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
251 #define FLD(f) abuf->fields.sfmt_add.f
252 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
253 int UNUSED written = 0;
254 IADDR UNUSED pc = abuf->addr;
255 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
258 SI opval = ANDSI (* FLD (i_dr), * FLD (i_sr));
259 * FLD (i_dr) = opval;
260 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
267 /* and3: and3 $dr,$sr,$uimm16 */
270 SEM_FN_NAME (m32rbf,and3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
272 #define FLD(f) abuf->fields.sfmt_and3.f
273 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
274 int UNUSED written = 0;
275 IADDR UNUSED pc = abuf->addr;
276 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
279 SI opval = ANDSI (* FLD (i_sr), FLD (f_uimm16));
280 * FLD (i_dr) = opval;
281 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
291 SEM_FN_NAME (m32rbf,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
293 #define FLD(f) abuf->fields.sfmt_add.f
294 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
295 int UNUSED written = 0;
296 IADDR UNUSED pc = abuf->addr;
297 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
300 SI opval = ORSI (* FLD (i_dr), * FLD (i_sr));
301 * FLD (i_dr) = opval;
302 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
309 /* or3: or3 $dr,$sr,$hash$ulo16 */
312 SEM_FN_NAME (m32rbf,or3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
314 #define FLD(f) abuf->fields.sfmt_and3.f
315 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
316 int UNUSED written = 0;
317 IADDR UNUSED pc = abuf->addr;
318 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
321 SI opval = ORSI (* FLD (i_sr), FLD (f_uimm16));
322 * FLD (i_dr) = opval;
323 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
330 /* xor: xor $dr,$sr */
333 SEM_FN_NAME (m32rbf,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
335 #define FLD(f) abuf->fields.sfmt_add.f
336 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
337 int UNUSED written = 0;
338 IADDR UNUSED pc = abuf->addr;
339 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
342 SI opval = XORSI (* FLD (i_dr), * FLD (i_sr));
343 * FLD (i_dr) = opval;
344 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
351 /* xor3: xor3 $dr,$sr,$uimm16 */
354 SEM_FN_NAME (m32rbf,xor3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
356 #define FLD(f) abuf->fields.sfmt_and3.f
357 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
358 int UNUSED written = 0;
359 IADDR UNUSED pc = abuf->addr;
360 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
363 SI opval = XORSI (* FLD (i_sr), FLD (f_uimm16));
364 * FLD (i_dr) = opval;
365 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
372 /* addi: addi $dr,$simm8 */
375 SEM_FN_NAME (m32rbf,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
377 #define FLD(f) abuf->fields.sfmt_addi.f
378 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
379 int UNUSED written = 0;
380 IADDR UNUSED pc = abuf->addr;
381 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
384 SI opval = ADDSI (* FLD (i_dr), FLD (f_simm8));
385 * FLD (i_dr) = opval;
386 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
393 /* addv: addv $dr,$sr */
396 SEM_FN_NAME (m32rbf,addv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
398 #define FLD(f) abuf->fields.sfmt_add.f
399 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
400 int UNUSED written = 0;
401 IADDR UNUSED pc = abuf->addr;
402 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
406 temp0 = ADDSI (* FLD (i_dr), * FLD (i_sr));
407 temp1 = ADDOFSI (* FLD (i_dr), * FLD (i_sr), 0);
410 * FLD (i_dr) = opval;
411 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
415 CPU (h_cond) = opval;
416 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
424 /* addv3: addv3 $dr,$sr,$simm16 */
427 SEM_FN_NAME (m32rbf,addv3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
429 #define FLD(f) abuf->fields.sfmt_add3.f
430 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
431 int UNUSED written = 0;
432 IADDR UNUSED pc = abuf->addr;
433 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
437 temp0 = ADDSI (* FLD (i_sr), FLD (f_simm16));
438 temp1 = ADDOFSI (* FLD (i_sr), FLD (f_simm16), 0);
441 * FLD (i_dr) = opval;
442 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
446 CPU (h_cond) = opval;
447 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
455 /* addx: addx $dr,$sr */
458 SEM_FN_NAME (m32rbf,addx) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
460 #define FLD(f) abuf->fields.sfmt_add.f
461 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
462 int UNUSED written = 0;
463 IADDR UNUSED pc = abuf->addr;
464 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
468 temp0 = ADDCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
469 temp1 = ADDCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
472 * FLD (i_dr) = opval;
473 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
477 CPU (h_cond) = opval;
478 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
486 /* bc8: bc.s $disp8 */
489 SEM_FN_NAME (m32rbf,bc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
491 #define FLD(f) abuf->fields.sfmt_bl8.f
492 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
493 int UNUSED written = 0;
494 IADDR UNUSED pc = abuf->addr;
496 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
500 USI opval = FLD (i_disp8);
501 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
503 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
507 abuf->written = written;
508 SEM_BRANCH_FINI (vpc);
513 /* bc24: bc.l $disp24 */
516 SEM_FN_NAME (m32rbf,bc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
518 #define FLD(f) abuf->fields.sfmt_bl24.f
519 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
520 int UNUSED written = 0;
521 IADDR UNUSED pc = abuf->addr;
523 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
527 USI opval = FLD (i_disp24);
528 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
530 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
534 abuf->written = written;
535 SEM_BRANCH_FINI (vpc);
540 /* beq: beq $src1,$src2,$disp16 */
543 SEM_FN_NAME (m32rbf,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
545 #define FLD(f) abuf->fields.sfmt_beq.f
546 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
547 int UNUSED written = 0;
548 IADDR UNUSED pc = abuf->addr;
550 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
552 if (EQSI (* FLD (i_src1), * FLD (i_src2))) {
554 USI opval = FLD (i_disp16);
555 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
557 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
561 abuf->written = written;
562 SEM_BRANCH_FINI (vpc);
567 /* beqz: beqz $src2,$disp16 */
570 SEM_FN_NAME (m32rbf,beqz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
572 #define FLD(f) abuf->fields.sfmt_beq.f
573 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
574 int UNUSED written = 0;
575 IADDR UNUSED pc = abuf->addr;
577 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
579 if (EQSI (* FLD (i_src2), 0)) {
581 USI opval = FLD (i_disp16);
582 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
584 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
588 abuf->written = written;
589 SEM_BRANCH_FINI (vpc);
594 /* bgez: bgez $src2,$disp16 */
597 SEM_FN_NAME (m32rbf,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
599 #define FLD(f) abuf->fields.sfmt_beq.f
600 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
601 int UNUSED written = 0;
602 IADDR UNUSED pc = abuf->addr;
604 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
606 if (GESI (* FLD (i_src2), 0)) {
608 USI opval = FLD (i_disp16);
609 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
611 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
615 abuf->written = written;
616 SEM_BRANCH_FINI (vpc);
621 /* bgtz: bgtz $src2,$disp16 */
624 SEM_FN_NAME (m32rbf,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
626 #define FLD(f) abuf->fields.sfmt_beq.f
627 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
628 int UNUSED written = 0;
629 IADDR UNUSED pc = abuf->addr;
631 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
633 if (GTSI (* FLD (i_src2), 0)) {
635 USI opval = FLD (i_disp16);
636 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
638 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
642 abuf->written = written;
643 SEM_BRANCH_FINI (vpc);
648 /* blez: blez $src2,$disp16 */
651 SEM_FN_NAME (m32rbf,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
653 #define FLD(f) abuf->fields.sfmt_beq.f
654 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
655 int UNUSED written = 0;
656 IADDR UNUSED pc = abuf->addr;
658 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
660 if (LESI (* FLD (i_src2), 0)) {
662 USI opval = FLD (i_disp16);
663 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
665 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
669 abuf->written = written;
670 SEM_BRANCH_FINI (vpc);
675 /* bltz: bltz $src2,$disp16 */
678 SEM_FN_NAME (m32rbf,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
680 #define FLD(f) abuf->fields.sfmt_beq.f
681 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
682 int UNUSED written = 0;
683 IADDR UNUSED pc = abuf->addr;
685 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
687 if (LTSI (* FLD (i_src2), 0)) {
689 USI opval = FLD (i_disp16);
690 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
692 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
696 abuf->written = written;
697 SEM_BRANCH_FINI (vpc);
702 /* bnez: bnez $src2,$disp16 */
705 SEM_FN_NAME (m32rbf,bnez) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
707 #define FLD(f) abuf->fields.sfmt_beq.f
708 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
709 int UNUSED written = 0;
710 IADDR UNUSED pc = abuf->addr;
712 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
714 if (NESI (* FLD (i_src2), 0)) {
716 USI opval = FLD (i_disp16);
717 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
719 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
723 abuf->written = written;
724 SEM_BRANCH_FINI (vpc);
729 /* bl8: bl.s $disp8 */
732 SEM_FN_NAME (m32rbf,bl8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
734 #define FLD(f) abuf->fields.sfmt_bl8.f
735 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
736 int UNUSED written = 0;
737 IADDR UNUSED pc = abuf->addr;
739 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
743 SI opval = ADDSI (ANDSI (pc, -4), 4);
744 CPU (h_gr[((UINT) 14)]) = opval;
745 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
748 USI opval = FLD (i_disp8);
749 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
750 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
754 SEM_BRANCH_FINI (vpc);
759 /* bl24: bl.l $disp24 */
762 SEM_FN_NAME (m32rbf,bl24) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
764 #define FLD(f) abuf->fields.sfmt_bl24.f
765 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
766 int UNUSED written = 0;
767 IADDR UNUSED pc = abuf->addr;
769 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
773 SI opval = ADDSI (pc, 4);
774 CPU (h_gr[((UINT) 14)]) = opval;
775 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
778 USI opval = FLD (i_disp24);
779 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
780 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
784 SEM_BRANCH_FINI (vpc);
789 /* bnc8: bnc.s $disp8 */
792 SEM_FN_NAME (m32rbf,bnc8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
794 #define FLD(f) abuf->fields.sfmt_bl8.f
795 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
796 int UNUSED written = 0;
797 IADDR UNUSED pc = abuf->addr;
799 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
801 if (NOTBI (CPU (h_cond))) {
803 USI opval = FLD (i_disp8);
804 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
806 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
810 abuf->written = written;
811 SEM_BRANCH_FINI (vpc);
816 /* bnc24: bnc.l $disp24 */
819 SEM_FN_NAME (m32rbf,bnc24) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
821 #define FLD(f) abuf->fields.sfmt_bl24.f
822 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
823 int UNUSED written = 0;
824 IADDR UNUSED pc = abuf->addr;
826 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
828 if (NOTBI (CPU (h_cond))) {
830 USI opval = FLD (i_disp24);
831 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
833 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
837 abuf->written = written;
838 SEM_BRANCH_FINI (vpc);
843 /* bne: bne $src1,$src2,$disp16 */
846 SEM_FN_NAME (m32rbf,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
848 #define FLD(f) abuf->fields.sfmt_beq.f
849 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
850 int UNUSED written = 0;
851 IADDR UNUSED pc = abuf->addr;
853 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
855 if (NESI (* FLD (i_src1), * FLD (i_src2))) {
857 USI opval = FLD (i_disp16);
858 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
860 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
864 abuf->written = written;
865 SEM_BRANCH_FINI (vpc);
870 /* bra8: bra.s $disp8 */
873 SEM_FN_NAME (m32rbf,bra8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
875 #define FLD(f) abuf->fields.sfmt_bl8.f
876 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
877 int UNUSED written = 0;
878 IADDR UNUSED pc = abuf->addr;
880 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
883 USI opval = FLD (i_disp8);
884 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
885 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
888 SEM_BRANCH_FINI (vpc);
893 /* bra24: bra.l $disp24 */
896 SEM_FN_NAME (m32rbf,bra24) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
898 #define FLD(f) abuf->fields.sfmt_bl24.f
899 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
900 int UNUSED written = 0;
901 IADDR UNUSED pc = abuf->addr;
903 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
906 USI opval = FLD (i_disp24);
907 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
908 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
911 SEM_BRANCH_FINI (vpc);
916 /* cmp: cmp $src1,$src2 */
919 SEM_FN_NAME (m32rbf,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
921 #define FLD(f) abuf->fields.sfmt_st_plus.f
922 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
923 int UNUSED written = 0;
924 IADDR UNUSED pc = abuf->addr;
925 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
928 BI opval = LTSI (* FLD (i_src1), * FLD (i_src2));
929 CPU (h_cond) = opval;
930 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
937 /* cmpi: cmpi $src2,$simm16 */
940 SEM_FN_NAME (m32rbf,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
942 #define FLD(f) abuf->fields.sfmt_st_d.f
943 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
944 int UNUSED written = 0;
945 IADDR UNUSED pc = abuf->addr;
946 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
949 BI opval = LTSI (* FLD (i_src2), FLD (f_simm16));
950 CPU (h_cond) = opval;
951 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
958 /* cmpu: cmpu $src1,$src2 */
961 SEM_FN_NAME (m32rbf,cmpu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
963 #define FLD(f) abuf->fields.sfmt_st_plus.f
964 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
965 int UNUSED written = 0;
966 IADDR UNUSED pc = abuf->addr;
967 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
970 BI opval = LTUSI (* FLD (i_src1), * FLD (i_src2));
971 CPU (h_cond) = opval;
972 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
979 /* cmpui: cmpui $src2,$simm16 */
982 SEM_FN_NAME (m32rbf,cmpui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
984 #define FLD(f) abuf->fields.sfmt_st_d.f
985 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
986 int UNUSED written = 0;
987 IADDR UNUSED pc = abuf->addr;
988 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
991 BI opval = LTUSI (* FLD (i_src2), FLD (f_simm16));
992 CPU (h_cond) = opval;
993 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
1000 /* div: div $dr,$sr */
1003 SEM_FN_NAME (m32rbf,div) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1005 #define FLD(f) abuf->fields.sfmt_add.f
1006 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1007 int UNUSED written = 0;
1008 IADDR UNUSED pc = abuf->addr;
1009 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1011 if (NESI (* FLD (i_sr), 0)) {
1013 SI opval = DIVSI (* FLD (i_dr), * FLD (i_sr));
1014 * FLD (i_dr) = opval;
1015 written |= (1 << 2);
1016 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1020 abuf->written = written;
1025 /* divu: divu $dr,$sr */
1028 SEM_FN_NAME (m32rbf,divu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1030 #define FLD(f) abuf->fields.sfmt_add.f
1031 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1032 int UNUSED written = 0;
1033 IADDR UNUSED pc = abuf->addr;
1034 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1036 if (NESI (* FLD (i_sr), 0)) {
1038 SI opval = UDIVSI (* FLD (i_dr), * FLD (i_sr));
1039 * FLD (i_dr) = opval;
1040 written |= (1 << 2);
1041 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1045 abuf->written = written;
1050 /* rem: rem $dr,$sr */
1053 SEM_FN_NAME (m32rbf,rem) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1055 #define FLD(f) abuf->fields.sfmt_add.f
1056 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1057 int UNUSED written = 0;
1058 IADDR UNUSED pc = abuf->addr;
1059 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1061 if (NESI (* FLD (i_sr), 0)) {
1063 SI opval = MODSI (* FLD (i_dr), * FLD (i_sr));
1064 * FLD (i_dr) = opval;
1065 written |= (1 << 2);
1066 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1070 abuf->written = written;
1075 /* remu: remu $dr,$sr */
1078 SEM_FN_NAME (m32rbf,remu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1080 #define FLD(f) abuf->fields.sfmt_add.f
1081 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1082 int UNUSED written = 0;
1083 IADDR UNUSED pc = abuf->addr;
1084 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1086 if (NESI (* FLD (i_sr), 0)) {
1088 SI opval = UMODSI (* FLD (i_dr), * FLD (i_sr));
1089 * FLD (i_dr) = opval;
1090 written |= (1 << 2);
1091 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1095 abuf->written = written;
1103 SEM_FN_NAME (m32rbf,jl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1105 #define FLD(f) abuf->fields.sfmt_jl.f
1106 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1107 int UNUSED written = 0;
1108 IADDR UNUSED pc = abuf->addr;
1110 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1114 temp0 = ADDSI (ANDSI (pc, -4), 4);
1115 temp1 = ANDSI (* FLD (i_sr), -4);
1118 CPU (h_gr[((UINT) 14)]) = opval;
1119 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1123 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1124 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1128 SEM_BRANCH_FINI (vpc);
1136 SEM_FN_NAME (m32rbf,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1138 #define FLD(f) abuf->fields.sfmt_jl.f
1139 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1140 int UNUSED written = 0;
1141 IADDR UNUSED pc = abuf->addr;
1143 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1146 USI opval = ANDSI (* FLD (i_sr), -4);
1147 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1148 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1151 SEM_BRANCH_FINI (vpc);
1156 /* ld: ld $dr,@$sr */
1159 SEM_FN_NAME (m32rbf,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1161 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1163 int UNUSED written = 0;
1164 IADDR UNUSED pc = abuf->addr;
1165 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1168 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
1169 * FLD (i_dr) = opval;
1170 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1177 /* ld-d: ld $dr,@($slo16,$sr) */
1180 SEM_FN_NAME (m32rbf,ld_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1182 #define FLD(f) abuf->fields.sfmt_add3.f
1183 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1184 int UNUSED written = 0;
1185 IADDR UNUSED pc = abuf->addr;
1186 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1189 SI opval = GETMEMSI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)));
1190 * FLD (i_dr) = opval;
1191 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1198 /* ldb: ldb $dr,@$sr */
1201 SEM_FN_NAME (m32rbf,ldb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1203 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1204 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1205 int UNUSED written = 0;
1206 IADDR UNUSED pc = abuf->addr;
1207 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1210 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
1211 * FLD (i_dr) = opval;
1212 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1219 /* ldb-d: ldb $dr,@($slo16,$sr) */
1222 SEM_FN_NAME (m32rbf,ldb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1224 #define FLD(f) abuf->fields.sfmt_add3.f
1225 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1226 int UNUSED written = 0;
1227 IADDR UNUSED pc = abuf->addr;
1228 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1231 SI opval = EXTQISI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1232 * FLD (i_dr) = opval;
1233 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1240 /* ldh: ldh $dr,@$sr */
1243 SEM_FN_NAME (m32rbf,ldh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1245 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1246 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1247 int UNUSED written = 0;
1248 IADDR UNUSED pc = abuf->addr;
1249 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1252 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
1253 * FLD (i_dr) = opval;
1254 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1261 /* ldh-d: ldh $dr,@($slo16,$sr) */
1264 SEM_FN_NAME (m32rbf,ldh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1266 #define FLD(f) abuf->fields.sfmt_add3.f
1267 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1268 int UNUSED written = 0;
1269 IADDR UNUSED pc = abuf->addr;
1270 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1273 SI opval = EXTHISI (GETMEMHI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1274 * FLD (i_dr) = opval;
1275 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1282 /* ldub: ldub $dr,@$sr */
1285 SEM_FN_NAME (m32rbf,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1287 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1288 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1289 int UNUSED written = 0;
1290 IADDR UNUSED pc = abuf->addr;
1291 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1294 SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, * FLD (i_sr)));
1295 * FLD (i_dr) = opval;
1296 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1303 /* ldub-d: ldub $dr,@($slo16,$sr) */
1306 SEM_FN_NAME (m32rbf,ldub_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1308 #define FLD(f) abuf->fields.sfmt_add3.f
1309 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1310 int UNUSED written = 0;
1311 IADDR UNUSED pc = abuf->addr;
1312 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1315 SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1316 * FLD (i_dr) = opval;
1317 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1324 /* lduh: lduh $dr,@$sr */
1327 SEM_FN_NAME (m32rbf,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1329 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1330 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1331 int UNUSED written = 0;
1332 IADDR UNUSED pc = abuf->addr;
1333 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1336 SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, * FLD (i_sr)));
1337 * FLD (i_dr) = opval;
1338 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1345 /* lduh-d: lduh $dr,@($slo16,$sr) */
1348 SEM_FN_NAME (m32rbf,lduh_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1350 #define FLD(f) abuf->fields.sfmt_add3.f
1351 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1352 int UNUSED written = 0;
1353 IADDR UNUSED pc = abuf->addr;
1354 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1357 SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))));
1358 * FLD (i_dr) = opval;
1359 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1366 /* ld-plus: ld $dr,@$sr+ */
1369 SEM_FN_NAME (m32rbf,ld_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1371 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1372 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1373 int UNUSED written = 0;
1374 IADDR UNUSED pc = abuf->addr;
1375 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1379 temp0 = GETMEMSI (current_cpu, pc, * FLD (i_sr));
1380 temp1 = ADDSI (* FLD (i_sr), 4);
1383 * FLD (i_dr) = opval;
1384 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1388 * FLD (i_sr) = opval;
1389 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1397 /* ld24: ld24 $dr,$uimm24 */
1400 SEM_FN_NAME (m32rbf,ld24) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1402 #define FLD(f) abuf->fields.sfmt_ld24.f
1403 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1404 int UNUSED written = 0;
1405 IADDR UNUSED pc = abuf->addr;
1406 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1409 SI opval = FLD (i_uimm24);
1410 * FLD (i_dr) = opval;
1411 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1418 /* ldi8: ldi8 $dr,$simm8 */
1421 SEM_FN_NAME (m32rbf,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1423 #define FLD(f) abuf->fields.sfmt_addi.f
1424 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1425 int UNUSED written = 0;
1426 IADDR UNUSED pc = abuf->addr;
1427 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1430 SI opval = FLD (f_simm8);
1431 * FLD (i_dr) = opval;
1432 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1439 /* ldi16: ldi16 $dr,$hash$slo16 */
1442 SEM_FN_NAME (m32rbf,ldi16) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1444 #define FLD(f) abuf->fields.sfmt_add3.f
1445 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1446 int UNUSED written = 0;
1447 IADDR UNUSED pc = abuf->addr;
1448 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1451 SI opval = FLD (f_simm16);
1452 * FLD (i_dr) = opval;
1453 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1460 /* lock: lock $dr,@$sr */
1463 SEM_FN_NAME (m32rbf,lock) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1465 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1466 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1467 int UNUSED written = 0;
1468 IADDR UNUSED pc = abuf->addr;
1469 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1474 CPU (h_lock) = opval;
1475 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
1478 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_sr));
1479 * FLD (i_dr) = opval;
1480 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1488 /* machi: machi $src1,$src2 */
1491 SEM_FN_NAME (m32rbf,machi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1493 #define FLD(f) abuf->fields.sfmt_st_plus.f
1494 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1495 int UNUSED written = 0;
1496 IADDR UNUSED pc = abuf->addr;
1497 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1500 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))))), 8), 8);
1501 SET_H_ACCUM (opval);
1502 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1509 /* maclo: maclo $src1,$src2 */
1512 SEM_FN_NAME (m32rbf,maclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1514 #define FLD(f) abuf->fields.sfmt_st_plus.f
1515 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1516 int UNUSED written = 0;
1517 IADDR UNUSED pc = abuf->addr;
1518 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1521 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))))), 8), 8);
1522 SET_H_ACCUM (opval);
1523 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1530 /* macwhi: macwhi $src1,$src2 */
1533 SEM_FN_NAME (m32rbf,macwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1535 #define FLD(f) abuf->fields.sfmt_st_plus.f
1536 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1537 int UNUSED written = 0;
1538 IADDR UNUSED pc = abuf->addr;
1539 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1542 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16))))), 8), 8);
1543 SET_H_ACCUM (opval);
1544 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1551 /* macwlo: macwlo $src1,$src2 */
1554 SEM_FN_NAME (m32rbf,macwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1556 #define FLD(f) abuf->fields.sfmt_st_plus.f
1557 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1558 int UNUSED written = 0;
1559 IADDR UNUSED pc = abuf->addr;
1560 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1563 DI opval = SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2))))), 8), 8);
1564 SET_H_ACCUM (opval);
1565 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1572 /* mul: mul $dr,$sr */
1575 SEM_FN_NAME (m32rbf,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1577 #define FLD(f) abuf->fields.sfmt_add.f
1578 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1579 int UNUSED written = 0;
1580 IADDR UNUSED pc = abuf->addr;
1581 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1584 SI opval = MULSI (* FLD (i_dr), * FLD (i_sr));
1585 * FLD (i_dr) = opval;
1586 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1593 /* mulhi: mulhi $src1,$src2 */
1596 SEM_FN_NAME (m32rbf,mulhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1598 #define FLD(f) abuf->fields.sfmt_st_plus.f
1599 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1600 int UNUSED written = 0;
1601 IADDR UNUSED pc = abuf->addr;
1602 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1605 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))), 16), 16);
1606 SET_H_ACCUM (opval);
1607 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1614 /* mullo: mullo $src1,$src2 */
1617 SEM_FN_NAME (m32rbf,mullo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1619 #define FLD(f) abuf->fields.sfmt_st_plus.f
1620 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1621 int UNUSED written = 0;
1622 IADDR UNUSED pc = abuf->addr;
1623 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1626 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 16), 16);
1627 SET_H_ACCUM (opval);
1628 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1635 /* mulwhi: mulwhi $src1,$src2 */
1638 SEM_FN_NAME (m32rbf,mulwhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1640 #define FLD(f) abuf->fields.sfmt_st_plus.f
1641 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1642 int UNUSED written = 0;
1643 IADDR UNUSED pc = abuf->addr;
1644 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1647 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2), 16)))), 8), 8);
1648 SET_H_ACCUM (opval);
1649 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1656 /* mulwlo: mulwlo $src1,$src2 */
1659 SEM_FN_NAME (m32rbf,mulwlo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1661 #define FLD(f) abuf->fields.sfmt_st_plus.f
1662 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1663 int UNUSED written = 0;
1664 IADDR UNUSED pc = abuf->addr;
1665 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1668 DI opval = SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1)), EXTHIDI (TRUNCSIHI (* FLD (i_src2)))), 8), 8);
1669 SET_H_ACCUM (opval);
1670 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1677 /* mv: mv $dr,$sr */
1680 SEM_FN_NAME (m32rbf,mv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1682 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1683 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1684 int UNUSED written = 0;
1685 IADDR UNUSED pc = abuf->addr;
1686 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1689 SI opval = * FLD (i_sr);
1690 * FLD (i_dr) = opval;
1691 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1698 /* mvfachi: mvfachi $dr */
1701 SEM_FN_NAME (m32rbf,mvfachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1703 #define FLD(f) abuf->fields.sfmt_seth.f
1704 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1705 int UNUSED written = 0;
1706 IADDR UNUSED pc = abuf->addr;
1707 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1710 SI opval = TRUNCDISI (SRADI (GET_H_ACCUM (), 32));
1711 * FLD (i_dr) = opval;
1712 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1719 /* mvfaclo: mvfaclo $dr */
1722 SEM_FN_NAME (m32rbf,mvfaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1724 #define FLD(f) abuf->fields.sfmt_seth.f
1725 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1726 int UNUSED written = 0;
1727 IADDR UNUSED pc = abuf->addr;
1728 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1731 SI opval = TRUNCDISI (GET_H_ACCUM ());
1732 * FLD (i_dr) = opval;
1733 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1740 /* mvfacmi: mvfacmi $dr */
1743 SEM_FN_NAME (m32rbf,mvfacmi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1745 #define FLD(f) abuf->fields.sfmt_seth.f
1746 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1747 int UNUSED written = 0;
1748 IADDR UNUSED pc = abuf->addr;
1749 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1752 SI opval = TRUNCDISI (SRADI (GET_H_ACCUM (), 16));
1753 * FLD (i_dr) = opval;
1754 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1761 /* mvfc: mvfc $dr,$scr */
1764 SEM_FN_NAME (m32rbf,mvfc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1766 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1767 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1768 int UNUSED written = 0;
1769 IADDR UNUSED pc = abuf->addr;
1770 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1773 SI opval = GET_H_CR (FLD (f_r2));
1774 * FLD (i_dr) = opval;
1775 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1782 /* mvtachi: mvtachi $src1 */
1785 SEM_FN_NAME (m32rbf,mvtachi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1787 #define FLD(f) abuf->fields.sfmt_st_plus.f
1788 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1789 int UNUSED written = 0;
1790 IADDR UNUSED pc = abuf->addr;
1791 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1794 DI opval = ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1)), 32));
1795 SET_H_ACCUM (opval);
1796 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1803 /* mvtaclo: mvtaclo $src1 */
1806 SEM_FN_NAME (m32rbf,mvtaclo) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1808 #define FLD(f) abuf->fields.sfmt_st_plus.f
1809 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1810 int UNUSED written = 0;
1811 IADDR UNUSED pc = abuf->addr;
1812 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1815 DI opval = ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1)));
1816 SET_H_ACCUM (opval);
1817 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1824 /* mvtc: mvtc $sr,$dcr */
1827 SEM_FN_NAME (m32rbf,mvtc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1829 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1830 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1831 int UNUSED written = 0;
1832 IADDR UNUSED pc = abuf->addr;
1833 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1836 USI opval = * FLD (i_sr);
1837 SET_H_CR (FLD (f_r1), opval);
1838 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
1845 /* neg: neg $dr,$sr */
1848 SEM_FN_NAME (m32rbf,neg) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1850 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1851 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1852 int UNUSED written = 0;
1853 IADDR UNUSED pc = abuf->addr;
1854 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1857 SI opval = NEGSI (* FLD (i_sr));
1858 * FLD (i_dr) = opval;
1859 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1869 SEM_FN_NAME (m32rbf,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1871 #define FLD(f) abuf->fields.fmt_empty.f
1872 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1873 int UNUSED written = 0;
1874 IADDR UNUSED pc = abuf->addr;
1875 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1877 PROFILE_COUNT_FILLNOPS (current_cpu, abuf->addr);
1883 /* not: not $dr,$sr */
1886 SEM_FN_NAME (m32rbf,not) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1888 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1890 int UNUSED written = 0;
1891 IADDR UNUSED pc = abuf->addr;
1892 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1895 SI opval = INVSI (* FLD (i_sr));
1896 * FLD (i_dr) = opval;
1897 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1907 SEM_FN_NAME (m32rbf,rac) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1909 #define FLD(f) abuf->fields.fmt_empty.f
1910 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1911 int UNUSED written = 0;
1912 IADDR UNUSED pc = abuf->addr;
1913 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1917 tmp_tmp1 = SLLDI (GET_H_ACCUM (), 1);
1918 tmp_tmp1 = ADDDI (tmp_tmp1, MAKEDI (0, 32768));
1920 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)));
1921 SET_H_ACCUM (opval);
1922 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1933 SEM_FN_NAME (m32rbf,rach) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1935 #define FLD(f) abuf->fields.fmt_empty.f
1936 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1937 int UNUSED written = 0;
1938 IADDR UNUSED pc = abuf->addr;
1939 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1943 tmp_tmp1 = ANDDI (GET_H_ACCUM (), MAKEDI (16777215, 0xffffffff));
1944 if (ANDIF (GEDI (tmp_tmp1, MAKEDI (16383, 0x80000000)), LEDI (tmp_tmp1, MAKEDI (8388607, 0xffffffff)))) {
1945 tmp_tmp1 = MAKEDI (16383, 0x80000000);
1947 if (ANDIF (GEDI (tmp_tmp1, MAKEDI (8388608, 0)), LEDI (tmp_tmp1, MAKEDI (16760832, 0)))) {
1948 tmp_tmp1 = MAKEDI (16760832, 0);
1950 tmp_tmp1 = ANDDI (ADDDI (GET_H_ACCUM (), MAKEDI (0, 1073741824)), MAKEDI (0xffffffff, 0x80000000));
1953 tmp_tmp1 = SLLDI (tmp_tmp1, 1);
1955 DI opval = SRADI (SLLDI (tmp_tmp1, 7), 7);
1956 SET_H_ACCUM (opval);
1957 TRACE_RESULT (current_cpu, abuf, "accum", 'D', opval);
1968 SEM_FN_NAME (m32rbf,rte) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1970 #define FLD(f) abuf->fields.fmt_empty.f
1971 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1972 int UNUSED written = 0;
1973 IADDR UNUSED pc = abuf->addr;
1975 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1979 USI opval = ANDSI (GET_H_CR (((UINT) 6)), -4);
1980 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1981 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1984 USI opval = GET_H_CR (((UINT) 14));
1985 SET_H_CR (((UINT) 6), opval);
1986 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
1989 UQI opval = CPU (h_bpsw);
1991 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
1994 UQI opval = CPU (h_bbpsw);
1995 CPU (h_bpsw) = opval;
1996 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
2000 SEM_BRANCH_FINI (vpc);
2005 /* seth: seth $dr,$hash$hi16 */
2008 SEM_FN_NAME (m32rbf,seth) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2010 #define FLD(f) abuf->fields.sfmt_seth.f
2011 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2012 int UNUSED written = 0;
2013 IADDR UNUSED pc = abuf->addr;
2014 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2017 SI opval = SLLSI (FLD (f_hi16), 16);
2018 * FLD (i_dr) = opval;
2019 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2026 /* sll: sll $dr,$sr */
2029 SEM_FN_NAME (m32rbf,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2031 #define FLD(f) abuf->fields.sfmt_add.f
2032 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2033 int UNUSED written = 0;
2034 IADDR UNUSED pc = abuf->addr;
2035 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2038 SI opval = SLLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2039 * FLD (i_dr) = opval;
2040 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2047 /* sll3: sll3 $dr,$sr,$simm16 */
2050 SEM_FN_NAME (m32rbf,sll3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2052 #define FLD(f) abuf->fields.sfmt_add3.f
2053 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2054 int UNUSED written = 0;
2055 IADDR UNUSED pc = abuf->addr;
2056 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2059 SI opval = SLLSI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2060 * FLD (i_dr) = opval;
2061 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2068 /* slli: slli $dr,$uimm5 */
2071 SEM_FN_NAME (m32rbf,slli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2073 #define FLD(f) abuf->fields.sfmt_slli.f
2074 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2075 int UNUSED written = 0;
2076 IADDR UNUSED pc = abuf->addr;
2077 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2080 SI opval = SLLSI (* FLD (i_dr), FLD (f_uimm5));
2081 * FLD (i_dr) = opval;
2082 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2089 /* sra: sra $dr,$sr */
2092 SEM_FN_NAME (m32rbf,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2094 #define FLD(f) abuf->fields.sfmt_add.f
2095 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2096 int UNUSED written = 0;
2097 IADDR UNUSED pc = abuf->addr;
2098 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2101 SI opval = SRASI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2102 * FLD (i_dr) = opval;
2103 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2110 /* sra3: sra3 $dr,$sr,$simm16 */
2113 SEM_FN_NAME (m32rbf,sra3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2115 #define FLD(f) abuf->fields.sfmt_add3.f
2116 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2117 int UNUSED written = 0;
2118 IADDR UNUSED pc = abuf->addr;
2119 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2122 SI opval = SRASI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2123 * FLD (i_dr) = opval;
2124 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2131 /* srai: srai $dr,$uimm5 */
2134 SEM_FN_NAME (m32rbf,srai) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2136 #define FLD(f) abuf->fields.sfmt_slli.f
2137 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2138 int UNUSED written = 0;
2139 IADDR UNUSED pc = abuf->addr;
2140 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2143 SI opval = SRASI (* FLD (i_dr), FLD (f_uimm5));
2144 * FLD (i_dr) = opval;
2145 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2152 /* srl: srl $dr,$sr */
2155 SEM_FN_NAME (m32rbf,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2157 #define FLD(f) abuf->fields.sfmt_add.f
2158 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2159 int UNUSED written = 0;
2160 IADDR UNUSED pc = abuf->addr;
2161 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2164 SI opval = SRLSI (* FLD (i_dr), ANDSI (* FLD (i_sr), 31));
2165 * FLD (i_dr) = opval;
2166 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2173 /* srl3: srl3 $dr,$sr,$simm16 */
2176 SEM_FN_NAME (m32rbf,srl3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2178 #define FLD(f) abuf->fields.sfmt_add3.f
2179 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2180 int UNUSED written = 0;
2181 IADDR UNUSED pc = abuf->addr;
2182 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2185 SI opval = SRLSI (* FLD (i_sr), ANDSI (FLD (f_simm16), 31));
2186 * FLD (i_dr) = opval;
2187 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2194 /* srli: srli $dr,$uimm5 */
2197 SEM_FN_NAME (m32rbf,srli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2199 #define FLD(f) abuf->fields.sfmt_slli.f
2200 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2201 int UNUSED written = 0;
2202 IADDR UNUSED pc = abuf->addr;
2203 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2206 SI opval = SRLSI (* FLD (i_dr), FLD (f_uimm5));
2207 * FLD (i_dr) = opval;
2208 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2215 /* st: st $src1,@$src2 */
2218 SEM_FN_NAME (m32rbf,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2220 #define FLD(f) abuf->fields.sfmt_st_plus.f
2221 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2222 int UNUSED written = 0;
2223 IADDR UNUSED pc = abuf->addr;
2224 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2227 SI opval = * FLD (i_src1);
2228 SETMEMSI (current_cpu, pc, * FLD (i_src2), opval);
2229 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2236 /* st-d: st $src1,@($slo16,$src2) */
2239 SEM_FN_NAME (m32rbf,st_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2241 #define FLD(f) abuf->fields.sfmt_st_d.f
2242 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2243 int UNUSED written = 0;
2244 IADDR UNUSED pc = abuf->addr;
2245 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2248 SI opval = * FLD (i_src1);
2249 SETMEMSI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2250 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2257 /* stb: stb $src1,@$src2 */
2260 SEM_FN_NAME (m32rbf,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2262 #define FLD(f) abuf->fields.sfmt_st_plus.f
2263 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2264 int UNUSED written = 0;
2265 IADDR UNUSED pc = abuf->addr;
2266 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2269 QI opval = * FLD (i_src1);
2270 SETMEMQI (current_cpu, pc, * FLD (i_src2), opval);
2271 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2278 /* stb-d: stb $src1,@($slo16,$src2) */
2281 SEM_FN_NAME (m32rbf,stb_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2283 #define FLD(f) abuf->fields.sfmt_st_d.f
2284 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2285 int UNUSED written = 0;
2286 IADDR UNUSED pc = abuf->addr;
2287 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2290 QI opval = * FLD (i_src1);
2291 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2292 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2299 /* sth: sth $src1,@$src2 */
2302 SEM_FN_NAME (m32rbf,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2304 #define FLD(f) abuf->fields.sfmt_st_plus.f
2305 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2306 int UNUSED written = 0;
2307 IADDR UNUSED pc = abuf->addr;
2308 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2311 HI opval = * FLD (i_src1);
2312 SETMEMHI (current_cpu, pc, * FLD (i_src2), opval);
2313 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2320 /* sth-d: sth $src1,@($slo16,$src2) */
2323 SEM_FN_NAME (m32rbf,sth_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2325 #define FLD(f) abuf->fields.sfmt_st_d.f
2326 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2327 int UNUSED written = 0;
2328 IADDR UNUSED pc = abuf->addr;
2329 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2332 HI opval = * FLD (i_src1);
2333 SETMEMHI (current_cpu, pc, ADDSI (* FLD (i_src2), FLD (f_simm16)), opval);
2334 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2341 /* st-plus: st $src1,@+$src2 */
2344 SEM_FN_NAME (m32rbf,st_plus) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2346 #define FLD(f) abuf->fields.sfmt_st_plus.f
2347 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2348 int UNUSED written = 0;
2349 IADDR UNUSED pc = abuf->addr;
2350 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2354 tmp_new_src2 = ADDSI (* FLD (i_src2), 4);
2356 SI opval = * FLD (i_src1);
2357 SETMEMSI (current_cpu, pc, tmp_new_src2, opval);
2358 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2361 SI opval = tmp_new_src2;
2362 * FLD (i_src2) = opval;
2363 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2371 /* st-minus: st $src1,@-$src2 */
2374 SEM_FN_NAME (m32rbf,st_minus) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2376 #define FLD(f) abuf->fields.sfmt_st_plus.f
2377 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2378 int UNUSED written = 0;
2379 IADDR UNUSED pc = abuf->addr;
2380 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2384 tmp_new_src2 = SUBSI (* FLD (i_src2), 4);
2386 SI opval = * FLD (i_src1);
2387 SETMEMSI (current_cpu, pc, tmp_new_src2, opval);
2388 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2391 SI opval = tmp_new_src2;
2392 * FLD (i_src2) = opval;
2393 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2401 /* sub: sub $dr,$sr */
2404 SEM_FN_NAME (m32rbf,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2406 #define FLD(f) abuf->fields.sfmt_add.f
2407 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2408 int UNUSED written = 0;
2409 IADDR UNUSED pc = abuf->addr;
2410 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2413 SI opval = SUBSI (* FLD (i_dr), * FLD (i_sr));
2414 * FLD (i_dr) = opval;
2415 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2422 /* subv: subv $dr,$sr */
2425 SEM_FN_NAME (m32rbf,subv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2427 #define FLD(f) abuf->fields.sfmt_add.f
2428 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2429 int UNUSED written = 0;
2430 IADDR UNUSED pc = abuf->addr;
2431 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2435 temp0 = SUBSI (* FLD (i_dr), * FLD (i_sr));
2436 temp1 = SUBOFSI (* FLD (i_dr), * FLD (i_sr), 0);
2439 * FLD (i_dr) = opval;
2440 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2444 CPU (h_cond) = opval;
2445 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
2453 /* subx: subx $dr,$sr */
2456 SEM_FN_NAME (m32rbf,subx) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2458 #define FLD(f) abuf->fields.sfmt_add.f
2459 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2460 int UNUSED written = 0;
2461 IADDR UNUSED pc = abuf->addr;
2462 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2466 temp0 = SUBCSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
2467 temp1 = SUBCFSI (* FLD (i_dr), * FLD (i_sr), CPU (h_cond));
2470 * FLD (i_dr) = opval;
2471 TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
2475 CPU (h_cond) = opval;
2476 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
2484 /* trap: trap $uimm4 */
2487 SEM_FN_NAME (m32rbf,trap) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2489 #define FLD(f) abuf->fields.sfmt_trap.f
2490 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2491 int UNUSED written = 0;
2492 IADDR UNUSED pc = abuf->addr;
2494 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2498 USI opval = GET_H_CR (((UINT) 6));
2499 SET_H_CR (((UINT) 14), opval);
2500 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2503 USI opval = ADDSI (pc, 4);
2504 SET_H_CR (((UINT) 6), opval);
2505 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2508 UQI opval = CPU (h_bpsw);
2509 CPU (h_bbpsw) = opval;
2510 TRACE_RESULT (current_cpu, abuf, "bbpsw", 'x', opval);
2513 UQI opval = GET_H_PSW ();
2514 CPU (h_bpsw) = opval;
2515 TRACE_RESULT (current_cpu, abuf, "bpsw", 'x', opval);
2518 UQI opval = ANDQI (GET_H_PSW (), 128);
2520 TRACE_RESULT (current_cpu, abuf, "psw", 'x', opval);
2523 SI opval = m32r_trap (current_cpu, pc, FLD (f_uimm4));
2524 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
2525 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
2529 SEM_BRANCH_FINI (vpc);
2534 /* unlock: unlock $src1,@$src2 */
2537 SEM_FN_NAME (m32rbf,unlock) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2539 #define FLD(f) abuf->fields.sfmt_st_plus.f
2540 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2541 int UNUSED written = 0;
2542 IADDR UNUSED pc = abuf->addr;
2543 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2548 SI opval = * FLD (i_src1);
2549 SETMEMSI (current_cpu, pc, * FLD (i_src2), opval);
2550 written |= (1 << 4);
2551 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2556 CPU (h_lock) = opval;
2557 TRACE_RESULT (current_cpu, abuf, "lock", 'x', opval);
2561 abuf->written = written;
2566 /* clrpsw: clrpsw $uimm8 */
2569 SEM_FN_NAME (m32rbf,clrpsw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2571 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2572 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2573 int UNUSED written = 0;
2574 IADDR UNUSED pc = abuf->addr;
2575 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2578 USI opval = ANDSI (GET_H_CR (((UINT) 0)), ORSI (ZEXTQISI (INVQI (FLD (f_uimm8))), 65280));
2579 SET_H_CR (((UINT) 0), opval);
2580 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2587 /* setpsw: setpsw $uimm8 */
2590 SEM_FN_NAME (m32rbf,setpsw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2592 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2593 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2594 int UNUSED written = 0;
2595 IADDR UNUSED pc = abuf->addr;
2596 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2599 USI opval = FLD (f_uimm8);
2600 SET_H_CR (((UINT) 0), opval);
2601 TRACE_RESULT (current_cpu, abuf, "cr", 'x', opval);
2608 /* bset: bset $uimm3,@($slo16,$sr) */
2611 SEM_FN_NAME (m32rbf,bset) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2613 #define FLD(f) abuf->fields.sfmt_bset.f
2614 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2615 int UNUSED written = 0;
2616 IADDR UNUSED pc = abuf->addr;
2617 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2620 QI opval = ORQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), SLLQI (1, SUBSI (7, FLD (f_uimm3))));
2621 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval);
2622 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2629 /* bclr: bclr $uimm3,@($slo16,$sr) */
2632 SEM_FN_NAME (m32rbf,bclr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2634 #define FLD(f) abuf->fields.sfmt_bset.f
2635 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2636 int UNUSED written = 0;
2637 IADDR UNUSED pc = abuf->addr;
2638 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2641 QI opval = ANDQI (GETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16))), INVQI (SLLQI (1, SUBSI (7, FLD (f_uimm3)))));
2642 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_sr), FLD (f_simm16)), opval);
2643 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2650 /* btst: btst $uimm3,$sr */
2653 SEM_FN_NAME (m32rbf,btst) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2655 #define FLD(f) abuf->fields.sfmt_bset.f
2656 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2657 int UNUSED written = 0;
2658 IADDR UNUSED pc = abuf->addr;
2659 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2662 BI opval = ANDQI (SRLQI (* FLD (i_sr), SUBSI (7, FLD (f_uimm3))), 1);
2663 CPU (h_cond) = opval;
2664 TRACE_RESULT (current_cpu, abuf, "cond", 'x', opval);
2671 /* Table of all semantic fns. */
2673 static const struct sem_fn_desc sem_fns[] = {
2674 { M32RBF_INSN_X_INVALID, SEM_FN_NAME (m32rbf,x_invalid) },
2675 { M32RBF_INSN_X_AFTER, SEM_FN_NAME (m32rbf,x_after) },
2676 { M32RBF_INSN_X_BEFORE, SEM_FN_NAME (m32rbf,x_before) },
2677 { M32RBF_INSN_X_CTI_CHAIN, SEM_FN_NAME (m32rbf,x_cti_chain) },
2678 { M32RBF_INSN_X_CHAIN, SEM_FN_NAME (m32rbf,x_chain) },
2679 { M32RBF_INSN_X_BEGIN, SEM_FN_NAME (m32rbf,x_begin) },
2680 { M32RBF_INSN_ADD, SEM_FN_NAME (m32rbf,add) },
2681 { M32RBF_INSN_ADD3, SEM_FN_NAME (m32rbf,add3) },
2682 { M32RBF_INSN_AND, SEM_FN_NAME (m32rbf,and) },
2683 { M32RBF_INSN_AND3, SEM_FN_NAME (m32rbf,and3) },
2684 { M32RBF_INSN_OR, SEM_FN_NAME (m32rbf,or) },
2685 { M32RBF_INSN_OR3, SEM_FN_NAME (m32rbf,or3) },
2686 { M32RBF_INSN_XOR, SEM_FN_NAME (m32rbf,xor) },
2687 { M32RBF_INSN_XOR3, SEM_FN_NAME (m32rbf,xor3) },
2688 { M32RBF_INSN_ADDI, SEM_FN_NAME (m32rbf,addi) },
2689 { M32RBF_INSN_ADDV, SEM_FN_NAME (m32rbf,addv) },
2690 { M32RBF_INSN_ADDV3, SEM_FN_NAME (m32rbf,addv3) },
2691 { M32RBF_INSN_ADDX, SEM_FN_NAME (m32rbf,addx) },
2692 { M32RBF_INSN_BC8, SEM_FN_NAME (m32rbf,bc8) },
2693 { M32RBF_INSN_BC24, SEM_FN_NAME (m32rbf,bc24) },
2694 { M32RBF_INSN_BEQ, SEM_FN_NAME (m32rbf,beq) },
2695 { M32RBF_INSN_BEQZ, SEM_FN_NAME (m32rbf,beqz) },
2696 { M32RBF_INSN_BGEZ, SEM_FN_NAME (m32rbf,bgez) },
2697 { M32RBF_INSN_BGTZ, SEM_FN_NAME (m32rbf,bgtz) },
2698 { M32RBF_INSN_BLEZ, SEM_FN_NAME (m32rbf,blez) },
2699 { M32RBF_INSN_BLTZ, SEM_FN_NAME (m32rbf,bltz) },
2700 { M32RBF_INSN_BNEZ, SEM_FN_NAME (m32rbf,bnez) },
2701 { M32RBF_INSN_BL8, SEM_FN_NAME (m32rbf,bl8) },
2702 { M32RBF_INSN_BL24, SEM_FN_NAME (m32rbf,bl24) },
2703 { M32RBF_INSN_BNC8, SEM_FN_NAME (m32rbf,bnc8) },
2704 { M32RBF_INSN_BNC24, SEM_FN_NAME (m32rbf,bnc24) },
2705 { M32RBF_INSN_BNE, SEM_FN_NAME (m32rbf,bne) },
2706 { M32RBF_INSN_BRA8, SEM_FN_NAME (m32rbf,bra8) },
2707 { M32RBF_INSN_BRA24, SEM_FN_NAME (m32rbf,bra24) },
2708 { M32RBF_INSN_CMP, SEM_FN_NAME (m32rbf,cmp) },
2709 { M32RBF_INSN_CMPI, SEM_FN_NAME (m32rbf,cmpi) },
2710 { M32RBF_INSN_CMPU, SEM_FN_NAME (m32rbf,cmpu) },
2711 { M32RBF_INSN_CMPUI, SEM_FN_NAME (m32rbf,cmpui) },
2712 { M32RBF_INSN_DIV, SEM_FN_NAME (m32rbf,div) },
2713 { M32RBF_INSN_DIVU, SEM_FN_NAME (m32rbf,divu) },
2714 { M32RBF_INSN_REM, SEM_FN_NAME (m32rbf,rem) },
2715 { M32RBF_INSN_REMU, SEM_FN_NAME (m32rbf,remu) },
2716 { M32RBF_INSN_JL, SEM_FN_NAME (m32rbf,jl) },
2717 { M32RBF_INSN_JMP, SEM_FN_NAME (m32rbf,jmp) },
2718 { M32RBF_INSN_LD, SEM_FN_NAME (m32rbf,ld) },
2719 { M32RBF_INSN_LD_D, SEM_FN_NAME (m32rbf,ld_d) },
2720 { M32RBF_INSN_LDB, SEM_FN_NAME (m32rbf,ldb) },
2721 { M32RBF_INSN_LDB_D, SEM_FN_NAME (m32rbf,ldb_d) },
2722 { M32RBF_INSN_LDH, SEM_FN_NAME (m32rbf,ldh) },
2723 { M32RBF_INSN_LDH_D, SEM_FN_NAME (m32rbf,ldh_d) },
2724 { M32RBF_INSN_LDUB, SEM_FN_NAME (m32rbf,ldub) },
2725 { M32RBF_INSN_LDUB_D, SEM_FN_NAME (m32rbf,ldub_d) },
2726 { M32RBF_INSN_LDUH, SEM_FN_NAME (m32rbf,lduh) },
2727 { M32RBF_INSN_LDUH_D, SEM_FN_NAME (m32rbf,lduh_d) },
2728 { M32RBF_INSN_LD_PLUS, SEM_FN_NAME (m32rbf,ld_plus) },
2729 { M32RBF_INSN_LD24, SEM_FN_NAME (m32rbf,ld24) },
2730 { M32RBF_INSN_LDI8, SEM_FN_NAME (m32rbf,ldi8) },
2731 { M32RBF_INSN_LDI16, SEM_FN_NAME (m32rbf,ldi16) },
2732 { M32RBF_INSN_LOCK, SEM_FN_NAME (m32rbf,lock) },
2733 { M32RBF_INSN_MACHI, SEM_FN_NAME (m32rbf,machi) },
2734 { M32RBF_INSN_MACLO, SEM_FN_NAME (m32rbf,maclo) },
2735 { M32RBF_INSN_MACWHI, SEM_FN_NAME (m32rbf,macwhi) },
2736 { M32RBF_INSN_MACWLO, SEM_FN_NAME (m32rbf,macwlo) },
2737 { M32RBF_INSN_MUL, SEM_FN_NAME (m32rbf,mul) },
2738 { M32RBF_INSN_MULHI, SEM_FN_NAME (m32rbf,mulhi) },
2739 { M32RBF_INSN_MULLO, SEM_FN_NAME (m32rbf,mullo) },
2740 { M32RBF_INSN_MULWHI, SEM_FN_NAME (m32rbf,mulwhi) },
2741 { M32RBF_INSN_MULWLO, SEM_FN_NAME (m32rbf,mulwlo) },
2742 { M32RBF_INSN_MV, SEM_FN_NAME (m32rbf,mv) },
2743 { M32RBF_INSN_MVFACHI, SEM_FN_NAME (m32rbf,mvfachi) },
2744 { M32RBF_INSN_MVFACLO, SEM_FN_NAME (m32rbf,mvfaclo) },
2745 { M32RBF_INSN_MVFACMI, SEM_FN_NAME (m32rbf,mvfacmi) },
2746 { M32RBF_INSN_MVFC, SEM_FN_NAME (m32rbf,mvfc) },
2747 { M32RBF_INSN_MVTACHI, SEM_FN_NAME (m32rbf,mvtachi) },
2748 { M32RBF_INSN_MVTACLO, SEM_FN_NAME (m32rbf,mvtaclo) },
2749 { M32RBF_INSN_MVTC, SEM_FN_NAME (m32rbf,mvtc) },
2750 { M32RBF_INSN_NEG, SEM_FN_NAME (m32rbf,neg) },
2751 { M32RBF_INSN_NOP, SEM_FN_NAME (m32rbf,nop) },
2752 { M32RBF_INSN_NOT, SEM_FN_NAME (m32rbf,not) },
2753 { M32RBF_INSN_RAC, SEM_FN_NAME (m32rbf,rac) },
2754 { M32RBF_INSN_RACH, SEM_FN_NAME (m32rbf,rach) },
2755 { M32RBF_INSN_RTE, SEM_FN_NAME (m32rbf,rte) },
2756 { M32RBF_INSN_SETH, SEM_FN_NAME (m32rbf,seth) },
2757 { M32RBF_INSN_SLL, SEM_FN_NAME (m32rbf,sll) },
2758 { M32RBF_INSN_SLL3, SEM_FN_NAME (m32rbf,sll3) },
2759 { M32RBF_INSN_SLLI, SEM_FN_NAME (m32rbf,slli) },
2760 { M32RBF_INSN_SRA, SEM_FN_NAME (m32rbf,sra) },
2761 { M32RBF_INSN_SRA3, SEM_FN_NAME (m32rbf,sra3) },
2762 { M32RBF_INSN_SRAI, SEM_FN_NAME (m32rbf,srai) },
2763 { M32RBF_INSN_SRL, SEM_FN_NAME (m32rbf,srl) },
2764 { M32RBF_INSN_SRL3, SEM_FN_NAME (m32rbf,srl3) },
2765 { M32RBF_INSN_SRLI, SEM_FN_NAME (m32rbf,srli) },
2766 { M32RBF_INSN_ST, SEM_FN_NAME (m32rbf,st) },
2767 { M32RBF_INSN_ST_D, SEM_FN_NAME (m32rbf,st_d) },
2768 { M32RBF_INSN_STB, SEM_FN_NAME (m32rbf,stb) },
2769 { M32RBF_INSN_STB_D, SEM_FN_NAME (m32rbf,stb_d) },
2770 { M32RBF_INSN_STH, SEM_FN_NAME (m32rbf,sth) },
2771 { M32RBF_INSN_STH_D, SEM_FN_NAME (m32rbf,sth_d) },
2772 { M32RBF_INSN_ST_PLUS, SEM_FN_NAME (m32rbf,st_plus) },
2773 { M32RBF_INSN_ST_MINUS, SEM_FN_NAME (m32rbf,st_minus) },
2774 { M32RBF_INSN_SUB, SEM_FN_NAME (m32rbf,sub) },
2775 { M32RBF_INSN_SUBV, SEM_FN_NAME (m32rbf,subv) },
2776 { M32RBF_INSN_SUBX, SEM_FN_NAME (m32rbf,subx) },
2777 { M32RBF_INSN_TRAP, SEM_FN_NAME (m32rbf,trap) },
2778 { M32RBF_INSN_UNLOCK, SEM_FN_NAME (m32rbf,unlock) },
2779 { M32RBF_INSN_CLRPSW, SEM_FN_NAME (m32rbf,clrpsw) },
2780 { M32RBF_INSN_SETPSW, SEM_FN_NAME (m32rbf,setpsw) },
2781 { M32RBF_INSN_BSET, SEM_FN_NAME (m32rbf,bset) },
2782 { M32RBF_INSN_BCLR, SEM_FN_NAME (m32rbf,bclr) },
2783 { M32RBF_INSN_BTST, SEM_FN_NAME (m32rbf,btst) },
2787 /* Add the semantic fns to IDESC_TABLE. */
2790 SEM_FN_NAME (m32rbf,init_idesc_table) (SIM_CPU *current_cpu)
2792 IDESC *idesc_table = CPU_IDESC (current_cpu);
2793 const struct sem_fn_desc *sf;
2794 int mach_num = MACH_NUM (CPU_MACH (current_cpu));
2796 for (sf = &sem_fns[0]; sf->fn != 0; ++sf)
2798 const CGEN_INSN *insn = idesc_table[sf->index].idata;
2799 int valid_p = (CGEN_INSN_VIRTUAL_P (insn)
2800 || CGEN_INSN_MACH_HAS_P (insn, mach_num));
2803 idesc_table[sf->index].sem_fast = sf->fn;
2805 idesc_table[sf->index].sem_fast = SEM_FN_NAME (m32rbf,x_invalid);
2808 idesc_table[sf->index].sem_full = sf->fn;
2810 idesc_table[sf->index].sem_full = SEM_FN_NAME (m32rbf,x_invalid);