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/>.
24 #define WANT_CPU m32rbf
25 #define WANT_CPU_M32RBF
32 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
33 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
35 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
38 /* This is used so that we can compile two copies of the semantic code,
39 one with full feature support and one without that runs fast(er).
40 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
42 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
44 #define TRACE_RESULT(cpu, abuf, name, type, val)
46 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
49 /* x-invalid: --invalid-- */
52 SEM_FN_NAME (m32rbf
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
54 #define FLD(f) abuf->fields.fmt_empty.f
55 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
56 int UNUSED written
= 0;
57 IADDR UNUSED pc
= abuf
->addr
;
58 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
61 /* Update the recorded pc in the cpu state struct.
62 Only necessary for WITH_SCACHE case, but to avoid the
63 conditional compilation .... */
65 /* Virtual insns have zero size. Overwrite vpc with address of next insn
66 using the default-insn-bitsize spec. When executing insns in parallel
67 we may want to queue the fault and continue execution. */
68 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
69 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
76 /* x-after: --after-- */
79 SEM_FN_NAME (m32rbf
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
81 #define FLD(f) abuf->fields.fmt_empty.f
82 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
83 int UNUSED written
= 0;
84 IADDR UNUSED pc
= abuf
->addr
;
85 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
88 #if WITH_SCACHE_PBB_M32RBF
89 m32rbf_pbb_after (current_cpu
, sem_arg
);
97 /* x-before: --before-- */
100 SEM_FN_NAME (m32rbf
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
102 #define FLD(f) abuf->fields.fmt_empty.f
103 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
104 int UNUSED written
= 0;
105 IADDR UNUSED pc
= abuf
->addr
;
106 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
109 #if WITH_SCACHE_PBB_M32RBF
110 m32rbf_pbb_before (current_cpu
, sem_arg
);
118 /* x-cti-chain: --cti-chain-- */
121 SEM_FN_NAME (m32rbf
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
123 #define FLD(f) abuf->fields.fmt_empty.f
124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
125 int UNUSED written
= 0;
126 IADDR UNUSED pc
= abuf
->addr
;
127 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
130 #if WITH_SCACHE_PBB_M32RBF
132 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
133 pbb_br_type
, pbb_br_npc
);
136 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
137 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
138 CPU_PBB_BR_TYPE (current_cpu
),
139 CPU_PBB_BR_NPC (current_cpu
));
148 /* x-chain: --chain-- */
151 SEM_FN_NAME (m32rbf
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
153 #define FLD(f) abuf->fields.fmt_empty.f
154 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
155 int UNUSED written
= 0;
156 IADDR UNUSED pc
= abuf
->addr
;
157 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
160 #if WITH_SCACHE_PBB_M32RBF
161 vpc
= m32rbf_pbb_chain (current_cpu
, sem_arg
);
172 /* x-begin: --begin-- */
175 SEM_FN_NAME (m32rbf
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
177 #define FLD(f) abuf->fields.fmt_empty.f
178 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
179 int UNUSED written
= 0;
180 IADDR UNUSED pc
= abuf
->addr
;
181 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
184 #if WITH_SCACHE_PBB_M32RBF
185 #if defined DEFINE_SWITCH || defined FAST_P
186 /* In the switch case FAST_P is a constant, allowing several optimizations
187 in any called inline functions. */
188 vpc
= m32rbf_pbb_begin (current_cpu
, FAST_P
);
190 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
191 vpc
= m32rbf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
193 vpc
= m32rbf_pbb_begin (current_cpu
, 0);
203 /* add: add $dr,$sr */
206 SEM_FN_NAME (m32rbf
,add
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
208 #define FLD(f) abuf->fields.sfmt_add.f
209 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
210 int UNUSED written
= 0;
211 IADDR UNUSED pc
= abuf
->addr
;
212 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
215 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
216 * FLD (i_dr
) = opval
;
217 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
224 /* add3: add3 $dr,$sr,$hash$slo16 */
227 SEM_FN_NAME (m32rbf
,add3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
229 #define FLD(f) abuf->fields.sfmt_add3.f
230 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
231 int UNUSED written
= 0;
232 IADDR UNUSED pc
= abuf
->addr
;
233 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
236 SI opval
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
237 * FLD (i_dr
) = opval
;
238 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
245 /* and: and $dr,$sr */
248 SEM_FN_NAME (m32rbf
,and) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
250 #define FLD(f) abuf->fields.sfmt_add.f
251 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
252 int UNUSED written
= 0;
253 IADDR UNUSED pc
= abuf
->addr
;
254 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
257 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
258 * FLD (i_dr
) = opval
;
259 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
266 /* and3: and3 $dr,$sr,$uimm16 */
269 SEM_FN_NAME (m32rbf
,and3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
271 #define FLD(f) abuf->fields.sfmt_and3.f
272 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
273 int UNUSED written
= 0;
274 IADDR UNUSED pc
= abuf
->addr
;
275 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
278 SI opval
= ANDSI (* FLD (i_sr
), FLD (f_uimm16
));
279 * FLD (i_dr
) = opval
;
280 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
290 SEM_FN_NAME (m32rbf
,or) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
292 #define FLD(f) abuf->fields.sfmt_add.f
293 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
294 int UNUSED written
= 0;
295 IADDR UNUSED pc
= abuf
->addr
;
296 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
299 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
300 * FLD (i_dr
) = opval
;
301 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
308 /* or3: or3 $dr,$sr,$hash$ulo16 */
311 SEM_FN_NAME (m32rbf
,or3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
313 #define FLD(f) abuf->fields.sfmt_and3.f
314 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
315 int UNUSED written
= 0;
316 IADDR UNUSED pc
= abuf
->addr
;
317 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
320 SI opval
= ORSI (* FLD (i_sr
), FLD (f_uimm16
));
321 * FLD (i_dr
) = opval
;
322 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
329 /* xor: xor $dr,$sr */
332 SEM_FN_NAME (m32rbf
,xor) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
334 #define FLD(f) abuf->fields.sfmt_add.f
335 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
336 int UNUSED written
= 0;
337 IADDR UNUSED pc
= abuf
->addr
;
338 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
341 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
342 * FLD (i_dr
) = opval
;
343 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
350 /* xor3: xor3 $dr,$sr,$uimm16 */
353 SEM_FN_NAME (m32rbf
,xor3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
355 #define FLD(f) abuf->fields.sfmt_and3.f
356 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
357 int UNUSED written
= 0;
358 IADDR UNUSED pc
= abuf
->addr
;
359 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
362 SI opval
= XORSI (* FLD (i_sr
), FLD (f_uimm16
));
363 * FLD (i_dr
) = opval
;
364 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
371 /* addi: addi $dr,$simm8 */
374 SEM_FN_NAME (m32rbf
,addi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
376 #define FLD(f) abuf->fields.sfmt_addi.f
377 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
378 int UNUSED written
= 0;
379 IADDR UNUSED pc
= abuf
->addr
;
380 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
383 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
384 * FLD (i_dr
) = opval
;
385 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
392 /* addv: addv $dr,$sr */
395 SEM_FN_NAME (m32rbf
,addv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
397 #define FLD(f) abuf->fields.sfmt_add.f
398 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
399 int UNUSED written
= 0;
400 IADDR UNUSED pc
= abuf
->addr
;
401 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
405 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
406 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
409 * FLD (i_dr
) = opval
;
410 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
414 CPU (h_cond
) = opval
;
415 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
423 /* addv3: addv3 $dr,$sr,$simm16 */
426 SEM_FN_NAME (m32rbf
,addv3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
428 #define FLD(f) abuf->fields.sfmt_add3.f
429 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
430 int UNUSED written
= 0;
431 IADDR UNUSED pc
= abuf
->addr
;
432 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
436 temp0
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
437 temp1
= ADDOFSI (* FLD (i_sr
), FLD (f_simm16
), 0);
440 * FLD (i_dr
) = opval
;
441 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
445 CPU (h_cond
) = opval
;
446 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
454 /* addx: addx $dr,$sr */
457 SEM_FN_NAME (m32rbf
,addx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
459 #define FLD(f) abuf->fields.sfmt_add.f
460 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
461 int UNUSED written
= 0;
462 IADDR UNUSED pc
= abuf
->addr
;
463 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
467 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
468 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
471 * FLD (i_dr
) = opval
;
472 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
476 CPU (h_cond
) = opval
;
477 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
485 /* bc8: bc.s $disp8 */
488 SEM_FN_NAME (m32rbf
,bc8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
490 #define FLD(f) abuf->fields.sfmt_bl8.f
491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
492 int UNUSED written
= 0;
493 IADDR UNUSED pc
= abuf
->addr
;
495 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
499 USI opval
= FLD (i_disp8
);
500 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
502 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
506 abuf
->written
= written
;
507 SEM_BRANCH_FINI (vpc
);
512 /* bc24: bc.l $disp24 */
515 SEM_FN_NAME (m32rbf
,bc24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
517 #define FLD(f) abuf->fields.sfmt_bl24.f
518 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
519 int UNUSED written
= 0;
520 IADDR UNUSED pc
= abuf
->addr
;
522 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
526 USI opval
= FLD (i_disp24
);
527 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
529 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
533 abuf
->written
= written
;
534 SEM_BRANCH_FINI (vpc
);
539 /* beq: beq $src1,$src2,$disp16 */
542 SEM_FN_NAME (m32rbf
,beq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
544 #define FLD(f) abuf->fields.sfmt_beq.f
545 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
546 int UNUSED written
= 0;
547 IADDR UNUSED pc
= abuf
->addr
;
549 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
551 if (EQSI (* FLD (i_src1
), * FLD (i_src2
))) {
553 USI opval
= FLD (i_disp16
);
554 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
556 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
560 abuf
->written
= written
;
561 SEM_BRANCH_FINI (vpc
);
566 /* beqz: beqz $src2,$disp16 */
569 SEM_FN_NAME (m32rbf
,beqz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
571 #define FLD(f) abuf->fields.sfmt_beq.f
572 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
573 int UNUSED written
= 0;
574 IADDR UNUSED pc
= abuf
->addr
;
576 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
578 if (EQSI (* FLD (i_src2
), 0)) {
580 USI opval
= FLD (i_disp16
);
581 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
583 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
587 abuf
->written
= written
;
588 SEM_BRANCH_FINI (vpc
);
593 /* bgez: bgez $src2,$disp16 */
596 SEM_FN_NAME (m32rbf
,bgez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
598 #define FLD(f) abuf->fields.sfmt_beq.f
599 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
600 int UNUSED written
= 0;
601 IADDR UNUSED pc
= abuf
->addr
;
603 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
605 if (GESI (* FLD (i_src2
), 0)) {
607 USI opval
= FLD (i_disp16
);
608 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
610 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
614 abuf
->written
= written
;
615 SEM_BRANCH_FINI (vpc
);
620 /* bgtz: bgtz $src2,$disp16 */
623 SEM_FN_NAME (m32rbf
,bgtz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
625 #define FLD(f) abuf->fields.sfmt_beq.f
626 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
627 int UNUSED written
= 0;
628 IADDR UNUSED pc
= abuf
->addr
;
630 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
632 if (GTSI (* FLD (i_src2
), 0)) {
634 USI opval
= FLD (i_disp16
);
635 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
637 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
641 abuf
->written
= written
;
642 SEM_BRANCH_FINI (vpc
);
647 /* blez: blez $src2,$disp16 */
650 SEM_FN_NAME (m32rbf
,blez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
652 #define FLD(f) abuf->fields.sfmt_beq.f
653 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
654 int UNUSED written
= 0;
655 IADDR UNUSED pc
= abuf
->addr
;
657 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
659 if (LESI (* FLD (i_src2
), 0)) {
661 USI opval
= FLD (i_disp16
);
662 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
664 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
668 abuf
->written
= written
;
669 SEM_BRANCH_FINI (vpc
);
674 /* bltz: bltz $src2,$disp16 */
677 SEM_FN_NAME (m32rbf
,bltz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
679 #define FLD(f) abuf->fields.sfmt_beq.f
680 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
681 int UNUSED written
= 0;
682 IADDR UNUSED pc
= abuf
->addr
;
684 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
686 if (LTSI (* FLD (i_src2
), 0)) {
688 USI opval
= FLD (i_disp16
);
689 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
691 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
695 abuf
->written
= written
;
696 SEM_BRANCH_FINI (vpc
);
701 /* bnez: bnez $src2,$disp16 */
704 SEM_FN_NAME (m32rbf
,bnez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
706 #define FLD(f) abuf->fields.sfmt_beq.f
707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
708 int UNUSED written
= 0;
709 IADDR UNUSED pc
= abuf
->addr
;
711 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
713 if (NESI (* FLD (i_src2
), 0)) {
715 USI opval
= FLD (i_disp16
);
716 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
718 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
722 abuf
->written
= written
;
723 SEM_BRANCH_FINI (vpc
);
728 /* bl8: bl.s $disp8 */
731 SEM_FN_NAME (m32rbf
,bl8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
733 #define FLD(f) abuf->fields.sfmt_bl8.f
734 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
735 int UNUSED written
= 0;
736 IADDR UNUSED pc
= abuf
->addr
;
738 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
742 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
743 CPU (h_gr
[((UINT
) 14)]) = opval
;
744 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
747 USI opval
= FLD (i_disp8
);
748 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
749 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
753 SEM_BRANCH_FINI (vpc
);
758 /* bl24: bl.l $disp24 */
761 SEM_FN_NAME (m32rbf
,bl24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
763 #define FLD(f) abuf->fields.sfmt_bl24.f
764 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
765 int UNUSED written
= 0;
766 IADDR UNUSED pc
= abuf
->addr
;
768 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
772 SI opval
= ADDSI (pc
, 4);
773 CPU (h_gr
[((UINT
) 14)]) = opval
;
774 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
777 USI opval
= FLD (i_disp24
);
778 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
779 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
783 SEM_BRANCH_FINI (vpc
);
788 /* bnc8: bnc.s $disp8 */
791 SEM_FN_NAME (m32rbf
,bnc8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
793 #define FLD(f) abuf->fields.sfmt_bl8.f
794 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
795 int UNUSED written
= 0;
796 IADDR UNUSED pc
= abuf
->addr
;
798 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
800 if (NOTBI (CPU (h_cond
))) {
802 USI opval
= FLD (i_disp8
);
803 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
805 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
809 abuf
->written
= written
;
810 SEM_BRANCH_FINI (vpc
);
815 /* bnc24: bnc.l $disp24 */
818 SEM_FN_NAME (m32rbf
,bnc24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
820 #define FLD(f) abuf->fields.sfmt_bl24.f
821 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
822 int UNUSED written
= 0;
823 IADDR UNUSED pc
= abuf
->addr
;
825 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
827 if (NOTBI (CPU (h_cond
))) {
829 USI opval
= FLD (i_disp24
);
830 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
832 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
836 abuf
->written
= written
;
837 SEM_BRANCH_FINI (vpc
);
842 /* bne: bne $src1,$src2,$disp16 */
845 SEM_FN_NAME (m32rbf
,bne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
847 #define FLD(f) abuf->fields.sfmt_beq.f
848 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
849 int UNUSED written
= 0;
850 IADDR UNUSED pc
= abuf
->addr
;
852 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
854 if (NESI (* FLD (i_src1
), * FLD (i_src2
))) {
856 USI opval
= FLD (i_disp16
);
857 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
859 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
863 abuf
->written
= written
;
864 SEM_BRANCH_FINI (vpc
);
869 /* bra8: bra.s $disp8 */
872 SEM_FN_NAME (m32rbf
,bra8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
874 #define FLD(f) abuf->fields.sfmt_bl8.f
875 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
876 int UNUSED written
= 0;
877 IADDR UNUSED pc
= abuf
->addr
;
879 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
882 USI opval
= FLD (i_disp8
);
883 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
884 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
887 SEM_BRANCH_FINI (vpc
);
892 /* bra24: bra.l $disp24 */
895 SEM_FN_NAME (m32rbf
,bra24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
897 #define FLD(f) abuf->fields.sfmt_bl24.f
898 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
899 int UNUSED written
= 0;
900 IADDR UNUSED pc
= abuf
->addr
;
902 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
905 USI opval
= FLD (i_disp24
);
906 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
907 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
910 SEM_BRANCH_FINI (vpc
);
915 /* cmp: cmp $src1,$src2 */
918 SEM_FN_NAME (m32rbf
,cmp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
920 #define FLD(f) abuf->fields.sfmt_st_plus.f
921 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
922 int UNUSED written
= 0;
923 IADDR UNUSED pc
= abuf
->addr
;
924 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
927 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
928 CPU (h_cond
) = opval
;
929 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
936 /* cmpi: cmpi $src2,$simm16 */
939 SEM_FN_NAME (m32rbf
,cmpi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
941 #define FLD(f) abuf->fields.sfmt_st_d.f
942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
943 int UNUSED written
= 0;
944 IADDR UNUSED pc
= abuf
->addr
;
945 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
948 BI opval
= LTSI (* FLD (i_src2
), FLD (f_simm16
));
949 CPU (h_cond
) = opval
;
950 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
957 /* cmpu: cmpu $src1,$src2 */
960 SEM_FN_NAME (m32rbf
,cmpu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
962 #define FLD(f) abuf->fields.sfmt_st_plus.f
963 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
964 int UNUSED written
= 0;
965 IADDR UNUSED pc
= abuf
->addr
;
966 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
969 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
970 CPU (h_cond
) = opval
;
971 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
978 /* cmpui: cmpui $src2,$simm16 */
981 SEM_FN_NAME (m32rbf
,cmpui
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
983 #define FLD(f) abuf->fields.sfmt_st_d.f
984 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
985 int UNUSED written
= 0;
986 IADDR UNUSED pc
= abuf
->addr
;
987 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
990 BI opval
= LTUSI (* FLD (i_src2
), FLD (f_simm16
));
991 CPU (h_cond
) = opval
;
992 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
999 /* div: div $dr,$sr */
1002 SEM_FN_NAME (m32rbf
,div
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1004 #define FLD(f) abuf->fields.sfmt_add.f
1005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1006 int UNUSED written
= 0;
1007 IADDR UNUSED pc
= abuf
->addr
;
1008 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1010 if (NESI (* FLD (i_sr
), 0)) {
1012 SI opval
= DIVSI (* FLD (i_dr
), * FLD (i_sr
));
1013 * FLD (i_dr
) = opval
;
1014 written
|= (1 << 2);
1015 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1019 abuf
->written
= written
;
1024 /* divu: divu $dr,$sr */
1027 SEM_FN_NAME (m32rbf
,divu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1029 #define FLD(f) abuf->fields.sfmt_add.f
1030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1031 int UNUSED written
= 0;
1032 IADDR UNUSED pc
= abuf
->addr
;
1033 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1035 if (NESI (* FLD (i_sr
), 0)) {
1037 SI opval
= UDIVSI (* FLD (i_dr
), * FLD (i_sr
));
1038 * FLD (i_dr
) = opval
;
1039 written
|= (1 << 2);
1040 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1044 abuf
->written
= written
;
1049 /* rem: rem $dr,$sr */
1052 SEM_FN_NAME (m32rbf
,rem
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1054 #define FLD(f) abuf->fields.sfmt_add.f
1055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1056 int UNUSED written
= 0;
1057 IADDR UNUSED pc
= abuf
->addr
;
1058 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1060 if (NESI (* FLD (i_sr
), 0)) {
1062 SI opval
= MODSI (* FLD (i_dr
), * FLD (i_sr
));
1063 * FLD (i_dr
) = opval
;
1064 written
|= (1 << 2);
1065 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1069 abuf
->written
= written
;
1074 /* remu: remu $dr,$sr */
1077 SEM_FN_NAME (m32rbf
,remu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1079 #define FLD(f) abuf->fields.sfmt_add.f
1080 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1081 int UNUSED written
= 0;
1082 IADDR UNUSED pc
= abuf
->addr
;
1083 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1085 if (NESI (* FLD (i_sr
), 0)) {
1087 SI opval
= UMODSI (* FLD (i_dr
), * FLD (i_sr
));
1088 * FLD (i_dr
) = opval
;
1089 written
|= (1 << 2);
1090 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1094 abuf
->written
= written
;
1102 SEM_FN_NAME (m32rbf
,jl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1104 #define FLD(f) abuf->fields.sfmt_jl.f
1105 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1106 int UNUSED written
= 0;
1107 IADDR UNUSED pc
= abuf
->addr
;
1109 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1113 temp0
= ADDSI (ANDSI (pc
, -4), 4);
1114 temp1
= ANDSI (* FLD (i_sr
), -4);
1117 CPU (h_gr
[((UINT
) 14)]) = opval
;
1118 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1122 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1123 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1127 SEM_BRANCH_FINI (vpc
);
1135 SEM_FN_NAME (m32rbf
,jmp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1137 #define FLD(f) abuf->fields.sfmt_jl.f
1138 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1139 int UNUSED written
= 0;
1140 IADDR UNUSED pc
= abuf
->addr
;
1142 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1145 USI opval
= ANDSI (* FLD (i_sr
), -4);
1146 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1147 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1150 SEM_BRANCH_FINI (vpc
);
1155 /* ld: ld $dr,@$sr */
1158 SEM_FN_NAME (m32rbf
,ld
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1160 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1161 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1162 int UNUSED written
= 0;
1163 IADDR UNUSED pc
= abuf
->addr
;
1164 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1167 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1168 * FLD (i_dr
) = opval
;
1169 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1176 /* ld-d: ld $dr,@($slo16,$sr) */
1179 SEM_FN_NAME (m32rbf
,ld_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1181 #define FLD(f) abuf->fields.sfmt_add3.f
1182 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1183 int UNUSED written
= 0;
1184 IADDR UNUSED pc
= abuf
->addr
;
1185 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1188 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)));
1189 * FLD (i_dr
) = opval
;
1190 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1197 /* ldb: ldb $dr,@$sr */
1200 SEM_FN_NAME (m32rbf
,ldb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1202 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1203 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1204 int UNUSED written
= 0;
1205 IADDR UNUSED pc
= abuf
->addr
;
1206 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1209 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1210 * FLD (i_dr
) = opval
;
1211 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1218 /* ldb-d: ldb $dr,@($slo16,$sr) */
1221 SEM_FN_NAME (m32rbf
,ldb_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1223 #define FLD(f) abuf->fields.sfmt_add3.f
1224 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1225 int UNUSED written
= 0;
1226 IADDR UNUSED pc
= abuf
->addr
;
1227 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1230 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1231 * FLD (i_dr
) = opval
;
1232 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1239 /* ldh: ldh $dr,@$sr */
1242 SEM_FN_NAME (m32rbf
,ldh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1244 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1245 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1246 int UNUSED written
= 0;
1247 IADDR UNUSED pc
= abuf
->addr
;
1248 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1251 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1252 * FLD (i_dr
) = opval
;
1253 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1260 /* ldh-d: ldh $dr,@($slo16,$sr) */
1263 SEM_FN_NAME (m32rbf
,ldh_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1265 #define FLD(f) abuf->fields.sfmt_add3.f
1266 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1267 int UNUSED written
= 0;
1268 IADDR UNUSED pc
= abuf
->addr
;
1269 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1272 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1273 * FLD (i_dr
) = opval
;
1274 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1281 /* ldub: ldub $dr,@$sr */
1284 SEM_FN_NAME (m32rbf
,ldub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1286 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1287 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1288 int UNUSED written
= 0;
1289 IADDR UNUSED pc
= abuf
->addr
;
1290 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1293 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1294 * FLD (i_dr
) = opval
;
1295 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1302 /* ldub-d: ldub $dr,@($slo16,$sr) */
1305 SEM_FN_NAME (m32rbf
,ldub_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1307 #define FLD(f) abuf->fields.sfmt_add3.f
1308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1309 int UNUSED written
= 0;
1310 IADDR UNUSED pc
= abuf
->addr
;
1311 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1314 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1315 * FLD (i_dr
) = opval
;
1316 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1323 /* lduh: lduh $dr,@$sr */
1326 SEM_FN_NAME (m32rbf
,lduh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1328 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1329 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1330 int UNUSED written
= 0;
1331 IADDR UNUSED pc
= abuf
->addr
;
1332 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1335 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1336 * FLD (i_dr
) = opval
;
1337 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1344 /* lduh-d: lduh $dr,@($slo16,$sr) */
1347 SEM_FN_NAME (m32rbf
,lduh_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1349 #define FLD(f) abuf->fields.sfmt_add3.f
1350 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1351 int UNUSED written
= 0;
1352 IADDR UNUSED pc
= abuf
->addr
;
1353 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1356 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1357 * FLD (i_dr
) = opval
;
1358 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1365 /* ld-plus: ld $dr,@$sr+ */
1368 SEM_FN_NAME (m32rbf
,ld_plus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1370 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1371 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1372 int UNUSED written
= 0;
1373 IADDR UNUSED pc
= abuf
->addr
;
1374 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1378 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1379 temp1
= ADDSI (* FLD (i_sr
), 4);
1382 * FLD (i_dr
) = opval
;
1383 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1387 * FLD (i_sr
) = opval
;
1388 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1396 /* ld24: ld24 $dr,$uimm24 */
1399 SEM_FN_NAME (m32rbf
,ld24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1401 #define FLD(f) abuf->fields.sfmt_ld24.f
1402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1403 int UNUSED written
= 0;
1404 IADDR UNUSED pc
= abuf
->addr
;
1405 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1408 SI opval
= FLD (i_uimm24
);
1409 * FLD (i_dr
) = opval
;
1410 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1417 /* ldi8: ldi8 $dr,$simm8 */
1420 SEM_FN_NAME (m32rbf
,ldi8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1422 #define FLD(f) abuf->fields.sfmt_addi.f
1423 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1424 int UNUSED written
= 0;
1425 IADDR UNUSED pc
= abuf
->addr
;
1426 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1429 SI opval
= FLD (f_simm8
);
1430 * FLD (i_dr
) = opval
;
1431 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1438 /* ldi16: ldi16 $dr,$hash$slo16 */
1441 SEM_FN_NAME (m32rbf
,ldi16
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1443 #define FLD(f) abuf->fields.sfmt_add3.f
1444 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1445 int UNUSED written
= 0;
1446 IADDR UNUSED pc
= abuf
->addr
;
1447 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1450 SI opval
= FLD (f_simm16
);
1451 * FLD (i_dr
) = opval
;
1452 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1459 /* lock: lock $dr,@$sr */
1462 SEM_FN_NAME (m32rbf
,lock
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1464 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1465 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1466 int UNUSED written
= 0;
1467 IADDR UNUSED pc
= abuf
->addr
;
1468 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1473 CPU (h_lock
) = opval
;
1474 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
1477 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1478 * FLD (i_dr
) = opval
;
1479 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1487 /* machi: machi $src1,$src2 */
1490 SEM_FN_NAME (m32rbf
,machi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1492 #define FLD(f) abuf->fields.sfmt_st_plus.f
1493 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1494 int UNUSED written
= 0;
1495 IADDR UNUSED pc
= abuf
->addr
;
1496 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1499 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1500 SET_H_ACCUM (opval
);
1501 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1508 /* maclo: maclo $src1,$src2 */
1511 SEM_FN_NAME (m32rbf
,maclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1513 #define FLD(f) abuf->fields.sfmt_st_plus.f
1514 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1515 int UNUSED written
= 0;
1516 IADDR UNUSED pc
= abuf
->addr
;
1517 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1520 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1521 SET_H_ACCUM (opval
);
1522 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1529 /* macwhi: macwhi $src1,$src2 */
1532 SEM_FN_NAME (m32rbf
,macwhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1534 #define FLD(f) abuf->fields.sfmt_st_plus.f
1535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1536 int UNUSED written
= 0;
1537 IADDR UNUSED pc
= abuf
->addr
;
1538 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1541 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1542 SET_H_ACCUM (opval
);
1543 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1550 /* macwlo: macwlo $src1,$src2 */
1553 SEM_FN_NAME (m32rbf
,macwlo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1555 #define FLD(f) abuf->fields.sfmt_st_plus.f
1556 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1557 int UNUSED written
= 0;
1558 IADDR UNUSED pc
= abuf
->addr
;
1559 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1562 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1563 SET_H_ACCUM (opval
);
1564 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1571 /* mul: mul $dr,$sr */
1574 SEM_FN_NAME (m32rbf
,mul
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1576 #define FLD(f) abuf->fields.sfmt_add.f
1577 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1578 int UNUSED written
= 0;
1579 IADDR UNUSED pc
= abuf
->addr
;
1580 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1583 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
1584 * FLD (i_dr
) = opval
;
1585 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1592 /* mulhi: mulhi $src1,$src2 */
1595 SEM_FN_NAME (m32rbf
,mulhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1597 #define FLD(f) abuf->fields.sfmt_st_plus.f
1598 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1599 int UNUSED written
= 0;
1600 IADDR UNUSED pc
= abuf
->addr
;
1601 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1604 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
1605 SET_H_ACCUM (opval
);
1606 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1613 /* mullo: mullo $src1,$src2 */
1616 SEM_FN_NAME (m32rbf
,mullo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1618 #define FLD(f) abuf->fields.sfmt_st_plus.f
1619 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1620 int UNUSED written
= 0;
1621 IADDR UNUSED pc
= abuf
->addr
;
1622 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1625 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
1626 SET_H_ACCUM (opval
);
1627 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1634 /* mulwhi: mulwhi $src1,$src2 */
1637 SEM_FN_NAME (m32rbf
,mulwhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1639 #define FLD(f) abuf->fields.sfmt_st_plus.f
1640 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1641 int UNUSED written
= 0;
1642 IADDR UNUSED pc
= abuf
->addr
;
1643 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1646 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 8), 8);
1647 SET_H_ACCUM (opval
);
1648 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1655 /* mulwlo: mulwlo $src1,$src2 */
1658 SEM_FN_NAME (m32rbf
,mulwlo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1660 #define FLD(f) abuf->fields.sfmt_st_plus.f
1661 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1662 int UNUSED written
= 0;
1663 IADDR UNUSED pc
= abuf
->addr
;
1664 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1667 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 8), 8);
1668 SET_H_ACCUM (opval
);
1669 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1676 /* mv: mv $dr,$sr */
1679 SEM_FN_NAME (m32rbf
,mv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1681 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1682 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1683 int UNUSED written
= 0;
1684 IADDR UNUSED pc
= abuf
->addr
;
1685 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1688 SI opval
= * FLD (i_sr
);
1689 * FLD (i_dr
) = opval
;
1690 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1697 /* mvfachi: mvfachi $dr */
1700 SEM_FN_NAME (m32rbf
,mvfachi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1702 #define FLD(f) abuf->fields.sfmt_seth.f
1703 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1704 int UNUSED written
= 0;
1705 IADDR UNUSED pc
= abuf
->addr
;
1706 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1709 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 32));
1710 * FLD (i_dr
) = opval
;
1711 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1718 /* mvfaclo: mvfaclo $dr */
1721 SEM_FN_NAME (m32rbf
,mvfaclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1723 #define FLD(f) abuf->fields.sfmt_seth.f
1724 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1725 int UNUSED written
= 0;
1726 IADDR UNUSED pc
= abuf
->addr
;
1727 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1730 SI opval
= TRUNCDISI (GET_H_ACCUM ());
1731 * FLD (i_dr
) = opval
;
1732 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1739 /* mvfacmi: mvfacmi $dr */
1742 SEM_FN_NAME (m32rbf
,mvfacmi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1744 #define FLD(f) abuf->fields.sfmt_seth.f
1745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1746 int UNUSED written
= 0;
1747 IADDR UNUSED pc
= abuf
->addr
;
1748 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1751 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 16));
1752 * FLD (i_dr
) = opval
;
1753 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1760 /* mvfc: mvfc $dr,$scr */
1763 SEM_FN_NAME (m32rbf
,mvfc
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1765 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1766 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1767 int UNUSED written
= 0;
1768 IADDR UNUSED pc
= abuf
->addr
;
1769 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1772 SI opval
= GET_H_CR (FLD (f_r2
));
1773 * FLD (i_dr
) = opval
;
1774 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1781 /* mvtachi: mvtachi $src1 */
1784 SEM_FN_NAME (m32rbf
,mvtachi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1786 #define FLD(f) abuf->fields.sfmt_st_plus.f
1787 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1788 int UNUSED written
= 0;
1789 IADDR UNUSED pc
= abuf
->addr
;
1790 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1793 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
1794 SET_H_ACCUM (opval
);
1795 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1802 /* mvtaclo: mvtaclo $src1 */
1805 SEM_FN_NAME (m32rbf
,mvtaclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1807 #define FLD(f) abuf->fields.sfmt_st_plus.f
1808 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1809 int UNUSED written
= 0;
1810 IADDR UNUSED pc
= abuf
->addr
;
1811 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1814 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
1815 SET_H_ACCUM (opval
);
1816 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1823 /* mvtc: mvtc $sr,$dcr */
1826 SEM_FN_NAME (m32rbf
,mvtc
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1828 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1829 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1830 int UNUSED written
= 0;
1831 IADDR UNUSED pc
= abuf
->addr
;
1832 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1835 USI opval
= * FLD (i_sr
);
1836 SET_H_CR (FLD (f_r1
), opval
);
1837 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
1844 /* neg: neg $dr,$sr */
1847 SEM_FN_NAME (m32rbf
,neg
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1849 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1850 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1851 int UNUSED written
= 0;
1852 IADDR UNUSED pc
= abuf
->addr
;
1853 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1856 SI opval
= NEGSI (* FLD (i_sr
));
1857 * FLD (i_dr
) = opval
;
1858 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1868 SEM_FN_NAME (m32rbf
,nop
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1870 #define FLD(f) abuf->fields.fmt_empty.f
1871 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1872 int UNUSED written
= 0;
1873 IADDR UNUSED pc
= abuf
->addr
;
1874 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1876 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
1882 /* not: not $dr,$sr */
1885 SEM_FN_NAME (m32rbf
,not) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1887 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1888 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1889 int UNUSED written
= 0;
1890 IADDR UNUSED pc
= abuf
->addr
;
1891 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1894 SI opval
= INVSI (* FLD (i_sr
));
1895 * FLD (i_dr
) = opval
;
1896 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1906 SEM_FN_NAME (m32rbf
,rac
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1908 #define FLD(f) abuf->fields.fmt_empty.f
1909 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1910 int UNUSED written
= 0;
1911 IADDR UNUSED pc
= abuf
->addr
;
1912 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1916 tmp_tmp1
= SLLDI (GET_H_ACCUM (), 1);
1917 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
1919 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)));
1920 SET_H_ACCUM (opval
);
1921 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1932 SEM_FN_NAME (m32rbf
,rach
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1934 #define FLD(f) abuf->fields.fmt_empty.f
1935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1936 int UNUSED written
= 0;
1937 IADDR UNUSED pc
= abuf
->addr
;
1938 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1942 tmp_tmp1
= ANDDI (GET_H_ACCUM (), MAKEDI (16777215, 0xffffffff));
1943 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (16383, 0x80000000)), LEDI (tmp_tmp1
, MAKEDI (8388607, 0xffffffff)))) {
1944 tmp_tmp1
= MAKEDI (16383, 0x80000000);
1946 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (8388608, 0)), LEDI (tmp_tmp1
, MAKEDI (16760832, 0)))) {
1947 tmp_tmp1
= MAKEDI (16760832, 0);
1949 tmp_tmp1
= ANDDI (ADDDI (GET_H_ACCUM (), MAKEDI (0, 1073741824)), MAKEDI (0xffffffff, 0x80000000));
1952 tmp_tmp1
= SLLDI (tmp_tmp1
, 1);
1954 DI opval
= SRADI (SLLDI (tmp_tmp1
, 7), 7);
1955 SET_H_ACCUM (opval
);
1956 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1967 SEM_FN_NAME (m32rbf
,rte
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1969 #define FLD(f) abuf->fields.fmt_empty.f
1970 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1971 int UNUSED written
= 0;
1972 IADDR UNUSED pc
= abuf
->addr
;
1974 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1978 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
1979 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1980 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1983 USI opval
= GET_H_CR (((UINT
) 14));
1984 SET_H_CR (((UINT
) 6), opval
);
1985 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
1988 UQI opval
= CPU (h_bpsw
);
1990 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
1993 UQI opval
= CPU (h_bbpsw
);
1994 CPU (h_bpsw
) = opval
;
1995 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
1999 SEM_BRANCH_FINI (vpc
);
2004 /* seth: seth $dr,$hash$hi16 */
2007 SEM_FN_NAME (m32rbf
,seth
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2009 #define FLD(f) abuf->fields.sfmt_seth.f
2010 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2011 int UNUSED written
= 0;
2012 IADDR UNUSED pc
= abuf
->addr
;
2013 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2016 SI opval
= SLLSI (FLD (f_hi16
), 16);
2017 * FLD (i_dr
) = opval
;
2018 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2025 /* sll: sll $dr,$sr */
2028 SEM_FN_NAME (m32rbf
,sll
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2030 #define FLD(f) abuf->fields.sfmt_add.f
2031 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2032 int UNUSED written
= 0;
2033 IADDR UNUSED pc
= abuf
->addr
;
2034 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2037 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2038 * FLD (i_dr
) = opval
;
2039 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2046 /* sll3: sll3 $dr,$sr,$simm16 */
2049 SEM_FN_NAME (m32rbf
,sll3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2051 #define FLD(f) abuf->fields.sfmt_add3.f
2052 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2053 int UNUSED written
= 0;
2054 IADDR UNUSED pc
= abuf
->addr
;
2055 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2058 SI opval
= SLLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2059 * FLD (i_dr
) = opval
;
2060 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2067 /* slli: slli $dr,$uimm5 */
2070 SEM_FN_NAME (m32rbf
,slli
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2072 #define FLD(f) abuf->fields.sfmt_slli.f
2073 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2074 int UNUSED written
= 0;
2075 IADDR UNUSED pc
= abuf
->addr
;
2076 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2079 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
2080 * FLD (i_dr
) = opval
;
2081 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2088 /* sra: sra $dr,$sr */
2091 SEM_FN_NAME (m32rbf
,sra
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2093 #define FLD(f) abuf->fields.sfmt_add.f
2094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2095 int UNUSED written
= 0;
2096 IADDR UNUSED pc
= abuf
->addr
;
2097 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2100 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2101 * FLD (i_dr
) = opval
;
2102 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2109 /* sra3: sra3 $dr,$sr,$simm16 */
2112 SEM_FN_NAME (m32rbf
,sra3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2114 #define FLD(f) abuf->fields.sfmt_add3.f
2115 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2116 int UNUSED written
= 0;
2117 IADDR UNUSED pc
= abuf
->addr
;
2118 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2121 SI opval
= SRASI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2122 * FLD (i_dr
) = opval
;
2123 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2130 /* srai: srai $dr,$uimm5 */
2133 SEM_FN_NAME (m32rbf
,srai
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2135 #define FLD(f) abuf->fields.sfmt_slli.f
2136 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2137 int UNUSED written
= 0;
2138 IADDR UNUSED pc
= abuf
->addr
;
2139 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2142 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
2143 * FLD (i_dr
) = opval
;
2144 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2151 /* srl: srl $dr,$sr */
2154 SEM_FN_NAME (m32rbf
,srl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2156 #define FLD(f) abuf->fields.sfmt_add.f
2157 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2158 int UNUSED written
= 0;
2159 IADDR UNUSED pc
= abuf
->addr
;
2160 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2163 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2164 * FLD (i_dr
) = opval
;
2165 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2172 /* srl3: srl3 $dr,$sr,$simm16 */
2175 SEM_FN_NAME (m32rbf
,srl3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2177 #define FLD(f) abuf->fields.sfmt_add3.f
2178 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2179 int UNUSED written
= 0;
2180 IADDR UNUSED pc
= abuf
->addr
;
2181 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2184 SI opval
= SRLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2185 * FLD (i_dr
) = opval
;
2186 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2193 /* srli: srli $dr,$uimm5 */
2196 SEM_FN_NAME (m32rbf
,srli
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2198 #define FLD(f) abuf->fields.sfmt_slli.f
2199 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2200 int UNUSED written
= 0;
2201 IADDR UNUSED pc
= abuf
->addr
;
2202 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2205 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
2206 * FLD (i_dr
) = opval
;
2207 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2214 /* st: st $src1,@$src2 */
2217 SEM_FN_NAME (m32rbf
,st
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2219 #define FLD(f) abuf->fields.sfmt_st_plus.f
2220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2221 int UNUSED written
= 0;
2222 IADDR UNUSED pc
= abuf
->addr
;
2223 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2226 SI opval
= * FLD (i_src1
);
2227 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2228 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2235 /* st-d: st $src1,@($slo16,$src2) */
2238 SEM_FN_NAME (m32rbf
,st_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2240 #define FLD(f) abuf->fields.sfmt_st_d.f
2241 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2242 int UNUSED written
= 0;
2243 IADDR UNUSED pc
= abuf
->addr
;
2244 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2247 SI opval
= * FLD (i_src1
);
2248 SETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2249 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2256 /* stb: stb $src1,@$src2 */
2259 SEM_FN_NAME (m32rbf
,stb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2261 #define FLD(f) abuf->fields.sfmt_st_plus.f
2262 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2263 int UNUSED written
= 0;
2264 IADDR UNUSED pc
= abuf
->addr
;
2265 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2268 QI opval
= * FLD (i_src1
);
2269 SETMEMQI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2270 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2277 /* stb-d: stb $src1,@($slo16,$src2) */
2280 SEM_FN_NAME (m32rbf
,stb_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2282 #define FLD(f) abuf->fields.sfmt_st_d.f
2283 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2284 int UNUSED written
= 0;
2285 IADDR UNUSED pc
= abuf
->addr
;
2286 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2289 QI opval
= * FLD (i_src1
);
2290 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2291 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2298 /* sth: sth $src1,@$src2 */
2301 SEM_FN_NAME (m32rbf
,sth
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2303 #define FLD(f) abuf->fields.sfmt_st_plus.f
2304 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2305 int UNUSED written
= 0;
2306 IADDR UNUSED pc
= abuf
->addr
;
2307 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2310 HI opval
= * FLD (i_src1
);
2311 SETMEMHI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2312 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2319 /* sth-d: sth $src1,@($slo16,$src2) */
2322 SEM_FN_NAME (m32rbf
,sth_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2324 #define FLD(f) abuf->fields.sfmt_st_d.f
2325 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2326 int UNUSED written
= 0;
2327 IADDR UNUSED pc
= abuf
->addr
;
2328 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2331 HI opval
= * FLD (i_src1
);
2332 SETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2333 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2340 /* st-plus: st $src1,@+$src2 */
2343 SEM_FN_NAME (m32rbf
,st_plus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2345 #define FLD(f) abuf->fields.sfmt_st_plus.f
2346 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2347 int UNUSED written
= 0;
2348 IADDR UNUSED pc
= abuf
->addr
;
2349 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2353 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
2355 SI opval
= * FLD (i_src1
);
2356 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2357 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2360 SI opval
= tmp_new_src2
;
2361 * FLD (i_src2
) = opval
;
2362 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2370 /* st-minus: st $src1,@-$src2 */
2373 SEM_FN_NAME (m32rbf
,st_minus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2375 #define FLD(f) abuf->fields.sfmt_st_plus.f
2376 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2377 int UNUSED written
= 0;
2378 IADDR UNUSED pc
= abuf
->addr
;
2379 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2383 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
2385 SI opval
= * FLD (i_src1
);
2386 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2387 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2390 SI opval
= tmp_new_src2
;
2391 * FLD (i_src2
) = opval
;
2392 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2400 /* sub: sub $dr,$sr */
2403 SEM_FN_NAME (m32rbf
,sub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2405 #define FLD(f) abuf->fields.sfmt_add.f
2406 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2407 int UNUSED written
= 0;
2408 IADDR UNUSED pc
= abuf
->addr
;
2409 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2412 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2413 * FLD (i_dr
) = opval
;
2414 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2421 /* subv: subv $dr,$sr */
2424 SEM_FN_NAME (m32rbf
,subv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2426 #define FLD(f) abuf->fields.sfmt_add.f
2427 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2428 int UNUSED written
= 0;
2429 IADDR UNUSED pc
= abuf
->addr
;
2430 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2434 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2435 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
2438 * FLD (i_dr
) = opval
;
2439 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2443 CPU (h_cond
) = opval
;
2444 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2452 /* subx: subx $dr,$sr */
2455 SEM_FN_NAME (m32rbf
,subx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2457 #define FLD(f) abuf->fields.sfmt_add.f
2458 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2459 int UNUSED written
= 0;
2460 IADDR UNUSED pc
= abuf
->addr
;
2461 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2465 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2466 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2469 * FLD (i_dr
) = opval
;
2470 TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
2474 CPU (h_cond
) = opval
;
2475 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2483 /* trap: trap $uimm4 */
2486 SEM_FN_NAME (m32rbf
,trap
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2488 #define FLD(f) abuf->fields.sfmt_trap.f
2489 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2490 int UNUSED written
= 0;
2491 IADDR UNUSED pc
= abuf
->addr
;
2493 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2497 USI opval
= GET_H_CR (((UINT
) 6));
2498 SET_H_CR (((UINT
) 14), opval
);
2499 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2502 USI opval
= ADDSI (pc
, 4);
2503 SET_H_CR (((UINT
) 6), opval
);
2504 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2507 UQI opval
= CPU (h_bpsw
);
2508 CPU (h_bbpsw
) = opval
;
2509 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
2512 UQI opval
= GET_H_PSW ();
2513 CPU (h_bpsw
) = opval
;
2514 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2517 UQI opval
= ANDQI (GET_H_PSW (), 128);
2519 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2522 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
2523 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2524 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2528 SEM_BRANCH_FINI (vpc
);
2533 /* unlock: unlock $src1,@$src2 */
2536 SEM_FN_NAME (m32rbf
,unlock
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2538 #define FLD(f) abuf->fields.sfmt_st_plus.f
2539 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2540 int UNUSED written
= 0;
2541 IADDR UNUSED pc
= abuf
->addr
;
2542 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2547 SI opval
= * FLD (i_src1
);
2548 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2549 written
|= (1 << 4);
2550 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2555 CPU (h_lock
) = opval
;
2556 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
2560 abuf
->written
= written
;
2565 /* clrpsw: clrpsw $uimm8 */
2568 SEM_FN_NAME (m32rbf
,clrpsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2570 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2572 int UNUSED written
= 0;
2573 IADDR UNUSED pc
= abuf
->addr
;
2574 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2577 SI opval
= ANDSI (GET_H_CR (((UINT
) 0)), ORSI (INVBI (FLD (f_uimm8
)), 65280));
2578 SET_H_CR (((UINT
) 0), opval
);
2579 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2586 /* setpsw: setpsw $uimm8 */
2589 SEM_FN_NAME (m32rbf
,setpsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2591 #define FLD(f) abuf->fields.sfmt_clrpsw.f
2592 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2593 int UNUSED written
= 0;
2594 IADDR UNUSED pc
= abuf
->addr
;
2595 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2598 SI opval
= FLD (f_uimm8
);
2599 SET_H_CR (((UINT
) 0), opval
);
2600 TRACE_RESULT (current_cpu
, abuf
, "cr", 'x', opval
);
2607 /* bset: bset $uimm3,@($slo16,$sr) */
2610 SEM_FN_NAME (m32rbf
,bset
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2612 #define FLD(f) abuf->fields.sfmt_bset.f
2613 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2614 int UNUSED written
= 0;
2615 IADDR UNUSED pc
= abuf
->addr
;
2616 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2619 QI opval
= ORQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), SLLSI (1, SUBSI (7, FLD (f_uimm3
))));
2620 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
2621 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2628 /* bclr: bclr $uimm3,@($slo16,$sr) */
2631 SEM_FN_NAME (m32rbf
,bclr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2633 #define FLD(f) abuf->fields.sfmt_bset.f
2634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2635 int UNUSED written
= 0;
2636 IADDR UNUSED pc
= abuf
->addr
;
2637 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2640 QI opval
= ANDQI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))), INVQI (SLLSI (1, SUBSI (7, FLD (f_uimm3
)))));
2641 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)), opval
);
2642 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2649 /* btst: btst $uimm3,$sr */
2652 SEM_FN_NAME (m32rbf
,btst
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2654 #define FLD(f) abuf->fields.sfmt_bset.f
2655 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2656 int UNUSED written
= 0;
2657 IADDR UNUSED pc
= abuf
->addr
;
2658 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2661 BI opval
= ANDQI (SRLSI (* FLD (i_sr
), SUBSI (7, FLD (f_uimm3
))), 1);
2662 CPU (h_cond
) = opval
;
2663 TRACE_RESULT (current_cpu
, abuf
, "cond", 'x', opval
);
2670 /* Table of all semantic fns. */
2672 static const struct sem_fn_desc sem_fns
[] = {
2673 { M32RBF_INSN_X_INVALID
, SEM_FN_NAME (m32rbf
,x_invalid
) },
2674 { M32RBF_INSN_X_AFTER
, SEM_FN_NAME (m32rbf
,x_after
) },
2675 { M32RBF_INSN_X_BEFORE
, SEM_FN_NAME (m32rbf
,x_before
) },
2676 { M32RBF_INSN_X_CTI_CHAIN
, SEM_FN_NAME (m32rbf
,x_cti_chain
) },
2677 { M32RBF_INSN_X_CHAIN
, SEM_FN_NAME (m32rbf
,x_chain
) },
2678 { M32RBF_INSN_X_BEGIN
, SEM_FN_NAME (m32rbf
,x_begin
) },
2679 { M32RBF_INSN_ADD
, SEM_FN_NAME (m32rbf
,add
) },
2680 { M32RBF_INSN_ADD3
, SEM_FN_NAME (m32rbf
,add3
) },
2681 { M32RBF_INSN_AND
, SEM_FN_NAME (m32rbf
,and) },
2682 { M32RBF_INSN_AND3
, SEM_FN_NAME (m32rbf
,and3
) },
2683 { M32RBF_INSN_OR
, SEM_FN_NAME (m32rbf
,or) },
2684 { M32RBF_INSN_OR3
, SEM_FN_NAME (m32rbf
,or3
) },
2685 { M32RBF_INSN_XOR
, SEM_FN_NAME (m32rbf
,xor) },
2686 { M32RBF_INSN_XOR3
, SEM_FN_NAME (m32rbf
,xor3
) },
2687 { M32RBF_INSN_ADDI
, SEM_FN_NAME (m32rbf
,addi
) },
2688 { M32RBF_INSN_ADDV
, SEM_FN_NAME (m32rbf
,addv
) },
2689 { M32RBF_INSN_ADDV3
, SEM_FN_NAME (m32rbf
,addv3
) },
2690 { M32RBF_INSN_ADDX
, SEM_FN_NAME (m32rbf
,addx
) },
2691 { M32RBF_INSN_BC8
, SEM_FN_NAME (m32rbf
,bc8
) },
2692 { M32RBF_INSN_BC24
, SEM_FN_NAME (m32rbf
,bc24
) },
2693 { M32RBF_INSN_BEQ
, SEM_FN_NAME (m32rbf
,beq
) },
2694 { M32RBF_INSN_BEQZ
, SEM_FN_NAME (m32rbf
,beqz
) },
2695 { M32RBF_INSN_BGEZ
, SEM_FN_NAME (m32rbf
,bgez
) },
2696 { M32RBF_INSN_BGTZ
, SEM_FN_NAME (m32rbf
,bgtz
) },
2697 { M32RBF_INSN_BLEZ
, SEM_FN_NAME (m32rbf
,blez
) },
2698 { M32RBF_INSN_BLTZ
, SEM_FN_NAME (m32rbf
,bltz
) },
2699 { M32RBF_INSN_BNEZ
, SEM_FN_NAME (m32rbf
,bnez
) },
2700 { M32RBF_INSN_BL8
, SEM_FN_NAME (m32rbf
,bl8
) },
2701 { M32RBF_INSN_BL24
, SEM_FN_NAME (m32rbf
,bl24
) },
2702 { M32RBF_INSN_BNC8
, SEM_FN_NAME (m32rbf
,bnc8
) },
2703 { M32RBF_INSN_BNC24
, SEM_FN_NAME (m32rbf
,bnc24
) },
2704 { M32RBF_INSN_BNE
, SEM_FN_NAME (m32rbf
,bne
) },
2705 { M32RBF_INSN_BRA8
, SEM_FN_NAME (m32rbf
,bra8
) },
2706 { M32RBF_INSN_BRA24
, SEM_FN_NAME (m32rbf
,bra24
) },
2707 { M32RBF_INSN_CMP
, SEM_FN_NAME (m32rbf
,cmp
) },
2708 { M32RBF_INSN_CMPI
, SEM_FN_NAME (m32rbf
,cmpi
) },
2709 { M32RBF_INSN_CMPU
, SEM_FN_NAME (m32rbf
,cmpu
) },
2710 { M32RBF_INSN_CMPUI
, SEM_FN_NAME (m32rbf
,cmpui
) },
2711 { M32RBF_INSN_DIV
, SEM_FN_NAME (m32rbf
,div
) },
2712 { M32RBF_INSN_DIVU
, SEM_FN_NAME (m32rbf
,divu
) },
2713 { M32RBF_INSN_REM
, SEM_FN_NAME (m32rbf
,rem
) },
2714 { M32RBF_INSN_REMU
, SEM_FN_NAME (m32rbf
,remu
) },
2715 { M32RBF_INSN_JL
, SEM_FN_NAME (m32rbf
,jl
) },
2716 { M32RBF_INSN_JMP
, SEM_FN_NAME (m32rbf
,jmp
) },
2717 { M32RBF_INSN_LD
, SEM_FN_NAME (m32rbf
,ld
) },
2718 { M32RBF_INSN_LD_D
, SEM_FN_NAME (m32rbf
,ld_d
) },
2719 { M32RBF_INSN_LDB
, SEM_FN_NAME (m32rbf
,ldb
) },
2720 { M32RBF_INSN_LDB_D
, SEM_FN_NAME (m32rbf
,ldb_d
) },
2721 { M32RBF_INSN_LDH
, SEM_FN_NAME (m32rbf
,ldh
) },
2722 { M32RBF_INSN_LDH_D
, SEM_FN_NAME (m32rbf
,ldh_d
) },
2723 { M32RBF_INSN_LDUB
, SEM_FN_NAME (m32rbf
,ldub
) },
2724 { M32RBF_INSN_LDUB_D
, SEM_FN_NAME (m32rbf
,ldub_d
) },
2725 { M32RBF_INSN_LDUH
, SEM_FN_NAME (m32rbf
,lduh
) },
2726 { M32RBF_INSN_LDUH_D
, SEM_FN_NAME (m32rbf
,lduh_d
) },
2727 { M32RBF_INSN_LD_PLUS
, SEM_FN_NAME (m32rbf
,ld_plus
) },
2728 { M32RBF_INSN_LD24
, SEM_FN_NAME (m32rbf
,ld24
) },
2729 { M32RBF_INSN_LDI8
, SEM_FN_NAME (m32rbf
,ldi8
) },
2730 { M32RBF_INSN_LDI16
, SEM_FN_NAME (m32rbf
,ldi16
) },
2731 { M32RBF_INSN_LOCK
, SEM_FN_NAME (m32rbf
,lock
) },
2732 { M32RBF_INSN_MACHI
, SEM_FN_NAME (m32rbf
,machi
) },
2733 { M32RBF_INSN_MACLO
, SEM_FN_NAME (m32rbf
,maclo
) },
2734 { M32RBF_INSN_MACWHI
, SEM_FN_NAME (m32rbf
,macwhi
) },
2735 { M32RBF_INSN_MACWLO
, SEM_FN_NAME (m32rbf
,macwlo
) },
2736 { M32RBF_INSN_MUL
, SEM_FN_NAME (m32rbf
,mul
) },
2737 { M32RBF_INSN_MULHI
, SEM_FN_NAME (m32rbf
,mulhi
) },
2738 { M32RBF_INSN_MULLO
, SEM_FN_NAME (m32rbf
,mullo
) },
2739 { M32RBF_INSN_MULWHI
, SEM_FN_NAME (m32rbf
,mulwhi
) },
2740 { M32RBF_INSN_MULWLO
, SEM_FN_NAME (m32rbf
,mulwlo
) },
2741 { M32RBF_INSN_MV
, SEM_FN_NAME (m32rbf
,mv
) },
2742 { M32RBF_INSN_MVFACHI
, SEM_FN_NAME (m32rbf
,mvfachi
) },
2743 { M32RBF_INSN_MVFACLO
, SEM_FN_NAME (m32rbf
,mvfaclo
) },
2744 { M32RBF_INSN_MVFACMI
, SEM_FN_NAME (m32rbf
,mvfacmi
) },
2745 { M32RBF_INSN_MVFC
, SEM_FN_NAME (m32rbf
,mvfc
) },
2746 { M32RBF_INSN_MVTACHI
, SEM_FN_NAME (m32rbf
,mvtachi
) },
2747 { M32RBF_INSN_MVTACLO
, SEM_FN_NAME (m32rbf
,mvtaclo
) },
2748 { M32RBF_INSN_MVTC
, SEM_FN_NAME (m32rbf
,mvtc
) },
2749 { M32RBF_INSN_NEG
, SEM_FN_NAME (m32rbf
,neg
) },
2750 { M32RBF_INSN_NOP
, SEM_FN_NAME (m32rbf
,nop
) },
2751 { M32RBF_INSN_NOT
, SEM_FN_NAME (m32rbf
,not) },
2752 { M32RBF_INSN_RAC
, SEM_FN_NAME (m32rbf
,rac
) },
2753 { M32RBF_INSN_RACH
, SEM_FN_NAME (m32rbf
,rach
) },
2754 { M32RBF_INSN_RTE
, SEM_FN_NAME (m32rbf
,rte
) },
2755 { M32RBF_INSN_SETH
, SEM_FN_NAME (m32rbf
,seth
) },
2756 { M32RBF_INSN_SLL
, SEM_FN_NAME (m32rbf
,sll
) },
2757 { M32RBF_INSN_SLL3
, SEM_FN_NAME (m32rbf
,sll3
) },
2758 { M32RBF_INSN_SLLI
, SEM_FN_NAME (m32rbf
,slli
) },
2759 { M32RBF_INSN_SRA
, SEM_FN_NAME (m32rbf
,sra
) },
2760 { M32RBF_INSN_SRA3
, SEM_FN_NAME (m32rbf
,sra3
) },
2761 { M32RBF_INSN_SRAI
, SEM_FN_NAME (m32rbf
,srai
) },
2762 { M32RBF_INSN_SRL
, SEM_FN_NAME (m32rbf
,srl
) },
2763 { M32RBF_INSN_SRL3
, SEM_FN_NAME (m32rbf
,srl3
) },
2764 { M32RBF_INSN_SRLI
, SEM_FN_NAME (m32rbf
,srli
) },
2765 { M32RBF_INSN_ST
, SEM_FN_NAME (m32rbf
,st
) },
2766 { M32RBF_INSN_ST_D
, SEM_FN_NAME (m32rbf
,st_d
) },
2767 { M32RBF_INSN_STB
, SEM_FN_NAME (m32rbf
,stb
) },
2768 { M32RBF_INSN_STB_D
, SEM_FN_NAME (m32rbf
,stb_d
) },
2769 { M32RBF_INSN_STH
, SEM_FN_NAME (m32rbf
,sth
) },
2770 { M32RBF_INSN_STH_D
, SEM_FN_NAME (m32rbf
,sth_d
) },
2771 { M32RBF_INSN_ST_PLUS
, SEM_FN_NAME (m32rbf
,st_plus
) },
2772 { M32RBF_INSN_ST_MINUS
, SEM_FN_NAME (m32rbf
,st_minus
) },
2773 { M32RBF_INSN_SUB
, SEM_FN_NAME (m32rbf
,sub
) },
2774 { M32RBF_INSN_SUBV
, SEM_FN_NAME (m32rbf
,subv
) },
2775 { M32RBF_INSN_SUBX
, SEM_FN_NAME (m32rbf
,subx
) },
2776 { M32RBF_INSN_TRAP
, SEM_FN_NAME (m32rbf
,trap
) },
2777 { M32RBF_INSN_UNLOCK
, SEM_FN_NAME (m32rbf
,unlock
) },
2778 { M32RBF_INSN_CLRPSW
, SEM_FN_NAME (m32rbf
,clrpsw
) },
2779 { M32RBF_INSN_SETPSW
, SEM_FN_NAME (m32rbf
,setpsw
) },
2780 { M32RBF_INSN_BSET
, SEM_FN_NAME (m32rbf
,bset
) },
2781 { M32RBF_INSN_BCLR
, SEM_FN_NAME (m32rbf
,bclr
) },
2782 { M32RBF_INSN_BTST
, SEM_FN_NAME (m32rbf
,btst
) },
2786 /* Add the semantic fns to IDESC_TABLE. */
2789 SEM_FN_NAME (m32rbf
,init_idesc_table
) (SIM_CPU
*current_cpu
)
2791 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
2792 const struct sem_fn_desc
*sf
;
2793 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
2795 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
2797 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
2798 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
2799 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
2802 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
2804 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (m32rbf
,x_invalid
);
2807 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
2809 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (m32rbf
,x_invalid
);