63a0abffa31b8da4ea6ba9383f66102d9cc9e695
1 /* Simulator instruction semantics for m32rbf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
7 This file is part of the GNU Simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #define WANT_CPU m32rbf
26 #define WANT_CPU_M32RBF
33 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
35 /* This is used so that we can compile two copies of the semantic code,
36 one with full feature support and one without that runs fast(er).
37 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
39 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
41 #define TRACE_RESULT(cpu, abuf, name, type, val)
43 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
46 /* x-invalid: --invalid-- */
49 SEM_FN_NAME (m32rbf
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
51 #define FLD(f) abuf->fields.fmt_empty.f
52 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
53 int UNUSED written
= 0;
54 IADDR UNUSED pc
= abuf
->addr
;
55 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
58 /* Update the recorded pc in the cpu state struct.
59 Only necessary for WITH_SCACHE case, but to avoid the
60 conditional compilation .... */
62 /* Virtual insns have zero size. Overwrite vpc with address of next insn
63 using the default-insn-bitsize spec. When executing insns in parallel
64 we may want to queue the fault and continue execution. */
65 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
66 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
73 /* x-after: --after-- */
76 SEM_FN_NAME (m32rbf
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
78 #define FLD(f) abuf->fields.fmt_empty.f
79 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
80 int UNUSED written
= 0;
81 IADDR UNUSED pc
= abuf
->addr
;
82 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
85 #if WITH_SCACHE_PBB_M32RBF
86 m32rbf_pbb_after (current_cpu
, sem_arg
);
94 /* x-before: --before-- */
97 SEM_FN_NAME (m32rbf
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
99 #define FLD(f) abuf->fields.fmt_empty.f
100 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
101 int UNUSED written
= 0;
102 IADDR UNUSED pc
= abuf
->addr
;
103 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
106 #if WITH_SCACHE_PBB_M32RBF
107 m32rbf_pbb_before (current_cpu
, sem_arg
);
115 /* x-cti-chain: --cti-chain-- */
118 SEM_FN_NAME (m32rbf
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
120 #define FLD(f) abuf->fields.fmt_empty.f
121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
122 int UNUSED written
= 0;
123 IADDR UNUSED pc
= abuf
->addr
;
124 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
127 #if WITH_SCACHE_PBB_M32RBF
129 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
130 pbb_br_type
, pbb_br_npc
);
133 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
134 vpc
= m32rbf_pbb_cti_chain (current_cpu
, sem_arg
,
135 CPU_PBB_BR_TYPE (current_cpu
),
136 CPU_PBB_BR_NPC (current_cpu
));
145 /* x-chain: --chain-- */
148 SEM_FN_NAME (m32rbf
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
150 #define FLD(f) abuf->fields.fmt_empty.f
151 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
152 int UNUSED written
= 0;
153 IADDR UNUSED pc
= abuf
->addr
;
154 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
157 #if WITH_SCACHE_PBB_M32RBF
158 vpc
= m32rbf_pbb_chain (current_cpu
, sem_arg
);
169 /* x-begin: --begin-- */
172 SEM_FN_NAME (m32rbf
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
174 #define FLD(f) abuf->fields.fmt_empty.f
175 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
176 int UNUSED written
= 0;
177 IADDR UNUSED pc
= abuf
->addr
;
178 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
181 #if WITH_SCACHE_PBB_M32RBF
183 /* In the switch case FAST_P is a constant, allowing several optimizations
184 in any called inline functions. */
185 vpc
= m32rbf_pbb_begin (current_cpu
, FAST_P
);
187 vpc
= m32rbf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
196 /* add: add $dr,$sr */
199 SEM_FN_NAME (m32rbf
,add
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
201 #define FLD(f) abuf->fields.sfmt_add.f
202 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
203 int UNUSED written
= 0;
204 IADDR UNUSED pc
= abuf
->addr
;
205 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
208 SI opval
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
209 * FLD (i_dr
) = opval
;
210 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
217 /* add3: add3 $dr,$sr,$hash$slo16 */
220 SEM_FN_NAME (m32rbf
,add3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
222 #define FLD(f) abuf->fields.sfmt_add3.f
223 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
224 int UNUSED written
= 0;
225 IADDR UNUSED pc
= abuf
->addr
;
226 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
229 SI opval
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
230 * FLD (i_dr
) = opval
;
231 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
238 /* and: and $dr,$sr */
241 SEM_FN_NAME (m32rbf
,and) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
243 #define FLD(f) abuf->fields.sfmt_add.f
244 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
245 int UNUSED written
= 0;
246 IADDR UNUSED pc
= abuf
->addr
;
247 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
250 SI opval
= ANDSI (* FLD (i_dr
), * FLD (i_sr
));
251 * FLD (i_dr
) = opval
;
252 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
259 /* and3: and3 $dr,$sr,$uimm16 */
262 SEM_FN_NAME (m32rbf
,and3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
264 #define FLD(f) abuf->fields.sfmt_and3.f
265 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
266 int UNUSED written
= 0;
267 IADDR UNUSED pc
= abuf
->addr
;
268 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
271 SI opval
= ANDSI (* FLD (i_sr
), FLD (f_uimm16
));
272 * FLD (i_dr
) = opval
;
273 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
283 SEM_FN_NAME (m32rbf
,or) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
285 #define FLD(f) abuf->fields.sfmt_add.f
286 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
287 int UNUSED written
= 0;
288 IADDR UNUSED pc
= abuf
->addr
;
289 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
292 SI opval
= ORSI (* FLD (i_dr
), * FLD (i_sr
));
293 * FLD (i_dr
) = opval
;
294 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
301 /* or3: or3 $dr,$sr,$hash$ulo16 */
304 SEM_FN_NAME (m32rbf
,or3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
306 #define FLD(f) abuf->fields.sfmt_and3.f
307 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
308 int UNUSED written
= 0;
309 IADDR UNUSED pc
= abuf
->addr
;
310 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
313 SI opval
= ORSI (* FLD (i_sr
), FLD (f_uimm16
));
314 * FLD (i_dr
) = opval
;
315 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
322 /* xor: xor $dr,$sr */
325 SEM_FN_NAME (m32rbf
,xor) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
327 #define FLD(f) abuf->fields.sfmt_add.f
328 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
329 int UNUSED written
= 0;
330 IADDR UNUSED pc
= abuf
->addr
;
331 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
334 SI opval
= XORSI (* FLD (i_dr
), * FLD (i_sr
));
335 * FLD (i_dr
) = opval
;
336 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
343 /* xor3: xor3 $dr,$sr,$uimm16 */
346 SEM_FN_NAME (m32rbf
,xor3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
348 #define FLD(f) abuf->fields.sfmt_and3.f
349 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
350 int UNUSED written
= 0;
351 IADDR UNUSED pc
= abuf
->addr
;
352 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
355 SI opval
= XORSI (* FLD (i_sr
), FLD (f_uimm16
));
356 * FLD (i_dr
) = opval
;
357 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
364 /* addi: addi $dr,$simm8 */
367 SEM_FN_NAME (m32rbf
,addi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
369 #define FLD(f) abuf->fields.sfmt_addi.f
370 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
371 int UNUSED written
= 0;
372 IADDR UNUSED pc
= abuf
->addr
;
373 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
376 SI opval
= ADDSI (* FLD (i_dr
), FLD (f_simm8
));
377 * FLD (i_dr
) = opval
;
378 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
385 /* addv: addv $dr,$sr */
388 SEM_FN_NAME (m32rbf
,addv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
390 #define FLD(f) abuf->fields.sfmt_add.f
391 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
392 int UNUSED written
= 0;
393 IADDR UNUSED pc
= abuf
->addr
;
394 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
398 temp0
= ADDSI (* FLD (i_dr
), * FLD (i_sr
));
399 temp1
= ADDOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
402 * FLD (i_dr
) = opval
;
403 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
407 CPU (h_cond
) = opval
;
408 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
416 /* addv3: addv3 $dr,$sr,$simm16 */
419 SEM_FN_NAME (m32rbf
,addv3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
421 #define FLD(f) abuf->fields.sfmt_add3.f
422 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
423 int UNUSED written
= 0;
424 IADDR UNUSED pc
= abuf
->addr
;
425 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
429 temp0
= ADDSI (* FLD (i_sr
), FLD (f_simm16
));
430 temp1
= ADDOFSI (* FLD (i_sr
), FLD (f_simm16
), 0);
433 * FLD (i_dr
) = opval
;
434 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
438 CPU (h_cond
) = opval
;
439 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
447 /* addx: addx $dr,$sr */
450 SEM_FN_NAME (m32rbf
,addx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
452 #define FLD(f) abuf->fields.sfmt_add.f
453 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
454 int UNUSED written
= 0;
455 IADDR UNUSED pc
= abuf
->addr
;
456 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
460 temp0
= ADDCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
461 temp1
= ADDCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
464 * FLD (i_dr
) = opval
;
465 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
469 CPU (h_cond
) = opval
;
470 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
478 /* bc8: bc.s $disp8 */
481 SEM_FN_NAME (m32rbf
,bc8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
483 #define FLD(f) abuf->fields.sfmt_bl8.f
484 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
485 int UNUSED written
= 0;
486 IADDR UNUSED pc
= abuf
->addr
;
488 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
492 USI opval
= FLD (i_disp8
);
493 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
495 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
499 abuf
->written
= written
;
500 SEM_BRANCH_FINI (vpc
);
505 /* bc24: bc.l $disp24 */
508 SEM_FN_NAME (m32rbf
,bc24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
510 #define FLD(f) abuf->fields.sfmt_bl24.f
511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
512 int UNUSED written
= 0;
513 IADDR UNUSED pc
= abuf
->addr
;
515 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
519 USI opval
= FLD (i_disp24
);
520 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
522 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
526 abuf
->written
= written
;
527 SEM_BRANCH_FINI (vpc
);
532 /* beq: beq $src1,$src2,$disp16 */
535 SEM_FN_NAME (m32rbf
,beq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
537 #define FLD(f) abuf->fields.sfmt_beq.f
538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
539 int UNUSED written
= 0;
540 IADDR UNUSED pc
= abuf
->addr
;
542 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
544 if (EQSI (* FLD (i_src1
), * FLD (i_src2
))) {
546 USI opval
= FLD (i_disp16
);
547 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
549 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
553 abuf
->written
= written
;
554 SEM_BRANCH_FINI (vpc
);
559 /* beqz: beqz $src2,$disp16 */
562 SEM_FN_NAME (m32rbf
,beqz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
564 #define FLD(f) abuf->fields.sfmt_beq.f
565 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
566 int UNUSED written
= 0;
567 IADDR UNUSED pc
= abuf
->addr
;
569 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
571 if (EQSI (* FLD (i_src2
), 0)) {
573 USI opval
= FLD (i_disp16
);
574 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
576 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
580 abuf
->written
= written
;
581 SEM_BRANCH_FINI (vpc
);
586 /* bgez: bgez $src2,$disp16 */
589 SEM_FN_NAME (m32rbf
,bgez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
591 #define FLD(f) abuf->fields.sfmt_beq.f
592 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
593 int UNUSED written
= 0;
594 IADDR UNUSED pc
= abuf
->addr
;
596 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
598 if (GESI (* FLD (i_src2
), 0)) {
600 USI opval
= FLD (i_disp16
);
601 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
603 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
607 abuf
->written
= written
;
608 SEM_BRANCH_FINI (vpc
);
613 /* bgtz: bgtz $src2,$disp16 */
616 SEM_FN_NAME (m32rbf
,bgtz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
618 #define FLD(f) abuf->fields.sfmt_beq.f
619 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
620 int UNUSED written
= 0;
621 IADDR UNUSED pc
= abuf
->addr
;
623 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
625 if (GTSI (* FLD (i_src2
), 0)) {
627 USI opval
= FLD (i_disp16
);
628 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
630 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
634 abuf
->written
= written
;
635 SEM_BRANCH_FINI (vpc
);
640 /* blez: blez $src2,$disp16 */
643 SEM_FN_NAME (m32rbf
,blez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
645 #define FLD(f) abuf->fields.sfmt_beq.f
646 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
647 int UNUSED written
= 0;
648 IADDR UNUSED pc
= abuf
->addr
;
650 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
652 if (LESI (* FLD (i_src2
), 0)) {
654 USI opval
= FLD (i_disp16
);
655 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
657 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
661 abuf
->written
= written
;
662 SEM_BRANCH_FINI (vpc
);
667 /* bltz: bltz $src2,$disp16 */
670 SEM_FN_NAME (m32rbf
,bltz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
672 #define FLD(f) abuf->fields.sfmt_beq.f
673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
674 int UNUSED written
= 0;
675 IADDR UNUSED pc
= abuf
->addr
;
677 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
679 if (LTSI (* FLD (i_src2
), 0)) {
681 USI opval
= FLD (i_disp16
);
682 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
684 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
688 abuf
->written
= written
;
689 SEM_BRANCH_FINI (vpc
);
694 /* bnez: bnez $src2,$disp16 */
697 SEM_FN_NAME (m32rbf
,bnez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
699 #define FLD(f) abuf->fields.sfmt_beq.f
700 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
701 int UNUSED written
= 0;
702 IADDR UNUSED pc
= abuf
->addr
;
704 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
706 if (NESI (* FLD (i_src2
), 0)) {
708 USI opval
= FLD (i_disp16
);
709 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
711 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
715 abuf
->written
= written
;
716 SEM_BRANCH_FINI (vpc
);
721 /* bl8: bl.s $disp8 */
724 SEM_FN_NAME (m32rbf
,bl8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
726 #define FLD(f) abuf->fields.sfmt_bl8.f
727 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
728 int UNUSED written
= 0;
729 IADDR UNUSED pc
= abuf
->addr
;
731 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
735 SI opval
= ADDSI (ANDSI (pc
, -4), 4);
736 CPU (h_gr
[((UINT
) 14)]) = opval
;
737 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
740 USI opval
= FLD (i_disp8
);
741 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
742 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
746 SEM_BRANCH_FINI (vpc
);
751 /* bl24: bl.l $disp24 */
754 SEM_FN_NAME (m32rbf
,bl24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
756 #define FLD(f) abuf->fields.sfmt_bl24.f
757 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
758 int UNUSED written
= 0;
759 IADDR UNUSED pc
= abuf
->addr
;
761 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
765 SI opval
= ADDSI (pc
, 4);
766 CPU (h_gr
[((UINT
) 14)]) = opval
;
767 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
770 USI opval
= FLD (i_disp24
);
771 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
772 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
776 SEM_BRANCH_FINI (vpc
);
781 /* bnc8: bnc.s $disp8 */
784 SEM_FN_NAME (m32rbf
,bnc8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
786 #define FLD(f) abuf->fields.sfmt_bl8.f
787 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
788 int UNUSED written
= 0;
789 IADDR UNUSED pc
= abuf
->addr
;
791 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
793 if (NOTBI (CPU (h_cond
))) {
795 USI opval
= FLD (i_disp8
);
796 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
798 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
802 abuf
->written
= written
;
803 SEM_BRANCH_FINI (vpc
);
808 /* bnc24: bnc.l $disp24 */
811 SEM_FN_NAME (m32rbf
,bnc24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
813 #define FLD(f) abuf->fields.sfmt_bl24.f
814 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
815 int UNUSED written
= 0;
816 IADDR UNUSED pc
= abuf
->addr
;
818 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
820 if (NOTBI (CPU (h_cond
))) {
822 USI opval
= FLD (i_disp24
);
823 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
825 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
829 abuf
->written
= written
;
830 SEM_BRANCH_FINI (vpc
);
835 /* bne: bne $src1,$src2,$disp16 */
838 SEM_FN_NAME (m32rbf
,bne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
840 #define FLD(f) abuf->fields.sfmt_beq.f
841 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
842 int UNUSED written
= 0;
843 IADDR UNUSED pc
= abuf
->addr
;
845 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
847 if (NESI (* FLD (i_src1
), * FLD (i_src2
))) {
849 USI opval
= FLD (i_disp16
);
850 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
852 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
856 abuf
->written
= written
;
857 SEM_BRANCH_FINI (vpc
);
862 /* bra8: bra.s $disp8 */
865 SEM_FN_NAME (m32rbf
,bra8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
867 #define FLD(f) abuf->fields.sfmt_bl8.f
868 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
869 int UNUSED written
= 0;
870 IADDR UNUSED pc
= abuf
->addr
;
872 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
875 USI opval
= FLD (i_disp8
);
876 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
877 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
880 SEM_BRANCH_FINI (vpc
);
885 /* bra24: bra.l $disp24 */
888 SEM_FN_NAME (m32rbf
,bra24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
890 #define FLD(f) abuf->fields.sfmt_bl24.f
891 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
892 int UNUSED written
= 0;
893 IADDR UNUSED pc
= abuf
->addr
;
895 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
898 USI opval
= FLD (i_disp24
);
899 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
900 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
903 SEM_BRANCH_FINI (vpc
);
908 /* cmp: cmp $src1,$src2 */
911 SEM_FN_NAME (m32rbf
,cmp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
913 #define FLD(f) abuf->fields.sfmt_st_plus.f
914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
915 int UNUSED written
= 0;
916 IADDR UNUSED pc
= abuf
->addr
;
917 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
920 BI opval
= LTSI (* FLD (i_src1
), * FLD (i_src2
));
921 CPU (h_cond
) = opval
;
922 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
929 /* cmpi: cmpi $src2,$simm16 */
932 SEM_FN_NAME (m32rbf
,cmpi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
934 #define FLD(f) abuf->fields.sfmt_st_d.f
935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
936 int UNUSED written
= 0;
937 IADDR UNUSED pc
= abuf
->addr
;
938 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
941 BI opval
= LTSI (* FLD (i_src2
), FLD (f_simm16
));
942 CPU (h_cond
) = opval
;
943 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
950 /* cmpu: cmpu $src1,$src2 */
953 SEM_FN_NAME (m32rbf
,cmpu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
955 #define FLD(f) abuf->fields.sfmt_st_plus.f
956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
957 int UNUSED written
= 0;
958 IADDR UNUSED pc
= abuf
->addr
;
959 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
962 BI opval
= LTUSI (* FLD (i_src1
), * FLD (i_src2
));
963 CPU (h_cond
) = opval
;
964 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
971 /* cmpui: cmpui $src2,$simm16 */
974 SEM_FN_NAME (m32rbf
,cmpui
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
976 #define FLD(f) abuf->fields.sfmt_st_d.f
977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
978 int UNUSED written
= 0;
979 IADDR UNUSED pc
= abuf
->addr
;
980 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
983 BI opval
= LTUSI (* FLD (i_src2
), FLD (f_simm16
));
984 CPU (h_cond
) = opval
;
985 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
992 /* div: div $dr,$sr */
995 SEM_FN_NAME (m32rbf
,div
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
997 #define FLD(f) abuf->fields.sfmt_add.f
998 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
999 int UNUSED written
= 0;
1000 IADDR UNUSED pc
= abuf
->addr
;
1001 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1003 if (NESI (* FLD (i_sr
), 0)) {
1005 SI opval
= DIVSI (* FLD (i_dr
), * FLD (i_sr
));
1006 * FLD (i_dr
) = opval
;
1007 written
|= (1 << 2);
1008 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1012 abuf
->written
= written
;
1017 /* divu: divu $dr,$sr */
1020 SEM_FN_NAME (m32rbf
,divu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1022 #define FLD(f) abuf->fields.sfmt_add.f
1023 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1024 int UNUSED written
= 0;
1025 IADDR UNUSED pc
= abuf
->addr
;
1026 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1028 if (NESI (* FLD (i_sr
), 0)) {
1030 SI opval
= UDIVSI (* FLD (i_dr
), * FLD (i_sr
));
1031 * FLD (i_dr
) = opval
;
1032 written
|= (1 << 2);
1033 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1037 abuf
->written
= written
;
1042 /* rem: rem $dr,$sr */
1045 SEM_FN_NAME (m32rbf
,rem
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1047 #define FLD(f) abuf->fields.sfmt_add.f
1048 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1049 int UNUSED written
= 0;
1050 IADDR UNUSED pc
= abuf
->addr
;
1051 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1053 if (NESI (* FLD (i_sr
), 0)) {
1055 SI opval
= MODSI (* FLD (i_dr
), * FLD (i_sr
));
1056 * FLD (i_dr
) = opval
;
1057 written
|= (1 << 2);
1058 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1062 abuf
->written
= written
;
1067 /* remu: remu $dr,$sr */
1070 SEM_FN_NAME (m32rbf
,remu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1072 #define FLD(f) abuf->fields.sfmt_add.f
1073 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1074 int UNUSED written
= 0;
1075 IADDR UNUSED pc
= abuf
->addr
;
1076 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1078 if (NESI (* FLD (i_sr
), 0)) {
1080 SI opval
= UMODSI (* FLD (i_dr
), * FLD (i_sr
));
1081 * FLD (i_dr
) = opval
;
1082 written
|= (1 << 2);
1083 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1087 abuf
->written
= written
;
1095 SEM_FN_NAME (m32rbf
,jl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1097 #define FLD(f) abuf->fields.sfmt_jl.f
1098 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1099 int UNUSED written
= 0;
1100 IADDR UNUSED pc
= abuf
->addr
;
1102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1106 temp0
= ADDSI (ANDSI (pc
, -4), 4);
1107 temp1
= ANDSI (* FLD (i_sr
), -4);
1110 CPU (h_gr
[((UINT
) 14)]) = opval
;
1111 TRACE_RESULT (current_cpu
, abuf
, "gr-14", 'x', opval
);
1115 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1116 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1120 SEM_BRANCH_FINI (vpc
);
1128 SEM_FN_NAME (m32rbf
,jmp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1130 #define FLD(f) abuf->fields.sfmt_mvtc.f
1131 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1132 int UNUSED written
= 0;
1133 IADDR UNUSED pc
= abuf
->addr
;
1135 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1138 USI opval
= ANDSI (* FLD (i_sr
), -4);
1139 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1140 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1143 SEM_BRANCH_FINI (vpc
);
1148 /* ld: ld $dr,@$sr */
1151 SEM_FN_NAME (m32rbf
,ld
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1153 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1154 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1155 int UNUSED written
= 0;
1156 IADDR UNUSED pc
= abuf
->addr
;
1157 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1160 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1161 * FLD (i_dr
) = opval
;
1162 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1169 /* ld-d: ld $dr,@($slo16,$sr) */
1172 SEM_FN_NAME (m32rbf
,ld_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1174 #define FLD(f) abuf->fields.sfmt_add3.f
1175 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1176 int UNUSED written
= 0;
1177 IADDR UNUSED pc
= abuf
->addr
;
1178 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1181 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
)));
1182 * FLD (i_dr
) = opval
;
1183 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1190 /* ldb: ldb $dr,@$sr */
1193 SEM_FN_NAME (m32rbf
,ldb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1195 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1196 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1197 int UNUSED written
= 0;
1198 IADDR UNUSED pc
= abuf
->addr
;
1199 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1202 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1203 * FLD (i_dr
) = opval
;
1204 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1211 /* ldb-d: ldb $dr,@($slo16,$sr) */
1214 SEM_FN_NAME (m32rbf
,ldb_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1216 #define FLD(f) abuf->fields.sfmt_add3.f
1217 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1218 int UNUSED written
= 0;
1219 IADDR UNUSED pc
= abuf
->addr
;
1220 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1223 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1224 * FLD (i_dr
) = opval
;
1225 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1232 /* ldh: ldh $dr,@$sr */
1235 SEM_FN_NAME (m32rbf
,ldh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1237 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1238 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1239 int UNUSED written
= 0;
1240 IADDR UNUSED pc
= abuf
->addr
;
1241 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1244 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1245 * FLD (i_dr
) = opval
;
1246 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1253 /* ldh-d: ldh $dr,@($slo16,$sr) */
1256 SEM_FN_NAME (m32rbf
,ldh_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1258 #define FLD(f) abuf->fields.sfmt_add3.f
1259 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1260 int UNUSED written
= 0;
1261 IADDR UNUSED pc
= abuf
->addr
;
1262 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1265 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1266 * FLD (i_dr
) = opval
;
1267 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1274 /* ldub: ldub $dr,@$sr */
1277 SEM_FN_NAME (m32rbf
,ldub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1279 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1280 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1281 int UNUSED written
= 0;
1282 IADDR UNUSED pc
= abuf
->addr
;
1283 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1286 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, * FLD (i_sr
)));
1287 * FLD (i_dr
) = opval
;
1288 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1295 /* ldub-d: ldub $dr,@($slo16,$sr) */
1298 SEM_FN_NAME (m32rbf
,ldub_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1300 #define FLD(f) abuf->fields.sfmt_add3.f
1301 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1302 int UNUSED written
= 0;
1303 IADDR UNUSED pc
= abuf
->addr
;
1304 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1307 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1308 * FLD (i_dr
) = opval
;
1309 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1316 /* lduh: lduh $dr,@$sr */
1319 SEM_FN_NAME (m32rbf
,lduh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1321 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1322 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1323 int UNUSED written
= 0;
1324 IADDR UNUSED pc
= abuf
->addr
;
1325 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1328 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, * FLD (i_sr
)));
1329 * FLD (i_dr
) = opval
;
1330 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1337 /* lduh-d: lduh $dr,@($slo16,$sr) */
1340 SEM_FN_NAME (m32rbf
,lduh_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1342 #define FLD(f) abuf->fields.sfmt_add3.f
1343 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1344 int UNUSED written
= 0;
1345 IADDR UNUSED pc
= abuf
->addr
;
1346 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1349 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_sr
), FLD (f_simm16
))));
1350 * FLD (i_dr
) = opval
;
1351 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1358 /* ld-plus: ld $dr,@$sr+ */
1361 SEM_FN_NAME (m32rbf
,ld_plus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1363 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1364 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1365 int UNUSED written
= 0;
1366 IADDR UNUSED pc
= abuf
->addr
;
1367 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1371 temp0
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1372 temp1
= ADDSI (* FLD (i_sr
), 4);
1375 * FLD (i_dr
) = opval
;
1376 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1380 * FLD (i_sr
) = opval
;
1381 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
1389 /* ld24: ld24 $dr,$uimm24 */
1392 SEM_FN_NAME (m32rbf
,ld24
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1394 #define FLD(f) abuf->fields.sfmt_ld24.f
1395 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1396 int UNUSED written
= 0;
1397 IADDR UNUSED pc
= abuf
->addr
;
1398 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1401 SI opval
= FLD (i_uimm24
);
1402 * FLD (i_dr
) = opval
;
1403 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1410 /* ldi8: ldi8 $dr,$simm8 */
1413 SEM_FN_NAME (m32rbf
,ldi8
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1415 #define FLD(f) abuf->fields.sfmt_addi.f
1416 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1417 int UNUSED written
= 0;
1418 IADDR UNUSED pc
= abuf
->addr
;
1419 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1422 SI opval
= FLD (f_simm8
);
1423 * FLD (i_dr
) = opval
;
1424 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1431 /* ldi16: ldi16 $dr,$hash$slo16 */
1434 SEM_FN_NAME (m32rbf
,ldi16
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1436 #define FLD(f) abuf->fields.sfmt_add3.f
1437 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1438 int UNUSED written
= 0;
1439 IADDR UNUSED pc
= abuf
->addr
;
1440 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1443 SI opval
= FLD (f_simm16
);
1444 * FLD (i_dr
) = opval
;
1445 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1452 /* lock: lock $dr,@$sr */
1455 SEM_FN_NAME (m32rbf
,lock
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1457 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1458 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1459 int UNUSED written
= 0;
1460 IADDR UNUSED pc
= abuf
->addr
;
1461 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1466 CPU (h_lock
) = opval
;
1467 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
1470 SI opval
= GETMEMSI (current_cpu
, pc
, * FLD (i_sr
));
1471 * FLD (i_dr
) = opval
;
1472 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1480 /* machi: machi $src1,$src2 */
1483 SEM_FN_NAME (m32rbf
,machi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1485 #define FLD(f) abuf->fields.sfmt_st_plus.f
1486 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1487 int UNUSED written
= 0;
1488 IADDR UNUSED pc
= abuf
->addr
;
1489 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1492 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1493 SET_H_ACCUM (opval
);
1494 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1501 /* maclo: maclo $src1,$src2 */
1504 SEM_FN_NAME (m32rbf
,maclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1506 #define FLD(f) abuf->fields.sfmt_st_plus.f
1507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1508 int UNUSED written
= 0;
1509 IADDR UNUSED pc
= abuf
->addr
;
1510 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1513 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1514 SET_H_ACCUM (opval
);
1515 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1522 /* macwhi: macwhi $src1,$src2 */
1525 SEM_FN_NAME (m32rbf
,macwhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1527 #define FLD(f) abuf->fields.sfmt_st_plus.f
1528 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1529 int UNUSED written
= 0;
1530 IADDR UNUSED pc
= abuf
->addr
;
1531 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1534 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16))))), 8), 8);
1535 SET_H_ACCUM (opval
);
1536 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1543 /* macwlo: macwlo $src1,$src2 */
1546 SEM_FN_NAME (m32rbf
,macwlo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1548 #define FLD(f) abuf->fields.sfmt_st_plus.f
1549 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1550 int UNUSED written
= 0;
1551 IADDR UNUSED pc
= abuf
->addr
;
1552 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1555 DI opval
= SRADI (SLLDI (ADDDI (GET_H_ACCUM (), MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
))))), 8), 8);
1556 SET_H_ACCUM (opval
);
1557 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1564 /* mul: mul $dr,$sr */
1567 SEM_FN_NAME (m32rbf
,mul
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1569 #define FLD(f) abuf->fields.sfmt_add.f
1570 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1571 int UNUSED written
= 0;
1572 IADDR UNUSED pc
= abuf
->addr
;
1573 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1576 SI opval
= MULSI (* FLD (i_dr
), * FLD (i_sr
));
1577 * FLD (i_dr
) = opval
;
1578 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1585 /* mulhi: mulhi $src1,$src2 */
1588 SEM_FN_NAME (m32rbf
,mulhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1590 #define FLD(f) abuf->fields.sfmt_st_plus.f
1591 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1592 int UNUSED written
= 0;
1593 IADDR UNUSED pc
= abuf
->addr
;
1594 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1597 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (ANDSI (* FLD (i_src1
), 0xffff0000)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 16), 16);
1598 SET_H_ACCUM (opval
);
1599 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1606 /* mullo: mullo $src1,$src2 */
1609 SEM_FN_NAME (m32rbf
,mullo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1611 #define FLD(f) abuf->fields.sfmt_st_plus.f
1612 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1613 int UNUSED written
= 0;
1614 IADDR UNUSED pc
= abuf
->addr
;
1615 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1618 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (SLLSI (* FLD (i_src1
), 16)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 16), 16);
1619 SET_H_ACCUM (opval
);
1620 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1627 /* mulwhi: mulwhi $src1,$src2 */
1630 SEM_FN_NAME (m32rbf
,mulwhi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1632 #define FLD(f) abuf->fields.sfmt_st_plus.f
1633 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1634 int UNUSED written
= 0;
1635 IADDR UNUSED pc
= abuf
->addr
;
1636 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1639 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (SRASI (* FLD (i_src2
), 16)))), 8), 8);
1640 SET_H_ACCUM (opval
);
1641 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1648 /* mulwlo: mulwlo $src1,$src2 */
1651 SEM_FN_NAME (m32rbf
,mulwlo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1653 #define FLD(f) abuf->fields.sfmt_st_plus.f
1654 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1655 int UNUSED written
= 0;
1656 IADDR UNUSED pc
= abuf
->addr
;
1657 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1660 DI opval
= SRADI (SLLDI (MULDI (EXTSIDI (* FLD (i_src1
)), EXTHIDI (TRUNCSIHI (* FLD (i_src2
)))), 8), 8);
1661 SET_H_ACCUM (opval
);
1662 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1669 /* mv: mv $dr,$sr */
1672 SEM_FN_NAME (m32rbf
,mv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1674 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1675 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1676 int UNUSED written
= 0;
1677 IADDR UNUSED pc
= abuf
->addr
;
1678 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1681 SI opval
= * FLD (i_sr
);
1682 * FLD (i_dr
) = opval
;
1683 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1690 /* mvfachi: mvfachi $dr */
1693 SEM_FN_NAME (m32rbf
,mvfachi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1695 #define FLD(f) abuf->fields.sfmt_seth.f
1696 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1697 int UNUSED written
= 0;
1698 IADDR UNUSED pc
= abuf
->addr
;
1699 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1702 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 32));
1703 * FLD (i_dr
) = opval
;
1704 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1711 /* mvfaclo: mvfaclo $dr */
1714 SEM_FN_NAME (m32rbf
,mvfaclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1716 #define FLD(f) abuf->fields.sfmt_seth.f
1717 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1718 int UNUSED written
= 0;
1719 IADDR UNUSED pc
= abuf
->addr
;
1720 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1723 SI opval
= TRUNCDISI (GET_H_ACCUM ());
1724 * FLD (i_dr
) = opval
;
1725 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1732 /* mvfacmi: mvfacmi $dr */
1735 SEM_FN_NAME (m32rbf
,mvfacmi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1737 #define FLD(f) abuf->fields.sfmt_seth.f
1738 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1739 int UNUSED written
= 0;
1740 IADDR UNUSED pc
= abuf
->addr
;
1741 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1744 SI opval
= TRUNCDISI (SRADI (GET_H_ACCUM (), 16));
1745 * FLD (i_dr
) = opval
;
1746 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1753 /* mvfc: mvfc $dr,$scr */
1756 SEM_FN_NAME (m32rbf
,mvfc
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1758 #define FLD(f) abuf->fields.sfmt_mvfc.f
1759 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1760 int UNUSED written
= 0;
1761 IADDR UNUSED pc
= abuf
->addr
;
1762 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1765 SI opval
= GET_H_CR (FLD (f_r2
));
1766 * FLD (i_dr
) = opval
;
1767 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1774 /* mvtachi: mvtachi $src1 */
1777 SEM_FN_NAME (m32rbf
,mvtachi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1779 #define FLD(f) abuf->fields.sfmt_st_plus.f
1780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1781 int UNUSED written
= 0;
1782 IADDR UNUSED pc
= abuf
->addr
;
1783 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1786 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0, 0xffffffff)), SLLDI (EXTSIDI (* FLD (i_src1
)), 32));
1787 SET_H_ACCUM (opval
);
1788 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1795 /* mvtaclo: mvtaclo $src1 */
1798 SEM_FN_NAME (m32rbf
,mvtaclo
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1800 #define FLD(f) abuf->fields.sfmt_st_plus.f
1801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1802 int UNUSED written
= 0;
1803 IADDR UNUSED pc
= abuf
->addr
;
1804 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1807 DI opval
= ORDI (ANDDI (GET_H_ACCUM (), MAKEDI (0xffffffff, 0)), ZEXTSIDI (* FLD (i_src1
)));
1808 SET_H_ACCUM (opval
);
1809 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1816 /* mvtc: mvtc $sr,$dcr */
1819 SEM_FN_NAME (m32rbf
,mvtc
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1821 #define FLD(f) abuf->fields.sfmt_mvtc.f
1822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1823 int UNUSED written
= 0;
1824 IADDR UNUSED pc
= abuf
->addr
;
1825 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1828 USI opval
= * FLD (i_sr
);
1829 SET_H_CR (FLD (f_r1
), opval
);
1830 TRACE_RESULT (current_cpu
, abuf
, "dcr", 'x', opval
);
1837 /* neg: neg $dr,$sr */
1840 SEM_FN_NAME (m32rbf
,neg
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1842 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1843 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1844 int UNUSED written
= 0;
1845 IADDR UNUSED pc
= abuf
->addr
;
1846 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1849 SI opval
= NEGSI (* FLD (i_sr
));
1850 * FLD (i_dr
) = opval
;
1851 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1861 SEM_FN_NAME (m32rbf
,nop
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1863 #define FLD(f) abuf->fields.fmt_empty.f
1864 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1865 int UNUSED written
= 0;
1866 IADDR UNUSED pc
= abuf
->addr
;
1867 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1869 PROFILE_COUNT_FILLNOPS (current_cpu
, abuf
->addr
);
1875 /* not: not $dr,$sr */
1878 SEM_FN_NAME (m32rbf
,not) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1880 #define FLD(f) abuf->fields.sfmt_ld_plus.f
1881 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1882 int UNUSED written
= 0;
1883 IADDR UNUSED pc
= abuf
->addr
;
1884 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1887 SI opval
= INVSI (* FLD (i_sr
));
1888 * FLD (i_dr
) = opval
;
1889 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
1899 SEM_FN_NAME (m32rbf
,rac
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1901 #define FLD(f) abuf->fields.fmt_empty.f
1902 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1903 int UNUSED written
= 0;
1904 IADDR UNUSED pc
= abuf
->addr
;
1905 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1909 tmp_tmp1
= SLLDI (GET_H_ACCUM (), 1);
1910 tmp_tmp1
= ADDDI (tmp_tmp1
, MAKEDI (0, 32768));
1912 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)));
1913 SET_H_ACCUM (opval
);
1914 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1925 SEM_FN_NAME (m32rbf
,rach
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1927 #define FLD(f) abuf->fields.fmt_empty.f
1928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1929 int UNUSED written
= 0;
1930 IADDR UNUSED pc
= abuf
->addr
;
1931 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1935 tmp_tmp1
= ANDDI (GET_H_ACCUM (), MAKEDI (16777215, 0xffffffff));
1936 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (16383, 0x80000000)), LEDI (tmp_tmp1
, MAKEDI (8388607, 0xffffffff)))) {
1937 tmp_tmp1
= MAKEDI (16383, 0x80000000);
1939 if (ANDIF (GEDI (tmp_tmp1
, MAKEDI (8388608, 0)), LEDI (tmp_tmp1
, MAKEDI (16760832, 0)))) {
1940 tmp_tmp1
= MAKEDI (16760832, 0);
1942 tmp_tmp1
= ANDDI (ADDDI (GET_H_ACCUM (), MAKEDI (0, 1073741824)), MAKEDI (0xffffffff, 0x80000000));
1945 tmp_tmp1
= SLLDI (tmp_tmp1
, 1);
1947 DI opval
= SRADI (SLLDI (tmp_tmp1
, 7), 7);
1948 SET_H_ACCUM (opval
);
1949 TRACE_RESULT (current_cpu
, abuf
, "accum", 'D', opval
);
1960 SEM_FN_NAME (m32rbf
,rte
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1962 #define FLD(f) abuf->fields.fmt_empty.f
1963 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1964 int UNUSED written
= 0;
1965 IADDR UNUSED pc
= abuf
->addr
;
1967 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1971 USI opval
= ANDSI (GET_H_CR (((UINT
) 6)), -4);
1972 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1973 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1976 USI opval
= GET_H_CR (((UINT
) 14));
1977 SET_H_CR (((UINT
) 6), opval
);
1978 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
1981 UQI opval
= CPU (h_bpsw
);
1983 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
1986 UQI opval
= CPU (h_bbpsw
);
1987 CPU (h_bpsw
) = opval
;
1988 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
1992 SEM_BRANCH_FINI (vpc
);
1997 /* seth: seth $dr,$hash$hi16 */
2000 SEM_FN_NAME (m32rbf
,seth
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2002 #define FLD(f) abuf->fields.sfmt_seth.f
2003 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2004 int UNUSED written
= 0;
2005 IADDR UNUSED pc
= abuf
->addr
;
2006 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2009 SI opval
= SLLSI (FLD (f_hi16
), 16);
2010 * FLD (i_dr
) = opval
;
2011 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2018 /* sll: sll $dr,$sr */
2021 SEM_FN_NAME (m32rbf
,sll
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2023 #define FLD(f) abuf->fields.sfmt_add.f
2024 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2025 int UNUSED written
= 0;
2026 IADDR UNUSED pc
= abuf
->addr
;
2027 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2030 SI opval
= SLLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2031 * FLD (i_dr
) = opval
;
2032 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2039 /* sll3: sll3 $dr,$sr,$simm16 */
2042 SEM_FN_NAME (m32rbf
,sll3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2044 #define FLD(f) abuf->fields.sfmt_add3.f
2045 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2046 int UNUSED written
= 0;
2047 IADDR UNUSED pc
= abuf
->addr
;
2048 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2051 SI opval
= SLLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2052 * FLD (i_dr
) = opval
;
2053 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2060 /* slli: slli $dr,$uimm5 */
2063 SEM_FN_NAME (m32rbf
,slli
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2065 #define FLD(f) abuf->fields.sfmt_slli.f
2066 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2067 int UNUSED written
= 0;
2068 IADDR UNUSED pc
= abuf
->addr
;
2069 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2072 SI opval
= SLLSI (* FLD (i_dr
), FLD (f_uimm5
));
2073 * FLD (i_dr
) = opval
;
2074 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2081 /* sra: sra $dr,$sr */
2084 SEM_FN_NAME (m32rbf
,sra
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2086 #define FLD(f) abuf->fields.sfmt_add.f
2087 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2088 int UNUSED written
= 0;
2089 IADDR UNUSED pc
= abuf
->addr
;
2090 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2093 SI opval
= SRASI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2094 * FLD (i_dr
) = opval
;
2095 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2102 /* sra3: sra3 $dr,$sr,$simm16 */
2105 SEM_FN_NAME (m32rbf
,sra3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2107 #define FLD(f) abuf->fields.sfmt_add3.f
2108 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2109 int UNUSED written
= 0;
2110 IADDR UNUSED pc
= abuf
->addr
;
2111 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2114 SI opval
= SRASI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2115 * FLD (i_dr
) = opval
;
2116 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2123 /* srai: srai $dr,$uimm5 */
2126 SEM_FN_NAME (m32rbf
,srai
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2128 #define FLD(f) abuf->fields.sfmt_slli.f
2129 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2130 int UNUSED written
= 0;
2131 IADDR UNUSED pc
= abuf
->addr
;
2132 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2135 SI opval
= SRASI (* FLD (i_dr
), FLD (f_uimm5
));
2136 * FLD (i_dr
) = opval
;
2137 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2144 /* srl: srl $dr,$sr */
2147 SEM_FN_NAME (m32rbf
,srl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2149 #define FLD(f) abuf->fields.sfmt_add.f
2150 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2151 int UNUSED written
= 0;
2152 IADDR UNUSED pc
= abuf
->addr
;
2153 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2156 SI opval
= SRLSI (* FLD (i_dr
), ANDSI (* FLD (i_sr
), 31));
2157 * FLD (i_dr
) = opval
;
2158 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2165 /* srl3: srl3 $dr,$sr,$simm16 */
2168 SEM_FN_NAME (m32rbf
,srl3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2170 #define FLD(f) abuf->fields.sfmt_add3.f
2171 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2172 int UNUSED written
= 0;
2173 IADDR UNUSED pc
= abuf
->addr
;
2174 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2177 SI opval
= SRLSI (* FLD (i_sr
), ANDSI (FLD (f_simm16
), 31));
2178 * FLD (i_dr
) = opval
;
2179 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2186 /* srli: srli $dr,$uimm5 */
2189 SEM_FN_NAME (m32rbf
,srli
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2191 #define FLD(f) abuf->fields.sfmt_slli.f
2192 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2193 int UNUSED written
= 0;
2194 IADDR UNUSED pc
= abuf
->addr
;
2195 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2198 SI opval
= SRLSI (* FLD (i_dr
), FLD (f_uimm5
));
2199 * FLD (i_dr
) = opval
;
2200 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2207 /* st: st $src1,@$src2 */
2210 SEM_FN_NAME (m32rbf
,st
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2212 #define FLD(f) abuf->fields.sfmt_st_plus.f
2213 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2214 int UNUSED written
= 0;
2215 IADDR UNUSED pc
= abuf
->addr
;
2216 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2219 SI opval
= * FLD (i_src1
);
2220 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2221 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2228 /* st-d: st $src1,@($slo16,$src2) */
2231 SEM_FN_NAME (m32rbf
,st_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2233 #define FLD(f) abuf->fields.sfmt_st_d.f
2234 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2235 int UNUSED written
= 0;
2236 IADDR UNUSED pc
= abuf
->addr
;
2237 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2240 SI opval
= * FLD (i_src1
);
2241 SETMEMSI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2242 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2249 /* stb: stb $src1,@$src2 */
2252 SEM_FN_NAME (m32rbf
,stb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2254 #define FLD(f) abuf->fields.sfmt_st_plus.f
2255 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2256 int UNUSED written
= 0;
2257 IADDR UNUSED pc
= abuf
->addr
;
2258 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2261 QI opval
= * FLD (i_src1
);
2262 SETMEMQI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2263 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2270 /* stb-d: stb $src1,@($slo16,$src2) */
2273 SEM_FN_NAME (m32rbf
,stb_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2275 #define FLD(f) abuf->fields.sfmt_st_d.f
2276 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2277 int UNUSED written
= 0;
2278 IADDR UNUSED pc
= abuf
->addr
;
2279 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2282 QI opval
= * FLD (i_src1
);
2283 SETMEMQI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2284 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2291 /* sth: sth $src1,@$src2 */
2294 SEM_FN_NAME (m32rbf
,sth
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2296 #define FLD(f) abuf->fields.sfmt_st_plus.f
2297 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2298 int UNUSED written
= 0;
2299 IADDR UNUSED pc
= abuf
->addr
;
2300 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2303 HI opval
= * FLD (i_src1
);
2304 SETMEMHI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2305 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2312 /* sth-d: sth $src1,@($slo16,$src2) */
2315 SEM_FN_NAME (m32rbf
,sth_d
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2317 #define FLD(f) abuf->fields.sfmt_st_d.f
2318 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2319 int UNUSED written
= 0;
2320 IADDR UNUSED pc
= abuf
->addr
;
2321 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2324 HI opval
= * FLD (i_src1
);
2325 SETMEMHI (current_cpu
, pc
, ADDSI (* FLD (i_src2
), FLD (f_simm16
)), opval
);
2326 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2333 /* st-plus: st $src1,@+$src2 */
2336 SEM_FN_NAME (m32rbf
,st_plus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2338 #define FLD(f) abuf->fields.sfmt_st_plus.f
2339 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2340 int UNUSED written
= 0;
2341 IADDR UNUSED pc
= abuf
->addr
;
2342 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2346 tmp_new_src2
= ADDSI (* FLD (i_src2
), 4);
2348 SI opval
= * FLD (i_src1
);
2349 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2350 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2353 SI opval
= tmp_new_src2
;
2354 * FLD (i_src2
) = opval
;
2355 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
2363 /* st-minus: st $src1,@-$src2 */
2366 SEM_FN_NAME (m32rbf
,st_minus
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2368 #define FLD(f) abuf->fields.sfmt_st_plus.f
2369 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2370 int UNUSED written
= 0;
2371 IADDR UNUSED pc
= abuf
->addr
;
2372 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2376 tmp_new_src2
= SUBSI (* FLD (i_src2
), 4);
2378 SI opval
= * FLD (i_src1
);
2379 SETMEMSI (current_cpu
, pc
, tmp_new_src2
, opval
);
2380 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2383 SI opval
= tmp_new_src2
;
2384 * FLD (i_src2
) = opval
;
2385 TRACE_RESULT (current_cpu
, abuf
, "src2", 'x', opval
);
2393 /* sub: sub $dr,$sr */
2396 SEM_FN_NAME (m32rbf
,sub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2398 #define FLD(f) abuf->fields.sfmt_add.f
2399 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2400 int UNUSED written
= 0;
2401 IADDR UNUSED pc
= abuf
->addr
;
2402 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2405 SI opval
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2406 * FLD (i_dr
) = opval
;
2407 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2414 /* subv: subv $dr,$sr */
2417 SEM_FN_NAME (m32rbf
,subv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2419 #define FLD(f) abuf->fields.sfmt_add.f
2420 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2421 int UNUSED written
= 0;
2422 IADDR UNUSED pc
= abuf
->addr
;
2423 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2427 temp0
= SUBSI (* FLD (i_dr
), * FLD (i_sr
));
2428 temp1
= SUBOFSI (* FLD (i_dr
), * FLD (i_sr
), 0);
2431 * FLD (i_dr
) = opval
;
2432 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2436 CPU (h_cond
) = opval
;
2437 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
2445 /* subx: subx $dr,$sr */
2448 SEM_FN_NAME (m32rbf
,subx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2450 #define FLD(f) abuf->fields.sfmt_add.f
2451 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2452 int UNUSED written
= 0;
2453 IADDR UNUSED pc
= abuf
->addr
;
2454 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2458 temp0
= SUBCSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2459 temp1
= SUBCFSI (* FLD (i_dr
), * FLD (i_sr
), CPU (h_cond
));
2462 * FLD (i_dr
) = opval
;
2463 TRACE_RESULT (current_cpu
, abuf
, "dr", 'x', opval
);
2467 CPU (h_cond
) = opval
;
2468 TRACE_RESULT (current_cpu
, abuf
, "condbit", 'x', opval
);
2476 /* trap: trap $uimm4 */
2479 SEM_FN_NAME (m32rbf
,trap
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2481 #define FLD(f) abuf->fields.sfmt_trap.f
2482 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2483 int UNUSED written
= 0;
2484 IADDR UNUSED pc
= abuf
->addr
;
2486 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2490 USI opval
= GET_H_CR (((UINT
) 6));
2491 SET_H_CR (((UINT
) 14), opval
);
2492 TRACE_RESULT (current_cpu
, abuf
, "cr-14", 'x', opval
);
2495 USI opval
= ADDSI (pc
, 4);
2496 SET_H_CR (((UINT
) 6), opval
);
2497 TRACE_RESULT (current_cpu
, abuf
, "cr-6", 'x', opval
);
2500 UQI opval
= CPU (h_bpsw
);
2501 CPU (h_bbpsw
) = opval
;
2502 TRACE_RESULT (current_cpu
, abuf
, "bbpsw", 'x', opval
);
2505 UQI opval
= GET_H_PSW ();
2506 CPU (h_bpsw
) = opval
;
2507 TRACE_RESULT (current_cpu
, abuf
, "bpsw", 'x', opval
);
2510 UQI opval
= ANDQI (GET_H_PSW (), 128);
2512 TRACE_RESULT (current_cpu
, abuf
, "psw", 'x', opval
);
2515 SI opval
= m32r_trap (current_cpu
, pc
, FLD (f_uimm4
));
2516 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2517 TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
2521 SEM_BRANCH_FINI (vpc
);
2526 /* unlock: unlock $src1,@$src2 */
2529 SEM_FN_NAME (m32rbf
,unlock
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2531 #define FLD(f) abuf->fields.sfmt_st_plus.f
2532 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2533 int UNUSED written
= 0;
2534 IADDR UNUSED pc
= abuf
->addr
;
2535 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2540 SI opval
= * FLD (i_src1
);
2541 SETMEMSI (current_cpu
, pc
, * FLD (i_src2
), opval
);
2542 written
|= (1 << 4);
2543 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2548 CPU (h_lock
) = opval
;
2549 TRACE_RESULT (current_cpu
, abuf
, "lock", 'x', opval
);
2553 abuf
->written
= written
;
2558 /* Table of all semantic fns. */
2560 static const struct sem_fn_desc sem_fns
[] = {
2561 { M32RBF_INSN_X_INVALID
, SEM_FN_NAME (m32rbf
,x_invalid
) },
2562 { M32RBF_INSN_X_AFTER
, SEM_FN_NAME (m32rbf
,x_after
) },
2563 { M32RBF_INSN_X_BEFORE
, SEM_FN_NAME (m32rbf
,x_before
) },
2564 { M32RBF_INSN_X_CTI_CHAIN
, SEM_FN_NAME (m32rbf
,x_cti_chain
) },
2565 { M32RBF_INSN_X_CHAIN
, SEM_FN_NAME (m32rbf
,x_chain
) },
2566 { M32RBF_INSN_X_BEGIN
, SEM_FN_NAME (m32rbf
,x_begin
) },
2567 { M32RBF_INSN_ADD
, SEM_FN_NAME (m32rbf
,add
) },
2568 { M32RBF_INSN_ADD3
, SEM_FN_NAME (m32rbf
,add3
) },
2569 { M32RBF_INSN_AND
, SEM_FN_NAME (m32rbf
,and) },
2570 { M32RBF_INSN_AND3
, SEM_FN_NAME (m32rbf
,and3
) },
2571 { M32RBF_INSN_OR
, SEM_FN_NAME (m32rbf
,or) },
2572 { M32RBF_INSN_OR3
, SEM_FN_NAME (m32rbf
,or3
) },
2573 { M32RBF_INSN_XOR
, SEM_FN_NAME (m32rbf
,xor) },
2574 { M32RBF_INSN_XOR3
, SEM_FN_NAME (m32rbf
,xor3
) },
2575 { M32RBF_INSN_ADDI
, SEM_FN_NAME (m32rbf
,addi
) },
2576 { M32RBF_INSN_ADDV
, SEM_FN_NAME (m32rbf
,addv
) },
2577 { M32RBF_INSN_ADDV3
, SEM_FN_NAME (m32rbf
,addv3
) },
2578 { M32RBF_INSN_ADDX
, SEM_FN_NAME (m32rbf
,addx
) },
2579 { M32RBF_INSN_BC8
, SEM_FN_NAME (m32rbf
,bc8
) },
2580 { M32RBF_INSN_BC24
, SEM_FN_NAME (m32rbf
,bc24
) },
2581 { M32RBF_INSN_BEQ
, SEM_FN_NAME (m32rbf
,beq
) },
2582 { M32RBF_INSN_BEQZ
, SEM_FN_NAME (m32rbf
,beqz
) },
2583 { M32RBF_INSN_BGEZ
, SEM_FN_NAME (m32rbf
,bgez
) },
2584 { M32RBF_INSN_BGTZ
, SEM_FN_NAME (m32rbf
,bgtz
) },
2585 { M32RBF_INSN_BLEZ
, SEM_FN_NAME (m32rbf
,blez
) },
2586 { M32RBF_INSN_BLTZ
, SEM_FN_NAME (m32rbf
,bltz
) },
2587 { M32RBF_INSN_BNEZ
, SEM_FN_NAME (m32rbf
,bnez
) },
2588 { M32RBF_INSN_BL8
, SEM_FN_NAME (m32rbf
,bl8
) },
2589 { M32RBF_INSN_BL24
, SEM_FN_NAME (m32rbf
,bl24
) },
2590 { M32RBF_INSN_BNC8
, SEM_FN_NAME (m32rbf
,bnc8
) },
2591 { M32RBF_INSN_BNC24
, SEM_FN_NAME (m32rbf
,bnc24
) },
2592 { M32RBF_INSN_BNE
, SEM_FN_NAME (m32rbf
,bne
) },
2593 { M32RBF_INSN_BRA8
, SEM_FN_NAME (m32rbf
,bra8
) },
2594 { M32RBF_INSN_BRA24
, SEM_FN_NAME (m32rbf
,bra24
) },
2595 { M32RBF_INSN_CMP
, SEM_FN_NAME (m32rbf
,cmp
) },
2596 { M32RBF_INSN_CMPI
, SEM_FN_NAME (m32rbf
,cmpi
) },
2597 { M32RBF_INSN_CMPU
, SEM_FN_NAME (m32rbf
,cmpu
) },
2598 { M32RBF_INSN_CMPUI
, SEM_FN_NAME (m32rbf
,cmpui
) },
2599 { M32RBF_INSN_DIV
, SEM_FN_NAME (m32rbf
,div
) },
2600 { M32RBF_INSN_DIVU
, SEM_FN_NAME (m32rbf
,divu
) },
2601 { M32RBF_INSN_REM
, SEM_FN_NAME (m32rbf
,rem
) },
2602 { M32RBF_INSN_REMU
, SEM_FN_NAME (m32rbf
,remu
) },
2603 { M32RBF_INSN_JL
, SEM_FN_NAME (m32rbf
,jl
) },
2604 { M32RBF_INSN_JMP
, SEM_FN_NAME (m32rbf
,jmp
) },
2605 { M32RBF_INSN_LD
, SEM_FN_NAME (m32rbf
,ld
) },
2606 { M32RBF_INSN_LD_D
, SEM_FN_NAME (m32rbf
,ld_d
) },
2607 { M32RBF_INSN_LDB
, SEM_FN_NAME (m32rbf
,ldb
) },
2608 { M32RBF_INSN_LDB_D
, SEM_FN_NAME (m32rbf
,ldb_d
) },
2609 { M32RBF_INSN_LDH
, SEM_FN_NAME (m32rbf
,ldh
) },
2610 { M32RBF_INSN_LDH_D
, SEM_FN_NAME (m32rbf
,ldh_d
) },
2611 { M32RBF_INSN_LDUB
, SEM_FN_NAME (m32rbf
,ldub
) },
2612 { M32RBF_INSN_LDUB_D
, SEM_FN_NAME (m32rbf
,ldub_d
) },
2613 { M32RBF_INSN_LDUH
, SEM_FN_NAME (m32rbf
,lduh
) },
2614 { M32RBF_INSN_LDUH_D
, SEM_FN_NAME (m32rbf
,lduh_d
) },
2615 { M32RBF_INSN_LD_PLUS
, SEM_FN_NAME (m32rbf
,ld_plus
) },
2616 { M32RBF_INSN_LD24
, SEM_FN_NAME (m32rbf
,ld24
) },
2617 { M32RBF_INSN_LDI8
, SEM_FN_NAME (m32rbf
,ldi8
) },
2618 { M32RBF_INSN_LDI16
, SEM_FN_NAME (m32rbf
,ldi16
) },
2619 { M32RBF_INSN_LOCK
, SEM_FN_NAME (m32rbf
,lock
) },
2620 { M32RBF_INSN_MACHI
, SEM_FN_NAME (m32rbf
,machi
) },
2621 { M32RBF_INSN_MACLO
, SEM_FN_NAME (m32rbf
,maclo
) },
2622 { M32RBF_INSN_MACWHI
, SEM_FN_NAME (m32rbf
,macwhi
) },
2623 { M32RBF_INSN_MACWLO
, SEM_FN_NAME (m32rbf
,macwlo
) },
2624 { M32RBF_INSN_MUL
, SEM_FN_NAME (m32rbf
,mul
) },
2625 { M32RBF_INSN_MULHI
, SEM_FN_NAME (m32rbf
,mulhi
) },
2626 { M32RBF_INSN_MULLO
, SEM_FN_NAME (m32rbf
,mullo
) },
2627 { M32RBF_INSN_MULWHI
, SEM_FN_NAME (m32rbf
,mulwhi
) },
2628 { M32RBF_INSN_MULWLO
, SEM_FN_NAME (m32rbf
,mulwlo
) },
2629 { M32RBF_INSN_MV
, SEM_FN_NAME (m32rbf
,mv
) },
2630 { M32RBF_INSN_MVFACHI
, SEM_FN_NAME (m32rbf
,mvfachi
) },
2631 { M32RBF_INSN_MVFACLO
, SEM_FN_NAME (m32rbf
,mvfaclo
) },
2632 { M32RBF_INSN_MVFACMI
, SEM_FN_NAME (m32rbf
,mvfacmi
) },
2633 { M32RBF_INSN_MVFC
, SEM_FN_NAME (m32rbf
,mvfc
) },
2634 { M32RBF_INSN_MVTACHI
, SEM_FN_NAME (m32rbf
,mvtachi
) },
2635 { M32RBF_INSN_MVTACLO
, SEM_FN_NAME (m32rbf
,mvtaclo
) },
2636 { M32RBF_INSN_MVTC
, SEM_FN_NAME (m32rbf
,mvtc
) },
2637 { M32RBF_INSN_NEG
, SEM_FN_NAME (m32rbf
,neg
) },
2638 { M32RBF_INSN_NOP
, SEM_FN_NAME (m32rbf
,nop
) },
2639 { M32RBF_INSN_NOT
, SEM_FN_NAME (m32rbf
,not) },
2640 { M32RBF_INSN_RAC
, SEM_FN_NAME (m32rbf
,rac
) },
2641 { M32RBF_INSN_RACH
, SEM_FN_NAME (m32rbf
,rach
) },
2642 { M32RBF_INSN_RTE
, SEM_FN_NAME (m32rbf
,rte
) },
2643 { M32RBF_INSN_SETH
, SEM_FN_NAME (m32rbf
,seth
) },
2644 { M32RBF_INSN_SLL
, SEM_FN_NAME (m32rbf
,sll
) },
2645 { M32RBF_INSN_SLL3
, SEM_FN_NAME (m32rbf
,sll3
) },
2646 { M32RBF_INSN_SLLI
, SEM_FN_NAME (m32rbf
,slli
) },
2647 { M32RBF_INSN_SRA
, SEM_FN_NAME (m32rbf
,sra
) },
2648 { M32RBF_INSN_SRA3
, SEM_FN_NAME (m32rbf
,sra3
) },
2649 { M32RBF_INSN_SRAI
, SEM_FN_NAME (m32rbf
,srai
) },
2650 { M32RBF_INSN_SRL
, SEM_FN_NAME (m32rbf
,srl
) },
2651 { M32RBF_INSN_SRL3
, SEM_FN_NAME (m32rbf
,srl3
) },
2652 { M32RBF_INSN_SRLI
, SEM_FN_NAME (m32rbf
,srli
) },
2653 { M32RBF_INSN_ST
, SEM_FN_NAME (m32rbf
,st
) },
2654 { M32RBF_INSN_ST_D
, SEM_FN_NAME (m32rbf
,st_d
) },
2655 { M32RBF_INSN_STB
, SEM_FN_NAME (m32rbf
,stb
) },
2656 { M32RBF_INSN_STB_D
, SEM_FN_NAME (m32rbf
,stb_d
) },
2657 { M32RBF_INSN_STH
, SEM_FN_NAME (m32rbf
,sth
) },
2658 { M32RBF_INSN_STH_D
, SEM_FN_NAME (m32rbf
,sth_d
) },
2659 { M32RBF_INSN_ST_PLUS
, SEM_FN_NAME (m32rbf
,st_plus
) },
2660 { M32RBF_INSN_ST_MINUS
, SEM_FN_NAME (m32rbf
,st_minus
) },
2661 { M32RBF_INSN_SUB
, SEM_FN_NAME (m32rbf
,sub
) },
2662 { M32RBF_INSN_SUBV
, SEM_FN_NAME (m32rbf
,subv
) },
2663 { M32RBF_INSN_SUBX
, SEM_FN_NAME (m32rbf
,subx
) },
2664 { M32RBF_INSN_TRAP
, SEM_FN_NAME (m32rbf
,trap
) },
2665 { M32RBF_INSN_UNLOCK
, SEM_FN_NAME (m32rbf
,unlock
) },
2669 /* Add the semantic fns to IDESC_TABLE. */
2672 SEM_FN_NAME (m32rbf
,init_idesc_table
) (SIM_CPU
*current_cpu
)
2674 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
2675 const struct sem_fn_desc
*sf
;
2676 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
2678 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
2680 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
2681 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
2682 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
2685 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
2687 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (m32rbf
,x_invalid
);
2690 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
2692 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (m32rbf
,x_invalid
);