1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2014 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
32 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
34 /* This is used so that we can compile two copies of the semantic code,
35 one with full feature support and one without that runs fast(er).
36 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
38 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
40 #define TRACE_RESULT(cpu, abuf, name, type, val)
42 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
45 /* x-invalid: --invalid-- */
48 SEM_FN_NAME (sh64_compact
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
50 #define FLD(f) abuf->fields.sfmt_empty.f
51 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
52 int UNUSED written
= 0;
53 IADDR UNUSED pc
= abuf
->addr
;
54 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
57 /* Update the recorded pc in the cpu state struct.
58 Only necessary for WITH_SCACHE case, but to avoid the
59 conditional compilation .... */
61 /* Virtual insns have zero size. Overwrite vpc with address of next insn
62 using the default-insn-bitsize spec. When executing insns in parallel
63 we may want to queue the fault and continue execution. */
64 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
65 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
72 /* x-after: --after-- */
75 SEM_FN_NAME (sh64_compact
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
77 #define FLD(f) abuf->fields.sfmt_empty.f
78 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
79 int UNUSED written
= 0;
80 IADDR UNUSED pc
= abuf
->addr
;
81 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
84 #if WITH_SCACHE_PBB_SH64_COMPACT
85 sh64_compact_pbb_after (current_cpu
, sem_arg
);
93 /* x-before: --before-- */
96 SEM_FN_NAME (sh64_compact
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
98 #define FLD(f) abuf->fields.sfmt_empty.f
99 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
100 int UNUSED written
= 0;
101 IADDR UNUSED pc
= abuf
->addr
;
102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
105 #if WITH_SCACHE_PBB_SH64_COMPACT
106 sh64_compact_pbb_before (current_cpu
, sem_arg
);
114 /* x-cti-chain: --cti-chain-- */
117 SEM_FN_NAME (sh64_compact
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
119 #define FLD(f) abuf->fields.sfmt_empty.f
120 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
121 int UNUSED written
= 0;
122 IADDR UNUSED pc
= abuf
->addr
;
123 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
126 #if WITH_SCACHE_PBB_SH64_COMPACT
128 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
129 pbb_br_type
, pbb_br_npc
);
132 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
133 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
134 CPU_PBB_BR_TYPE (current_cpu
),
135 CPU_PBB_BR_NPC (current_cpu
));
144 /* x-chain: --chain-- */
147 SEM_FN_NAME (sh64_compact
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
149 #define FLD(f) abuf->fields.sfmt_empty.f
150 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
151 int UNUSED written
= 0;
152 IADDR UNUSED pc
= abuf
->addr
;
153 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
156 #if WITH_SCACHE_PBB_SH64_COMPACT
157 vpc
= sh64_compact_pbb_chain (current_cpu
, sem_arg
);
168 /* x-begin: --begin-- */
171 SEM_FN_NAME (sh64_compact
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
173 #define FLD(f) abuf->fields.sfmt_empty.f
174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
175 int UNUSED written
= 0;
176 IADDR UNUSED pc
= abuf
->addr
;
177 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
180 #if WITH_SCACHE_PBB_SH64_COMPACT
181 #if defined DEFINE_SWITCH || defined FAST_P
182 /* In the switch case FAST_P is a constant, allowing several optimizations
183 in any called inline functions. */
184 vpc
= sh64_compact_pbb_begin (current_cpu
, FAST_P
);
186 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
187 vpc
= sh64_compact_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
189 vpc
= sh64_compact_pbb_begin (current_cpu
, 0);
199 /* add-compact: add $rm, $rn */
202 SEM_FN_NAME (sh64_compact
,add_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
204 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
206 int UNUSED written
= 0;
207 IADDR UNUSED pc
= abuf
->addr
;
208 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
211 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
212 SET_H_GRC (FLD (f_rn
), opval
);
213 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
220 /* addi-compact: add #$imm8, $rn */
223 SEM_FN_NAME (sh64_compact
,addi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
225 #define FLD(f) abuf->fields.sfmt_addi_compact.f
226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
227 int UNUSED written
= 0;
228 IADDR UNUSED pc
= abuf
->addr
;
229 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
232 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
233 SET_H_GRC (FLD (f_rn
), opval
);
234 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
241 /* addc-compact: addc $rm, $rn */
244 SEM_FN_NAME (sh64_compact
,addc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
246 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
247 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
248 int UNUSED written
= 0;
249 IADDR UNUSED pc
= abuf
->addr
;
250 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
254 tmp_flag
= ADDCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
256 SI opval
= ADDCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
257 SET_H_GRC (FLD (f_rn
), opval
);
258 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
263 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
271 /* addv-compact: addv $rm, $rn */
274 SEM_FN_NAME (sh64_compact
,addv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
276 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
277 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
278 int UNUSED written
= 0;
279 IADDR UNUSED pc
= abuf
->addr
;
280 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
284 tmp_t
= ADDOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
286 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
287 SET_H_GRC (FLD (f_rn
), opval
);
288 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
293 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
301 /* and-compact: and $rm64, $rn64 */
304 SEM_FN_NAME (sh64_compact
,and_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
306 #define FLD(f) abuf->fields.sfmt_movl12_compact.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
, 2);
313 DI opval
= ANDDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
314 SET_H_GR (FLD (f_rn
), opval
);
315 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
322 /* andi-compact: and #$uimm8, r0 */
325 SEM_FN_NAME (sh64_compact
,andi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
327 #define FLD(f) abuf->fields.sfmt_addi_compact.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
= ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
335 SET_H_GRC (((UINT
) 0), opval
);
336 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
343 /* andb-compact: and.b #$imm8, @(r0, gbr) */
346 SEM_FN_NAME (sh64_compact
,andb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
348 #define FLD(f) abuf->fields.sfmt_addi_compact.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
, 2);
357 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
358 tmp_data
= ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
360 UQI opval
= tmp_data
;
361 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
362 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
370 /* bf-compact: bf $disp8 */
373 SEM_FN_NAME (sh64_compact
,bf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
375 #define FLD(f) abuf->fields.sfmt_bf_compact.f
376 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
377 int UNUSED written
= 0;
378 IADDR UNUSED pc
= abuf
->addr
;
380 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
382 if (NOTBI (GET_H_TBIT ())) {
384 UDI opval
= FLD (i_disp8
);
385 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
387 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
391 abuf
->written
= written
;
392 SEM_BRANCH_FINI (vpc
);
397 /* bfs-compact: bf/s $disp8 */
400 SEM_FN_NAME (sh64_compact
,bfs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
402 #define FLD(f) abuf->fields.sfmt_bf_compact.f
403 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
404 int UNUSED written
= 0;
405 IADDR UNUSED pc
= abuf
->addr
;
407 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
409 if (NOTBI (GET_H_TBIT ())) {
412 UDI opval
= ADDDI (pc
, 2);
413 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
415 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
420 UDI opval
= FLD (i_disp8
);
421 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
423 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
429 abuf
->written
= written
;
430 SEM_BRANCH_FINI (vpc
);
435 /* bra-compact: bra $disp12 */
438 SEM_FN_NAME (sh64_compact
,bra_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
440 #define FLD(f) abuf->fields.sfmt_bra_compact.f
441 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
442 int UNUSED written
= 0;
443 IADDR UNUSED pc
= abuf
->addr
;
445 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
449 UDI opval
= ADDDI (pc
, 2);
450 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
451 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
456 UDI opval
= FLD (i_disp12
);
457 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
458 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
463 SEM_BRANCH_FINI (vpc
);
468 /* braf-compact: braf $rn */
471 SEM_FN_NAME (sh64_compact
,braf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
473 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
474 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
475 int UNUSED written
= 0;
476 IADDR UNUSED pc
= abuf
->addr
;
478 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
482 UDI opval
= ADDDI (pc
, 2);
483 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
484 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
489 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
490 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
491 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
496 SEM_BRANCH_FINI (vpc
);
501 /* brk-compact: brk */
504 SEM_FN_NAME (sh64_compact
,brk_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
506 #define FLD(f) abuf->fields.sfmt_empty.f
507 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
508 int UNUSED written
= 0;
509 IADDR UNUSED pc
= abuf
->addr
;
510 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
512 sh64_break (current_cpu
, pc
);
518 /* bsr-compact: bsr $disp12 */
521 SEM_FN_NAME (sh64_compact
,bsr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
523 #define FLD(f) abuf->fields.sfmt_bra_compact.f
524 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
525 int UNUSED written
= 0;
526 IADDR UNUSED pc
= abuf
->addr
;
528 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
533 SI opval
= ADDDI (pc
, 4);
535 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
539 UDI opval
= ADDDI (pc
, 2);
540 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
541 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
546 UDI opval
= FLD (i_disp12
);
547 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
548 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
553 SEM_BRANCH_FINI (vpc
);
558 /* bsrf-compact: bsrf $rn */
561 SEM_FN_NAME (sh64_compact
,bsrf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
563 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
564 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
565 int UNUSED written
= 0;
566 IADDR UNUSED pc
= abuf
->addr
;
568 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
573 SI opval
= ADDDI (pc
, 4);
575 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
579 UDI opval
= ADDDI (pc
, 2);
580 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
581 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
586 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
587 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
588 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
593 SEM_BRANCH_FINI (vpc
);
598 /* bt-compact: bt $disp8 */
601 SEM_FN_NAME (sh64_compact
,bt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
603 #define FLD(f) abuf->fields.sfmt_bf_compact.f
604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
605 int UNUSED written
= 0;
606 IADDR UNUSED pc
= abuf
->addr
;
608 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
612 UDI opval
= FLD (i_disp8
);
613 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
615 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
619 abuf
->written
= written
;
620 SEM_BRANCH_FINI (vpc
);
625 /* bts-compact: bt/s $disp8 */
628 SEM_FN_NAME (sh64_compact
,bts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
630 #define FLD(f) abuf->fields.sfmt_bf_compact.f
631 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
632 int UNUSED written
= 0;
633 IADDR UNUSED pc
= abuf
->addr
;
635 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
640 UDI opval
= ADDDI (pc
, 2);
641 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
643 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
648 UDI opval
= FLD (i_disp8
);
649 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
651 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
657 abuf
->written
= written
;
658 SEM_BRANCH_FINI (vpc
);
663 /* clrmac-compact: clrmac */
666 SEM_FN_NAME (sh64_compact
,clrmac_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
668 #define FLD(f) abuf->fields.sfmt_empty.f
669 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
670 int UNUSED written
= 0;
671 IADDR UNUSED pc
= abuf
->addr
;
672 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
678 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
683 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
691 /* clrs-compact: clrs */
694 SEM_FN_NAME (sh64_compact
,clrs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
696 #define FLD(f) abuf->fields.sfmt_empty.f
697 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
698 int UNUSED written
= 0;
699 IADDR UNUSED pc
= abuf
->addr
;
700 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
705 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
712 /* clrt-compact: clrt */
715 SEM_FN_NAME (sh64_compact
,clrt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
717 #define FLD(f) abuf->fields.sfmt_empty.f
718 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
719 int UNUSED written
= 0;
720 IADDR UNUSED pc
= abuf
->addr
;
721 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
726 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
733 /* cmpeq-compact: cmp/eq $rm, $rn */
736 SEM_FN_NAME (sh64_compact
,cmpeq_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
738 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
740 int UNUSED written
= 0;
741 IADDR UNUSED pc
= abuf
->addr
;
742 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
745 BI opval
= EQSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
747 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
754 /* cmpeqi-compact: cmp/eq #$imm8, r0 */
757 SEM_FN_NAME (sh64_compact
,cmpeqi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
759 #define FLD(f) abuf->fields.sfmt_addi_compact.f
760 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
761 int UNUSED written
= 0;
762 IADDR UNUSED pc
= abuf
->addr
;
763 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
766 BI opval
= EQSI (GET_H_GRC (((UINT
) 0)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
768 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
775 /* cmpge-compact: cmp/ge $rm, $rn */
778 SEM_FN_NAME (sh64_compact
,cmpge_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
780 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
781 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
782 int UNUSED written
= 0;
783 IADDR UNUSED pc
= abuf
->addr
;
784 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
787 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
789 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
796 /* cmpgt-compact: cmp/gt $rm, $rn */
799 SEM_FN_NAME (sh64_compact
,cmpgt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
801 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
802 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
803 int UNUSED written
= 0;
804 IADDR UNUSED pc
= abuf
->addr
;
805 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
808 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
810 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
817 /* cmphi-compact: cmp/hi $rm, $rn */
820 SEM_FN_NAME (sh64_compact
,cmphi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
822 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
823 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
824 int UNUSED written
= 0;
825 IADDR UNUSED pc
= abuf
->addr
;
826 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
829 BI opval
= GTUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
831 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
838 /* cmphs-compact: cmp/hs $rm, $rn */
841 SEM_FN_NAME (sh64_compact
,cmphs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
843 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
844 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
845 int UNUSED written
= 0;
846 IADDR UNUSED pc
= abuf
->addr
;
847 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
850 BI opval
= GEUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
852 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
859 /* cmppl-compact: cmp/pl $rn */
862 SEM_FN_NAME (sh64_compact
,cmppl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
864 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
865 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
866 int UNUSED written
= 0;
867 IADDR UNUSED pc
= abuf
->addr
;
868 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
871 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), 0);
873 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
880 /* cmppz-compact: cmp/pz $rn */
883 SEM_FN_NAME (sh64_compact
,cmppz_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
885 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
886 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
887 int UNUSED written
= 0;
888 IADDR UNUSED pc
= abuf
->addr
;
889 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
892 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), 0);
894 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
901 /* cmpstr-compact: cmp/str $rm, $rn */
904 SEM_FN_NAME (sh64_compact
,cmpstr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
906 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
907 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
908 int UNUSED written
= 0;
909 IADDR UNUSED pc
= abuf
->addr
;
910 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
915 tmp_temp
= XORSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
916 tmp_t
= EQSI (ANDSI (tmp_temp
, 0xff000000), 0);
917 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 16711680), 0), tmp_t
);
918 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 65280), 0), tmp_t
);
919 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 255), 0), tmp_t
);
921 BI opval
= ((GTUBI (tmp_t
, 0)) ? (1) : (0));
923 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
931 /* div0s-compact: div0s $rm, $rn */
934 SEM_FN_NAME (sh64_compact
,div0s_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
936 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
937 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
938 int UNUSED written
= 0;
939 IADDR UNUSED pc
= abuf
->addr
;
940 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
944 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
946 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
949 BI opval
= SRLSI (GET_H_GRC (FLD (f_rm
)), 31);
951 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
954 BI opval
= ((EQSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 31), SRLSI (GET_H_GRC (FLD (f_rn
)), 31))) ? (0) : (1));
956 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
964 /* div0u-compact: div0u */
967 SEM_FN_NAME (sh64_compact
,div0u_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
969 #define FLD(f) abuf->fields.sfmt_empty.f
970 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
971 int UNUSED written
= 0;
972 IADDR UNUSED pc
= abuf
->addr
;
973 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
979 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
984 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
989 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
997 /* div1-compact: div1 $rm, $rn */
1000 SEM_FN_NAME (sh64_compact
,div1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1002 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1003 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1004 int UNUSED written
= 0;
1005 IADDR UNUSED pc
= abuf
->addr
;
1006 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1012 tmp_oldq
= GET_H_QBIT ();
1014 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
1016 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1019 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), ZEXTBISI (GET_H_TBIT ()));
1020 SET_H_GRC (FLD (f_rn
), opval
);
1021 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1023 if (NOTBI (tmp_oldq
)) {
1024 if (NOTBI (GET_H_MBIT ())) {
1026 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1028 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1029 SET_H_GRC (FLD (f_rn
), opval
);
1030 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1032 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1033 if (NOTBI (GET_H_QBIT ())) {
1035 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1037 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1041 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1043 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1049 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1051 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1052 SET_H_GRC (FLD (f_rn
), opval
);
1053 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1055 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1056 if (NOTBI (GET_H_QBIT ())) {
1058 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1060 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1064 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1066 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1072 if (NOTBI (GET_H_MBIT ())) {
1074 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1076 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
1077 SET_H_GRC (FLD (f_rn
), opval
);
1078 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1080 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1081 if (NOTBI (GET_H_QBIT ())) {
1083 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1085 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1089 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1091 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1097 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1099 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1100 SET_H_GRC (FLD (f_rn
), opval
);
1101 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1103 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1104 if (NOTBI (GET_H_QBIT ())) {
1106 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1108 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1112 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1114 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1121 BI opval
= ((EQBI (GET_H_QBIT (), GET_H_MBIT ())) ? (1) : (0));
1123 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1131 /* divu-compact: divu r0, $rn */
1134 SEM_FN_NAME (sh64_compact
,divu_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1136 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1137 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1138 int UNUSED written
= 0;
1139 IADDR UNUSED pc
= abuf
->addr
;
1140 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1143 SI opval
= UDIVSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (((UINT
) 0)));
1144 SET_H_GRC (FLD (f_rn
), opval
);
1145 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1152 /* mulr-compact: mulr r0, $rn */
1155 SEM_FN_NAME (sh64_compact
,mulr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1157 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1158 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1159 int UNUSED written
= 0;
1160 IADDR UNUSED pc
= abuf
->addr
;
1161 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1164 SI opval
= MULSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (((UINT
) 0)));
1165 SET_H_GRC (FLD (f_rn
), opval
);
1166 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1173 /* dmulsl-compact: dmuls.l $rm, $rn */
1176 SEM_FN_NAME (sh64_compact
,dmulsl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1178 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1179 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1180 int UNUSED written
= 0;
1181 IADDR UNUSED pc
= abuf
->addr
;
1182 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1186 tmp_result
= MULDI (EXTSIDI (GET_H_GRC (FLD (f_rm
))), EXTSIDI (GET_H_GRC (FLD (f_rn
))));
1188 SI opval
= SUBWORDDISI (tmp_result
, 0);
1190 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1193 SI opval
= SUBWORDDISI (tmp_result
, 1);
1195 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1203 /* dmulul-compact: dmulu.l $rm, $rn */
1206 SEM_FN_NAME (sh64_compact
,dmulul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1208 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1209 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1210 int UNUSED written
= 0;
1211 IADDR UNUSED pc
= abuf
->addr
;
1212 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1216 tmp_result
= MULDI (ZEXTSIDI (GET_H_GRC (FLD (f_rm
))), ZEXTSIDI (GET_H_GRC (FLD (f_rn
))));
1218 SI opval
= SUBWORDDISI (tmp_result
, 0);
1220 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1223 SI opval
= SUBWORDDISI (tmp_result
, 1);
1225 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1233 /* dt-compact: dt $rn */
1236 SEM_FN_NAME (sh64_compact
,dt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1238 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1239 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1240 int UNUSED written
= 0;
1241 IADDR UNUSED pc
= abuf
->addr
;
1242 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1246 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
1247 SET_H_GRC (FLD (f_rn
), opval
);
1248 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1251 BI opval
= EQSI (GET_H_GRC (FLD (f_rn
)), 0);
1253 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1261 /* extsb-compact: exts.b $rm, $rn */
1264 SEM_FN_NAME (sh64_compact
,extsb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1266 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1267 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1268 int UNUSED written
= 0;
1269 IADDR UNUSED pc
= abuf
->addr
;
1270 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1273 SI opval
= EXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1274 SET_H_GRC (FLD (f_rn
), opval
);
1275 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1282 /* extsw-compact: exts.w $rm, $rn */
1285 SEM_FN_NAME (sh64_compact
,extsw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1287 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1288 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1289 int UNUSED written
= 0;
1290 IADDR UNUSED pc
= abuf
->addr
;
1291 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1294 SI opval
= EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1295 SET_H_GRC (FLD (f_rn
), opval
);
1296 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1303 /* extub-compact: extu.b $rm, $rn */
1306 SEM_FN_NAME (sh64_compact
,extub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1308 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1309 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1310 int UNUSED written
= 0;
1311 IADDR UNUSED pc
= abuf
->addr
;
1312 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1315 SI opval
= ZEXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1316 SET_H_GRC (FLD (f_rn
), opval
);
1317 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1324 /* extuw-compact: extu.w $rm, $rn */
1327 SEM_FN_NAME (sh64_compact
,extuw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1329 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1331 int UNUSED written
= 0;
1332 IADDR UNUSED pc
= abuf
->addr
;
1333 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1336 SI opval
= ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1337 SET_H_GRC (FLD (f_rn
), opval
);
1338 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1345 /* fabs-compact: fabs $fsdn */
1348 SEM_FN_NAME (sh64_compact
,fabs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1350 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1351 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1352 int UNUSED written
= 0;
1353 IADDR UNUSED pc
= abuf
->addr
;
1354 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1356 if (GET_H_PRBIT ()) {
1358 DF opval
= sh64_fabsd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
1359 SET_H_FSD (FLD (f_rn
), opval
);
1360 written
|= (1 << 2);
1361 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1365 DF opval
= sh64_fabss (current_cpu
, GET_H_FSD (FLD (f_rn
)));
1366 SET_H_FSD (FLD (f_rn
), opval
);
1367 written
|= (1 << 2);
1368 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1372 abuf
->written
= written
;
1377 /* fadd-compact: fadd $fsdm, $fsdn */
1380 SEM_FN_NAME (sh64_compact
,fadd_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1382 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1383 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1384 int UNUSED written
= 0;
1385 IADDR UNUSED pc
= abuf
->addr
;
1386 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1388 if (GET_H_PRBIT ()) {
1390 DF opval
= sh64_faddd (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1391 SET_H_FSD (FLD (f_rn
), opval
);
1392 written
|= (1 << 3);
1393 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1397 DF opval
= sh64_fadds (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1398 SET_H_FSD (FLD (f_rn
), opval
);
1399 written
|= (1 << 3);
1400 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1404 abuf
->written
= written
;
1409 /* fcmpeq-compact: fcmp/eq $fsdm, $fsdn */
1412 SEM_FN_NAME (sh64_compact
,fcmpeq_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1414 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1415 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1416 int UNUSED written
= 0;
1417 IADDR UNUSED pc
= abuf
->addr
;
1418 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1420 if (GET_H_PRBIT ()) {
1422 BI opval
= sh64_fcmpeqd (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1424 written
|= (1 << 3);
1425 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1429 BI opval
= sh64_fcmpeqs (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1431 written
|= (1 << 3);
1432 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1436 abuf
->written
= written
;
1441 /* fcmpgt-compact: fcmp/gt $fsdm, $fsdn */
1444 SEM_FN_NAME (sh64_compact
,fcmpgt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1446 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1447 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1448 int UNUSED written
= 0;
1449 IADDR UNUSED pc
= abuf
->addr
;
1450 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1452 if (GET_H_PRBIT ()) {
1454 BI opval
= sh64_fcmpgtd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1456 written
|= (1 << 3);
1457 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1461 BI opval
= sh64_fcmpgts (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1463 written
|= (1 << 3);
1464 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1468 abuf
->written
= written
;
1473 /* fcnvds-compact: fcnvds $drn, fpul */
1476 SEM_FN_NAME (sh64_compact
,fcnvds_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1478 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1479 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1480 int UNUSED written
= 0;
1481 IADDR UNUSED pc
= abuf
->addr
;
1482 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1485 SF opval
= sh64_fcnvds (current_cpu
, GET_H_DRC (FLD (f_dn
)));
1486 CPU (h_fr
[((UINT
) 32)]) = opval
;
1487 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1494 /* fcnvsd-compact: fcnvsd fpul, $drn */
1497 SEM_FN_NAME (sh64_compact
,fcnvsd_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1499 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1500 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1501 int UNUSED written
= 0;
1502 IADDR UNUSED pc
= abuf
->addr
;
1503 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1506 DF opval
= sh64_fcnvsd (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1507 SET_H_DRC (FLD (f_dn
), opval
);
1508 TRACE_RESULT (current_cpu
, abuf
, "drc", 'f', opval
);
1515 /* fdiv-compact: fdiv $fsdm, $fsdn */
1518 SEM_FN_NAME (sh64_compact
,fdiv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1520 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1521 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1522 int UNUSED written
= 0;
1523 IADDR UNUSED pc
= abuf
->addr
;
1524 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1526 if (GET_H_PRBIT ()) {
1528 DF opval
= sh64_fdivd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1529 SET_H_FSD (FLD (f_rn
), opval
);
1530 written
|= (1 << 3);
1531 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1535 DF opval
= sh64_fdivs (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
1536 SET_H_FSD (FLD (f_rn
), opval
);
1537 written
|= (1 << 3);
1538 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1542 abuf
->written
= written
;
1547 /* fipr-compact: fipr $fvm, $fvn */
1550 SEM_FN_NAME (sh64_compact
,fipr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1552 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
1553 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1554 int UNUSED written
= 0;
1555 IADDR UNUSED pc
= abuf
->addr
;
1556 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1558 sh64_fipr (current_cpu
, FLD (f_vm
), FLD (f_vn
));
1564 /* flds-compact: flds $frn, fpul */
1567 SEM_FN_NAME (sh64_compact
,flds_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1569 #define FLD(f) abuf->fields.sfmt_movw10_compact.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 SF opval
= GET_H_FRC (FLD (f_rn
));
1577 CPU (h_fr
[((UINT
) 32)]) = opval
;
1578 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1585 /* fldi0-compact: fldi0 $frn */
1588 SEM_FN_NAME (sh64_compact
,fldi0_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1590 #define FLD(f) abuf->fields.sfmt_movw10_compact.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 SF opval
= sh64_fldi0 (current_cpu
);
1598 SET_H_FRC (FLD (f_rn
), opval
);
1599 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1606 /* fldi1-compact: fldi1 $frn */
1609 SEM_FN_NAME (sh64_compact
,fldi1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1611 #define FLD(f) abuf->fields.sfmt_movw10_compact.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 SF opval
= sh64_fldi1 (current_cpu
);
1619 SET_H_FRC (FLD (f_rn
), opval
);
1620 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1627 /* float-compact: float fpul, $fsdn */
1630 SEM_FN_NAME (sh64_compact
,float_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1632 #define FLD(f) abuf->fields.sfmt_movw10_compact.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);
1638 if (GET_H_PRBIT ()) {
1640 DF opval
= sh64_floatld (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1641 SET_H_FSD (FLD (f_rn
), opval
);
1642 written
|= (1 << 2);
1643 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1647 DF opval
= sh64_floatls (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1648 SET_H_FSD (FLD (f_rn
), opval
);
1649 written
|= (1 << 2);
1650 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1654 abuf
->written
= written
;
1659 /* fmac-compact: fmac fr0, $frm, $frn */
1662 SEM_FN_NAME (sh64_compact
,fmac_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1664 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1665 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1666 int UNUSED written
= 0;
1667 IADDR UNUSED pc
= abuf
->addr
;
1668 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1671 SF opval
= sh64_fmacs (current_cpu
, GET_H_FRC (((UINT
) 0)), GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1672 SET_H_FRC (FLD (f_rn
), opval
);
1673 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
1680 /* fmov1-compact: fmov $fmovm, $fmovn */
1683 SEM_FN_NAME (sh64_compact
,fmov1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1685 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1686 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1687 int UNUSED written
= 0;
1688 IADDR UNUSED pc
= abuf
->addr
;
1689 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1692 DF opval
= GET_H_FMOV (FLD (f_rm
));
1693 SET_H_FMOV (FLD (f_rn
), opval
);
1694 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1701 /* fmov2-compact: fmov @$rm, $fmovn */
1704 SEM_FN_NAME (sh64_compact
,fmov2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1706 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1708 int UNUSED written
= 0;
1709 IADDR UNUSED pc
= abuf
->addr
;
1710 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1712 if (NOTBI (GET_H_SZBIT ())) {
1714 DF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1715 SET_H_FMOV (FLD (f_rn
), opval
);
1716 written
|= (1 << 4);
1717 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1721 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1722 SET_H_FMOV (FLD (f_rn
), opval
);
1723 written
|= (1 << 4);
1724 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1728 abuf
->written
= written
;
1733 /* fmov3-compact: fmov @${rm}+, fmovn */
1736 SEM_FN_NAME (sh64_compact
,fmov3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1738 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1739 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1740 int UNUSED written
= 0;
1741 IADDR UNUSED pc
= abuf
->addr
;
1742 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1744 if (NOTBI (GET_H_SZBIT ())) {
1747 DF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1748 SET_H_FMOV (FLD (f_rn
), opval
);
1749 written
|= (1 << 4);
1750 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1753 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
1754 SET_H_GRC (FLD (f_rm
), opval
);
1755 written
|= (1 << 5);
1756 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1762 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1763 SET_H_FMOV (FLD (f_rn
), opval
);
1764 written
|= (1 << 4);
1765 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1768 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 8);
1769 SET_H_GRC (FLD (f_rm
), opval
);
1770 written
|= (1 << 5);
1771 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1776 abuf
->written
= written
;
1781 /* fmov4-compact: fmov @(r0, $rm), $fmovn */
1784 SEM_FN_NAME (sh64_compact
,fmov4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1786 #define FLD(f) abuf->fields.sfmt_movl12_compact.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);
1792 if (NOTBI (GET_H_SZBIT ())) {
1794 DF opval
= GETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1795 SET_H_FMOV (FLD (f_rn
), opval
);
1796 written
|= (1 << 5);
1797 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1801 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1802 SET_H_FMOV (FLD (f_rn
), opval
);
1803 written
|= (1 << 5);
1804 TRACE_RESULT (current_cpu
, abuf
, "fmov", 'f', opval
);
1808 abuf
->written
= written
;
1813 /* fmov5-compact: fmov $fmovm, @$rn */
1816 SEM_FN_NAME (sh64_compact
,fmov5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1818 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1819 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1820 int UNUSED written
= 0;
1821 IADDR UNUSED pc
= abuf
->addr
;
1822 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1824 if (NOTBI (GET_H_SZBIT ())) {
1826 SF opval
= GET_H_FMOV (FLD (f_rm
));
1827 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1828 written
|= (1 << 4);
1829 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1833 DF opval
= GET_H_FMOV (FLD (f_rm
));
1834 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1835 written
|= (1 << 3);
1836 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1840 abuf
->written
= written
;
1845 /* fmov6-compact: fmov $fmovm, @-$rn */
1848 SEM_FN_NAME (sh64_compact
,fmov6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1850 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1852 int UNUSED written
= 0;
1853 IADDR UNUSED pc
= abuf
->addr
;
1854 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1856 if (NOTBI (GET_H_SZBIT ())) {
1859 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
1860 SET_H_GRC (FLD (f_rn
), opval
);
1861 written
|= (1 << 5);
1862 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1865 SF opval
= GET_H_FMOV (FLD (f_rm
));
1866 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1867 written
|= (1 << 4);
1868 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1874 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 8);
1875 SET_H_GRC (FLD (f_rn
), opval
);
1876 written
|= (1 << 5);
1877 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
1880 DF opval
= GET_H_FMOV (FLD (f_rm
));
1881 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1882 written
|= (1 << 3);
1883 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1888 abuf
->written
= written
;
1893 /* fmov7-compact: fmov $fmovm, @(r0, $rn) */
1896 SEM_FN_NAME (sh64_compact
,fmov7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1898 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1899 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1900 int UNUSED written
= 0;
1901 IADDR UNUSED pc
= abuf
->addr
;
1902 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1904 if (NOTBI (GET_H_SZBIT ())) {
1906 SF opval
= GET_H_FMOV (FLD (f_rm
));
1907 SETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
1908 written
|= (1 << 5);
1909 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1913 DF opval
= GET_H_FMOV (FLD (f_rm
));
1914 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
1915 written
|= (1 << 4);
1916 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1920 abuf
->written
= written
;
1925 /* fmov8-compact: fmov.d @($imm12x8, $rm), $drn */
1928 SEM_FN_NAME (sh64_compact
,fmov8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1930 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1931 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1932 int UNUSED written
= 0;
1933 IADDR UNUSED pc
= abuf
->addr
;
1934 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1937 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm12x8
)));
1938 SET_H_DRC (FLD (f_dn
), opval
);
1939 TRACE_RESULT (current_cpu
, abuf
, "drc", 'f', opval
);
1946 /* fmov9-compact: mov.l $drm, @($imm12x8, $rn) */
1949 SEM_FN_NAME (sh64_compact
,fmov9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1951 #define FLD(f) abuf->fields.sfmt_fmov9_compact.f
1952 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1953 int UNUSED written
= 0;
1954 IADDR UNUSED pc
= abuf
->addr
;
1955 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1958 DF opval
= GET_H_DRC (FLD (f_dm
));
1959 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm12x8
)), opval
);
1960 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1967 /* fmul-compact: fmul $fsdm, $fsdn */
1970 SEM_FN_NAME (sh64_compact
,fmul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1972 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1974 int UNUSED written
= 0;
1975 IADDR UNUSED pc
= abuf
->addr
;
1976 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1978 if (GET_H_PRBIT ()) {
1980 DF opval
= sh64_fmuld (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1981 SET_H_FSD (FLD (f_rn
), opval
);
1982 written
|= (1 << 3);
1983 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1987 DF opval
= sh64_fmuls (current_cpu
, GET_H_FSD (FLD (f_rm
)), GET_H_FSD (FLD (f_rn
)));
1988 SET_H_FSD (FLD (f_rn
), opval
);
1989 written
|= (1 << 3);
1990 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
1994 abuf
->written
= written
;
1999 /* fneg-compact: fneg $fsdn */
2002 SEM_FN_NAME (sh64_compact
,fneg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2004 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2005 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2006 int UNUSED written
= 0;
2007 IADDR UNUSED pc
= abuf
->addr
;
2008 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2010 if (GET_H_PRBIT ()) {
2012 DF opval
= sh64_fnegd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2013 SET_H_FSD (FLD (f_rn
), opval
);
2014 written
|= (1 << 2);
2015 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2019 DF opval
= sh64_fnegs (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2020 SET_H_FSD (FLD (f_rn
), opval
);
2021 written
|= (1 << 2);
2022 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2026 abuf
->written
= written
;
2031 /* frchg-compact: frchg */
2034 SEM_FN_NAME (sh64_compact
,frchg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2036 #define FLD(f) abuf->fields.sfmt_empty.f
2037 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2038 int UNUSED written
= 0;
2039 IADDR UNUSED pc
= abuf
->addr
;
2040 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2043 BI opval
= NOTBI (GET_H_FRBIT ());
2044 SET_H_FRBIT (opval
);
2045 TRACE_RESULT (current_cpu
, abuf
, "frbit", 'x', opval
);
2052 /* fschg-compact: fschg */
2055 SEM_FN_NAME (sh64_compact
,fschg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2057 #define FLD(f) abuf->fields.sfmt_empty.f
2058 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2059 int UNUSED written
= 0;
2060 IADDR UNUSED pc
= abuf
->addr
;
2061 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2064 BI opval
= NOTBI (GET_H_SZBIT ());
2065 SET_H_SZBIT (opval
);
2066 TRACE_RESULT (current_cpu
, abuf
, "szbit", 'x', opval
);
2073 /* fsqrt-compact: fsqrt $fsdn */
2076 SEM_FN_NAME (sh64_compact
,fsqrt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2078 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2079 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2080 int UNUSED written
= 0;
2081 IADDR UNUSED pc
= abuf
->addr
;
2082 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2084 if (GET_H_PRBIT ()) {
2086 DF opval
= sh64_fsqrtd (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2087 SET_H_FSD (FLD (f_rn
), opval
);
2088 written
|= (1 << 2);
2089 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2093 DF opval
= sh64_fsqrts (current_cpu
, GET_H_FSD (FLD (f_rn
)));
2094 SET_H_FSD (FLD (f_rn
), opval
);
2095 written
|= (1 << 2);
2096 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2100 abuf
->written
= written
;
2105 /* fsts-compact: fsts fpul, $frn */
2108 SEM_FN_NAME (sh64_compact
,fsts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2110 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2111 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2112 int UNUSED written
= 0;
2113 IADDR UNUSED pc
= abuf
->addr
;
2114 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2117 SF opval
= CPU (h_fr
[((UINT
) 32)]);
2118 SET_H_FRC (FLD (f_rn
), opval
);
2119 TRACE_RESULT (current_cpu
, abuf
, "frc", 'f', opval
);
2126 /* fsub-compact: fsub $fsdm, $fsdn */
2129 SEM_FN_NAME (sh64_compact
,fsub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2131 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2133 int UNUSED written
= 0;
2134 IADDR UNUSED pc
= abuf
->addr
;
2135 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2137 if (GET_H_PRBIT ()) {
2139 DF opval
= sh64_fsubd (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
2140 SET_H_FSD (FLD (f_rn
), opval
);
2141 written
|= (1 << 3);
2142 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2146 DF opval
= sh64_fsubs (current_cpu
, GET_H_FSD (FLD (f_rn
)), GET_H_FSD (FLD (f_rm
)));
2147 SET_H_FSD (FLD (f_rn
), opval
);
2148 written
|= (1 << 3);
2149 TRACE_RESULT (current_cpu
, abuf
, "fsd", 'f', opval
);
2153 abuf
->written
= written
;
2158 /* ftrc-compact: ftrc $fsdn, fpul */
2161 SEM_FN_NAME (sh64_compact
,ftrc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2163 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2164 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2165 int UNUSED written
= 0;
2166 IADDR UNUSED pc
= abuf
->addr
;
2167 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2170 SF opval
= ((GET_H_PRBIT ()) ? (sh64_ftrcdl (current_cpu
, GET_H_FSD (FLD (f_rn
)))) : (sh64_ftrcsl (current_cpu
, GET_H_FSD (FLD (f_rn
)))));
2171 CPU (h_fr
[((UINT
) 32)]) = opval
;
2172 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2179 /* ftrv-compact: ftrv xmtrx, $fvn */
2182 SEM_FN_NAME (sh64_compact
,ftrv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2184 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
2185 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2186 int UNUSED written
= 0;
2187 IADDR UNUSED pc
= abuf
->addr
;
2188 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2190 sh64_ftrv (current_cpu
, FLD (f_vn
));
2196 /* jmp-compact: jmp @$rn */
2199 SEM_FN_NAME (sh64_compact
,jmp_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2201 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2202 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2203 int UNUSED written
= 0;
2204 IADDR UNUSED pc
= abuf
->addr
;
2206 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2210 UDI opval
= ADDDI (pc
, 2);
2211 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2212 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2217 UDI opval
= GET_H_GRC (FLD (f_rn
));
2218 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2219 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2225 SEM_BRANCH_FINI (vpc
);
2230 /* jsr-compact: jsr @$rn */
2233 SEM_FN_NAME (sh64_compact
,jsr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2235 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2236 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2237 int UNUSED written
= 0;
2238 IADDR UNUSED pc
= abuf
->addr
;
2240 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2245 SI opval
= ADDDI (pc
, 4);
2247 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2251 UDI opval
= ADDDI (pc
, 2);
2252 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2253 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2258 UDI opval
= GET_H_GRC (FLD (f_rn
));
2259 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2260 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2266 SEM_BRANCH_FINI (vpc
);
2271 /* ldc-gbr-compact: ldc $rn, gbr */
2274 SEM_FN_NAME (sh64_compact
,ldc_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2276 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2277 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2278 int UNUSED written
= 0;
2279 IADDR UNUSED pc
= abuf
->addr
;
2280 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2283 SI opval
= GET_H_GRC (FLD (f_rn
));
2285 TRACE_RESULT (current_cpu
, abuf
, "gbr", 'x', opval
);
2292 /* ldc-vbr-compact: ldc $rn, vbr */
2295 SEM_FN_NAME (sh64_compact
,ldc_vbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2297 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2298 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2299 int UNUSED written
= 0;
2300 IADDR UNUSED pc
= abuf
->addr
;
2301 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2304 SI opval
= GET_H_GRC (FLD (f_rn
));
2306 TRACE_RESULT (current_cpu
, abuf
, "vbr", 'x', opval
);
2313 /* ldc-sr-compact: ldc $rn, sr */
2316 SEM_FN_NAME (sh64_compact
,ldc_sr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2318 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2319 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2320 int UNUSED written
= 0;
2321 IADDR UNUSED pc
= abuf
->addr
;
2322 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2325 SI opval
= GET_H_GRC (FLD (f_rn
));
2327 TRACE_RESULT (current_cpu
, abuf
, "sr", 'x', opval
);
2334 /* ldcl-gbr-compact: ldc.l @${rn}+, gbr */
2337 SEM_FN_NAME (sh64_compact
,ldcl_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2339 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2340 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2341 int UNUSED written
= 0;
2342 IADDR UNUSED pc
= abuf
->addr
;
2343 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2347 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2349 TRACE_RESULT (current_cpu
, abuf
, "gbr", 'x', opval
);
2352 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2353 SET_H_GRC (FLD (f_rn
), opval
);
2354 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2362 /* ldcl-vbr-compact: ldc.l @${rn}+, vbr */
2365 SEM_FN_NAME (sh64_compact
,ldcl_vbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2367 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2368 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2369 int UNUSED written
= 0;
2370 IADDR UNUSED pc
= abuf
->addr
;
2371 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2375 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2377 TRACE_RESULT (current_cpu
, abuf
, "vbr", 'x', opval
);
2380 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2381 SET_H_GRC (FLD (f_rn
), opval
);
2382 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2390 /* lds-fpscr-compact: lds $rn, fpscr */
2393 SEM_FN_NAME (sh64_compact
,lds_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2395 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2396 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2397 int UNUSED written
= 0;
2398 IADDR UNUSED pc
= abuf
->addr
;
2399 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2402 SI opval
= GET_H_GRC (FLD (f_rn
));
2403 CPU (h_fpscr
) = opval
;
2404 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2411 /* ldsl-fpscr-compact: lds.l @${rn}+, fpscr */
2414 SEM_FN_NAME (sh64_compact
,ldsl_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2416 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2417 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2418 int UNUSED written
= 0;
2419 IADDR UNUSED pc
= abuf
->addr
;
2420 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2424 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2425 CPU (h_fpscr
) = opval
;
2426 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2429 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2430 SET_H_GRC (FLD (f_rn
), opval
);
2431 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2439 /* lds-fpul-compact: lds $rn, fpul */
2442 SEM_FN_NAME (sh64_compact
,lds_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2444 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2445 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2446 int UNUSED written
= 0;
2447 IADDR UNUSED pc
= abuf
->addr
;
2448 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2451 SF opval
= SUBWORDSISF (GET_H_GRC (FLD (f_rn
)));
2452 CPU (h_fr
[((UINT
) 32)]) = opval
;
2453 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2460 /* ldsl-fpul-compact: lds.l @${rn}+, fpul */
2463 SEM_FN_NAME (sh64_compact
,ldsl_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2465 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2466 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2467 int UNUSED written
= 0;
2468 IADDR UNUSED pc
= abuf
->addr
;
2469 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2473 SF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2474 CPU (h_fr
[((UINT
) 32)]) = opval
;
2475 TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
2478 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2479 SET_H_GRC (FLD (f_rn
), opval
);
2480 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2488 /* lds-mach-compact: lds $rn, mach */
2491 SEM_FN_NAME (sh64_compact
,lds_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2493 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2494 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2495 int UNUSED written
= 0;
2496 IADDR UNUSED pc
= abuf
->addr
;
2497 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2500 SI opval
= GET_H_GRC (FLD (f_rn
));
2502 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2509 /* ldsl-mach-compact: lds.l @${rn}+, mach */
2512 SEM_FN_NAME (sh64_compact
,ldsl_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2514 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2515 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2516 int UNUSED written
= 0;
2517 IADDR UNUSED pc
= abuf
->addr
;
2518 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2522 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2524 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2527 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2528 SET_H_GRC (FLD (f_rn
), opval
);
2529 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2537 /* lds-macl-compact: lds $rn, macl */
2540 SEM_FN_NAME (sh64_compact
,lds_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2542 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2543 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2544 int UNUSED written
= 0;
2545 IADDR UNUSED pc
= abuf
->addr
;
2546 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2549 SI opval
= GET_H_GRC (FLD (f_rn
));
2551 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2558 /* ldsl-macl-compact: lds.l @${rn}+, macl */
2561 SEM_FN_NAME (sh64_compact
,ldsl_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2563 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2564 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2565 int UNUSED written
= 0;
2566 IADDR UNUSED pc
= abuf
->addr
;
2567 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2571 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2573 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2576 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2577 SET_H_GRC (FLD (f_rn
), opval
);
2578 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2586 /* lds-pr-compact: lds $rn, pr */
2589 SEM_FN_NAME (sh64_compact
,lds_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2591 #define FLD(f) abuf->fields.sfmt_movw10_compact.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
= GET_H_GRC (FLD (f_rn
));
2600 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2607 /* ldsl-pr-compact: lds.l @${rn}+, pr */
2610 SEM_FN_NAME (sh64_compact
,ldsl_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2612 #define FLD(f) abuf->fields.sfmt_movw10_compact.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
, 2);
2620 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2622 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2625 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2626 SET_H_GRC (FLD (f_rn
), opval
);
2627 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2635 /* macl-compact: mac.l @${rm}+, @${rn}+ */
2638 SEM_FN_NAME (sh64_compact
,macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2640 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2641 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2642 int UNUSED written
= 0;
2643 IADDR UNUSED pc
= abuf
->addr
;
2644 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2652 tmp_x
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2654 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2655 SET_H_GRC (FLD (f_rn
), opval
);
2656 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2658 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2661 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2662 SET_H_GRC (FLD (f_rn
), opval
);
2663 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2666 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2667 SET_H_GRC (FLD (f_rm
), opval
);
2668 written
|= (1 << 11);
2669 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2673 tmp_y
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2675 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2676 SET_H_GRC (FLD (f_rm
), opval
);
2677 written
|= (1 << 11);
2678 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2680 tmp_tmpry
= MULDI (ZEXTSIDI (tmp_x
), ZEXTSIDI (tmp_y
));
2681 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2682 tmp_result
= ADDDI (tmp_mac
, tmp_tmpry
);
2684 if (GET_H_SBIT ()) {
2688 tmp_max
= SRLDI (INVDI (0), 16);
2689 tmp_min
= SRLDI (INVDI (0), 15);
2690 if (GTDI (tmp_result
, tmp_max
)) {
2691 tmp_result
= tmp_max
;
2693 if (LTDI (tmp_result
, tmp_min
)) {
2694 tmp_result
= tmp_min
;
2700 SI opval
= SUBWORDDISI (tmp_result
, 0);
2702 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2705 SI opval
= SUBWORDDISI (tmp_result
, 1);
2707 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2712 abuf
->written
= written
;
2717 /* macw-compact: mac.w @${rm}+, @${rn}+ */
2720 SEM_FN_NAME (sh64_compact
,macw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2722 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2723 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2724 int UNUSED written
= 0;
2725 IADDR UNUSED pc
= abuf
->addr
;
2726 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2734 tmp_x
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2736 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2737 SET_H_GRC (FLD (f_rn
), opval
);
2738 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2740 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2743 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2744 SET_H_GRC (FLD (f_rn
), opval
);
2745 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2748 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2749 SET_H_GRC (FLD (f_rm
), opval
);
2750 written
|= (1 << 11);
2751 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2755 tmp_y
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2757 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2758 SET_H_GRC (FLD (f_rm
), opval
);
2759 written
|= (1 << 11);
2760 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2762 tmp_tmpry
= MULSI (ZEXTHISI (tmp_x
), ZEXTHISI (tmp_y
));
2763 if (GET_H_SBIT ()) {
2765 if (ADDOFSI (tmp_tmpry
, GET_H_MACL (), 0)) {
2769 written
|= (1 << 9);
2770 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2774 SI opval
= ADDSI (tmp_tmpry
, GET_H_MACL ());
2776 written
|= (1 << 10);
2777 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2782 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2783 tmp_result
= ADDDI (tmp_mac
, EXTSIDI (tmp_tmpry
));
2785 SI opval
= SUBWORDDISI (tmp_result
, 0);
2787 written
|= (1 << 9);
2788 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2791 SI opval
= SUBWORDDISI (tmp_result
, 1);
2793 written
|= (1 << 10);
2794 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2800 abuf
->written
= written
;
2805 /* mov-compact: mov $rm64, $rn64 */
2808 SEM_FN_NAME (sh64_compact
,mov_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2810 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2811 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2812 int UNUSED written
= 0;
2813 IADDR UNUSED pc
= abuf
->addr
;
2814 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2817 DI opval
= GET_H_GR (FLD (f_rm
));
2818 SET_H_GR (FLD (f_rn
), opval
);
2819 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2826 /* movi-compact: mov #$imm8, $rn */
2829 SEM_FN_NAME (sh64_compact
,movi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2831 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2832 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2833 int UNUSED written
= 0;
2834 IADDR UNUSED pc
= abuf
->addr
;
2835 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2838 SI opval
= EXTQIDI (ANDQI (FLD (f_imm8
), 255));
2839 SET_H_GRC (FLD (f_rn
), opval
);
2840 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2847 /* movi20-compact: movi20 #$imm20, $rn */
2850 SEM_FN_NAME (sh64_compact
,movi20_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2852 #define FLD(f) abuf->fields.sfmt_movi20_compact.f
2853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2854 int UNUSED written
= 0;
2855 IADDR UNUSED pc
= abuf
->addr
;
2856 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2859 SI opval
= FLD (f_imm20
);
2860 SET_H_GRC (FLD (f_rn
), opval
);
2861 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2868 /* movb1-compact: mov.b $rm, @$rn */
2871 SEM_FN_NAME (sh64_compact
,movb1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2873 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2874 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2875 int UNUSED written
= 0;
2876 IADDR UNUSED pc
= abuf
->addr
;
2877 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2880 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2881 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
2882 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2889 /* movb2-compact: mov.b $rm, @-$rn */
2892 SEM_FN_NAME (sh64_compact
,movb2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2894 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2895 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2896 int UNUSED written
= 0;
2897 IADDR UNUSED pc
= abuf
->addr
;
2898 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2902 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
2904 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2905 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2906 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2909 SI opval
= tmp_addr
;
2910 SET_H_GRC (FLD (f_rn
), opval
);
2911 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
2919 /* movb3-compact: mov.b $rm, @(r0,$rn) */
2922 SEM_FN_NAME (sh64_compact
,movb3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2924 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2925 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2926 int UNUSED written
= 0;
2927 IADDR UNUSED pc
= abuf
->addr
;
2928 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2931 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2932 SETMEMUQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
2933 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2940 /* movb4-compact: mov.b r0, @($imm8, gbr) */
2943 SEM_FN_NAME (sh64_compact
,movb4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2945 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2946 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2947 int UNUSED written
= 0;
2948 IADDR UNUSED pc
= abuf
->addr
;
2949 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2953 tmp_addr
= ADDSI (GET_H_GBR (), FLD (f_imm8
));
2955 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
2956 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2957 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2965 /* movb5-compact: mov.b r0, @($imm4, $rm) */
2968 SEM_FN_NAME (sh64_compact
,movb5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2970 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
2971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2972 int UNUSED written
= 0;
2973 IADDR UNUSED pc
= abuf
->addr
;
2974 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2978 tmp_addr
= ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
));
2980 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
2981 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2982 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2990 /* movb6-compact: mov.b @$rm, $rn */
2993 SEM_FN_NAME (sh64_compact
,movb6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2995 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
2996 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2997 int UNUSED written
= 0;
2998 IADDR UNUSED pc
= abuf
->addr
;
2999 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3002 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
3003 SET_H_GRC (FLD (f_rn
), opval
);
3004 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3011 /* movb7-compact: mov.b @${rm}+, $rn */
3014 SEM_FN_NAME (sh64_compact
,movb7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3016 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3017 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3018 int UNUSED written
= 0;
3019 IADDR UNUSED pc
= abuf
->addr
;
3020 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3024 tmp_data
= GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3025 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3027 SI opval
= EXTQISI (tmp_data
);
3028 SET_H_GRC (FLD (f_rm
), opval
);
3029 written
|= (1 << 4);
3030 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3034 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 1);
3035 SET_H_GRC (FLD (f_rm
), opval
);
3036 written
|= (1 << 4);
3037 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3041 SI opval
= EXTQISI (tmp_data
);
3042 SET_H_GRC (FLD (f_rn
), opval
);
3043 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3047 abuf
->written
= written
;
3052 /* movb8-compact: mov.b @(r0, $rm), $rn */
3055 SEM_FN_NAME (sh64_compact
,movb8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3057 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3058 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3059 int UNUSED written
= 0;
3060 IADDR UNUSED pc
= abuf
->addr
;
3061 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3064 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
3065 SET_H_GRC (FLD (f_rn
), opval
);
3066 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3073 /* movb9-compact: mov.b @($imm8, gbr), r0 */
3076 SEM_FN_NAME (sh64_compact
,movb9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3078 #define FLD(f) abuf->fields.sfmt_addi_compact.f
3079 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3080 int UNUSED written
= 0;
3081 IADDR UNUSED pc
= abuf
->addr
;
3082 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3085 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8
))));
3086 SET_H_GRC (((UINT
) 0), opval
);
3087 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3094 /* movb10-compact: mov.b @($imm4, $rm), r0 */
3097 SEM_FN_NAME (sh64_compact
,movb10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3099 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
3100 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3101 int UNUSED written
= 0;
3102 IADDR UNUSED pc
= abuf
->addr
;
3103 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3106 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
))));
3107 SET_H_GRC (((UINT
) 0), opval
);
3108 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3115 /* movl1-compact: mov.l $rm, @$rn */
3118 SEM_FN_NAME (sh64_compact
,movl1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3120 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3122 int UNUSED written
= 0;
3123 IADDR UNUSED pc
= abuf
->addr
;
3124 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3127 SI opval
= GET_H_GRC (FLD (f_rm
));
3128 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3129 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3136 /* movl2-compact: mov.l $rm, @-$rn */
3139 SEM_FN_NAME (sh64_compact
,movl2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3141 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3142 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3143 int UNUSED written
= 0;
3144 IADDR UNUSED pc
= abuf
->addr
;
3145 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3149 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
3151 SI opval
= GET_H_GRC (FLD (f_rm
));
3152 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3153 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3156 SI opval
= tmp_addr
;
3157 SET_H_GRC (FLD (f_rn
), opval
);
3158 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3166 /* movl3-compact: mov.l $rm, @(r0, $rn) */
3169 SEM_FN_NAME (sh64_compact
,movl3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3171 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3172 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3173 int UNUSED written
= 0;
3174 IADDR UNUSED pc
= abuf
->addr
;
3175 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3178 SI opval
= GET_H_GRC (FLD (f_rm
));
3179 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3180 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3187 /* movl4-compact: mov.l r0, @($imm8x4, gbr) */
3190 SEM_FN_NAME (sh64_compact
,movl4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3192 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3193 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3194 int UNUSED written
= 0;
3195 IADDR UNUSED pc
= abuf
->addr
;
3196 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3199 SI opval
= GET_H_GRC (((UINT
) 0));
3200 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)), opval
);
3201 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3208 /* movl5-compact: mov.l $rm, @($imm4x4, $rn) */
3211 SEM_FN_NAME (sh64_compact
,movl5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3213 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3214 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3215 int UNUSED written
= 0;
3216 IADDR UNUSED pc
= abuf
->addr
;
3217 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3220 SI opval
= GET_H_GRC (FLD (f_rm
));
3221 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm4x4
)), opval
);
3222 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3229 /* movl6-compact: mov.l @$rm, $rn */
3232 SEM_FN_NAME (sh64_compact
,movl6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3234 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3235 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3236 int UNUSED written
= 0;
3237 IADDR UNUSED pc
= abuf
->addr
;
3238 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3241 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3242 SET_H_GRC (FLD (f_rn
), opval
);
3243 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3250 /* movl7-compact: mov.l @${rm}+, $rn */
3253 SEM_FN_NAME (sh64_compact
,movl7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3255 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3256 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3257 int UNUSED written
= 0;
3258 IADDR UNUSED pc
= abuf
->addr
;
3259 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3263 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3264 SET_H_GRC (FLD (f_rn
), opval
);
3265 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3267 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3269 SI opval
= GET_H_GRC (FLD (f_rn
));
3270 SET_H_GRC (FLD (f_rm
), opval
);
3271 written
|= (1 << 5);
3272 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3276 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
3277 SET_H_GRC (FLD (f_rm
), opval
);
3278 written
|= (1 << 5);
3279 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3284 abuf
->written
= written
;
3289 /* movl8-compact: mov.l @(r0, $rm), $rn */
3292 SEM_FN_NAME (sh64_compact
,movl8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3294 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3295 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3296 int UNUSED written
= 0;
3297 IADDR UNUSED pc
= abuf
->addr
;
3298 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3301 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
3302 SET_H_GRC (FLD (f_rn
), opval
);
3303 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3310 /* movl9-compact: mov.l @($imm8x4, gbr), r0 */
3313 SEM_FN_NAME (sh64_compact
,movl9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3315 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3316 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3317 int UNUSED written
= 0;
3318 IADDR UNUSED pc
= abuf
->addr
;
3319 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3322 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)));
3323 SET_H_GRC (((UINT
) 0), opval
);
3324 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3331 /* movl10-compact: mov.l @($imm8x4, pc), $rn */
3334 SEM_FN_NAME (sh64_compact
,movl10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3336 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3337 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3338 int UNUSED written
= 0;
3339 IADDR UNUSED pc
= abuf
->addr
;
3340 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3343 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (FLD (f_imm8x4
), ANDDI (ADDDI (pc
, 4), INVSI (3))));
3344 SET_H_GRC (FLD (f_rn
), opval
);
3345 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3352 /* movl11-compact: mov.l @($imm4x4, $rm), $rn */
3355 SEM_FN_NAME (sh64_compact
,movl11_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3357 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3358 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3359 int UNUSED written
= 0;
3360 IADDR UNUSED pc
= abuf
->addr
;
3361 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3364 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x4
)));
3365 SET_H_GRC (FLD (f_rn
), opval
);
3366 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3373 /* movl12-compact: mov.l @($imm12x4, $rm), $rn */
3376 SEM_FN_NAME (sh64_compact
,movl12_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3378 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3379 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3380 int UNUSED written
= 0;
3381 IADDR UNUSED pc
= abuf
->addr
;
3382 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3385 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm12x4
)));
3386 SET_H_GRC (FLD (f_rn
), opval
);
3387 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3394 /* movl13-compact: mov.l $rm, @($imm12x4, $rn) */
3397 SEM_FN_NAME (sh64_compact
,movl13_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3399 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3400 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3401 int UNUSED written
= 0;
3402 IADDR UNUSED pc
= abuf
->addr
;
3403 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3406 SI opval
= GET_H_GRC (FLD (f_rm
));
3407 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm12x4
)), opval
);
3408 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3415 /* movw1-compact: mov.w $rm, @$rn */
3418 SEM_FN_NAME (sh64_compact
,movw1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3420 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3421 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3422 int UNUSED written
= 0;
3423 IADDR UNUSED pc
= abuf
->addr
;
3424 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3427 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3428 SETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3429 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3436 /* movw2-compact: mov.w $rm, @-$rn */
3439 SEM_FN_NAME (sh64_compact
,movw2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3441 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3442 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3443 int UNUSED written
= 0;
3444 IADDR UNUSED pc
= abuf
->addr
;
3445 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3449 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 2);
3451 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3452 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
3453 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3456 SI opval
= tmp_addr
;
3457 SET_H_GRC (FLD (f_rn
), opval
);
3458 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3466 /* movw3-compact: mov.w $rm, @(r0, $rn) */
3469 SEM_FN_NAME (sh64_compact
,movw3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3471 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3472 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3473 int UNUSED written
= 0;
3474 IADDR UNUSED pc
= abuf
->addr
;
3475 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3478 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3479 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3480 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3487 /* movw4-compact: mov.w r0, @($imm8x2, gbr) */
3490 SEM_FN_NAME (sh64_compact
,movw4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3492 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3493 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3494 int UNUSED written
= 0;
3495 IADDR UNUSED pc
= abuf
->addr
;
3496 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3499 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3500 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
)), opval
);
3501 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3508 /* movw5-compact: mov.w r0, @($imm4x2, $rm) */
3511 SEM_FN_NAME (sh64_compact
,movw5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3513 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3514 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3515 int UNUSED written
= 0;
3516 IADDR UNUSED pc
= abuf
->addr
;
3517 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3520 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3521 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x2
)), opval
);
3522 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3529 /* movw6-compact: mov.w @$rm, $rn */
3532 SEM_FN_NAME (sh64_compact
,movw6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3534 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3536 int UNUSED written
= 0;
3537 IADDR UNUSED pc
= abuf
->addr
;
3538 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3541 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
3542 SET_H_GRC (FLD (f_rn
), opval
);
3543 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3550 /* movw7-compact: mov.w @${rm}+, $rn */
3553 SEM_FN_NAME (sh64_compact
,movw7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3555 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3556 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3557 int UNUSED written
= 0;
3558 IADDR UNUSED pc
= abuf
->addr
;
3559 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3563 tmp_data
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3564 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3566 SI opval
= EXTHISI (tmp_data
);
3567 SET_H_GRC (FLD (f_rm
), opval
);
3568 written
|= (1 << 4);
3569 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3573 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
3574 SET_H_GRC (FLD (f_rm
), opval
);
3575 written
|= (1 << 4);
3576 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3580 SI opval
= EXTHISI (tmp_data
);
3581 SET_H_GRC (FLD (f_rn
), opval
);
3582 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3586 abuf
->written
= written
;
3591 /* movw8-compact: mov.w @(r0, $rm), $rn */
3594 SEM_FN_NAME (sh64_compact
,movw8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3596 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3597 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3598 int UNUSED written
= 0;
3599 IADDR UNUSED pc
= abuf
->addr
;
3600 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3603 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
3604 SET_H_GRC (FLD (f_rn
), opval
);
3605 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3612 /* movw9-compact: mov.w @($imm8x2, gbr), r0 */
3615 SEM_FN_NAME (sh64_compact
,movw9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3617 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3618 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3619 int UNUSED written
= 0;
3620 IADDR UNUSED pc
= abuf
->addr
;
3621 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3624 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
))));
3625 SET_H_GRC (((UINT
) 0), opval
);
3626 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3633 /* movw10-compact: mov.w @($imm8x2, pc), $rn */
3636 SEM_FN_NAME (sh64_compact
,movw10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3638 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3639 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3640 int UNUSED written
= 0;
3641 IADDR UNUSED pc
= abuf
->addr
;
3642 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3645 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDDI (ADDDI (pc
, 4), FLD (f_imm8x2
))));
3646 SET_H_GRC (FLD (f_rn
), opval
);
3647 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3654 /* movw11-compact: mov.w @($imm4x2, $rm), r0 */
3657 SEM_FN_NAME (sh64_compact
,movw11_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3659 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3660 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3661 int UNUSED written
= 0;
3662 IADDR UNUSED pc
= abuf
->addr
;
3663 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3666 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x2
))));
3667 SET_H_GRC (((UINT
) 0), opval
);
3668 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3675 /* mova-compact: mova @($imm8x4, pc), r0 */
3678 SEM_FN_NAME (sh64_compact
,mova_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3680 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3681 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3682 int UNUSED written
= 0;
3683 IADDR UNUSED pc
= abuf
->addr
;
3684 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3687 SI opval
= ADDDI (ANDDI (ADDDI (pc
, 4), INVSI (3)), FLD (f_imm8x4
));
3688 SET_H_GRC (((UINT
) 0), opval
);
3689 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3696 /* movcal-compact: movca.l r0, @$rn */
3699 SEM_FN_NAME (sh64_compact
,movcal_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3701 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3702 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3703 int UNUSED written
= 0;
3704 IADDR UNUSED pc
= abuf
->addr
;
3705 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3708 SI opval
= GET_H_GRC (((UINT
) 0));
3709 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3710 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3717 /* movcol-compact: movco.l r0, @$rn */
3720 SEM_FN_NAME (sh64_compact
,movcol_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3722 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3723 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3724 int UNUSED written
= 0;
3725 IADDR UNUSED pc
= abuf
->addr
;
3726 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3729 SI opval
= GET_H_GRC (FLD (f_rn
));
3730 SET_H_GRC (FLD (f_rn
), opval
);
3731 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3738 /* movt-compact: movt $rn */
3741 SEM_FN_NAME (sh64_compact
,movt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3743 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3744 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3745 int UNUSED written
= 0;
3746 IADDR UNUSED pc
= abuf
->addr
;
3747 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3750 SI opval
= ZEXTBISI (GET_H_TBIT ());
3751 SET_H_GRC (FLD (f_rn
), opval
);
3752 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3759 /* movual-compact: movua.l @$rn, r0 */
3762 SEM_FN_NAME (sh64_compact
,movual_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3764 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3765 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3766 int UNUSED written
= 0;
3767 IADDR UNUSED pc
= abuf
->addr
;
3768 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3771 SI opval
= sh64_movua (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
3772 SET_H_GRC (((UINT
) 0), opval
);
3773 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3780 /* movual2-compact: movua.l @$rn+, r0 */
3783 SEM_FN_NAME (sh64_compact
,movual2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3785 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3786 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3787 int UNUSED written
= 0;
3788 IADDR UNUSED pc
= abuf
->addr
;
3789 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3793 SI opval
= sh64_movua (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
3794 SET_H_GRC (((UINT
) 0), opval
);
3795 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3798 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
3799 SET_H_GRC (FLD (f_rn
), opval
);
3800 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3808 /* mull-compact: mul.l $rm, $rn */
3811 SEM_FN_NAME (sh64_compact
,mull_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3813 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3814 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3815 int UNUSED written
= 0;
3816 IADDR UNUSED pc
= abuf
->addr
;
3817 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3820 SI opval
= MULSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
3822 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3829 /* mulsw-compact: muls.w $rm, $rn */
3832 SEM_FN_NAME (sh64_compact
,mulsw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3834 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3835 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3836 int UNUSED written
= 0;
3837 IADDR UNUSED pc
= abuf
->addr
;
3838 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3841 SI opval
= MULSI (EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3843 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3850 /* muluw-compact: mulu.w $rm, $rn */
3853 SEM_FN_NAME (sh64_compact
,muluw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3855 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3856 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3857 int UNUSED written
= 0;
3858 IADDR UNUSED pc
= abuf
->addr
;
3859 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3862 SI opval
= MULSI (ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3864 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3871 /* neg-compact: neg $rm, $rn */
3874 SEM_FN_NAME (sh64_compact
,neg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3876 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3877 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3878 int UNUSED written
= 0;
3879 IADDR UNUSED pc
= abuf
->addr
;
3880 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3883 SI opval
= NEGSI (GET_H_GRC (FLD (f_rm
)));
3884 SET_H_GRC (FLD (f_rn
), opval
);
3885 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3892 /* negc-compact: negc $rm, $rn */
3895 SEM_FN_NAME (sh64_compact
,negc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3897 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3898 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3899 int UNUSED written
= 0;
3900 IADDR UNUSED pc
= abuf
->addr
;
3901 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3905 tmp_flag
= SUBCFSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3907 SI opval
= SUBCSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3908 SET_H_GRC (FLD (f_rn
), opval
);
3909 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3912 BI opval
= tmp_flag
;
3914 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3922 /* nop-compact: nop */
3925 SEM_FN_NAME (sh64_compact
,nop_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3927 #define FLD(f) abuf->fields.sfmt_empty.f
3928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3929 int UNUSED written
= 0;
3930 IADDR UNUSED pc
= abuf
->addr
;
3931 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3939 /* not-compact: not $rm64, $rn64 */
3942 SEM_FN_NAME (sh64_compact
,not_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3944 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3946 int UNUSED written
= 0;
3947 IADDR UNUSED pc
= abuf
->addr
;
3948 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3951 DI opval
= INVDI (GET_H_GR (FLD (f_rm
)));
3952 SET_H_GR (FLD (f_rn
), opval
);
3953 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3960 /* ocbi-compact: ocbi @$rn */
3963 SEM_FN_NAME (sh64_compact
,ocbi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3965 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3966 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3967 int UNUSED written
= 0;
3968 IADDR UNUSED pc
= abuf
->addr
;
3969 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3973 SI opval
= GET_H_GRC (FLD (f_rn
));
3974 SET_H_GRC (FLD (f_rn
), opval
);
3975 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
3984 /* ocbp-compact: ocbp @$rn */
3987 SEM_FN_NAME (sh64_compact
,ocbp_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3989 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3990 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3991 int UNUSED written
= 0;
3992 IADDR UNUSED pc
= abuf
->addr
;
3993 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3997 SI opval
= GET_H_GRC (FLD (f_rn
));
3998 SET_H_GRC (FLD (f_rn
), opval
);
3999 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4008 /* ocbwb-compact: ocbwb @$rn */
4011 SEM_FN_NAME (sh64_compact
,ocbwb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4013 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4014 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4015 int UNUSED written
= 0;
4016 IADDR UNUSED pc
= abuf
->addr
;
4017 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4021 SI opval
= GET_H_GRC (FLD (f_rn
));
4022 SET_H_GRC (FLD (f_rn
), opval
);
4023 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4032 /* or-compact: or $rm64, $rn64 */
4035 SEM_FN_NAME (sh64_compact
,or_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4037 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4038 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4039 int UNUSED written
= 0;
4040 IADDR UNUSED pc
= abuf
->addr
;
4041 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4044 DI opval
= ORDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
4045 SET_H_GR (FLD (f_rn
), opval
);
4046 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4053 /* ori-compact: or #$uimm8, r0 */
4056 SEM_FN_NAME (sh64_compact
,ori_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4058 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4059 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4060 int UNUSED written
= 0;
4061 IADDR UNUSED pc
= abuf
->addr
;
4062 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4065 SI opval
= ORSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
4066 SET_H_GRC (((UINT
) 0), opval
);
4067 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4074 /* orb-compact: or.b #$imm8, @(r0, gbr) */
4077 SEM_FN_NAME (sh64_compact
,orb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4079 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4080 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4081 int UNUSED written
= 0;
4082 IADDR UNUSED pc
= abuf
->addr
;
4083 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4088 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
4089 tmp_data
= ORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
4091 UQI opval
= tmp_data
;
4092 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
4093 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4101 /* pref-compact: pref @$rn */
4104 SEM_FN_NAME (sh64_compact
,pref_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4106 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4108 int UNUSED written
= 0;
4109 IADDR UNUSED pc
= abuf
->addr
;
4110 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4112 sh64_pref (current_cpu
, GET_H_GRC (FLD (f_rn
)));
4118 /* rotcl-compact: rotcl $rn */
4121 SEM_FN_NAME (sh64_compact
,rotcl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4123 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4124 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4125 int UNUSED written
= 0;
4126 IADDR UNUSED pc
= abuf
->addr
;
4127 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4131 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4133 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), GET_H_TBIT ());
4134 SET_H_GRC (FLD (f_rn
), opval
);
4135 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4138 BI opval
= ((tmp_temp
) ? (1) : (0));
4140 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4148 /* rotcr-compact: rotcr $rn */
4151 SEM_FN_NAME (sh64_compact
,rotcr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4153 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4154 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4155 int UNUSED written
= 0;
4156 IADDR UNUSED pc
= abuf
->addr
;
4157 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4162 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
4163 tmp_temp
= GET_H_TBIT ();
4165 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
4166 SET_H_GRC (FLD (f_rn
), opval
);
4167 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4170 BI opval
= ((tmp_lsbit
) ? (1) : (0));
4172 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4180 /* rotl-compact: rotl $rn */
4183 SEM_FN_NAME (sh64_compact
,rotl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4185 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4186 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4187 int UNUSED written
= 0;
4188 IADDR UNUSED pc
= abuf
->addr
;
4189 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4193 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4195 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), tmp_temp
);
4196 SET_H_GRC (FLD (f_rn
), opval
);
4197 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4200 BI opval
= ((tmp_temp
) ? (1) : (0));
4202 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4210 /* rotr-compact: rotr $rn */
4213 SEM_FN_NAME (sh64_compact
,rotr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4215 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4216 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4217 int UNUSED written
= 0;
4218 IADDR UNUSED pc
= abuf
->addr
;
4219 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4224 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
4225 tmp_temp
= tmp_lsbit
;
4227 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
4228 SET_H_GRC (FLD (f_rn
), opval
);
4229 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4232 BI opval
= ((tmp_lsbit
) ? (1) : (0));
4234 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4242 /* rts-compact: rts */
4245 SEM_FN_NAME (sh64_compact
,rts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4247 #define FLD(f) abuf->fields.sfmt_empty.f
4248 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4249 int UNUSED written
= 0;
4250 IADDR UNUSED pc
= abuf
->addr
;
4252 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4256 UDI opval
= ADDDI (pc
, 2);
4257 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
4258 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
4263 UDI opval
= GET_H_PR ();
4264 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
4265 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
4271 SEM_BRANCH_FINI (vpc
);
4276 /* sets-compact: sets */
4279 SEM_FN_NAME (sh64_compact
,sets_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4281 #define FLD(f) abuf->fields.sfmt_empty.f
4282 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4283 int UNUSED written
= 0;
4284 IADDR UNUSED pc
= abuf
->addr
;
4285 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4290 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
4297 /* sett-compact: sett */
4300 SEM_FN_NAME (sh64_compact
,sett_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4302 #define FLD(f) abuf->fields.sfmt_empty.f
4303 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4304 int UNUSED written
= 0;
4305 IADDR UNUSED pc
= abuf
->addr
;
4306 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4311 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4318 /* shad-compact: shad $rm, $rn */
4321 SEM_FN_NAME (sh64_compact
,shad_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4323 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4324 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4325 int UNUSED written
= 0;
4326 IADDR UNUSED pc
= abuf
->addr
;
4327 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4331 tmp_shamt
= ANDSI (GET_H_GRC (FLD (f_rm
)), 31);
4332 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4334 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4335 SET_H_GRC (FLD (f_rn
), opval
);
4336 written
|= (1 << 2);
4337 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4340 if (NESI (tmp_shamt
, 0)) {
4342 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4343 SET_H_GRC (FLD (f_rn
), opval
);
4344 written
|= (1 << 2);
4345 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4348 if (LTSI (GET_H_GRC (FLD (f_rn
)), 0)) {
4350 SI opval
= NEGSI (1);
4351 SET_H_GRC (FLD (f_rn
), opval
);
4352 written
|= (1 << 2);
4353 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4358 SET_H_GRC (FLD (f_rn
), opval
);
4359 written
|= (1 << 2);
4360 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4367 abuf
->written
= written
;
4372 /* shal-compact: shal $rn */
4375 SEM_FN_NAME (sh64_compact
,shal_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4377 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4378 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4379 int UNUSED written
= 0;
4380 IADDR UNUSED pc
= abuf
->addr
;
4381 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4385 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4387 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4388 SET_H_GRC (FLD (f_rn
), opval
);
4389 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4392 BI opval
= ((tmp_t
) ? (1) : (0));
4394 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4402 /* shar-compact: shar $rn */
4405 SEM_FN_NAME (sh64_compact
,shar_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4407 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4408 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4409 int UNUSED written
= 0;
4410 IADDR UNUSED pc
= abuf
->addr
;
4411 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4415 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4417 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), 1);
4418 SET_H_GRC (FLD (f_rn
), opval
);
4419 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4422 BI opval
= ((tmp_t
) ? (1) : (0));
4424 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4432 /* shld-compact: shld $rm, $rn */
4435 SEM_FN_NAME (sh64_compact
,shld_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4437 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4438 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4439 int UNUSED written
= 0;
4440 IADDR UNUSED pc
= abuf
->addr
;
4441 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4445 tmp_shamt
= ANDSI (GET_H_GRC (FLD (f_rm
)), 31);
4446 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4448 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4449 SET_H_GRC (FLD (f_rn
), opval
);
4450 written
|= (1 << 2);
4451 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4454 if (NESI (tmp_shamt
, 0)) {
4456 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4457 SET_H_GRC (FLD (f_rn
), opval
);
4458 written
|= (1 << 2);
4459 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4464 SET_H_GRC (FLD (f_rn
), opval
);
4465 written
|= (1 << 2);
4466 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4472 abuf
->written
= written
;
4477 /* shll-compact: shll $rn */
4480 SEM_FN_NAME (sh64_compact
,shll_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4482 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4483 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4484 int UNUSED written
= 0;
4485 IADDR UNUSED pc
= abuf
->addr
;
4486 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4490 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4492 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4493 SET_H_GRC (FLD (f_rn
), opval
);
4494 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4497 BI opval
= ((tmp_t
) ? (1) : (0));
4499 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4507 /* shll2-compact: shll2 $rn */
4510 SEM_FN_NAME (sh64_compact
,shll2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4512 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4513 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4514 int UNUSED written
= 0;
4515 IADDR UNUSED pc
= abuf
->addr
;
4516 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4519 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 2);
4520 SET_H_GRC (FLD (f_rn
), opval
);
4521 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4528 /* shll8-compact: shll8 $rn */
4531 SEM_FN_NAME (sh64_compact
,shll8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4533 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4534 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4535 int UNUSED written
= 0;
4536 IADDR UNUSED pc
= abuf
->addr
;
4537 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4540 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 8);
4541 SET_H_GRC (FLD (f_rn
), opval
);
4542 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4549 /* shll16-compact: shll16 $rn */
4552 SEM_FN_NAME (sh64_compact
,shll16_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4554 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4555 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4556 int UNUSED written
= 0;
4557 IADDR UNUSED pc
= abuf
->addr
;
4558 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4561 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 16);
4562 SET_H_GRC (FLD (f_rn
), opval
);
4563 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4570 /* shlr-compact: shlr $rn */
4573 SEM_FN_NAME (sh64_compact
,shlr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4575 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4576 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4577 int UNUSED written
= 0;
4578 IADDR UNUSED pc
= abuf
->addr
;
4579 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4583 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4585 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 1);
4586 SET_H_GRC (FLD (f_rn
), opval
);
4587 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4590 BI opval
= ((tmp_t
) ? (1) : (0));
4592 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4600 /* shlr2-compact: shlr2 $rn */
4603 SEM_FN_NAME (sh64_compact
,shlr2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4605 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4607 int UNUSED written
= 0;
4608 IADDR UNUSED pc
= abuf
->addr
;
4609 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4612 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 2);
4613 SET_H_GRC (FLD (f_rn
), opval
);
4614 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4621 /* shlr8-compact: shlr8 $rn */
4624 SEM_FN_NAME (sh64_compact
,shlr8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4626 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4628 int UNUSED written
= 0;
4629 IADDR UNUSED pc
= abuf
->addr
;
4630 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4633 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 8);
4634 SET_H_GRC (FLD (f_rn
), opval
);
4635 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4642 /* shlr16-compact: shlr16 $rn */
4645 SEM_FN_NAME (sh64_compact
,shlr16_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4647 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4648 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4649 int UNUSED written
= 0;
4650 IADDR UNUSED pc
= abuf
->addr
;
4651 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4654 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 16);
4655 SET_H_GRC (FLD (f_rn
), opval
);
4656 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4663 /* stc-gbr-compact: stc gbr, $rn */
4666 SEM_FN_NAME (sh64_compact
,stc_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4668 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4669 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4670 int UNUSED written
= 0;
4671 IADDR UNUSED pc
= abuf
->addr
;
4672 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4675 SI opval
= GET_H_GBR ();
4676 SET_H_GRC (FLD (f_rn
), opval
);
4677 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4684 /* stc-vbr-compact: stc vbr, $rn */
4687 SEM_FN_NAME (sh64_compact
,stc_vbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4689 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4690 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4691 int UNUSED written
= 0;
4692 IADDR UNUSED pc
= abuf
->addr
;
4693 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4696 SI opval
= GET_H_VBR ();
4697 SET_H_GRC (FLD (f_rn
), opval
);
4698 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4705 /* stcl-gbr-compact: stc.l gbr, @-$rn */
4708 SEM_FN_NAME (sh64_compact
,stcl_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4710 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4711 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4712 int UNUSED written
= 0;
4713 IADDR UNUSED pc
= abuf
->addr
;
4714 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4718 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4720 SI opval
= GET_H_GBR ();
4721 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4722 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4725 SI opval
= tmp_addr
;
4726 SET_H_GRC (FLD (f_rn
), opval
);
4727 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4735 /* stcl-vbr-compact: stc.l vbr, @-$rn */
4738 SEM_FN_NAME (sh64_compact
,stcl_vbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4740 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4742 int UNUSED written
= 0;
4743 IADDR UNUSED pc
= abuf
->addr
;
4744 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4748 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4750 SI opval
= GET_H_VBR ();
4751 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4752 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4755 SI opval
= tmp_addr
;
4756 SET_H_GRC (FLD (f_rn
), opval
);
4757 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4765 /* sts-fpscr-compact: sts fpscr, $rn */
4768 SEM_FN_NAME (sh64_compact
,sts_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4770 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4771 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4772 int UNUSED written
= 0;
4773 IADDR UNUSED pc
= abuf
->addr
;
4774 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4777 SI opval
= CPU (h_fpscr
);
4778 SET_H_GRC (FLD (f_rn
), opval
);
4779 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4786 /* stsl-fpscr-compact: sts.l fpscr, @-$rn */
4789 SEM_FN_NAME (sh64_compact
,stsl_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4791 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4793 int UNUSED written
= 0;
4794 IADDR UNUSED pc
= abuf
->addr
;
4795 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4799 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4801 SI opval
= CPU (h_fpscr
);
4802 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4803 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4806 SI opval
= tmp_addr
;
4807 SET_H_GRC (FLD (f_rn
), opval
);
4808 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4816 /* sts-fpul-compact: sts fpul, $rn */
4819 SEM_FN_NAME (sh64_compact
,sts_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4821 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4822 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4823 int UNUSED written
= 0;
4824 IADDR UNUSED pc
= abuf
->addr
;
4825 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4828 SI opval
= SUBWORDSFSI (CPU (h_fr
[((UINT
) 32)]));
4829 SET_H_GRC (FLD (f_rn
), opval
);
4830 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4837 /* stsl-fpul-compact: sts.l fpul, @-$rn */
4840 SEM_FN_NAME (sh64_compact
,stsl_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4842 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4843 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4844 int UNUSED written
= 0;
4845 IADDR UNUSED pc
= abuf
->addr
;
4846 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4850 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4852 SF opval
= CPU (h_fr
[((UINT
) 32)]);
4853 SETMEMSF (current_cpu
, pc
, tmp_addr
, opval
);
4854 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
4857 SI opval
= tmp_addr
;
4858 SET_H_GRC (FLD (f_rn
), opval
);
4859 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4867 /* sts-mach-compact: sts mach, $rn */
4870 SEM_FN_NAME (sh64_compact
,sts_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4872 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4873 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4874 int UNUSED written
= 0;
4875 IADDR UNUSED pc
= abuf
->addr
;
4876 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4879 SI opval
= GET_H_MACH ();
4880 SET_H_GRC (FLD (f_rn
), opval
);
4881 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4888 /* stsl-mach-compact: sts.l mach, @-$rn */
4891 SEM_FN_NAME (sh64_compact
,stsl_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4893 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4894 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4895 int UNUSED written
= 0;
4896 IADDR UNUSED pc
= abuf
->addr
;
4897 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4901 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4903 SI opval
= GET_H_MACH ();
4904 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4905 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4908 SI opval
= tmp_addr
;
4909 SET_H_GRC (FLD (f_rn
), opval
);
4910 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4918 /* sts-macl-compact: sts macl, $rn */
4921 SEM_FN_NAME (sh64_compact
,sts_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4923 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4924 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4925 int UNUSED written
= 0;
4926 IADDR UNUSED pc
= abuf
->addr
;
4927 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4930 SI opval
= GET_H_MACL ();
4931 SET_H_GRC (FLD (f_rn
), opval
);
4932 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4939 /* stsl-macl-compact: sts.l macl, @-$rn */
4942 SEM_FN_NAME (sh64_compact
,stsl_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4944 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4946 int UNUSED written
= 0;
4947 IADDR UNUSED pc
= abuf
->addr
;
4948 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4952 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4954 SI opval
= GET_H_MACL ();
4955 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4956 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4959 SI opval
= tmp_addr
;
4960 SET_H_GRC (FLD (f_rn
), opval
);
4961 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4969 /* sts-pr-compact: sts pr, $rn */
4972 SEM_FN_NAME (sh64_compact
,sts_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4974 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4975 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4976 int UNUSED written
= 0;
4977 IADDR UNUSED pc
= abuf
->addr
;
4978 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4981 SI opval
= GET_H_PR ();
4982 SET_H_GRC (FLD (f_rn
), opval
);
4983 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
4990 /* stsl-pr-compact: sts.l pr, @-$rn */
4993 SEM_FN_NAME (sh64_compact
,stsl_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4995 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4996 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4997 int UNUSED written
= 0;
4998 IADDR UNUSED pc
= abuf
->addr
;
4999 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5003 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
5005 SI opval
= GET_H_PR ();
5006 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
5007 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5010 SI opval
= tmp_addr
;
5011 SET_H_GRC (FLD (f_rn
), opval
);
5012 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5020 /* sub-compact: sub $rm, $rn */
5023 SEM_FN_NAME (sh64_compact
,sub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5025 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5026 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5027 int UNUSED written
= 0;
5028 IADDR UNUSED pc
= abuf
->addr
;
5029 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5032 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
5033 SET_H_GRC (FLD (f_rn
), opval
);
5034 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5041 /* subc-compact: subc $rm, $rn */
5044 SEM_FN_NAME (sh64_compact
,subc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5046 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5048 int UNUSED written
= 0;
5049 IADDR UNUSED pc
= abuf
->addr
;
5050 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5054 tmp_flag
= SUBCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
5056 SI opval
= SUBCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
5057 SET_H_GRC (FLD (f_rn
), opval
);
5058 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5061 BI opval
= tmp_flag
;
5063 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5071 /* subv-compact: subv $rm, $rn */
5074 SEM_FN_NAME (sh64_compact
,subv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5076 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5077 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5078 int UNUSED written
= 0;
5079 IADDR UNUSED pc
= abuf
->addr
;
5080 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5084 tmp_t
= SUBOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
5086 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
5087 SET_H_GRC (FLD (f_rn
), opval
);
5088 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5091 BI opval
= ((tmp_t
) ? (1) : (0));
5093 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5101 /* swapb-compact: swap.b $rm, $rn */
5104 SEM_FN_NAME (sh64_compact
,swapb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5106 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5107 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5108 int UNUSED written
= 0;
5109 IADDR UNUSED pc
= abuf
->addr
;
5110 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5116 tmp_top_half
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 0);
5117 tmp_byte1
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 2);
5118 tmp_byte0
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3);
5120 SI opval
= ORSI (SLLSI (tmp_top_half
, 16), ORSI (SLLSI (tmp_byte0
, 8), tmp_byte1
));
5121 SET_H_GRC (FLD (f_rn
), opval
);
5122 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5130 /* swapw-compact: swap.w $rm, $rn */
5133 SEM_FN_NAME (sh64_compact
,swapw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5135 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5136 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5137 int UNUSED written
= 0;
5138 IADDR UNUSED pc
= abuf
->addr
;
5139 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5142 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 16), SLLSI (GET_H_GRC (FLD (f_rm
)), 16));
5143 SET_H_GRC (FLD (f_rn
), opval
);
5144 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5151 /* tasb-compact: tas.b @$rn */
5154 SEM_FN_NAME (sh64_compact
,tasb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5156 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
5157 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5158 int UNUSED written
= 0;
5159 IADDR UNUSED pc
= abuf
->addr
;
5160 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5164 tmp_byte
= GETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
5166 BI opval
= ((EQQI (tmp_byte
, 0)) ? (1) : (0));
5168 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5170 tmp_byte
= ORQI (tmp_byte
, 128);
5172 UQI opval
= tmp_byte
;
5173 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
5174 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5182 /* trapa-compact: trapa #$uimm8 */
5185 SEM_FN_NAME (sh64_compact
,trapa_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5187 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5188 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5189 int UNUSED written
= 0;
5190 IADDR UNUSED pc
= abuf
->addr
;
5191 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5193 sh64_compact_trapa (current_cpu
, FLD (f_imm8
), pc
);
5199 /* tst-compact: tst $rm, $rn */
5202 SEM_FN_NAME (sh64_compact
,tst_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5204 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5206 int UNUSED written
= 0;
5207 IADDR UNUSED pc
= abuf
->addr
;
5208 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5211 BI opval
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
))), 0)) ? (1) : (0));
5213 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5220 /* tsti-compact: tst #$uimm8, r0 */
5223 SEM_FN_NAME (sh64_compact
,tsti_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5225 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5227 int UNUSED written
= 0;
5228 IADDR UNUSED pc
= abuf
->addr
;
5229 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5232 BI opval
= ((EQSI (ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSISI (FLD (f_imm8
))), 0)) ? (1) : (0));
5234 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5241 /* tstb-compact: tst.b #$imm8, @(r0, gbr) */
5244 SEM_FN_NAME (sh64_compact
,tstb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5246 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5247 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5248 int UNUSED written
= 0;
5249 IADDR UNUSED pc
= abuf
->addr
;
5250 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5254 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
5256 BI opval
= ((EQQI (ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
)), 0)) ? (1) : (0));
5258 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
5266 /* xor-compact: xor $rm64, $rn64 */
5269 SEM_FN_NAME (sh64_compact
,xor_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5271 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5272 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5273 int UNUSED written
= 0;
5274 IADDR UNUSED pc
= abuf
->addr
;
5275 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5278 DI opval
= XORDI (GET_H_GR (FLD (f_rn
)), GET_H_GR (FLD (f_rm
)));
5279 SET_H_GR (FLD (f_rn
), opval
);
5280 TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5287 /* xori-compact: xor #$uimm8, r0 */
5290 SEM_FN_NAME (sh64_compact
,xori_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5292 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5293 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5294 int UNUSED written
= 0;
5295 IADDR UNUSED pc
= abuf
->addr
;
5296 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5299 SI opval
= XORSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
5300 SET_H_GRC (((UINT
) 0), opval
);
5301 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5308 /* xorb-compact: xor.b #$imm8, @(r0, gbr) */
5311 SEM_FN_NAME (sh64_compact
,xorb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5313 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5314 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5315 int UNUSED written
= 0;
5316 IADDR UNUSED pc
= abuf
->addr
;
5317 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5322 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
5323 tmp_data
= XORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
5325 UQI opval
= tmp_data
;
5326 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5327 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5335 /* xtrct-compact: xtrct $rm, $rn */
5338 SEM_FN_NAME (sh64_compact
,xtrct_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5340 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5341 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5342 int UNUSED written
= 0;
5343 IADDR UNUSED pc
= abuf
->addr
;
5344 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5347 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rm
)), 16), SRLSI (GET_H_GRC (FLD (f_rn
)), 16));
5348 SET_H_GRC (FLD (f_rn
), opval
);
5349 TRACE_RESULT (current_cpu
, abuf
, "grc", 'x', opval
);
5356 /* Table of all semantic fns. */
5358 static const struct sem_fn_desc sem_fns
[] = {
5359 { SH64_COMPACT_INSN_X_INVALID
, SEM_FN_NAME (sh64_compact
,x_invalid
) },
5360 { SH64_COMPACT_INSN_X_AFTER
, SEM_FN_NAME (sh64_compact
,x_after
) },
5361 { SH64_COMPACT_INSN_X_BEFORE
, SEM_FN_NAME (sh64_compact
,x_before
) },
5362 { SH64_COMPACT_INSN_X_CTI_CHAIN
, SEM_FN_NAME (sh64_compact
,x_cti_chain
) },
5363 { SH64_COMPACT_INSN_X_CHAIN
, SEM_FN_NAME (sh64_compact
,x_chain
) },
5364 { SH64_COMPACT_INSN_X_BEGIN
, SEM_FN_NAME (sh64_compact
,x_begin
) },
5365 { SH64_COMPACT_INSN_ADD_COMPACT
, SEM_FN_NAME (sh64_compact
,add_compact
) },
5366 { SH64_COMPACT_INSN_ADDI_COMPACT
, SEM_FN_NAME (sh64_compact
,addi_compact
) },
5367 { SH64_COMPACT_INSN_ADDC_COMPACT
, SEM_FN_NAME (sh64_compact
,addc_compact
) },
5368 { SH64_COMPACT_INSN_ADDV_COMPACT
, SEM_FN_NAME (sh64_compact
,addv_compact
) },
5369 { SH64_COMPACT_INSN_AND_COMPACT
, SEM_FN_NAME (sh64_compact
,and_compact
) },
5370 { SH64_COMPACT_INSN_ANDI_COMPACT
, SEM_FN_NAME (sh64_compact
,andi_compact
) },
5371 { SH64_COMPACT_INSN_ANDB_COMPACT
, SEM_FN_NAME (sh64_compact
,andb_compact
) },
5372 { SH64_COMPACT_INSN_BF_COMPACT
, SEM_FN_NAME (sh64_compact
,bf_compact
) },
5373 { SH64_COMPACT_INSN_BFS_COMPACT
, SEM_FN_NAME (sh64_compact
,bfs_compact
) },
5374 { SH64_COMPACT_INSN_BRA_COMPACT
, SEM_FN_NAME (sh64_compact
,bra_compact
) },
5375 { SH64_COMPACT_INSN_BRAF_COMPACT
, SEM_FN_NAME (sh64_compact
,braf_compact
) },
5376 { SH64_COMPACT_INSN_BRK_COMPACT
, SEM_FN_NAME (sh64_compact
,brk_compact
) },
5377 { SH64_COMPACT_INSN_BSR_COMPACT
, SEM_FN_NAME (sh64_compact
,bsr_compact
) },
5378 { SH64_COMPACT_INSN_BSRF_COMPACT
, SEM_FN_NAME (sh64_compact
,bsrf_compact
) },
5379 { SH64_COMPACT_INSN_BT_COMPACT
, SEM_FN_NAME (sh64_compact
,bt_compact
) },
5380 { SH64_COMPACT_INSN_BTS_COMPACT
, SEM_FN_NAME (sh64_compact
,bts_compact
) },
5381 { SH64_COMPACT_INSN_CLRMAC_COMPACT
, SEM_FN_NAME (sh64_compact
,clrmac_compact
) },
5382 { SH64_COMPACT_INSN_CLRS_COMPACT
, SEM_FN_NAME (sh64_compact
,clrs_compact
) },
5383 { SH64_COMPACT_INSN_CLRT_COMPACT
, SEM_FN_NAME (sh64_compact
,clrt_compact
) },
5384 { SH64_COMPACT_INSN_CMPEQ_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpeq_compact
) },
5385 { SH64_COMPACT_INSN_CMPEQI_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpeqi_compact
) },
5386 { SH64_COMPACT_INSN_CMPGE_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpge_compact
) },
5387 { SH64_COMPACT_INSN_CMPGT_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpgt_compact
) },
5388 { SH64_COMPACT_INSN_CMPHI_COMPACT
, SEM_FN_NAME (sh64_compact
,cmphi_compact
) },
5389 { SH64_COMPACT_INSN_CMPHS_COMPACT
, SEM_FN_NAME (sh64_compact
,cmphs_compact
) },
5390 { SH64_COMPACT_INSN_CMPPL_COMPACT
, SEM_FN_NAME (sh64_compact
,cmppl_compact
) },
5391 { SH64_COMPACT_INSN_CMPPZ_COMPACT
, SEM_FN_NAME (sh64_compact
,cmppz_compact
) },
5392 { SH64_COMPACT_INSN_CMPSTR_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpstr_compact
) },
5393 { SH64_COMPACT_INSN_DIV0S_COMPACT
, SEM_FN_NAME (sh64_compact
,div0s_compact
) },
5394 { SH64_COMPACT_INSN_DIV0U_COMPACT
, SEM_FN_NAME (sh64_compact
,div0u_compact
) },
5395 { SH64_COMPACT_INSN_DIV1_COMPACT
, SEM_FN_NAME (sh64_compact
,div1_compact
) },
5396 { SH64_COMPACT_INSN_DIVU_COMPACT
, SEM_FN_NAME (sh64_compact
,divu_compact
) },
5397 { SH64_COMPACT_INSN_MULR_COMPACT
, SEM_FN_NAME (sh64_compact
,mulr_compact
) },
5398 { SH64_COMPACT_INSN_DMULSL_COMPACT
, SEM_FN_NAME (sh64_compact
,dmulsl_compact
) },
5399 { SH64_COMPACT_INSN_DMULUL_COMPACT
, SEM_FN_NAME (sh64_compact
,dmulul_compact
) },
5400 { SH64_COMPACT_INSN_DT_COMPACT
, SEM_FN_NAME (sh64_compact
,dt_compact
) },
5401 { SH64_COMPACT_INSN_EXTSB_COMPACT
, SEM_FN_NAME (sh64_compact
,extsb_compact
) },
5402 { SH64_COMPACT_INSN_EXTSW_COMPACT
, SEM_FN_NAME (sh64_compact
,extsw_compact
) },
5403 { SH64_COMPACT_INSN_EXTUB_COMPACT
, SEM_FN_NAME (sh64_compact
,extub_compact
) },
5404 { SH64_COMPACT_INSN_EXTUW_COMPACT
, SEM_FN_NAME (sh64_compact
,extuw_compact
) },
5405 { SH64_COMPACT_INSN_FABS_COMPACT
, SEM_FN_NAME (sh64_compact
,fabs_compact
) },
5406 { SH64_COMPACT_INSN_FADD_COMPACT
, SEM_FN_NAME (sh64_compact
,fadd_compact
) },
5407 { SH64_COMPACT_INSN_FCMPEQ_COMPACT
, SEM_FN_NAME (sh64_compact
,fcmpeq_compact
) },
5408 { SH64_COMPACT_INSN_FCMPGT_COMPACT
, SEM_FN_NAME (sh64_compact
,fcmpgt_compact
) },
5409 { SH64_COMPACT_INSN_FCNVDS_COMPACT
, SEM_FN_NAME (sh64_compact
,fcnvds_compact
) },
5410 { SH64_COMPACT_INSN_FCNVSD_COMPACT
, SEM_FN_NAME (sh64_compact
,fcnvsd_compact
) },
5411 { SH64_COMPACT_INSN_FDIV_COMPACT
, SEM_FN_NAME (sh64_compact
,fdiv_compact
) },
5412 { SH64_COMPACT_INSN_FIPR_COMPACT
, SEM_FN_NAME (sh64_compact
,fipr_compact
) },
5413 { SH64_COMPACT_INSN_FLDS_COMPACT
, SEM_FN_NAME (sh64_compact
,flds_compact
) },
5414 { SH64_COMPACT_INSN_FLDI0_COMPACT
, SEM_FN_NAME (sh64_compact
,fldi0_compact
) },
5415 { SH64_COMPACT_INSN_FLDI1_COMPACT
, SEM_FN_NAME (sh64_compact
,fldi1_compact
) },
5416 { SH64_COMPACT_INSN_FLOAT_COMPACT
, SEM_FN_NAME (sh64_compact
,float_compact
) },
5417 { SH64_COMPACT_INSN_FMAC_COMPACT
, SEM_FN_NAME (sh64_compact
,fmac_compact
) },
5418 { SH64_COMPACT_INSN_FMOV1_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov1_compact
) },
5419 { SH64_COMPACT_INSN_FMOV2_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov2_compact
) },
5420 { SH64_COMPACT_INSN_FMOV3_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov3_compact
) },
5421 { SH64_COMPACT_INSN_FMOV4_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov4_compact
) },
5422 { SH64_COMPACT_INSN_FMOV5_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov5_compact
) },
5423 { SH64_COMPACT_INSN_FMOV6_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov6_compact
) },
5424 { SH64_COMPACT_INSN_FMOV7_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov7_compact
) },
5425 { SH64_COMPACT_INSN_FMOV8_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov8_compact
) },
5426 { SH64_COMPACT_INSN_FMOV9_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov9_compact
) },
5427 { SH64_COMPACT_INSN_FMUL_COMPACT
, SEM_FN_NAME (sh64_compact
,fmul_compact
) },
5428 { SH64_COMPACT_INSN_FNEG_COMPACT
, SEM_FN_NAME (sh64_compact
,fneg_compact
) },
5429 { SH64_COMPACT_INSN_FRCHG_COMPACT
, SEM_FN_NAME (sh64_compact
,frchg_compact
) },
5430 { SH64_COMPACT_INSN_FSCHG_COMPACT
, SEM_FN_NAME (sh64_compact
,fschg_compact
) },
5431 { SH64_COMPACT_INSN_FSQRT_COMPACT
, SEM_FN_NAME (sh64_compact
,fsqrt_compact
) },
5432 { SH64_COMPACT_INSN_FSTS_COMPACT
, SEM_FN_NAME (sh64_compact
,fsts_compact
) },
5433 { SH64_COMPACT_INSN_FSUB_COMPACT
, SEM_FN_NAME (sh64_compact
,fsub_compact
) },
5434 { SH64_COMPACT_INSN_FTRC_COMPACT
, SEM_FN_NAME (sh64_compact
,ftrc_compact
) },
5435 { SH64_COMPACT_INSN_FTRV_COMPACT
, SEM_FN_NAME (sh64_compact
,ftrv_compact
) },
5436 { SH64_COMPACT_INSN_JMP_COMPACT
, SEM_FN_NAME (sh64_compact
,jmp_compact
) },
5437 { SH64_COMPACT_INSN_JSR_COMPACT
, SEM_FN_NAME (sh64_compact
,jsr_compact
) },
5438 { SH64_COMPACT_INSN_LDC_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldc_gbr_compact
) },
5439 { SH64_COMPACT_INSN_LDC_VBR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldc_vbr_compact
) },
5440 { SH64_COMPACT_INSN_LDC_SR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldc_sr_compact
) },
5441 { SH64_COMPACT_INSN_LDCL_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldcl_gbr_compact
) },
5442 { SH64_COMPACT_INSN_LDCL_VBR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldcl_vbr_compact
) },
5443 { SH64_COMPACT_INSN_LDS_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_fpscr_compact
) },
5444 { SH64_COMPACT_INSN_LDSL_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_fpscr_compact
) },
5445 { SH64_COMPACT_INSN_LDS_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_fpul_compact
) },
5446 { SH64_COMPACT_INSN_LDSL_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_fpul_compact
) },
5447 { SH64_COMPACT_INSN_LDS_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_mach_compact
) },
5448 { SH64_COMPACT_INSN_LDSL_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_mach_compact
) },
5449 { SH64_COMPACT_INSN_LDS_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_macl_compact
) },
5450 { SH64_COMPACT_INSN_LDSL_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_macl_compact
) },
5451 { SH64_COMPACT_INSN_LDS_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_pr_compact
) },
5452 { SH64_COMPACT_INSN_LDSL_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_pr_compact
) },
5453 { SH64_COMPACT_INSN_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,macl_compact
) },
5454 { SH64_COMPACT_INSN_MACW_COMPACT
, SEM_FN_NAME (sh64_compact
,macw_compact
) },
5455 { SH64_COMPACT_INSN_MOV_COMPACT
, SEM_FN_NAME (sh64_compact
,mov_compact
) },
5456 { SH64_COMPACT_INSN_MOVI_COMPACT
, SEM_FN_NAME (sh64_compact
,movi_compact
) },
5457 { SH64_COMPACT_INSN_MOVI20_COMPACT
, SEM_FN_NAME (sh64_compact
,movi20_compact
) },
5458 { SH64_COMPACT_INSN_MOVB1_COMPACT
, SEM_FN_NAME (sh64_compact
,movb1_compact
) },
5459 { SH64_COMPACT_INSN_MOVB2_COMPACT
, SEM_FN_NAME (sh64_compact
,movb2_compact
) },
5460 { SH64_COMPACT_INSN_MOVB3_COMPACT
, SEM_FN_NAME (sh64_compact
,movb3_compact
) },
5461 { SH64_COMPACT_INSN_MOVB4_COMPACT
, SEM_FN_NAME (sh64_compact
,movb4_compact
) },
5462 { SH64_COMPACT_INSN_MOVB5_COMPACT
, SEM_FN_NAME (sh64_compact
,movb5_compact
) },
5463 { SH64_COMPACT_INSN_MOVB6_COMPACT
, SEM_FN_NAME (sh64_compact
,movb6_compact
) },
5464 { SH64_COMPACT_INSN_MOVB7_COMPACT
, SEM_FN_NAME (sh64_compact
,movb7_compact
) },
5465 { SH64_COMPACT_INSN_MOVB8_COMPACT
, SEM_FN_NAME (sh64_compact
,movb8_compact
) },
5466 { SH64_COMPACT_INSN_MOVB9_COMPACT
, SEM_FN_NAME (sh64_compact
,movb9_compact
) },
5467 { SH64_COMPACT_INSN_MOVB10_COMPACT
, SEM_FN_NAME (sh64_compact
,movb10_compact
) },
5468 { SH64_COMPACT_INSN_MOVL1_COMPACT
, SEM_FN_NAME (sh64_compact
,movl1_compact
) },
5469 { SH64_COMPACT_INSN_MOVL2_COMPACT
, SEM_FN_NAME (sh64_compact
,movl2_compact
) },
5470 { SH64_COMPACT_INSN_MOVL3_COMPACT
, SEM_FN_NAME (sh64_compact
,movl3_compact
) },
5471 { SH64_COMPACT_INSN_MOVL4_COMPACT
, SEM_FN_NAME (sh64_compact
,movl4_compact
) },
5472 { SH64_COMPACT_INSN_MOVL5_COMPACT
, SEM_FN_NAME (sh64_compact
,movl5_compact
) },
5473 { SH64_COMPACT_INSN_MOVL6_COMPACT
, SEM_FN_NAME (sh64_compact
,movl6_compact
) },
5474 { SH64_COMPACT_INSN_MOVL7_COMPACT
, SEM_FN_NAME (sh64_compact
,movl7_compact
) },
5475 { SH64_COMPACT_INSN_MOVL8_COMPACT
, SEM_FN_NAME (sh64_compact
,movl8_compact
) },
5476 { SH64_COMPACT_INSN_MOVL9_COMPACT
, SEM_FN_NAME (sh64_compact
,movl9_compact
) },
5477 { SH64_COMPACT_INSN_MOVL10_COMPACT
, SEM_FN_NAME (sh64_compact
,movl10_compact
) },
5478 { SH64_COMPACT_INSN_MOVL11_COMPACT
, SEM_FN_NAME (sh64_compact
,movl11_compact
) },
5479 { SH64_COMPACT_INSN_MOVL12_COMPACT
, SEM_FN_NAME (sh64_compact
,movl12_compact
) },
5480 { SH64_COMPACT_INSN_MOVL13_COMPACT
, SEM_FN_NAME (sh64_compact
,movl13_compact
) },
5481 { SH64_COMPACT_INSN_MOVW1_COMPACT
, SEM_FN_NAME (sh64_compact
,movw1_compact
) },
5482 { SH64_COMPACT_INSN_MOVW2_COMPACT
, SEM_FN_NAME (sh64_compact
,movw2_compact
) },
5483 { SH64_COMPACT_INSN_MOVW3_COMPACT
, SEM_FN_NAME (sh64_compact
,movw3_compact
) },
5484 { SH64_COMPACT_INSN_MOVW4_COMPACT
, SEM_FN_NAME (sh64_compact
,movw4_compact
) },
5485 { SH64_COMPACT_INSN_MOVW5_COMPACT
, SEM_FN_NAME (sh64_compact
,movw5_compact
) },
5486 { SH64_COMPACT_INSN_MOVW6_COMPACT
, SEM_FN_NAME (sh64_compact
,movw6_compact
) },
5487 { SH64_COMPACT_INSN_MOVW7_COMPACT
, SEM_FN_NAME (sh64_compact
,movw7_compact
) },
5488 { SH64_COMPACT_INSN_MOVW8_COMPACT
, SEM_FN_NAME (sh64_compact
,movw8_compact
) },
5489 { SH64_COMPACT_INSN_MOVW9_COMPACT
, SEM_FN_NAME (sh64_compact
,movw9_compact
) },
5490 { SH64_COMPACT_INSN_MOVW10_COMPACT
, SEM_FN_NAME (sh64_compact
,movw10_compact
) },
5491 { SH64_COMPACT_INSN_MOVW11_COMPACT
, SEM_FN_NAME (sh64_compact
,movw11_compact
) },
5492 { SH64_COMPACT_INSN_MOVA_COMPACT
, SEM_FN_NAME (sh64_compact
,mova_compact
) },
5493 { SH64_COMPACT_INSN_MOVCAL_COMPACT
, SEM_FN_NAME (sh64_compact
,movcal_compact
) },
5494 { SH64_COMPACT_INSN_MOVCOL_COMPACT
, SEM_FN_NAME (sh64_compact
,movcol_compact
) },
5495 { SH64_COMPACT_INSN_MOVT_COMPACT
, SEM_FN_NAME (sh64_compact
,movt_compact
) },
5496 { SH64_COMPACT_INSN_MOVUAL_COMPACT
, SEM_FN_NAME (sh64_compact
,movual_compact
) },
5497 { SH64_COMPACT_INSN_MOVUAL2_COMPACT
, SEM_FN_NAME (sh64_compact
,movual2_compact
) },
5498 { SH64_COMPACT_INSN_MULL_COMPACT
, SEM_FN_NAME (sh64_compact
,mull_compact
) },
5499 { SH64_COMPACT_INSN_MULSW_COMPACT
, SEM_FN_NAME (sh64_compact
,mulsw_compact
) },
5500 { SH64_COMPACT_INSN_MULUW_COMPACT
, SEM_FN_NAME (sh64_compact
,muluw_compact
) },
5501 { SH64_COMPACT_INSN_NEG_COMPACT
, SEM_FN_NAME (sh64_compact
,neg_compact
) },
5502 { SH64_COMPACT_INSN_NEGC_COMPACT
, SEM_FN_NAME (sh64_compact
,negc_compact
) },
5503 { SH64_COMPACT_INSN_NOP_COMPACT
, SEM_FN_NAME (sh64_compact
,nop_compact
) },
5504 { SH64_COMPACT_INSN_NOT_COMPACT
, SEM_FN_NAME (sh64_compact
,not_compact
) },
5505 { SH64_COMPACT_INSN_OCBI_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbi_compact
) },
5506 { SH64_COMPACT_INSN_OCBP_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbp_compact
) },
5507 { SH64_COMPACT_INSN_OCBWB_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbwb_compact
) },
5508 { SH64_COMPACT_INSN_OR_COMPACT
, SEM_FN_NAME (sh64_compact
,or_compact
) },
5509 { SH64_COMPACT_INSN_ORI_COMPACT
, SEM_FN_NAME (sh64_compact
,ori_compact
) },
5510 { SH64_COMPACT_INSN_ORB_COMPACT
, SEM_FN_NAME (sh64_compact
,orb_compact
) },
5511 { SH64_COMPACT_INSN_PREF_COMPACT
, SEM_FN_NAME (sh64_compact
,pref_compact
) },
5512 { SH64_COMPACT_INSN_ROTCL_COMPACT
, SEM_FN_NAME (sh64_compact
,rotcl_compact
) },
5513 { SH64_COMPACT_INSN_ROTCR_COMPACT
, SEM_FN_NAME (sh64_compact
,rotcr_compact
) },
5514 { SH64_COMPACT_INSN_ROTL_COMPACT
, SEM_FN_NAME (sh64_compact
,rotl_compact
) },
5515 { SH64_COMPACT_INSN_ROTR_COMPACT
, SEM_FN_NAME (sh64_compact
,rotr_compact
) },
5516 { SH64_COMPACT_INSN_RTS_COMPACT
, SEM_FN_NAME (sh64_compact
,rts_compact
) },
5517 { SH64_COMPACT_INSN_SETS_COMPACT
, SEM_FN_NAME (sh64_compact
,sets_compact
) },
5518 { SH64_COMPACT_INSN_SETT_COMPACT
, SEM_FN_NAME (sh64_compact
,sett_compact
) },
5519 { SH64_COMPACT_INSN_SHAD_COMPACT
, SEM_FN_NAME (sh64_compact
,shad_compact
) },
5520 { SH64_COMPACT_INSN_SHAL_COMPACT
, SEM_FN_NAME (sh64_compact
,shal_compact
) },
5521 { SH64_COMPACT_INSN_SHAR_COMPACT
, SEM_FN_NAME (sh64_compact
,shar_compact
) },
5522 { SH64_COMPACT_INSN_SHLD_COMPACT
, SEM_FN_NAME (sh64_compact
,shld_compact
) },
5523 { SH64_COMPACT_INSN_SHLL_COMPACT
, SEM_FN_NAME (sh64_compact
,shll_compact
) },
5524 { SH64_COMPACT_INSN_SHLL2_COMPACT
, SEM_FN_NAME (sh64_compact
,shll2_compact
) },
5525 { SH64_COMPACT_INSN_SHLL8_COMPACT
, SEM_FN_NAME (sh64_compact
,shll8_compact
) },
5526 { SH64_COMPACT_INSN_SHLL16_COMPACT
, SEM_FN_NAME (sh64_compact
,shll16_compact
) },
5527 { SH64_COMPACT_INSN_SHLR_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr_compact
) },
5528 { SH64_COMPACT_INSN_SHLR2_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr2_compact
) },
5529 { SH64_COMPACT_INSN_SHLR8_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr8_compact
) },
5530 { SH64_COMPACT_INSN_SHLR16_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr16_compact
) },
5531 { SH64_COMPACT_INSN_STC_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stc_gbr_compact
) },
5532 { SH64_COMPACT_INSN_STC_VBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stc_vbr_compact
) },
5533 { SH64_COMPACT_INSN_STCL_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stcl_gbr_compact
) },
5534 { SH64_COMPACT_INSN_STCL_VBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stcl_vbr_compact
) },
5535 { SH64_COMPACT_INSN_STS_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_fpscr_compact
) },
5536 { SH64_COMPACT_INSN_STSL_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_fpscr_compact
) },
5537 { SH64_COMPACT_INSN_STS_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_fpul_compact
) },
5538 { SH64_COMPACT_INSN_STSL_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_fpul_compact
) },
5539 { SH64_COMPACT_INSN_STS_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_mach_compact
) },
5540 { SH64_COMPACT_INSN_STSL_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_mach_compact
) },
5541 { SH64_COMPACT_INSN_STS_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_macl_compact
) },
5542 { SH64_COMPACT_INSN_STSL_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_macl_compact
) },
5543 { SH64_COMPACT_INSN_STS_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_pr_compact
) },
5544 { SH64_COMPACT_INSN_STSL_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_pr_compact
) },
5545 { SH64_COMPACT_INSN_SUB_COMPACT
, SEM_FN_NAME (sh64_compact
,sub_compact
) },
5546 { SH64_COMPACT_INSN_SUBC_COMPACT
, SEM_FN_NAME (sh64_compact
,subc_compact
) },
5547 { SH64_COMPACT_INSN_SUBV_COMPACT
, SEM_FN_NAME (sh64_compact
,subv_compact
) },
5548 { SH64_COMPACT_INSN_SWAPB_COMPACT
, SEM_FN_NAME (sh64_compact
,swapb_compact
) },
5549 { SH64_COMPACT_INSN_SWAPW_COMPACT
, SEM_FN_NAME (sh64_compact
,swapw_compact
) },
5550 { SH64_COMPACT_INSN_TASB_COMPACT
, SEM_FN_NAME (sh64_compact
,tasb_compact
) },
5551 { SH64_COMPACT_INSN_TRAPA_COMPACT
, SEM_FN_NAME (sh64_compact
,trapa_compact
) },
5552 { SH64_COMPACT_INSN_TST_COMPACT
, SEM_FN_NAME (sh64_compact
,tst_compact
) },
5553 { SH64_COMPACT_INSN_TSTI_COMPACT
, SEM_FN_NAME (sh64_compact
,tsti_compact
) },
5554 { SH64_COMPACT_INSN_TSTB_COMPACT
, SEM_FN_NAME (sh64_compact
,tstb_compact
) },
5555 { SH64_COMPACT_INSN_XOR_COMPACT
, SEM_FN_NAME (sh64_compact
,xor_compact
) },
5556 { SH64_COMPACT_INSN_XORI_COMPACT
, SEM_FN_NAME (sh64_compact
,xori_compact
) },
5557 { SH64_COMPACT_INSN_XORB_COMPACT
, SEM_FN_NAME (sh64_compact
,xorb_compact
) },
5558 { SH64_COMPACT_INSN_XTRCT_COMPACT
, SEM_FN_NAME (sh64_compact
,xtrct_compact
) },
5562 /* Add the semantic fns to IDESC_TABLE. */
5565 SEM_FN_NAME (sh64_compact
,init_idesc_table
) (SIM_CPU
*current_cpu
)
5567 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
5568 const struct sem_fn_desc
*sf
;
5569 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
5571 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
5573 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
5574 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
5575 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
5578 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
5580 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (sh64_compact
,x_invalid
);
5583 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
5585 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (sh64_compact
,x_invalid
);