1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
7 This file is part of the GNU Simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
34 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
36 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_/**/attr)
39 /* This is used so that we can compile two copies of the semantic code,
40 one with full feature support and one without that runs fast(er).
41 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
43 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
45 #define TRACE_RESULT(cpu, abuf, name, type, val)
47 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
50 /* x-invalid: --invalid-- */
53 SEM_FN_NAME (sh64_compact
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
55 #define FLD(f) abuf->fields.fmt_empty.f
56 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
57 int UNUSED written
= 0;
58 IADDR UNUSED pc
= abuf
->addr
;
59 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
62 /* Update the recorded pc in the cpu state struct.
63 Only necessary for WITH_SCACHE case, but to avoid the
64 conditional compilation .... */
66 /* Virtual insns have zero size. Overwrite vpc with address of next insn
67 using the default-insn-bitsize spec. When executing insns in parallel
68 we may want to queue the fault and continue execution. */
69 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
70 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
77 /* x-after: --after-- */
80 SEM_FN_NAME (sh64_compact
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
82 #define FLD(f) abuf->fields.fmt_empty.f
83 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
84 int UNUSED written
= 0;
85 IADDR UNUSED pc
= abuf
->addr
;
86 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
89 #if WITH_SCACHE_PBB_SH64_COMPACT
90 sh64_compact_pbb_after (current_cpu
, sem_arg
);
98 /* x-before: --before-- */
101 SEM_FN_NAME (sh64_compact
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
103 #define FLD(f) abuf->fields.fmt_empty.f
104 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
105 int UNUSED written
= 0;
106 IADDR UNUSED pc
= abuf
->addr
;
107 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
110 #if WITH_SCACHE_PBB_SH64_COMPACT
111 sh64_compact_pbb_before (current_cpu
, sem_arg
);
119 /* x-cti-chain: --cti-chain-- */
122 SEM_FN_NAME (sh64_compact
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
124 #define FLD(f) abuf->fields.fmt_empty.f
125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
126 int UNUSED written
= 0;
127 IADDR UNUSED pc
= abuf
->addr
;
128 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
131 #if WITH_SCACHE_PBB_SH64_COMPACT
133 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
134 pbb_br_type
, pbb_br_npc
);
137 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
138 vpc
= sh64_compact_pbb_cti_chain (current_cpu
, sem_arg
,
139 CPU_PBB_BR_TYPE (current_cpu
),
140 CPU_PBB_BR_NPC (current_cpu
));
149 /* x-chain: --chain-- */
152 SEM_FN_NAME (sh64_compact
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
154 #define FLD(f) abuf->fields.fmt_empty.f
155 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
156 int UNUSED written
= 0;
157 IADDR UNUSED pc
= abuf
->addr
;
158 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
161 #if WITH_SCACHE_PBB_SH64_COMPACT
162 vpc
= sh64_compact_pbb_chain (current_cpu
, sem_arg
);
173 /* x-begin: --begin-- */
176 SEM_FN_NAME (sh64_compact
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
178 #define FLD(f) abuf->fields.fmt_empty.f
179 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
180 int UNUSED written
= 0;
181 IADDR UNUSED pc
= abuf
->addr
;
182 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
185 #if WITH_SCACHE_PBB_SH64_COMPACT
186 #if defined DEFINE_SWITCH || defined FAST_P
187 /* In the switch case FAST_P is a constant, allowing several optimizations
188 in any called inline functions. */
189 vpc
= sh64_compact_pbb_begin (current_cpu
, FAST_P
);
191 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
192 vpc
= sh64_compact_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
194 vpc
= sh64_compact_pbb_begin (current_cpu
, 0);
204 /* add-compact: add $rm, $rn */
207 SEM_FN_NAME (sh64_compact
,add_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
209 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
210 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
211 int UNUSED written
= 0;
212 IADDR UNUSED pc
= abuf
->addr
;
213 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
216 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
217 SET_H_GRC (FLD (f_rn
), opval
);
218 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
225 /* addi-compact: add #$imm8, $rn */
228 SEM_FN_NAME (sh64_compact
,addi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
230 #define FLD(f) abuf->fields.sfmt_addi_compact.f
231 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
232 int UNUSED written
= 0;
233 IADDR UNUSED pc
= abuf
->addr
;
234 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
237 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
238 SET_H_GRC (FLD (f_rn
), opval
);
239 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
246 /* addc-compact: addc $rm, $rn */
249 SEM_FN_NAME (sh64_compact
,addc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
251 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
252 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
253 int UNUSED written
= 0;
254 IADDR UNUSED pc
= abuf
->addr
;
255 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
259 tmp_flag
= ADDCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
261 SI opval
= ADDCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
262 SET_H_GRC (FLD (f_rn
), opval
);
263 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
268 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
276 /* addv-compact: addv $rm, $rn */
279 SEM_FN_NAME (sh64_compact
,addv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
281 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
282 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
283 int UNUSED written
= 0;
284 IADDR UNUSED pc
= abuf
->addr
;
285 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
289 tmp_t
= ADDOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
291 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
292 SET_H_GRC (FLD (f_rn
), opval
);
293 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
298 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
306 /* and-compact: and $rm64, $rn64 */
309 SEM_FN_NAME (sh64_compact
,and_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
311 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
312 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
313 int UNUSED written
= 0;
314 IADDR UNUSED pc
= abuf
->addr
;
315 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
318 DI opval
= ANDDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
319 SET_H_GR (FLD (f_rn
), opval
);
320 TRACE_RESULT (current_cpu
, abuf
, "rn64", 'D', opval
);
327 /* andi-compact: and #$uimm8, r0 */
330 SEM_FN_NAME (sh64_compact
,andi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
332 #define FLD(f) abuf->fields.sfmt_addi_compact.f
333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
334 int UNUSED written
= 0;
335 IADDR UNUSED pc
= abuf
->addr
;
336 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
339 SI opval
= ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
340 SET_H_GRC (((UINT
) 0), opval
);
341 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
348 /* andb-compact: and.b #$imm8, @(r0, gbr) */
351 SEM_FN_NAME (sh64_compact
,andb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
353 #define FLD(f) abuf->fields.sfmt_addi_compact.f
354 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
355 int UNUSED written
= 0;
356 IADDR UNUSED pc
= abuf
->addr
;
357 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
362 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
363 tmp_data
= ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
365 UQI opval
= tmp_data
;
366 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
367 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
375 /* bf-compact: bf $disp8 */
378 SEM_FN_NAME (sh64_compact
,bf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
380 #define FLD(f) abuf->fields.sfmt_bf_compact.f
381 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
382 int UNUSED written
= 0;
383 IADDR UNUSED pc
= abuf
->addr
;
385 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
387 if (NOTBI (GET_H_TBIT ())) {
389 UDI opval
= FLD (i_disp8
);
390 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
392 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
396 abuf
->written
= written
;
397 SEM_BRANCH_FINI (vpc
);
402 /* bfs-compact: bf/s $disp8 */
405 SEM_FN_NAME (sh64_compact
,bfs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
407 #define FLD(f) abuf->fields.sfmt_bf_compact.f
408 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
409 int UNUSED written
= 0;
410 IADDR UNUSED pc
= abuf
->addr
;
412 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
414 if (NOTBI (GET_H_TBIT ())) {
417 UDI opval
= FLD (i_disp8
);
418 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
420 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
425 abuf
->written
= written
;
426 SEM_BRANCH_FINI (vpc
);
431 /* bra-compact: bra $disp12 */
434 SEM_FN_NAME (sh64_compact
,bra_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
436 #define FLD(f) abuf->fields.sfmt_bra_compact.f
437 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
438 int UNUSED written
= 0;
439 IADDR UNUSED pc
= abuf
->addr
;
441 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
445 UDI opval
= FLD (i_disp12
);
446 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
447 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
451 SEM_BRANCH_FINI (vpc
);
456 /* braf-compact: braf $rn */
459 SEM_FN_NAME (sh64_compact
,braf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
461 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
462 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
463 int UNUSED written
= 0;
464 IADDR UNUSED pc
= abuf
->addr
;
466 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
470 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
471 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
472 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
476 SEM_BRANCH_FINI (vpc
);
481 /* brk-compact: brk */
484 SEM_FN_NAME (sh64_compact
,brk_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
486 #define FLD(f) abuf->fields.fmt_empty.f
487 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
488 int UNUSED written
= 0;
489 IADDR UNUSED pc
= abuf
->addr
;
490 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
492 sh64_break (current_cpu
, pc
);
498 /* bsr-compact: bsr $disp12 */
501 SEM_FN_NAME (sh64_compact
,bsr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
503 #define FLD(f) abuf->fields.sfmt_bra_compact.f
504 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
505 int UNUSED written
= 0;
506 IADDR UNUSED pc
= abuf
->addr
;
508 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
513 SI opval
= ADDDI (pc
, 4);
515 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
518 UDI opval
= FLD (i_disp12
);
519 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
520 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
525 SEM_BRANCH_FINI (vpc
);
530 /* bsrf-compact: bsrf $rn */
533 SEM_FN_NAME (sh64_compact
,bsrf_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
535 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
536 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
537 int UNUSED written
= 0;
538 IADDR UNUSED pc
= abuf
->addr
;
540 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
545 SI opval
= ADDDI (pc
, 4);
547 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
550 UDI opval
= ADDDI (EXTSIDI (GET_H_GRC (FLD (f_rn
))), ADDDI (pc
, 4));
551 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
552 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
557 SEM_BRANCH_FINI (vpc
);
562 /* bt-compact: bt $disp8 */
565 SEM_FN_NAME (sh64_compact
,bt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
567 #define FLD(f) abuf->fields.sfmt_bf_compact.f
568 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
569 int UNUSED written
= 0;
570 IADDR UNUSED pc
= abuf
->addr
;
572 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
576 UDI opval
= FLD (i_disp8
);
577 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
579 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
583 abuf
->written
= written
;
584 SEM_BRANCH_FINI (vpc
);
589 /* bts-compact: bt/s $disp8 */
592 SEM_FN_NAME (sh64_compact
,bts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
594 #define FLD(f) abuf->fields.sfmt_bf_compact.f
595 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
596 int UNUSED written
= 0;
597 IADDR UNUSED pc
= abuf
->addr
;
599 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
604 UDI opval
= FLD (i_disp8
);
605 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
607 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
612 abuf
->written
= written
;
613 SEM_BRANCH_FINI (vpc
);
618 /* clrmac-compact: clrmac */
621 SEM_FN_NAME (sh64_compact
,clrmac_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
623 #define FLD(f) abuf->fields.fmt_empty.f
624 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
625 int UNUSED written
= 0;
626 IADDR UNUSED pc
= abuf
->addr
;
627 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
633 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
638 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
646 /* clrs-compact: clrs */
649 SEM_FN_NAME (sh64_compact
,clrs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
651 #define FLD(f) abuf->fields.fmt_empty.f
652 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
653 int UNUSED written
= 0;
654 IADDR UNUSED pc
= abuf
->addr
;
655 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
660 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
667 /* clrt-compact: clrt */
670 SEM_FN_NAME (sh64_compact
,clrt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
672 #define FLD(f) abuf->fields.fmt_empty.f
673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
674 int UNUSED written
= 0;
675 IADDR UNUSED pc
= abuf
->addr
;
676 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
681 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
688 /* cmpeq-compact: cmp/eq $rm, $rn */
691 SEM_FN_NAME (sh64_compact
,cmpeq_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
693 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
694 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
695 int UNUSED written
= 0;
696 IADDR UNUSED pc
= abuf
->addr
;
697 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
700 BI opval
= EQSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
702 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
709 /* cmpeqi-compact: cmp/eq #$imm8, r0 */
712 SEM_FN_NAME (sh64_compact
,cmpeqi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
714 #define FLD(f) abuf->fields.sfmt_addi_compact.f
715 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
716 int UNUSED written
= 0;
717 IADDR UNUSED pc
= abuf
->addr
;
718 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
721 BI opval
= EQSI (GET_H_GRC (((UINT
) 0)), EXTQISI (ANDQI (FLD (f_imm8
), 255)));
723 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
730 /* cmpge-compact: cmp/ge $rm, $rn */
733 SEM_FN_NAME (sh64_compact
,cmpge_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
735 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
736 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
737 int UNUSED written
= 0;
738 IADDR UNUSED pc
= abuf
->addr
;
739 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
742 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
744 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
751 /* cmpgt-compact: cmp/gt $rm, $rn */
754 SEM_FN_NAME (sh64_compact
,cmpgt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
756 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
757 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
758 int UNUSED written
= 0;
759 IADDR UNUSED pc
= abuf
->addr
;
760 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
763 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
765 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
772 /* cmphi-compact: cmp/hi $rm, $rn */
775 SEM_FN_NAME (sh64_compact
,cmphi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
777 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
778 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
779 int UNUSED written
= 0;
780 IADDR UNUSED pc
= abuf
->addr
;
781 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
784 BI opval
= GTUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
786 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
793 /* cmphs-compact: cmp/hs $rm, $rn */
796 SEM_FN_NAME (sh64_compact
,cmphs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
798 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
799 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
800 int UNUSED written
= 0;
801 IADDR UNUSED pc
= abuf
->addr
;
802 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
805 BI opval
= GEUSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
807 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
814 /* cmppl-compact: cmp/pl $rn */
817 SEM_FN_NAME (sh64_compact
,cmppl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
819 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
820 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
821 int UNUSED written
= 0;
822 IADDR UNUSED pc
= abuf
->addr
;
823 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
826 BI opval
= GTSI (GET_H_GRC (FLD (f_rn
)), 0);
828 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
835 /* cmppz-compact: cmp/pz $rn */
838 SEM_FN_NAME (sh64_compact
,cmppz_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
840 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
841 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
842 int UNUSED written
= 0;
843 IADDR UNUSED pc
= abuf
->addr
;
844 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
847 BI opval
= GESI (GET_H_GRC (FLD (f_rn
)), 0);
849 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
856 /* cmpstr-compact: cmp/str $rm, $rn */
859 SEM_FN_NAME (sh64_compact
,cmpstr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
861 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
862 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
863 int UNUSED written
= 0;
864 IADDR UNUSED pc
= abuf
->addr
;
865 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
870 tmp_temp
= XORSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
871 tmp_t
= EQSI (ANDSI (tmp_temp
, 0xff000000), 0);
872 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 16711680), 0), tmp_t
);
873 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 65280), 0), tmp_t
);
874 tmp_t
= ORBI (EQSI (ANDSI (tmp_temp
, 255), 0), tmp_t
);
876 BI opval
= ((GTUBI (tmp_t
, 0)) ? (1) : (0));
878 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
886 /* div0s-compact: div0s $rm, $rn */
889 SEM_FN_NAME (sh64_compact
,div0s_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
891 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
892 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
893 int UNUSED written
= 0;
894 IADDR UNUSED pc
= abuf
->addr
;
895 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
899 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
901 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
904 BI opval
= SRLSI (GET_H_GRC (FLD (f_rm
)), 31);
906 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
909 BI opval
= ((EQSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 31), SRLSI (GET_H_GRC (FLD (f_rn
)), 31))) ? (0) : (1));
911 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
919 /* div0u-compact: div0u */
922 SEM_FN_NAME (sh64_compact
,div0u_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
924 #define FLD(f) abuf->fields.fmt_empty.f
925 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
926 int UNUSED written
= 0;
927 IADDR UNUSED pc
= abuf
->addr
;
928 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
934 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
939 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
944 TRACE_RESULT (current_cpu
, abuf
, "mbit", 'x', opval
);
952 /* div1-compact: div1 $rm, $rn */
955 SEM_FN_NAME (sh64_compact
,div1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
957 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
958 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
959 int UNUSED written
= 0;
960 IADDR UNUSED pc
= abuf
->addr
;
961 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
967 tmp_oldq
= GET_H_QBIT ();
969 BI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
971 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
974 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), ZEXTBISI (GET_H_TBIT ()));
975 SET_H_GRC (FLD (f_rn
), opval
);
976 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
978 if (NOTBI (tmp_oldq
)) {
979 if (NOTBI (GET_H_MBIT ())) {
981 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
983 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
984 SET_H_GRC (FLD (f_rn
), opval
);
985 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
987 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
988 if (NOTBI (GET_H_QBIT ())) {
990 BI opval
= ((tmp_tmp1
) ? (1) : (0));
992 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
996 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
998 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1004 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1006 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1007 SET_H_GRC (FLD (f_rn
), opval
);
1008 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1010 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1011 if (NOTBI (GET_H_QBIT ())) {
1013 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1015 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1019 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1021 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1027 if (NOTBI (GET_H_MBIT ())) {
1029 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1031 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
1032 SET_H_GRC (FLD (f_rn
), opval
);
1033 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1035 tmp_tmp1
= LTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1036 if (NOTBI (GET_H_QBIT ())) {
1038 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1040 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1044 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1046 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1052 tmp_tmp0
= GET_H_GRC (FLD (f_rn
));
1054 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
1055 SET_H_GRC (FLD (f_rn
), opval
);
1056 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1058 tmp_tmp1
= GTUSI (GET_H_GRC (FLD (f_rn
)), tmp_tmp0
);
1059 if (NOTBI (GET_H_QBIT ())) {
1061 BI opval
= ((EQQI (tmp_tmp1
, 0)) ? (1) : (0));
1063 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1067 BI opval
= ((tmp_tmp1
) ? (1) : (0));
1069 TRACE_RESULT (current_cpu
, abuf
, "qbit", 'x', opval
);
1076 BI opval
= ((EQBI (GET_H_QBIT (), GET_H_MBIT ())) ? (1) : (0));
1078 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1086 /* dmulsl-compact: dmuls.l $rm, $rn */
1089 SEM_FN_NAME (sh64_compact
,dmulsl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1091 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1092 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1093 int UNUSED written
= 0;
1094 IADDR UNUSED pc
= abuf
->addr
;
1095 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1099 tmp_result
= MULDI (EXTSIDI (GET_H_GRC (FLD (f_rm
))), EXTSIDI (GET_H_GRC (FLD (f_rn
))));
1101 SI opval
= SUBWORDDISI (tmp_result
, 0);
1103 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1106 SI opval
= SUBWORDDISI (tmp_result
, 1);
1108 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1116 /* dmulul-compact: dmulu.l $rm, $rn */
1119 SEM_FN_NAME (sh64_compact
,dmulul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1121 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1122 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1123 int UNUSED written
= 0;
1124 IADDR UNUSED pc
= abuf
->addr
;
1125 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1129 tmp_result
= MULDI (ZEXTSIDI (GET_H_GRC (FLD (f_rm
))), ZEXTSIDI (GET_H_GRC (FLD (f_rn
))));
1131 SI opval
= SUBWORDDISI (tmp_result
, 0);
1133 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
1136 SI opval
= SUBWORDDISI (tmp_result
, 1);
1138 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
1146 /* dt-compact: dt $rn */
1149 SEM_FN_NAME (sh64_compact
,dt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1151 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1153 int UNUSED written
= 0;
1154 IADDR UNUSED pc
= abuf
->addr
;
1155 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1159 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
1160 SET_H_GRC (FLD (f_rn
), opval
);
1161 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1164 BI opval
= EQSI (GET_H_GRC (FLD (f_rn
)), 0);
1166 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1174 /* extsb-compact: exts.b $rm, $rn */
1177 SEM_FN_NAME (sh64_compact
,extsb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1179 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1180 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1181 int UNUSED written
= 0;
1182 IADDR UNUSED pc
= abuf
->addr
;
1183 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1186 SI opval
= EXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1187 SET_H_GRC (FLD (f_rn
), opval
);
1188 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1195 /* extsw-compact: exts.w $rm, $rn */
1198 SEM_FN_NAME (sh64_compact
,extsw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1200 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1201 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1202 int UNUSED written
= 0;
1203 IADDR UNUSED pc
= abuf
->addr
;
1204 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1207 SI opval
= EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1208 SET_H_GRC (FLD (f_rn
), opval
);
1209 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1216 /* extub-compact: extu.b $rm, $rn */
1219 SEM_FN_NAME (sh64_compact
,extub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1221 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1222 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1223 int UNUSED written
= 0;
1224 IADDR UNUSED pc
= abuf
->addr
;
1225 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1228 SI opval
= ZEXTQISI (SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3));
1229 SET_H_GRC (FLD (f_rn
), opval
);
1230 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1237 /* extuw-compact: extu.w $rm, $rn */
1240 SEM_FN_NAME (sh64_compact
,extuw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1242 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1243 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1244 int UNUSED written
= 0;
1245 IADDR UNUSED pc
= abuf
->addr
;
1246 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1249 SI opval
= ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1));
1250 SET_H_GRC (FLD (f_rn
), opval
);
1251 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1258 /* fabs-compact: fabs $fsdn */
1261 SEM_FN_NAME (sh64_compact
,fabs_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1263 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1264 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1265 int UNUSED written
= 0;
1266 IADDR UNUSED pc
= abuf
->addr
;
1267 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1269 if (GET_H_PRBIT ()) {
1271 DF opval
= sh64_fabsd (current_cpu
, GET_H_DR (FLD (f_rn
)));
1272 SET_H_DR (FLD (f_rn
), opval
);
1273 written
|= (1 << 5);
1274 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1278 SF opval
= sh64_fabss (current_cpu
, GET_H_FRC (FLD (f_rn
)));
1279 SET_H_FRC (FLD (f_rn
), opval
);
1280 written
|= (1 << 4);
1281 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
1285 abuf
->written
= written
;
1290 /* fadd-compact: fadd $fsdm, $fsdn */
1293 SEM_FN_NAME (sh64_compact
,fadd_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1295 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1296 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1297 int UNUSED written
= 0;
1298 IADDR UNUSED pc
= abuf
->addr
;
1299 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1301 if (GET_H_PRBIT ()) {
1303 DF opval
= sh64_faddd (current_cpu
, GET_H_DR (FLD (f_rm
)), GET_H_DR (FLD (f_rn
)));
1304 SET_H_DR (FLD (f_rn
), opval
);
1305 written
|= (1 << 8);
1306 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1310 SF opval
= sh64_fadds (current_cpu
, GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1311 SET_H_FRC (FLD (f_rn
), opval
);
1312 written
|= (1 << 7);
1313 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
1317 abuf
->written
= written
;
1322 /* fcmpeq-compact: fcmp/eq $fsdm, $fsdn */
1325 SEM_FN_NAME (sh64_compact
,fcmpeq_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1327 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1328 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1329 int UNUSED written
= 0;
1330 IADDR UNUSED pc
= abuf
->addr
;
1331 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1333 if (GET_H_PRBIT ()) {
1335 BI opval
= sh64_fcmpeqd (current_cpu
, GET_H_DR (FLD (f_rm
)), GET_H_DR (FLD (f_rn
)));
1337 written
|= (1 << 7);
1338 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1342 BI opval
= sh64_fcmpeqs (current_cpu
, GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1344 written
|= (1 << 7);
1345 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1349 abuf
->written
= written
;
1354 /* fcmpgt-compact: fcmp/gt $fsdm, $fsdn */
1357 SEM_FN_NAME (sh64_compact
,fcmpgt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1359 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1361 int UNUSED written
= 0;
1362 IADDR UNUSED pc
= abuf
->addr
;
1363 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1365 if (GET_H_PRBIT ()) {
1367 BI opval
= sh64_fcmpgtd (current_cpu
, GET_H_DR (FLD (f_rn
)), GET_H_DR (FLD (f_rm
)));
1369 written
|= (1 << 7);
1370 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1374 BI opval
= sh64_fcmpgts (current_cpu
, GET_H_FRC (FLD (f_rn
)), GET_H_FRC (FLD (f_rm
)));
1376 written
|= (1 << 7);
1377 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
1381 abuf
->written
= written
;
1386 /* fcnvds-compact: fcnvds $drn, fpul */
1389 SEM_FN_NAME (sh64_compact
,fcnvds_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1391 #define FLD(f) abuf->fields.sfmt_fcnvds_compact.f
1392 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1393 int UNUSED written
= 0;
1394 IADDR UNUSED pc
= abuf
->addr
;
1395 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1398 SF opval
= sh64_fcnvds (current_cpu
, GET_H_DRC (FLD (f_dn
)));
1399 CPU (h_fr
[((UINT
) 32)]) = opval
;
1400 TRACE_RESULT (current_cpu
, abuf
, "fpul", 'f', opval
);
1407 /* fcnvsd-compact: fcnvsd fpul, $drn */
1410 SEM_FN_NAME (sh64_compact
,fcnvsd_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1412 #define FLD(f) abuf->fields.sfmt_fcnvds_compact.f
1413 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1414 int UNUSED written
= 0;
1415 IADDR UNUSED pc
= abuf
->addr
;
1416 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1419 DF opval
= sh64_fcnvsd (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1420 SET_H_DRC (FLD (f_dn
), opval
);
1421 TRACE_RESULT (current_cpu
, abuf
, "drn", 'f', opval
);
1428 /* fdiv-compact: fdiv $fsdm, $fsdn */
1431 SEM_FN_NAME (sh64_compact
,fdiv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1433 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1434 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1435 int UNUSED written
= 0;
1436 IADDR UNUSED pc
= abuf
->addr
;
1437 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1439 if (GET_H_PRBIT ()) {
1441 DF opval
= sh64_fdivd (current_cpu
, GET_H_DR (FLD (f_rn
)), GET_H_DR (FLD (f_rm
)));
1442 SET_H_DR (FLD (f_rn
), opval
);
1443 written
|= (1 << 8);
1444 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1448 SF opval
= sh64_fdivs (current_cpu
, GET_H_FRC (FLD (f_rn
)), GET_H_FRC (FLD (f_rm
)));
1449 SET_H_FRC (FLD (f_rn
), opval
);
1450 written
|= (1 << 7);
1451 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
1455 abuf
->written
= written
;
1460 /* fipr-compact: fipr $fvm, $fvn */
1463 SEM_FN_NAME (sh64_compact
,fipr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1465 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
1466 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1467 int UNUSED written
= 0;
1468 IADDR UNUSED pc
= abuf
->addr
;
1469 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1477 tmp_res
= sh64_fmuls (current_cpu
, GET_H_FVC (FLD (f_vm
)), GET_H_FVC (FLD (f_vn
)));
1478 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_FRC (ADDQI (tmp_m
, 1)), GET_H_FRC (ADDQI (tmp_n
, 1))));
1479 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_FRC (ADDQI (tmp_m
, 2)), GET_H_FRC (ADDQI (tmp_n
, 2))));
1480 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_FRC (ADDQI (tmp_m
, 3)), GET_H_FRC (ADDQI (tmp_n
, 3))));
1483 SET_H_FRC (ADDQI (tmp_n
, 3), opval
);
1484 TRACE_RESULT (current_cpu
, abuf
, "frc-add--DFLT-n-3", 'f', opval
);
1492 /* flds-compact: flds $frn */
1495 SEM_FN_NAME (sh64_compact
,flds_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1497 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1498 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1499 int UNUSED written
= 0;
1500 IADDR UNUSED pc
= abuf
->addr
;
1501 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1504 SF opval
= GET_H_FRC (FLD (f_rn
));
1505 CPU (h_fr
[((UINT
) 32)]) = opval
;
1506 TRACE_RESULT (current_cpu
, abuf
, "fpul", 'f', opval
);
1513 /* fldi0-compact: fldi0 $frn */
1516 SEM_FN_NAME (sh64_compact
,fldi0_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1518 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1519 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1520 int UNUSED written
= 0;
1521 IADDR UNUSED pc
= abuf
->addr
;
1522 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1525 SF opval
= sh64_fldi0 (current_cpu
);
1526 SET_H_FRC (FLD (f_rn
), opval
);
1527 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1534 /* fldi1-compact: fldi1 $frn */
1537 SEM_FN_NAME (sh64_compact
,fldi1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1539 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1540 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1541 int UNUSED written
= 0;
1542 IADDR UNUSED pc
= abuf
->addr
;
1543 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1546 SF opval
= sh64_fldi1 (current_cpu
);
1547 SET_H_FRC (FLD (f_rn
), opval
);
1548 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1555 /* float-compact: float fpul, $fsdn */
1558 SEM_FN_NAME (sh64_compact
,float_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1560 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1561 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1562 int UNUSED written
= 0;
1563 IADDR UNUSED pc
= abuf
->addr
;
1564 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1566 if (GET_H_PRBIT ()) {
1568 DF opval
= sh64_floatld (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1569 SET_H_DR (FLD (f_rn
), opval
);
1570 written
|= (1 << 4);
1571 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1575 SF opval
= sh64_floatls (current_cpu
, CPU (h_fr
[((UINT
) 32)]));
1576 SET_H_FRC (FLD (f_rn
), opval
);
1577 written
|= (1 << 3);
1578 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
1582 abuf
->written
= written
;
1587 /* fmac-compact: fmac fr0, $frm, $frn */
1590 SEM_FN_NAME (sh64_compact
,fmac_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1592 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1593 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1594 int UNUSED written
= 0;
1595 IADDR UNUSED pc
= abuf
->addr
;
1596 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1599 SF opval
= sh64_fmacs (current_cpu
, GET_H_FRC (((UINT
) 0)), GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1600 SET_H_FRC (FLD (f_rn
), opval
);
1601 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1608 /* fmov1-compact: fmov $frm, $frn */
1611 SEM_FN_NAME (sh64_compact
,fmov1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1613 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1614 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1615 int UNUSED written
= 0;
1616 IADDR UNUSED pc
= abuf
->addr
;
1617 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1619 if (NOTBI (GET_H_SZBIT ())) {
1621 SF opval
= GET_H_FRC (FLD (f_rm
));
1622 SET_H_FRC (FLD (f_rn
), opval
);
1623 written
|= (1 << 6);
1624 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1627 if (EQSI (ANDSI (FLD (f_rm
), 1), 1)) {
1628 if (EQSI (ANDSI (FLD (f_rn
), 1), 1)) {
1630 DF opval
= GET_H_XD (((FLD (f_rm
)) & (INVQI (1))));
1631 SET_H_XD (((FLD (f_rn
)) & (INVQI (1))), opval
);
1632 written
|= (1 << 8);
1633 TRACE_RESULT (current_cpu
, abuf
, "xd-and--DFLT-index-of--DFLT-frn-inv--QI-1", 'f', opval
);
1637 DF opval
= GET_H_XD (((FLD (f_rm
)) & (INVQI (1))));
1638 SET_H_DR (FLD (f_rn
), opval
);
1639 written
|= (1 << 7);
1640 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-frn", 'f', opval
);
1644 if (EQSI (ANDSI (FLD (f_rn
), 1), 1)) {
1646 DF opval
= GET_H_DR (FLD (f_rm
));
1647 SET_H_XD (((FLD (f_rn
)) & (INVQI (1))), opval
);
1648 written
|= (1 << 8);
1649 TRACE_RESULT (current_cpu
, abuf
, "xd-and--DFLT-index-of--DFLT-frn-inv--QI-1", 'f', opval
);
1653 DF opval
= GET_H_DR (FLD (f_rm
));
1654 SET_H_DR (FLD (f_rn
), opval
);
1655 written
|= (1 << 7);
1656 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-frn", 'f', opval
);
1662 abuf
->written
= written
;
1667 /* fmov2-compact: fmov @$rm, $frn */
1670 SEM_FN_NAME (sh64_compact
,fmov2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1672 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1674 int UNUSED written
= 0;
1675 IADDR UNUSED pc
= abuf
->addr
;
1676 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1678 if (NOTBI (GET_H_SZBIT ())) {
1680 SF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1681 SET_H_FRC (FLD (f_rn
), opval
);
1682 written
|= (1 << 5);
1683 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1686 if (EQSI (ANDSI (FLD (f_rn
), 1), 1)) {
1688 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1689 SET_H_XD (((FLD (f_rn
)) & (INVQI (1))), opval
);
1690 written
|= (1 << 7);
1691 TRACE_RESULT (current_cpu
, abuf
, "xd-and--DFLT-index-of--DFLT-frn-inv--QI-1", 'f', opval
);
1695 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1696 SET_H_DR (FLD (f_rn
), opval
);
1697 written
|= (1 << 6);
1698 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-frn", 'f', opval
);
1703 abuf
->written
= written
;
1708 /* fmov3-compact: fmov @${rm}+, frn */
1711 SEM_FN_NAME (sh64_compact
,fmov3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1713 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1714 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1715 int UNUSED written
= 0;
1716 IADDR UNUSED pc
= abuf
->addr
;
1717 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1719 if (NOTBI (GET_H_SZBIT ())) {
1722 SF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1723 SET_H_FRC (FLD (f_rn
), opval
);
1724 written
|= (1 << 5);
1725 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1728 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
1729 SET_H_GRC (FLD (f_rm
), opval
);
1730 written
|= (1 << 8);
1731 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
1736 if (EQSI (ANDSI (FLD (f_rn
), 1), 1)) {
1738 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1739 SET_H_XD (((FLD (f_rn
)) & (INVQI (1))), opval
);
1740 written
|= (1 << 7);
1741 TRACE_RESULT (current_cpu
, abuf
, "xd-and--DFLT-index-of--DFLT-frn-inv--QI-1", 'f', opval
);
1745 DF opval
= GETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
1746 SET_H_DR (FLD (f_rn
), opval
);
1747 written
|= (1 << 6);
1748 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-frn", 'f', opval
);
1752 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 8);
1753 SET_H_GRC (FLD (f_rm
), opval
);
1754 written
|= (1 << 8);
1755 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
1760 abuf
->written
= written
;
1765 /* fmov4-compact: fmov @(r0, $rm), $frn */
1768 SEM_FN_NAME (sh64_compact
,fmov4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1770 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1771 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1772 int UNUSED written
= 0;
1773 IADDR UNUSED pc
= abuf
->addr
;
1774 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1776 if (NOTBI (GET_H_SZBIT ())) {
1778 SF opval
= GETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1779 SET_H_FRC (FLD (f_rn
), opval
);
1780 written
|= (1 << 6);
1781 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
1784 if (EQSI (ANDSI (FLD (f_rn
), 1), 1)) {
1786 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1787 SET_H_XD (((FLD (f_rn
)) & (INVQI (1))), opval
);
1788 written
|= (1 << 8);
1789 TRACE_RESULT (current_cpu
, abuf
, "xd-and--DFLT-index-of--DFLT-frn-inv--QI-1", 'f', opval
);
1793 DF opval
= GETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
1794 SET_H_DR (FLD (f_rn
), opval
);
1795 written
|= (1 << 7);
1796 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-frn", 'f', opval
);
1801 abuf
->written
= written
;
1806 /* fmov5-compact: fmov $frm, @$rn */
1809 SEM_FN_NAME (sh64_compact
,fmov5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1811 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1812 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1813 int UNUSED written
= 0;
1814 IADDR UNUSED pc
= abuf
->addr
;
1815 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1817 if (NOTBI (GET_H_SZBIT ())) {
1819 SF opval
= GET_H_FRC (FLD (f_rm
));
1820 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1821 written
|= (1 << 6);
1822 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1825 if (EQSI (ANDSI (FLD (f_rm
), 1), 1)) {
1827 DF opval
= GET_H_XD (((FLD (f_rm
)) & (INVQI (1))));
1828 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1829 written
|= (1 << 7);
1830 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1834 DF opval
= GET_H_DR (FLD (f_rm
));
1835 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1836 written
|= (1 << 7);
1837 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1842 abuf
->written
= written
;
1847 /* fmov6-compact: fmov $frm, @-$rn */
1850 SEM_FN_NAME (sh64_compact
,fmov6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1852 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1853 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1854 int UNUSED written
= 0;
1855 IADDR UNUSED pc
= abuf
->addr
;
1856 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1858 if (NOTBI (GET_H_SZBIT ())) {
1861 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
1862 SET_H_GRC (FLD (f_rn
), opval
);
1863 written
|= (1 << 8);
1864 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1867 SF opval
= GET_H_FRC (FLD (f_rm
));
1868 SETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1869 written
|= (1 << 6);
1870 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1876 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), 8);
1877 SET_H_GRC (FLD (f_rn
), opval
);
1878 written
|= (1 << 8);
1879 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
1881 if (EQSI (ANDSI (FLD (f_rm
), 1), 1)) {
1883 DF opval
= GET_H_XD (((FLD (f_rm
)) & (INVQI (1))));
1884 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1885 written
|= (1 << 7);
1886 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1890 DF opval
= GET_H_DR (FLD (f_rm
));
1891 SETMEMDF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
1892 written
|= (1 << 7);
1893 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1899 abuf
->written
= written
;
1904 /* fmov7-compact: fmov $frm, @(r0, $rn) */
1907 SEM_FN_NAME (sh64_compact
,fmov7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1909 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1910 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1911 int UNUSED written
= 0;
1912 IADDR UNUSED pc
= abuf
->addr
;
1913 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1915 if (NOTBI (GET_H_SZBIT ())) {
1917 SF opval
= GET_H_FRC (FLD (f_rm
));
1918 SETMEMSF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
1919 written
|= (1 << 7);
1920 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1923 if (EQSI (ANDSI (FLD (f_rm
), 1), 1)) {
1925 DF opval
= GET_H_XD (((FLD (f_rm
)) & (INVQI (1))));
1926 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
1927 written
|= (1 << 8);
1928 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1932 DF opval
= GET_H_DR (FLD (f_rm
));
1933 SETMEMDF (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
1934 written
|= (1 << 8);
1935 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1940 abuf
->written
= written
;
1945 /* fmul-compact: fmul $fsdm, $fsdn */
1948 SEM_FN_NAME (sh64_compact
,fmul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1950 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
1951 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1952 int UNUSED written
= 0;
1953 IADDR UNUSED pc
= abuf
->addr
;
1954 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1956 if (GET_H_PRBIT ()) {
1958 DF opval
= sh64_fmuld (current_cpu
, GET_H_DR (FLD (f_rm
)), GET_H_DR (FLD (f_rn
)));
1959 SET_H_DR (FLD (f_rn
), opval
);
1960 written
|= (1 << 8);
1961 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1965 SF opval
= sh64_fmuls (current_cpu
, GET_H_FRC (FLD (f_rm
)), GET_H_FRC (FLD (f_rn
)));
1966 SET_H_FRC (FLD (f_rn
), opval
);
1967 written
|= (1 << 7);
1968 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
1972 abuf
->written
= written
;
1977 /* fneg-compact: fneg $fsdn */
1980 SEM_FN_NAME (sh64_compact
,fneg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1982 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
1983 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1984 int UNUSED written
= 0;
1985 IADDR UNUSED pc
= abuf
->addr
;
1986 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
1988 if (GET_H_PRBIT ()) {
1990 DF opval
= sh64_fnegd (current_cpu
, GET_H_DR (FLD (f_rn
)));
1991 SET_H_DR (FLD (f_rn
), opval
);
1992 written
|= (1 << 5);
1993 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
1997 SF opval
= sh64_fnegs (current_cpu
, GET_H_FRC (FLD (f_rn
)));
1998 SET_H_FRC (FLD (f_rn
), opval
);
1999 written
|= (1 << 4);
2000 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
2004 abuf
->written
= written
;
2009 /* frchg-compact: frchg */
2012 SEM_FN_NAME (sh64_compact
,frchg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2014 #define FLD(f) abuf->fields.fmt_empty.f
2015 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2016 int UNUSED written
= 0;
2017 IADDR UNUSED pc
= abuf
->addr
;
2018 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2021 BI opval
= NOTBI (GET_H_FRBIT ());
2022 SET_H_FRBIT (opval
);
2023 TRACE_RESULT (current_cpu
, abuf
, "frbit", 'x', opval
);
2030 /* fschg-compact: fschg */
2033 SEM_FN_NAME (sh64_compact
,fschg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2035 #define FLD(f) abuf->fields.fmt_empty.f
2036 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2037 int UNUSED written
= 0;
2038 IADDR UNUSED pc
= abuf
->addr
;
2039 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2042 BI opval
= NOTBI (GET_H_SZBIT ());
2043 SET_H_SZBIT (opval
);
2044 TRACE_RESULT (current_cpu
, abuf
, "szbit", 'x', opval
);
2051 /* fsqrt-compact: fsqrt $fsdn */
2054 SEM_FN_NAME (sh64_compact
,fsqrt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2056 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2057 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2058 int UNUSED written
= 0;
2059 IADDR UNUSED pc
= abuf
->addr
;
2060 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2062 if (GET_H_PRBIT ()) {
2064 DF opval
= sh64_fsqrtd (current_cpu
, GET_H_DR (FLD (f_rn
)));
2065 SET_H_DR (FLD (f_rn
), opval
);
2066 written
|= (1 << 5);
2067 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
2071 SF opval
= sh64_fsqrts (current_cpu
, GET_H_FRC (FLD (f_rn
)));
2072 SET_H_FRC (FLD (f_rn
), opval
);
2073 written
|= (1 << 4);
2074 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
2078 abuf
->written
= written
;
2083 /* fsts-compact: fsts fpul, $frn */
2086 SEM_FN_NAME (sh64_compact
,fsts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2088 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2089 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2090 int UNUSED written
= 0;
2091 IADDR UNUSED pc
= abuf
->addr
;
2092 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2095 SF opval
= CPU (h_fr
[((UINT
) 32)]);
2096 SET_H_FRC (FLD (f_rn
), opval
);
2097 TRACE_RESULT (current_cpu
, abuf
, "frn", 'f', opval
);
2104 /* fsub-compact: fsub $fsdm, $fsdn */
2107 SEM_FN_NAME (sh64_compact
,fsub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2109 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2110 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2111 int UNUSED written
= 0;
2112 IADDR UNUSED pc
= abuf
->addr
;
2113 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2115 if (GET_H_PRBIT ()) {
2117 DF opval
= sh64_fsubd (current_cpu
, GET_H_DR (FLD (f_rn
)), GET_H_DR (FLD (f_rm
)));
2118 SET_H_DR (FLD (f_rn
), opval
);
2119 written
|= (1 << 8);
2120 TRACE_RESULT (current_cpu
, abuf
, "dr-index-of--DFLT-fsdn", 'f', opval
);
2124 SF opval
= sh64_fsubs (current_cpu
, GET_H_FRC (FLD (f_rn
)), GET_H_FRC (FLD (f_rm
)));
2125 SET_H_FRC (FLD (f_rn
), opval
);
2126 written
|= (1 << 7);
2127 TRACE_RESULT (current_cpu
, abuf
, "fsdn", 'f', opval
);
2131 abuf
->written
= written
;
2136 /* ftrc-compact: ftrc $fsdn, fpul */
2139 SEM_FN_NAME (sh64_compact
,ftrc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2141 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2142 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2143 int UNUSED written
= 0;
2144 IADDR UNUSED pc
= abuf
->addr
;
2145 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2148 SF opval
= ((GET_H_PRBIT ()) ? (sh64_ftrcdl (current_cpu
, GET_H_DR (FLD (f_rn
)))) : (sh64_ftrcsl (current_cpu
, GET_H_FRC (FLD (f_rn
)))));
2149 CPU (h_fr
[((UINT
) 32)]) = opval
;
2150 TRACE_RESULT (current_cpu
, abuf
, "fpul", 'f', opval
);
2157 /* ftrv-compact: ftrv xmtrx, $fvn */
2160 SEM_FN_NAME (sh64_compact
,ftrv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2162 #define FLD(f) abuf->fields.sfmt_fipr_compact.f
2163 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2164 int UNUSED written
= 0;
2165 IADDR UNUSED pc
= abuf
->addr
;
2166 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2172 tmp_res
= sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 0)), GET_H_FRC (tmp_n
));
2173 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 4)), GET_H_FRC (ADDQI (tmp_n
, 1))));
2174 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 8)), GET_H_FRC (ADDQI (tmp_n
, 2))));
2175 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 12)), GET_H_FRC (ADDQI (tmp_n
, 3))));
2178 SET_H_FRC (tmp_n
, opval
);
2179 TRACE_RESULT (current_cpu
, abuf
, "frc-n", 'f', opval
);
2181 tmp_res
= sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 1)), GET_H_FRC (tmp_n
));
2182 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 5)), GET_H_FRC (ADDQI (tmp_n
, 1))));
2183 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 9)), GET_H_FRC (ADDQI (tmp_n
, 2))));
2184 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 13)), GET_H_FRC (ADDQI (tmp_n
, 3))));
2187 SET_H_FRC (ADDQI (tmp_n
, 1), opval
);
2188 TRACE_RESULT (current_cpu
, abuf
, "frc-add--DFLT-n-1", 'f', opval
);
2190 tmp_res
= sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 2)), GET_H_FRC (tmp_n
));
2191 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 6)), GET_H_FRC (ADDQI (tmp_n
, 1))));
2192 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 10)), GET_H_FRC (ADDQI (tmp_n
, 2))));
2193 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 14)), GET_H_FRC (ADDQI (tmp_n
, 3))));
2196 SET_H_FRC (ADDQI (tmp_n
, 2), opval
);
2197 TRACE_RESULT (current_cpu
, abuf
, "frc-add--DFLT-n-2", 'f', opval
);
2199 tmp_res
= sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 3)), GET_H_FRC (tmp_n
));
2200 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 7)), GET_H_FRC (ADDQI (tmp_n
, 1))));
2201 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 11)), GET_H_FRC (ADDQI (tmp_n
, 2))));
2202 tmp_res
= sh64_fadds (current_cpu
, tmp_res
, sh64_fmuls (current_cpu
, GET_H_XF (((UINT
) 15)), GET_H_FRC (ADDQI (tmp_n
, 3))));
2205 SET_H_FRC (ADDQI (tmp_n
, 3), opval
);
2206 TRACE_RESULT (current_cpu
, abuf
, "frc-add--DFLT-n-3", 'f', opval
);
2214 /* jmp-compact: jmp @$rn */
2217 SEM_FN_NAME (sh64_compact
,jmp_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2219 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2220 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2221 int UNUSED written
= 0;
2222 IADDR UNUSED pc
= abuf
->addr
;
2224 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2228 UDI opval
= GET_H_GRC (FLD (f_rn
));
2229 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2230 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2234 SEM_BRANCH_FINI (vpc
);
2239 /* jsr-compact: jsr @$rn */
2242 SEM_FN_NAME (sh64_compact
,jsr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2244 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2245 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2246 int UNUSED written
= 0;
2247 IADDR UNUSED pc
= abuf
->addr
;
2249 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2254 SI opval
= ADDDI (pc
, 4);
2256 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2259 UDI opval
= GET_H_GRC (FLD (f_rn
));
2260 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
2261 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
2266 SEM_BRANCH_FINI (vpc
);
2271 /* ldc-compact: ldc $rn, gbr */
2274 SEM_FN_NAME (sh64_compact
,ldc_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 /* ldcl-compact: ldc.l @${rn}+, gbr */
2295 SEM_FN_NAME (sh64_compact
,ldcl_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);
2305 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2307 TRACE_RESULT (current_cpu
, abuf
, "gbr", 'x', opval
);
2310 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2311 SET_H_GRC (FLD (f_rn
), opval
);
2312 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2320 /* lds-fpscr-compact: lds $rn, fpscr */
2323 SEM_FN_NAME (sh64_compact
,lds_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2325 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2326 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2327 int UNUSED written
= 0;
2328 IADDR UNUSED pc
= abuf
->addr
;
2329 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2332 SI opval
= GET_H_GRC (FLD (f_rn
));
2333 SET_H_FPCCR (opval
);
2334 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2341 /* ldsl-fpscr-compact: lds.l @${rn}+, fpscr */
2344 SEM_FN_NAME (sh64_compact
,ldsl_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2346 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2347 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2348 int UNUSED written
= 0;
2349 IADDR UNUSED pc
= abuf
->addr
;
2350 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2354 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2355 SET_H_FPCCR (opval
);
2356 TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
2359 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2360 SET_H_GRC (FLD (f_rn
), opval
);
2361 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2369 /* lds-fpul-compact: lds $rn, fpul */
2372 SEM_FN_NAME (sh64_compact
,lds_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2374 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2375 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2376 int UNUSED written
= 0;
2377 IADDR UNUSED pc
= abuf
->addr
;
2378 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2381 SF opval
= SUBWORDSISF (GET_H_GRC (FLD (f_rn
)));
2382 CPU (h_fr
[((UINT
) 32)]) = opval
;
2383 TRACE_RESULT (current_cpu
, abuf
, "fpul", 'f', opval
);
2390 /* ldsl-fpul-compact: lds.l @${rn}+, fpul */
2393 SEM_FN_NAME (sh64_compact
,ldsl_fpul_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);
2403 SF opval
= GETMEMSF (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2404 CPU (h_fr
[((UINT
) 32)]) = opval
;
2405 TRACE_RESULT (current_cpu
, abuf
, "fpul", 'f', opval
);
2408 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2409 SET_H_GRC (FLD (f_rn
), opval
);
2410 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2418 /* lds-mach-compact: lds $rn, mach */
2421 SEM_FN_NAME (sh64_compact
,lds_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2423 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2424 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2425 int UNUSED written
= 0;
2426 IADDR UNUSED pc
= abuf
->addr
;
2427 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2430 SI opval
= GET_H_GRC (FLD (f_rn
));
2432 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2439 /* ldsl-mach-compact: lds.l @${rn}+, mach */
2442 SEM_FN_NAME (sh64_compact
,ldsl_mach_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);
2452 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2454 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2457 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2458 SET_H_GRC (FLD (f_rn
), opval
);
2459 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2467 /* lds-macl-compact: lds $rn, macl */
2470 SEM_FN_NAME (sh64_compact
,lds_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2472 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2473 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2474 int UNUSED written
= 0;
2475 IADDR UNUSED pc
= abuf
->addr
;
2476 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2479 SI opval
= GET_H_GRC (FLD (f_rn
));
2481 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2488 /* ldsl-macl-compact: lds.l @${rn}+, macl */
2491 SEM_FN_NAME (sh64_compact
,ldsl_macl_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);
2501 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2503 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2506 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2507 SET_H_GRC (FLD (f_rn
), opval
);
2508 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2516 /* lds-pr-compact: lds $rn, pr */
2519 SEM_FN_NAME (sh64_compact
,lds_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2521 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
2522 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2523 int UNUSED written
= 0;
2524 IADDR UNUSED pc
= abuf
->addr
;
2525 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2528 SI opval
= GET_H_GRC (FLD (f_rn
));
2530 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2537 /* ldsl-pr-compact: lds.l @${rn}+, pr */
2540 SEM_FN_NAME (sh64_compact
,ldsl_pr_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);
2550 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2552 TRACE_RESULT (current_cpu
, abuf
, "pr", 'x', opval
);
2555 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2556 SET_H_GRC (FLD (f_rn
), opval
);
2557 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2565 /* macl-compact: mac.l @${rm}+, @${rn}+ */
2568 SEM_FN_NAME (sh64_compact
,macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2570 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2572 int UNUSED written
= 0;
2573 IADDR UNUSED pc
= abuf
->addr
;
2574 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2582 tmp_x
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2584 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2585 SET_H_GRC (FLD (f_rn
), opval
);
2586 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2588 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2591 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 4);
2592 SET_H_GRC (FLD (f_rn
), opval
);
2593 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2596 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2597 SET_H_GRC (FLD (f_rm
), opval
);
2598 written
|= (1 << 11);
2599 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2603 tmp_y
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2605 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
2606 SET_H_GRC (FLD (f_rm
), opval
);
2607 written
|= (1 << 11);
2608 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2610 tmp_tmpry
= MULDI (ZEXTSIDI (tmp_x
), ZEXTSIDI (tmp_y
));
2611 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2612 tmp_result
= ADDDI (tmp_mac
, tmp_tmpry
);
2614 if (GET_H_SBIT ()) {
2618 tmp_max
= SRLDI (INVDI (0), 16);
2619 tmp_min
= SRLDI (INVDI (0), 15);
2620 if (GTDI (tmp_result
, tmp_max
)) {
2621 tmp_result
= tmp_max
;
2623 if (LTDI (tmp_result
, tmp_min
)) {
2624 tmp_result
= tmp_min
;
2630 SI opval
= SUBWORDDISI (tmp_result
, 0);
2632 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2635 SI opval
= SUBWORDDISI (tmp_result
, 1);
2637 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2642 abuf
->written
= written
;
2647 /* macw-compact: mac.w @${rm}+, @${rn}+ */
2650 SEM_FN_NAME (sh64_compact
,macw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2652 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2653 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2654 int UNUSED written
= 0;
2655 IADDR UNUSED pc
= abuf
->addr
;
2656 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2664 tmp_x
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
2666 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2667 SET_H_GRC (FLD (f_rn
), opval
);
2668 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2670 if (EQSI (FLD (f_rn
), FLD (f_rm
))) {
2673 SI opval
= ADDSI (GET_H_GRC (FLD (f_rn
)), 2);
2674 SET_H_GRC (FLD (f_rn
), opval
);
2675 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2678 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2679 SET_H_GRC (FLD (f_rm
), opval
);
2680 written
|= (1 << 11);
2681 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2685 tmp_y
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2687 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
2688 SET_H_GRC (FLD (f_rm
), opval
);
2689 written
|= (1 << 11);
2690 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2692 tmp_tmpry
= MULSI (ZEXTHISI (tmp_x
), ZEXTHISI (tmp_y
));
2693 if (GET_H_SBIT ()) {
2695 if (ADDOFSI (tmp_tmpry
, GET_H_MACL (), 0)) {
2699 written
|= (1 << 9);
2700 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2704 SI opval
= ADDSI (tmp_tmpry
, GET_H_MACL ());
2706 written
|= (1 << 10);
2707 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2712 tmp_mac
= ORDI (SLLDI (ZEXTSIDI (GET_H_MACH ()), 32), ZEXTSIDI (GET_H_MACL ()));
2713 tmp_result
= ADDDI (tmp_mac
, EXTSIDI (tmp_tmpry
));
2715 SI opval
= SUBWORDDISI (tmp_result
, 0);
2717 written
|= (1 << 9);
2718 TRACE_RESULT (current_cpu
, abuf
, "mach", 'x', opval
);
2721 SI opval
= SUBWORDDISI (tmp_result
, 1);
2723 written
|= (1 << 10);
2724 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
2730 abuf
->written
= written
;
2735 /* mov-compact: mov $rm64, $rn64 */
2738 SEM_FN_NAME (sh64_compact
,mov_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2740 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2742 int UNUSED written
= 0;
2743 IADDR UNUSED pc
= abuf
->addr
;
2744 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2747 DI opval
= GET_H_GR (FLD (f_rm
));
2748 SET_H_GR (FLD (f_rn
), opval
);
2749 TRACE_RESULT (current_cpu
, abuf
, "rn64", 'D', opval
);
2756 /* movi-compact: mov #$imm8, $rn */
2759 SEM_FN_NAME (sh64_compact
,movi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2761 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2762 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2763 int UNUSED written
= 0;
2764 IADDR UNUSED pc
= abuf
->addr
;
2765 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2768 SI opval
= EXTQIDI (ANDQI (FLD (f_imm8
), 255));
2769 SET_H_GRC (FLD (f_rn
), opval
);
2770 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2777 /* movb1-compact: mov.b $rm, @$rn */
2780 SEM_FN_NAME (sh64_compact
,movb1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2782 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2783 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2784 int UNUSED written
= 0;
2785 IADDR UNUSED pc
= abuf
->addr
;
2786 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2789 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2790 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
2791 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2798 /* movb2-compact: mov.b $rm, @-$rn */
2801 SEM_FN_NAME (sh64_compact
,movb2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2803 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2804 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2805 int UNUSED written
= 0;
2806 IADDR UNUSED pc
= abuf
->addr
;
2807 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2811 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 1);
2813 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2814 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2815 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2818 SI opval
= tmp_addr
;
2819 SET_H_GRC (FLD (f_rn
), opval
);
2820 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2828 /* movb3-compact: mov.b $rm, @(r0,$rn) */
2831 SEM_FN_NAME (sh64_compact
,movb3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2833 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2835 int UNUSED written
= 0;
2836 IADDR UNUSED pc
= abuf
->addr
;
2837 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2840 UQI opval
= SUBWORDSIUQI (GET_H_GRC (FLD (f_rm
)), 3);
2841 SETMEMUQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
2842 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2849 /* movb4-compact: mov.b r0, @($imm8, gbr) */
2852 SEM_FN_NAME (sh64_compact
,movb4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2854 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2856 int UNUSED written
= 0;
2857 IADDR UNUSED pc
= abuf
->addr
;
2858 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2862 tmp_addr
= ADDSI (GET_H_GBR (), FLD (f_imm8
));
2864 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
2865 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2866 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2874 /* movb5-compact: mov.b r0, @($imm4, $rm) */
2877 SEM_FN_NAME (sh64_compact
,movb5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2879 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
2880 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2881 int UNUSED written
= 0;
2882 IADDR UNUSED pc
= abuf
->addr
;
2883 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2887 tmp_addr
= ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
));
2889 UQI opval
= SUBWORDSIUQI (GET_H_GRC (((UINT
) 0)), 3);
2890 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
2891 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
2899 /* movb6-compact: mov.b @$rm, $rn */
2902 SEM_FN_NAME (sh64_compact
,movb6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2904 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2905 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2906 int UNUSED written
= 0;
2907 IADDR UNUSED pc
= abuf
->addr
;
2908 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2911 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
2912 SET_H_GRC (FLD (f_rn
), opval
);
2913 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2920 /* movb7-compact: mov.b @${rm}+, $rn */
2923 SEM_FN_NAME (sh64_compact
,movb7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2925 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2926 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2927 int UNUSED written
= 0;
2928 IADDR UNUSED pc
= abuf
->addr
;
2929 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2933 tmp_data
= GETMEMQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
2934 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
2936 SI opval
= EXTQISI (tmp_data
);
2937 SET_H_GRC (FLD (f_rm
), opval
);
2938 written
|= (1 << 4);
2939 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2943 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 1);
2944 SET_H_GRC (FLD (f_rm
), opval
);
2945 written
|= (1 << 4);
2946 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
2950 SI opval
= EXTQISI (tmp_data
);
2951 SET_H_GRC (FLD (f_rn
), opval
);
2952 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2956 abuf
->written
= written
;
2961 /* movb8-compact: mov.b @(r0, $rm), $rn */
2964 SEM_FN_NAME (sh64_compact
,movb8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2966 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
2967 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2968 int UNUSED written
= 0;
2969 IADDR UNUSED pc
= abuf
->addr
;
2970 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2973 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
2974 SET_H_GRC (FLD (f_rn
), opval
);
2975 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
2982 /* movb9-compact: mov.b @($imm8, gbr), r0 */
2985 SEM_FN_NAME (sh64_compact
,movb9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2987 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2989 int UNUSED written
= 0;
2990 IADDR UNUSED pc
= abuf
->addr
;
2991 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
2994 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8
))));
2995 SET_H_GRC (((UINT
) 0), opval
);
2996 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3003 /* movb10-compact: mov.b @($imm4, $rm), r0 */
3006 SEM_FN_NAME (sh64_compact
,movb10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3008 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
3009 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3010 int UNUSED written
= 0;
3011 IADDR UNUSED pc
= abuf
->addr
;
3012 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3015 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4
))));
3016 SET_H_GRC (((UINT
) 0), opval
);
3017 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3024 /* movl1-compact: mov.l $rm, @$rn */
3027 SEM_FN_NAME (sh64_compact
,movl1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3029 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3031 int UNUSED written
= 0;
3032 IADDR UNUSED pc
= abuf
->addr
;
3033 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3036 SI opval
= GET_H_GRC (FLD (f_rm
));
3037 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3038 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3045 /* movl2-compact: mov.l $rm, @-$rn */
3048 SEM_FN_NAME (sh64_compact
,movl2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3050 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3051 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3052 int UNUSED written
= 0;
3053 IADDR UNUSED pc
= abuf
->addr
;
3054 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3058 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
3060 SI opval
= GET_H_GRC (FLD (f_rm
));
3061 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3062 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3065 SI opval
= tmp_addr
;
3066 SET_H_GRC (FLD (f_rn
), opval
);
3067 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3075 /* movl3-compact: mov.l $rm, @(r0, $rn) */
3078 SEM_FN_NAME (sh64_compact
,movl3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3080 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3081 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3082 int UNUSED written
= 0;
3083 IADDR UNUSED pc
= abuf
->addr
;
3084 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3087 SI opval
= GET_H_GRC (FLD (f_rm
));
3088 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3089 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3096 /* movl4-compact: mov.l r0, @($imm8x4, gbr) */
3099 SEM_FN_NAME (sh64_compact
,movl4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3101 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3102 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3103 int UNUSED written
= 0;
3104 IADDR UNUSED pc
= abuf
->addr
;
3105 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3108 SI opval
= GET_H_GRC (((UINT
) 0));
3109 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)), opval
);
3110 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3117 /* movl5-compact: mov.l $rm, @($imm4x4, $rn) */
3120 SEM_FN_NAME (sh64_compact
,movl5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3122 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3123 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3124 int UNUSED written
= 0;
3125 IADDR UNUSED pc
= abuf
->addr
;
3126 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3129 SI opval
= GET_H_GRC (FLD (f_rm
));
3130 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm4x4
)), opval
);
3131 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3138 /* movl6-compact: mov.l @$rm, $rn */
3141 SEM_FN_NAME (sh64_compact
,movl6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3143 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3144 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3145 int UNUSED written
= 0;
3146 IADDR UNUSED pc
= abuf
->addr
;
3147 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3150 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3151 SET_H_GRC (FLD (f_rn
), opval
);
3152 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3159 /* movl7-compact: mov.l @${rm}+, $rn */
3162 SEM_FN_NAME (sh64_compact
,movl7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3164 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3165 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3166 int UNUSED written
= 0;
3167 IADDR UNUSED pc
= abuf
->addr
;
3168 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3172 SI opval
= GETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3173 SET_H_GRC (FLD (f_rn
), opval
);
3174 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3176 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3178 SI opval
= GET_H_GRC (FLD (f_rn
));
3179 SET_H_GRC (FLD (f_rm
), opval
);
3180 written
|= (1 << 5);
3181 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
3185 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 4);
3186 SET_H_GRC (FLD (f_rm
), opval
);
3187 written
|= (1 << 5);
3188 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
3193 abuf
->written
= written
;
3198 /* movl8-compact: mov.l @(r0, $rm), $rn */
3201 SEM_FN_NAME (sh64_compact
,movl8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3203 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3204 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3205 int UNUSED written
= 0;
3206 IADDR UNUSED pc
= abuf
->addr
;
3207 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3210 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
))));
3211 SET_H_GRC (FLD (f_rn
), opval
);
3212 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3219 /* movl9-compact: mov.l @($imm8x4, gbr), r0 */
3222 SEM_FN_NAME (sh64_compact
,movl9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3224 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3225 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3226 int UNUSED written
= 0;
3227 IADDR UNUSED pc
= abuf
->addr
;
3228 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3231 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x4
)));
3232 SET_H_GRC (((UINT
) 0), opval
);
3233 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3240 /* movl10-compact: mov.l @($imm8x4, pc), $rn */
3243 SEM_FN_NAME (sh64_compact
,movl10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3245 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3247 int UNUSED written
= 0;
3248 IADDR UNUSED pc
= abuf
->addr
;
3249 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3252 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (FLD (f_imm8x4
), ANDDI (ADDDI (pc
, 4), INVSI (3))));
3253 SET_H_GRC (FLD (f_rn
), opval
);
3254 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3261 /* movl11-compact: mov.l @($imm4x4, $rm), $rn */
3264 SEM_FN_NAME (sh64_compact
,movl11_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3266 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3267 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3268 int UNUSED written
= 0;
3269 IADDR UNUSED pc
= abuf
->addr
;
3270 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3273 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x4
)));
3274 SET_H_GRC (FLD (f_rn
), opval
);
3275 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3282 /* movw1-compact: mov.w $rm, @$rn */
3285 SEM_FN_NAME (sh64_compact
,movw1_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3287 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3288 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3289 int UNUSED written
= 0;
3290 IADDR UNUSED pc
= abuf
->addr
;
3291 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3294 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3295 SETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3296 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3303 /* movw2-compact: mov.w $rm, @-$rn */
3306 SEM_FN_NAME (sh64_compact
,movw2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3308 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3309 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3310 int UNUSED written
= 0;
3311 IADDR UNUSED pc
= abuf
->addr
;
3312 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3316 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 2);
3318 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3319 SETMEMHI (current_cpu
, pc
, tmp_addr
, opval
);
3320 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3323 SI opval
= tmp_addr
;
3324 SET_H_GRC (FLD (f_rn
), opval
);
3325 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3333 /* movw3-compact: mov.w $rm, @(r0, $rn) */
3336 SEM_FN_NAME (sh64_compact
,movw3_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3338 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3339 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3340 int UNUSED written
= 0;
3341 IADDR UNUSED pc
= abuf
->addr
;
3342 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3345 HI opval
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1);
3346 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rn
))), opval
);
3347 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3354 /* movw4-compact: mov.w r0, @($imm8x2, gbr) */
3357 SEM_FN_NAME (sh64_compact
,movw4_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3359 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3360 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3361 int UNUSED written
= 0;
3362 IADDR UNUSED pc
= abuf
->addr
;
3363 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3366 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3367 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
)), opval
);
3368 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3375 /* movw5-compact: mov.w r0, @($imm4x2, $rn) */
3378 SEM_FN_NAME (sh64_compact
,movw5_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3380 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3381 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3382 int UNUSED written
= 0;
3383 IADDR UNUSED pc
= abuf
->addr
;
3384 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3387 HI opval
= SUBWORDSIHI (GET_H_GRC (((UINT
) 0)), 1);
3388 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rn
)), FLD (f_imm4x2
)), opval
);
3389 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3396 /* movw6-compact: mov.w @$rm, $rn */
3399 SEM_FN_NAME (sh64_compact
,movw6_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3401 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3402 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3403 int UNUSED written
= 0;
3404 IADDR UNUSED pc
= abuf
->addr
;
3405 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3408 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
))));
3409 SET_H_GRC (FLD (f_rn
), opval
);
3410 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3417 /* movw7-compact: mov.w @${rm}+, $rn */
3420 SEM_FN_NAME (sh64_compact
,movw7_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3422 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3423 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3424 int UNUSED written
= 0;
3425 IADDR UNUSED pc
= abuf
->addr
;
3426 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3430 tmp_data
= GETMEMHI (current_cpu
, pc
, GET_H_GRC (FLD (f_rm
)));
3431 if (EQSI (FLD (f_rm
), FLD (f_rn
))) {
3433 SI opval
= EXTHISI (tmp_data
);
3434 SET_H_GRC (FLD (f_rm
), opval
);
3435 written
|= (1 << 4);
3436 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
3440 SI opval
= ADDSI (GET_H_GRC (FLD (f_rm
)), 2);
3441 SET_H_GRC (FLD (f_rm
), opval
);
3442 written
|= (1 << 4);
3443 TRACE_RESULT (current_cpu
, abuf
, "rm", 'x', opval
);
3447 SI opval
= EXTHISI (tmp_data
);
3448 SET_H_GRC (FLD (f_rn
), opval
);
3449 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3453 abuf
->written
= written
;
3458 /* movw8-compact: mov.w @(r0, $rm), $rn */
3461 SEM_FN_NAME (sh64_compact
,movw8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3463 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3464 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3465 int UNUSED written
= 0;
3466 IADDR UNUSED pc
= abuf
->addr
;
3467 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3470 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GRC (FLD (f_rm
)))));
3471 SET_H_GRC (FLD (f_rn
), opval
);
3472 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3479 /* movw9-compact: mov.w @($imm8x2, gbr), r0 */
3482 SEM_FN_NAME (sh64_compact
,movw9_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3484 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3485 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3486 int UNUSED written
= 0;
3487 IADDR UNUSED pc
= abuf
->addr
;
3488 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3491 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GBR (), FLD (f_imm8x2
))));
3492 SET_H_GRC (((UINT
) 0), opval
);
3493 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3500 /* movw10-compact: mov.w @($imm8x2, pc), $rn */
3503 SEM_FN_NAME (sh64_compact
,movw10_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3505 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3506 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3507 int UNUSED written
= 0;
3508 IADDR UNUSED pc
= abuf
->addr
;
3509 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3512 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDDI (ADDDI (pc
, 4), FLD (f_imm8x2
))));
3513 SET_H_GRC (FLD (f_rn
), opval
);
3514 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3521 /* movw11-compact: mov.w @($imm4x2, $rm), r0 */
3524 SEM_FN_NAME (sh64_compact
,movw11_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3526 #define FLD(f) abuf->fields.sfmt_movw11_compact.f
3527 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3528 int UNUSED written
= 0;
3529 IADDR UNUSED pc
= abuf
->addr
;
3530 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3533 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GRC (FLD (f_rm
)), FLD (f_imm4x2
))));
3534 SET_H_GRC (((UINT
) 0), opval
);
3535 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3542 /* mova-compact: mova @($imm8x4, pc), r0 */
3545 SEM_FN_NAME (sh64_compact
,mova_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3547 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3548 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3549 int UNUSED written
= 0;
3550 IADDR UNUSED pc
= abuf
->addr
;
3551 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3554 SI opval
= ADDDI (ANDDI (ADDDI (pc
, 4), INVSI (3)), FLD (f_imm8x4
));
3555 SET_H_GRC (((UINT
) 0), opval
);
3556 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3563 /* movcal-compact: movca.l r0, @$rn */
3566 SEM_FN_NAME (sh64_compact
,movcal_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3568 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3569 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3570 int UNUSED written
= 0;
3571 IADDR UNUSED pc
= abuf
->addr
;
3572 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3575 SI opval
= GET_H_GRC (((UINT
) 0));
3576 SETMEMSI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
3577 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3584 /* movt-compact: movt $rn */
3587 SEM_FN_NAME (sh64_compact
,movt_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3589 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3590 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3591 int UNUSED written
= 0;
3592 IADDR UNUSED pc
= abuf
->addr
;
3593 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3596 SI opval
= ZEXTBISI (GET_H_TBIT ());
3597 SET_H_GRC (FLD (f_rn
), opval
);
3598 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3605 /* mull-compact: mul.l $rm, $rn */
3608 SEM_FN_NAME (sh64_compact
,mull_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3610 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3611 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3612 int UNUSED written
= 0;
3613 IADDR UNUSED pc
= abuf
->addr
;
3614 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3617 SI opval
= MULSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
)));
3619 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3626 /* mulsw-compact: muls.w $rm, $rn */
3629 SEM_FN_NAME (sh64_compact
,mulsw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3631 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3632 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3633 int UNUSED written
= 0;
3634 IADDR UNUSED pc
= abuf
->addr
;
3635 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3638 SI opval
= MULSI (EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), EXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3640 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3647 /* muluw-compact: mulu.w $rm, $rn */
3650 SEM_FN_NAME (sh64_compact
,muluw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3652 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3653 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3654 int UNUSED written
= 0;
3655 IADDR UNUSED pc
= abuf
->addr
;
3656 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3659 SI opval
= MULSI (ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 1)), ZEXTHISI (SUBWORDSIHI (GET_H_GRC (FLD (f_rn
)), 1)));
3661 TRACE_RESULT (current_cpu
, abuf
, "macl", 'x', opval
);
3668 /* neg-compact: neg $rm, $rn */
3671 SEM_FN_NAME (sh64_compact
,neg_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3673 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3674 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3675 int UNUSED written
= 0;
3676 IADDR UNUSED pc
= abuf
->addr
;
3677 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3680 SI opval
= NEGSI (GET_H_GRC (FLD (f_rm
)));
3681 SET_H_GRC (FLD (f_rn
), opval
);
3682 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3689 /* negc-compact: negc $rm, $rn */
3692 SEM_FN_NAME (sh64_compact
,negc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3694 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3695 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3696 int UNUSED written
= 0;
3697 IADDR UNUSED pc
= abuf
->addr
;
3698 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3702 tmp_flag
= SUBCFSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3704 SI opval
= SUBCSI (0, GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
3705 SET_H_GRC (FLD (f_rn
), opval
);
3706 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3709 BI opval
= tmp_flag
;
3711 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3719 /* nop-compact: nop */
3722 SEM_FN_NAME (sh64_compact
,nop_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3724 #define FLD(f) abuf->fields.fmt_empty.f
3725 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3726 int UNUSED written
= 0;
3727 IADDR UNUSED pc
= abuf
->addr
;
3728 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3736 /* not-compact: not $rm64, $rn64 */
3739 SEM_FN_NAME (sh64_compact
,not_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3741 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3742 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3743 int UNUSED written
= 0;
3744 IADDR UNUSED pc
= abuf
->addr
;
3745 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3748 DI opval
= INVDI (GET_H_GR (FLD (f_rm
)));
3749 SET_H_GR (FLD (f_rn
), opval
);
3750 TRACE_RESULT (current_cpu
, abuf
, "rn64", 'D', opval
);
3757 /* ocbi-compact: ocbi @$rn */
3760 SEM_FN_NAME (sh64_compact
,ocbi_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3762 #define FLD(f) abuf->fields.fmt_empty.f
3763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3764 int UNUSED written
= 0;
3765 IADDR UNUSED pc
= abuf
->addr
;
3766 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3774 /* ocbp-compact: ocbp @$rn */
3777 SEM_FN_NAME (sh64_compact
,ocbp_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3779 #define FLD(f) abuf->fields.fmt_empty.f
3780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3781 int UNUSED written
= 0;
3782 IADDR UNUSED pc
= abuf
->addr
;
3783 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3791 /* ocbwb-compact: ocbwb @$rn */
3794 SEM_FN_NAME (sh64_compact
,ocbwb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3796 #define FLD(f) abuf->fields.fmt_empty.f
3797 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3798 int UNUSED written
= 0;
3799 IADDR UNUSED pc
= abuf
->addr
;
3800 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3808 /* or-compact: or $rm64, $rn64 */
3811 SEM_FN_NAME (sh64_compact
,or_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3813 #define FLD(f) abuf->fields.sfmt_movl5_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 DI opval
= ORDI (GET_H_GR (FLD (f_rm
)), GET_H_GR (FLD (f_rn
)));
3821 SET_H_GR (FLD (f_rn
), opval
);
3822 TRACE_RESULT (current_cpu
, abuf
, "rn64", 'D', opval
);
3829 /* ori-compact: or #$uimm8, r0 */
3832 SEM_FN_NAME (sh64_compact
,ori_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3834 #define FLD(f) abuf->fields.sfmt_addi_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
= ORSI (GET_H_GRC (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
3842 SET_H_GRC (((UINT
) 0), opval
);
3843 TRACE_RESULT (current_cpu
, abuf
, "r0", 'x', opval
);
3850 /* orb-compact: or.b #$imm8, @(r0, gbr) */
3853 SEM_FN_NAME (sh64_compact
,orb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3855 #define FLD(f) abuf->fields.sfmt_addi_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);
3864 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
3865 tmp_data
= ORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
3867 UQI opval
= tmp_data
;
3868 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
3869 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3877 /* pref-compact: pref @$rn */
3880 SEM_FN_NAME (sh64_compact
,pref_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3882 #define FLD(f) abuf->fields.fmt_empty.f
3883 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3884 int UNUSED written
= 0;
3885 IADDR UNUSED pc
= abuf
->addr
;
3886 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3894 /* rotcl-compact: rotcl $rn */
3897 SEM_FN_NAME (sh64_compact
,rotcl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3899 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3900 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3901 int UNUSED written
= 0;
3902 IADDR UNUSED pc
= abuf
->addr
;
3903 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3907 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
3909 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), GET_H_TBIT ());
3910 SET_H_GRC (FLD (f_rn
), opval
);
3911 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3914 BI opval
= ((tmp_temp
) ? (1) : (0));
3916 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3924 /* rotcr-compact: rotcr $rn */
3927 SEM_FN_NAME (sh64_compact
,rotcr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3929 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3930 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3931 int UNUSED written
= 0;
3932 IADDR UNUSED pc
= abuf
->addr
;
3933 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3938 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
3939 tmp_temp
= GET_H_TBIT ();
3941 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
3942 SET_H_GRC (FLD (f_rn
), opval
);
3943 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3946 BI opval
= ((tmp_lsbit
) ? (1) : (0));
3948 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3956 /* rotl-compact: rotl $rn */
3959 SEM_FN_NAME (sh64_compact
,rotl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3961 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3962 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3963 int UNUSED written
= 0;
3964 IADDR UNUSED pc
= abuf
->addr
;
3965 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
3969 tmp_temp
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
3971 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rn
)), 1), tmp_temp
);
3972 SET_H_GRC (FLD (f_rn
), opval
);
3973 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
3976 BI opval
= ((tmp_temp
) ? (1) : (0));
3978 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
3986 /* rotr-compact: rotr $rn */
3989 SEM_FN_NAME (sh64_compact
,rotr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3991 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3992 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3993 int UNUSED written
= 0;
3994 IADDR UNUSED pc
= abuf
->addr
;
3995 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4000 tmp_lsbit
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rn
)), 1), 0)) ? (0) : (1));
4001 tmp_temp
= tmp_lsbit
;
4003 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rn
)), 1), SLLSI (tmp_temp
, 31));
4004 SET_H_GRC (FLD (f_rn
), opval
);
4005 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4008 BI opval
= ((tmp_lsbit
) ? (1) : (0));
4010 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4018 /* rts-compact: rts */
4021 SEM_FN_NAME (sh64_compact
,rts_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4023 #define FLD(f) abuf->fields.fmt_empty.f
4024 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4025 int UNUSED written
= 0;
4026 IADDR UNUSED pc
= abuf
->addr
;
4028 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4032 UDI opval
= GET_H_PR ();
4033 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
4034 TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
4038 SEM_BRANCH_FINI (vpc
);
4043 /* sets-compact: sets */
4046 SEM_FN_NAME (sh64_compact
,sets_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4048 #define FLD(f) abuf->fields.fmt_empty.f
4049 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4050 int UNUSED written
= 0;
4051 IADDR UNUSED pc
= abuf
->addr
;
4052 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4057 TRACE_RESULT (current_cpu
, abuf
, "sbit", 'x', opval
);
4064 /* sett-compact: sett */
4067 SEM_FN_NAME (sh64_compact
,sett_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4069 #define FLD(f) abuf->fields.fmt_empty.f
4070 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4071 int UNUSED written
= 0;
4072 IADDR UNUSED pc
= abuf
->addr
;
4073 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4078 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4085 /* shad-compact: shad $rm, $rn */
4088 SEM_FN_NAME (sh64_compact
,shad_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4090 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4091 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4092 int UNUSED written
= 0;
4093 IADDR UNUSED pc
= abuf
->addr
;
4094 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4098 tmp_shamt
= ANDQI (GET_H_GRC (FLD (f_rm
)), 31);
4099 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4101 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4102 SET_H_GRC (FLD (f_rn
), opval
);
4103 written
|= (1 << 3);
4104 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4107 if (NEQI (tmp_shamt
, 0)) {
4109 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4110 SET_H_GRC (FLD (f_rn
), opval
);
4111 written
|= (1 << 3);
4112 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4115 if (LTSI (GET_H_GRC (FLD (f_rn
)), 0)) {
4117 SI opval
= NEGSI (1);
4118 SET_H_GRC (FLD (f_rn
), opval
);
4119 written
|= (1 << 3);
4120 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4125 SET_H_GRC (FLD (f_rn
), opval
);
4126 written
|= (1 << 3);
4127 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4134 abuf
->written
= written
;
4139 /* shal-compact: shal $rn */
4142 SEM_FN_NAME (sh64_compact
,shal_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4144 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4145 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4146 int UNUSED written
= 0;
4147 IADDR UNUSED pc
= abuf
->addr
;
4148 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4152 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4154 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4155 SET_H_GRC (FLD (f_rn
), opval
);
4156 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4159 BI opval
= ((tmp_t
) ? (1) : (0));
4161 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4169 /* shar-compact: shar $rn */
4172 SEM_FN_NAME (sh64_compact
,shar_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4174 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4175 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4176 int UNUSED written
= 0;
4177 IADDR UNUSED pc
= abuf
->addr
;
4178 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4182 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4184 SI opval
= SRASI (GET_H_GRC (FLD (f_rn
)), 1);
4185 SET_H_GRC (FLD (f_rn
), opval
);
4186 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4189 BI opval
= ((tmp_t
) ? (1) : (0));
4191 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4199 /* shld-compact: shld $rm, $rn */
4202 SEM_FN_NAME (sh64_compact
,shld_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4204 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4206 int UNUSED written
= 0;
4207 IADDR UNUSED pc
= abuf
->addr
;
4208 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4212 tmp_shamt
= ANDQI (GET_H_GRC (FLD (f_rm
)), 31);
4213 if (GESI (GET_H_GRC (FLD (f_rm
)), 0)) {
4215 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), tmp_shamt
);
4216 SET_H_GRC (FLD (f_rn
), opval
);
4217 written
|= (1 << 3);
4218 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4221 if (NEQI (tmp_shamt
, 0)) {
4223 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), SUBSI (32, tmp_shamt
));
4224 SET_H_GRC (FLD (f_rn
), opval
);
4225 written
|= (1 << 3);
4226 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4231 SET_H_GRC (FLD (f_rn
), opval
);
4232 written
|= (1 << 3);
4233 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4239 abuf
->written
= written
;
4244 /* shll-compact: shll $rn */
4247 SEM_FN_NAME (sh64_compact
,shll_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4249 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4250 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4251 int UNUSED written
= 0;
4252 IADDR UNUSED pc
= abuf
->addr
;
4253 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4257 tmp_t
= SRLSI (GET_H_GRC (FLD (f_rn
)), 31);
4259 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 1);
4260 SET_H_GRC (FLD (f_rn
), opval
);
4261 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4264 BI opval
= ((tmp_t
) ? (1) : (0));
4266 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4274 /* shll2-compact: shll2 $rn */
4277 SEM_FN_NAME (sh64_compact
,shll2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4279 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4280 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4281 int UNUSED written
= 0;
4282 IADDR UNUSED pc
= abuf
->addr
;
4283 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4286 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 2);
4287 SET_H_GRC (FLD (f_rn
), opval
);
4288 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4295 /* shll8-compact: shll8 $rn */
4298 SEM_FN_NAME (sh64_compact
,shll8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4300 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4301 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4302 int UNUSED written
= 0;
4303 IADDR UNUSED pc
= abuf
->addr
;
4304 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4307 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 8);
4308 SET_H_GRC (FLD (f_rn
), opval
);
4309 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4316 /* shll16-compact: shll16 $rn */
4319 SEM_FN_NAME (sh64_compact
,shll16_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4321 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4322 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4323 int UNUSED written
= 0;
4324 IADDR UNUSED pc
= abuf
->addr
;
4325 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4328 SI opval
= SLLSI (GET_H_GRC (FLD (f_rn
)), 16);
4329 SET_H_GRC (FLD (f_rn
), opval
);
4330 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4337 /* shlr-compact: shlr $rn */
4340 SEM_FN_NAME (sh64_compact
,shlr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4342 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4343 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4344 int UNUSED written
= 0;
4345 IADDR UNUSED pc
= abuf
->addr
;
4346 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4350 tmp_t
= ANDSI (GET_H_GRC (FLD (f_rn
)), 1);
4352 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 1);
4353 SET_H_GRC (FLD (f_rn
), opval
);
4354 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4357 BI opval
= ((tmp_t
) ? (1) : (0));
4359 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4367 /* shlr2-compact: shlr2 $rn */
4370 SEM_FN_NAME (sh64_compact
,shlr2_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4372 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4373 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4374 int UNUSED written
= 0;
4375 IADDR UNUSED pc
= abuf
->addr
;
4376 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4379 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 2);
4380 SET_H_GRC (FLD (f_rn
), opval
);
4381 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4388 /* shlr8-compact: shlr8 $rn */
4391 SEM_FN_NAME (sh64_compact
,shlr8_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4393 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4394 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4395 int UNUSED written
= 0;
4396 IADDR UNUSED pc
= abuf
->addr
;
4397 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4400 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 8);
4401 SET_H_GRC (FLD (f_rn
), opval
);
4402 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4409 /* shlr16-compact: shlr16 $rn */
4412 SEM_FN_NAME (sh64_compact
,shlr16_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4414 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4415 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4416 int UNUSED written
= 0;
4417 IADDR UNUSED pc
= abuf
->addr
;
4418 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4421 SI opval
= SRLSI (GET_H_GRC (FLD (f_rn
)), 16);
4422 SET_H_GRC (FLD (f_rn
), opval
);
4423 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4430 /* stc-gbr-compact: stc gbr, $rn */
4433 SEM_FN_NAME (sh64_compact
,stc_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4435 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4436 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4437 int UNUSED written
= 0;
4438 IADDR UNUSED pc
= abuf
->addr
;
4439 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4442 SI opval
= GET_H_GBR ();
4443 SET_H_GRC (FLD (f_rn
), opval
);
4444 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4451 /* stcl-gbr-compact: stc.l gbr, @-$rn */
4454 SEM_FN_NAME (sh64_compact
,stcl_gbr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4456 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4457 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4458 int UNUSED written
= 0;
4459 IADDR UNUSED pc
= abuf
->addr
;
4460 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4464 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4466 SI opval
= GET_H_GBR ();
4467 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4468 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4471 SI opval
= tmp_addr
;
4472 SET_H_GRC (FLD (f_rn
), opval
);
4473 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4481 /* sts-fpscr-compact: sts fpscr, $rn */
4484 SEM_FN_NAME (sh64_compact
,sts_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4486 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4487 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4488 int UNUSED written
= 0;
4489 IADDR UNUSED pc
= abuf
->addr
;
4490 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4493 SI opval
= GET_H_FPCCR ();
4494 SET_H_GRC (FLD (f_rn
), opval
);
4495 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4502 /* stsl-fpscr-compact: sts.l fpscr, @-$rn */
4505 SEM_FN_NAME (sh64_compact
,stsl_fpscr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4507 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4508 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4509 int UNUSED written
= 0;
4510 IADDR UNUSED pc
= abuf
->addr
;
4511 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4515 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4517 SI opval
= GET_H_FPCCR ();
4518 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4519 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4522 SI opval
= tmp_addr
;
4523 SET_H_GRC (FLD (f_rn
), opval
);
4524 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4532 /* sts-fpul-compact: sts fpul, $rn */
4535 SEM_FN_NAME (sh64_compact
,sts_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4537 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4539 int UNUSED written
= 0;
4540 IADDR UNUSED pc
= abuf
->addr
;
4541 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4544 SI opval
= SUBWORDSFSI (CPU (h_fr
[((UINT
) 32)]));
4545 SET_H_GRC (FLD (f_rn
), opval
);
4546 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4553 /* stsl-fpul-compact: sts.l fpul, @-$rn */
4556 SEM_FN_NAME (sh64_compact
,stsl_fpul_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4558 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4559 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4560 int UNUSED written
= 0;
4561 IADDR UNUSED pc
= abuf
->addr
;
4562 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4566 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4568 SF opval
= CPU (h_fr
[((UINT
) 32)]);
4569 SETMEMSF (current_cpu
, pc
, tmp_addr
, opval
);
4570 TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
4573 SI opval
= tmp_addr
;
4574 SET_H_GRC (FLD (f_rn
), opval
);
4575 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4583 /* sts-mach-compact: sts mach, $rn */
4586 SEM_FN_NAME (sh64_compact
,sts_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4588 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4589 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4590 int UNUSED written
= 0;
4591 IADDR UNUSED pc
= abuf
->addr
;
4592 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4595 SI opval
= GET_H_MACH ();
4596 SET_H_GRC (FLD (f_rn
), opval
);
4597 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4604 /* stsl-mach-compact: sts.l mach, @-$rn */
4607 SEM_FN_NAME (sh64_compact
,stsl_mach_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4609 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4610 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4611 int UNUSED written
= 0;
4612 IADDR UNUSED pc
= abuf
->addr
;
4613 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4617 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4619 SI opval
= GET_H_MACH ();
4620 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4621 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4624 SI opval
= tmp_addr
;
4625 SET_H_GRC (FLD (f_rn
), opval
);
4626 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4634 /* sts-macl-compact: sts macl, $rn */
4637 SEM_FN_NAME (sh64_compact
,sts_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4639 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4640 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4641 int UNUSED written
= 0;
4642 IADDR UNUSED pc
= abuf
->addr
;
4643 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4646 SI opval
= GET_H_MACL ();
4647 SET_H_GRC (FLD (f_rn
), opval
);
4648 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4655 /* stsl-macl-compact: sts.l macl, @-$rn */
4658 SEM_FN_NAME (sh64_compact
,stsl_macl_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4660 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4661 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4662 int UNUSED written
= 0;
4663 IADDR UNUSED pc
= abuf
->addr
;
4664 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4668 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4670 SI opval
= GET_H_MACL ();
4671 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4672 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4675 SI opval
= tmp_addr
;
4676 SET_H_GRC (FLD (f_rn
), opval
);
4677 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4685 /* sts-pr-compact: sts pr, $rn */
4688 SEM_FN_NAME (sh64_compact
,sts_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4690 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4691 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4692 int UNUSED written
= 0;
4693 IADDR UNUSED pc
= abuf
->addr
;
4694 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4697 SI opval
= GET_H_PR ();
4698 SET_H_GRC (FLD (f_rn
), opval
);
4699 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4706 /* stsl-pr-compact: sts.l pr, @-$rn */
4709 SEM_FN_NAME (sh64_compact
,stsl_pr_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4711 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4712 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4713 int UNUSED written
= 0;
4714 IADDR UNUSED pc
= abuf
->addr
;
4715 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4719 tmp_addr
= SUBSI (GET_H_GRC (FLD (f_rn
)), 4);
4721 SI opval
= GET_H_PR ();
4722 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
4723 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4726 SI opval
= tmp_addr
;
4727 SET_H_GRC (FLD (f_rn
), opval
);
4728 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4736 /* sub-compact: sub $rm, $rn */
4739 SEM_FN_NAME (sh64_compact
,sub_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4741 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4742 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4743 int UNUSED written
= 0;
4744 IADDR UNUSED pc
= abuf
->addr
;
4745 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4748 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
4749 SET_H_GRC (FLD (f_rn
), opval
);
4750 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4757 /* subc-compact: subc $rm, $rn */
4760 SEM_FN_NAME (sh64_compact
,subc_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4762 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4764 int UNUSED written
= 0;
4765 IADDR UNUSED pc
= abuf
->addr
;
4766 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4770 tmp_flag
= SUBCFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
4772 SI opval
= SUBCSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), GET_H_TBIT ());
4773 SET_H_GRC (FLD (f_rn
), opval
);
4774 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4777 BI opval
= tmp_flag
;
4779 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4787 /* subv-compact: subv $rm, $rn */
4790 SEM_FN_NAME (sh64_compact
,subv_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4792 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4793 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4794 int UNUSED written
= 0;
4795 IADDR UNUSED pc
= abuf
->addr
;
4796 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4800 tmp_t
= SUBOFSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)), 0);
4802 SI opval
= SUBSI (GET_H_GRC (FLD (f_rn
)), GET_H_GRC (FLD (f_rm
)));
4803 SET_H_GRC (FLD (f_rn
), opval
);
4804 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4807 BI opval
= ((tmp_t
) ? (1) : (0));
4809 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4817 /* swapb-compact: swap.b $rm, $rn */
4820 SEM_FN_NAME (sh64_compact
,swapb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4822 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4823 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4824 int UNUSED written
= 0;
4825 IADDR UNUSED pc
= abuf
->addr
;
4826 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4832 tmp_top_half
= SUBWORDSIHI (GET_H_GRC (FLD (f_rm
)), 0);
4833 tmp_byte1
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 2);
4834 tmp_byte0
= SUBWORDSIQI (GET_H_GRC (FLD (f_rm
)), 3);
4836 SI opval
= ORSI (SLLSI (tmp_top_half
, 16), ORSI (SLLSI (tmp_byte0
, 8), tmp_byte1
));
4837 SET_H_GRC (FLD (f_rn
), opval
);
4838 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4846 /* swapw-compact: swap.w $rm, $rn */
4849 SEM_FN_NAME (sh64_compact
,swapw_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4851 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4852 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4853 int UNUSED written
= 0;
4854 IADDR UNUSED pc
= abuf
->addr
;
4855 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4858 SI opval
= ORSI (SRLSI (GET_H_GRC (FLD (f_rm
)), 16), SLLSI (GET_H_GRC (FLD (f_rm
)), 16));
4859 SET_H_GRC (FLD (f_rn
), opval
);
4860 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
4867 /* tasb-compact: tas.b @$rn */
4870 SEM_FN_NAME (sh64_compact
,tasb_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);
4880 tmp_byte
= GETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)));
4882 BI opval
= ((EQQI (tmp_byte
, 0)) ? (1) : (0));
4884 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4886 tmp_byte
= ORQI (tmp_byte
, 128);
4888 UQI opval
= tmp_byte
;
4889 SETMEMUQI (current_cpu
, pc
, GET_H_GRC (FLD (f_rn
)), opval
);
4890 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4898 /* trapa-compact: trapa #$uimm8 */
4901 SEM_FN_NAME (sh64_compact
,trapa_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4903 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4904 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4905 int UNUSED written
= 0;
4906 IADDR UNUSED pc
= abuf
->addr
;
4907 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4909 sh64_compact_trapa (current_cpu
, FLD (f_imm8
), pc
);
4915 /* tst-compact: tst $rm, $rn */
4918 SEM_FN_NAME (sh64_compact
,tst_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4920 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4921 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4922 int UNUSED written
= 0;
4923 IADDR UNUSED pc
= abuf
->addr
;
4924 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4927 BI opval
= ((EQSI (ANDSI (GET_H_GRC (FLD (f_rm
)), GET_H_GRC (FLD (f_rn
))), 0)) ? (1) : (0));
4929 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4936 /* tsti-compact: tst #$uimm8, r0 */
4939 SEM_FN_NAME (sh64_compact
,tsti_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4941 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4943 int UNUSED written
= 0;
4944 IADDR UNUSED pc
= abuf
->addr
;
4945 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4948 BI opval
= ((EQSI (ANDSI (GET_H_GRC (((UINT
) 0)), ZEXTSISI (FLD (f_imm8
))), 0)) ? (1) : (0));
4950 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4957 /* tstb-compact: tst.b #$imm8, @(r0, gbr) */
4960 SEM_FN_NAME (sh64_compact
,tstb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4962 #define FLD(f) abuf->fields.sfmt_addi_compact.f
4963 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4964 int UNUSED written
= 0;
4965 IADDR UNUSED pc
= abuf
->addr
;
4966 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4970 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
4972 BI opval
= ((EQQI (ANDQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
)), 0)) ? (1) : (0));
4974 TRACE_RESULT (current_cpu
, abuf
, "tbit", 'x', opval
);
4982 /* xor-compact: xor $rm64, $rn64 */
4985 SEM_FN_NAME (sh64_compact
,xor_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4987 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
4988 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4989 int UNUSED written
= 0;
4990 IADDR UNUSED pc
= abuf
->addr
;
4991 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
4994 DI opval
= XORDI (GET_H_GR (FLD (f_rn
)), GET_H_GR (FLD (f_rm
)));
4995 SET_H_GR (FLD (f_rn
), opval
);
4996 TRACE_RESULT (current_cpu
, abuf
, "rn64", 'D', opval
);
5003 /* xori-compact: xor #$uimm8, r0 */
5006 SEM_FN_NAME (sh64_compact
,xori_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5008 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5009 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5010 int UNUSED written
= 0;
5011 IADDR UNUSED pc
= abuf
->addr
;
5012 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5015 DI opval
= XORDI (GET_H_GR (((UINT
) 0)), ZEXTSIDI (FLD (f_imm8
)));
5016 SET_H_GR (((UINT
) 0), opval
);
5017 TRACE_RESULT (current_cpu
, abuf
, "gr-0", 'D', opval
);
5024 /* xorb-compact: xor.b #$imm8, @(r0, gbr) */
5027 SEM_FN_NAME (sh64_compact
,xorb_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5029 #define FLD(f) abuf->fields.sfmt_addi_compact.f
5030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5031 int UNUSED written
= 0;
5032 IADDR UNUSED pc
= abuf
->addr
;
5033 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5038 tmp_addr
= ADDSI (GET_H_GRC (((UINT
) 0)), GET_H_GBR ());
5039 tmp_data
= XORQI (GETMEMUQI (current_cpu
, pc
, tmp_addr
), FLD (f_imm8
));
5041 UQI opval
= tmp_data
;
5042 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5043 TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5051 /* xtrct-compact: xtrct $rm, $rn */
5054 SEM_FN_NAME (sh64_compact
,xtrct_compact
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5056 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
5057 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5058 int UNUSED written
= 0;
5059 IADDR UNUSED pc
= abuf
->addr
;
5060 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 2);
5063 SI opval
= ORSI (SLLSI (GET_H_GRC (FLD (f_rm
)), 16), SRLSI (GET_H_GRC (FLD (f_rn
)), 16));
5064 SET_H_GRC (FLD (f_rn
), opval
);
5065 TRACE_RESULT (current_cpu
, abuf
, "rn", 'x', opval
);
5072 /* Table of all semantic fns. */
5074 static const struct sem_fn_desc sem_fns
[] = {
5075 { SH64_COMPACT_INSN_X_INVALID
, SEM_FN_NAME (sh64_compact
,x_invalid
) },
5076 { SH64_COMPACT_INSN_X_AFTER
, SEM_FN_NAME (sh64_compact
,x_after
) },
5077 { SH64_COMPACT_INSN_X_BEFORE
, SEM_FN_NAME (sh64_compact
,x_before
) },
5078 { SH64_COMPACT_INSN_X_CTI_CHAIN
, SEM_FN_NAME (sh64_compact
,x_cti_chain
) },
5079 { SH64_COMPACT_INSN_X_CHAIN
, SEM_FN_NAME (sh64_compact
,x_chain
) },
5080 { SH64_COMPACT_INSN_X_BEGIN
, SEM_FN_NAME (sh64_compact
,x_begin
) },
5081 { SH64_COMPACT_INSN_ADD_COMPACT
, SEM_FN_NAME (sh64_compact
,add_compact
) },
5082 { SH64_COMPACT_INSN_ADDI_COMPACT
, SEM_FN_NAME (sh64_compact
,addi_compact
) },
5083 { SH64_COMPACT_INSN_ADDC_COMPACT
, SEM_FN_NAME (sh64_compact
,addc_compact
) },
5084 { SH64_COMPACT_INSN_ADDV_COMPACT
, SEM_FN_NAME (sh64_compact
,addv_compact
) },
5085 { SH64_COMPACT_INSN_AND_COMPACT
, SEM_FN_NAME (sh64_compact
,and_compact
) },
5086 { SH64_COMPACT_INSN_ANDI_COMPACT
, SEM_FN_NAME (sh64_compact
,andi_compact
) },
5087 { SH64_COMPACT_INSN_ANDB_COMPACT
, SEM_FN_NAME (sh64_compact
,andb_compact
) },
5088 { SH64_COMPACT_INSN_BF_COMPACT
, SEM_FN_NAME (sh64_compact
,bf_compact
) },
5089 { SH64_COMPACT_INSN_BFS_COMPACT
, SEM_FN_NAME (sh64_compact
,bfs_compact
) },
5090 { SH64_COMPACT_INSN_BRA_COMPACT
, SEM_FN_NAME (sh64_compact
,bra_compact
) },
5091 { SH64_COMPACT_INSN_BRAF_COMPACT
, SEM_FN_NAME (sh64_compact
,braf_compact
) },
5092 { SH64_COMPACT_INSN_BRK_COMPACT
, SEM_FN_NAME (sh64_compact
,brk_compact
) },
5093 { SH64_COMPACT_INSN_BSR_COMPACT
, SEM_FN_NAME (sh64_compact
,bsr_compact
) },
5094 { SH64_COMPACT_INSN_BSRF_COMPACT
, SEM_FN_NAME (sh64_compact
,bsrf_compact
) },
5095 { SH64_COMPACT_INSN_BT_COMPACT
, SEM_FN_NAME (sh64_compact
,bt_compact
) },
5096 { SH64_COMPACT_INSN_BTS_COMPACT
, SEM_FN_NAME (sh64_compact
,bts_compact
) },
5097 { SH64_COMPACT_INSN_CLRMAC_COMPACT
, SEM_FN_NAME (sh64_compact
,clrmac_compact
) },
5098 { SH64_COMPACT_INSN_CLRS_COMPACT
, SEM_FN_NAME (sh64_compact
,clrs_compact
) },
5099 { SH64_COMPACT_INSN_CLRT_COMPACT
, SEM_FN_NAME (sh64_compact
,clrt_compact
) },
5100 { SH64_COMPACT_INSN_CMPEQ_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpeq_compact
) },
5101 { SH64_COMPACT_INSN_CMPEQI_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpeqi_compact
) },
5102 { SH64_COMPACT_INSN_CMPGE_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpge_compact
) },
5103 { SH64_COMPACT_INSN_CMPGT_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpgt_compact
) },
5104 { SH64_COMPACT_INSN_CMPHI_COMPACT
, SEM_FN_NAME (sh64_compact
,cmphi_compact
) },
5105 { SH64_COMPACT_INSN_CMPHS_COMPACT
, SEM_FN_NAME (sh64_compact
,cmphs_compact
) },
5106 { SH64_COMPACT_INSN_CMPPL_COMPACT
, SEM_FN_NAME (sh64_compact
,cmppl_compact
) },
5107 { SH64_COMPACT_INSN_CMPPZ_COMPACT
, SEM_FN_NAME (sh64_compact
,cmppz_compact
) },
5108 { SH64_COMPACT_INSN_CMPSTR_COMPACT
, SEM_FN_NAME (sh64_compact
,cmpstr_compact
) },
5109 { SH64_COMPACT_INSN_DIV0S_COMPACT
, SEM_FN_NAME (sh64_compact
,div0s_compact
) },
5110 { SH64_COMPACT_INSN_DIV0U_COMPACT
, SEM_FN_NAME (sh64_compact
,div0u_compact
) },
5111 { SH64_COMPACT_INSN_DIV1_COMPACT
, SEM_FN_NAME (sh64_compact
,div1_compact
) },
5112 { SH64_COMPACT_INSN_DMULSL_COMPACT
, SEM_FN_NAME (sh64_compact
,dmulsl_compact
) },
5113 { SH64_COMPACT_INSN_DMULUL_COMPACT
, SEM_FN_NAME (sh64_compact
,dmulul_compact
) },
5114 { SH64_COMPACT_INSN_DT_COMPACT
, SEM_FN_NAME (sh64_compact
,dt_compact
) },
5115 { SH64_COMPACT_INSN_EXTSB_COMPACT
, SEM_FN_NAME (sh64_compact
,extsb_compact
) },
5116 { SH64_COMPACT_INSN_EXTSW_COMPACT
, SEM_FN_NAME (sh64_compact
,extsw_compact
) },
5117 { SH64_COMPACT_INSN_EXTUB_COMPACT
, SEM_FN_NAME (sh64_compact
,extub_compact
) },
5118 { SH64_COMPACT_INSN_EXTUW_COMPACT
, SEM_FN_NAME (sh64_compact
,extuw_compact
) },
5119 { SH64_COMPACT_INSN_FABS_COMPACT
, SEM_FN_NAME (sh64_compact
,fabs_compact
) },
5120 { SH64_COMPACT_INSN_FADD_COMPACT
, SEM_FN_NAME (sh64_compact
,fadd_compact
) },
5121 { SH64_COMPACT_INSN_FCMPEQ_COMPACT
, SEM_FN_NAME (sh64_compact
,fcmpeq_compact
) },
5122 { SH64_COMPACT_INSN_FCMPGT_COMPACT
, SEM_FN_NAME (sh64_compact
,fcmpgt_compact
) },
5123 { SH64_COMPACT_INSN_FCNVDS_COMPACT
, SEM_FN_NAME (sh64_compact
,fcnvds_compact
) },
5124 { SH64_COMPACT_INSN_FCNVSD_COMPACT
, SEM_FN_NAME (sh64_compact
,fcnvsd_compact
) },
5125 { SH64_COMPACT_INSN_FDIV_COMPACT
, SEM_FN_NAME (sh64_compact
,fdiv_compact
) },
5126 { SH64_COMPACT_INSN_FIPR_COMPACT
, SEM_FN_NAME (sh64_compact
,fipr_compact
) },
5127 { SH64_COMPACT_INSN_FLDS_COMPACT
, SEM_FN_NAME (sh64_compact
,flds_compact
) },
5128 { SH64_COMPACT_INSN_FLDI0_COMPACT
, SEM_FN_NAME (sh64_compact
,fldi0_compact
) },
5129 { SH64_COMPACT_INSN_FLDI1_COMPACT
, SEM_FN_NAME (sh64_compact
,fldi1_compact
) },
5130 { SH64_COMPACT_INSN_FLOAT_COMPACT
, SEM_FN_NAME (sh64_compact
,float_compact
) },
5131 { SH64_COMPACT_INSN_FMAC_COMPACT
, SEM_FN_NAME (sh64_compact
,fmac_compact
) },
5132 { SH64_COMPACT_INSN_FMOV1_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov1_compact
) },
5133 { SH64_COMPACT_INSN_FMOV2_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov2_compact
) },
5134 { SH64_COMPACT_INSN_FMOV3_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov3_compact
) },
5135 { SH64_COMPACT_INSN_FMOV4_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov4_compact
) },
5136 { SH64_COMPACT_INSN_FMOV5_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov5_compact
) },
5137 { SH64_COMPACT_INSN_FMOV6_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov6_compact
) },
5138 { SH64_COMPACT_INSN_FMOV7_COMPACT
, SEM_FN_NAME (sh64_compact
,fmov7_compact
) },
5139 { SH64_COMPACT_INSN_FMUL_COMPACT
, SEM_FN_NAME (sh64_compact
,fmul_compact
) },
5140 { SH64_COMPACT_INSN_FNEG_COMPACT
, SEM_FN_NAME (sh64_compact
,fneg_compact
) },
5141 { SH64_COMPACT_INSN_FRCHG_COMPACT
, SEM_FN_NAME (sh64_compact
,frchg_compact
) },
5142 { SH64_COMPACT_INSN_FSCHG_COMPACT
, SEM_FN_NAME (sh64_compact
,fschg_compact
) },
5143 { SH64_COMPACT_INSN_FSQRT_COMPACT
, SEM_FN_NAME (sh64_compact
,fsqrt_compact
) },
5144 { SH64_COMPACT_INSN_FSTS_COMPACT
, SEM_FN_NAME (sh64_compact
,fsts_compact
) },
5145 { SH64_COMPACT_INSN_FSUB_COMPACT
, SEM_FN_NAME (sh64_compact
,fsub_compact
) },
5146 { SH64_COMPACT_INSN_FTRC_COMPACT
, SEM_FN_NAME (sh64_compact
,ftrc_compact
) },
5147 { SH64_COMPACT_INSN_FTRV_COMPACT
, SEM_FN_NAME (sh64_compact
,ftrv_compact
) },
5148 { SH64_COMPACT_INSN_JMP_COMPACT
, SEM_FN_NAME (sh64_compact
,jmp_compact
) },
5149 { SH64_COMPACT_INSN_JSR_COMPACT
, SEM_FN_NAME (sh64_compact
,jsr_compact
) },
5150 { SH64_COMPACT_INSN_LDC_COMPACT
, SEM_FN_NAME (sh64_compact
,ldc_compact
) },
5151 { SH64_COMPACT_INSN_LDCL_COMPACT
, SEM_FN_NAME (sh64_compact
,ldcl_compact
) },
5152 { SH64_COMPACT_INSN_LDS_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_fpscr_compact
) },
5153 { SH64_COMPACT_INSN_LDSL_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_fpscr_compact
) },
5154 { SH64_COMPACT_INSN_LDS_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_fpul_compact
) },
5155 { SH64_COMPACT_INSN_LDSL_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_fpul_compact
) },
5156 { SH64_COMPACT_INSN_LDS_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_mach_compact
) },
5157 { SH64_COMPACT_INSN_LDSL_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_mach_compact
) },
5158 { SH64_COMPACT_INSN_LDS_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_macl_compact
) },
5159 { SH64_COMPACT_INSN_LDSL_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_macl_compact
) },
5160 { SH64_COMPACT_INSN_LDS_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,lds_pr_compact
) },
5161 { SH64_COMPACT_INSN_LDSL_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,ldsl_pr_compact
) },
5162 { SH64_COMPACT_INSN_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,macl_compact
) },
5163 { SH64_COMPACT_INSN_MACW_COMPACT
, SEM_FN_NAME (sh64_compact
,macw_compact
) },
5164 { SH64_COMPACT_INSN_MOV_COMPACT
, SEM_FN_NAME (sh64_compact
,mov_compact
) },
5165 { SH64_COMPACT_INSN_MOVI_COMPACT
, SEM_FN_NAME (sh64_compact
,movi_compact
) },
5166 { SH64_COMPACT_INSN_MOVB1_COMPACT
, SEM_FN_NAME (sh64_compact
,movb1_compact
) },
5167 { SH64_COMPACT_INSN_MOVB2_COMPACT
, SEM_FN_NAME (sh64_compact
,movb2_compact
) },
5168 { SH64_COMPACT_INSN_MOVB3_COMPACT
, SEM_FN_NAME (sh64_compact
,movb3_compact
) },
5169 { SH64_COMPACT_INSN_MOVB4_COMPACT
, SEM_FN_NAME (sh64_compact
,movb4_compact
) },
5170 { SH64_COMPACT_INSN_MOVB5_COMPACT
, SEM_FN_NAME (sh64_compact
,movb5_compact
) },
5171 { SH64_COMPACT_INSN_MOVB6_COMPACT
, SEM_FN_NAME (sh64_compact
,movb6_compact
) },
5172 { SH64_COMPACT_INSN_MOVB7_COMPACT
, SEM_FN_NAME (sh64_compact
,movb7_compact
) },
5173 { SH64_COMPACT_INSN_MOVB8_COMPACT
, SEM_FN_NAME (sh64_compact
,movb8_compact
) },
5174 { SH64_COMPACT_INSN_MOVB9_COMPACT
, SEM_FN_NAME (sh64_compact
,movb9_compact
) },
5175 { SH64_COMPACT_INSN_MOVB10_COMPACT
, SEM_FN_NAME (sh64_compact
,movb10_compact
) },
5176 { SH64_COMPACT_INSN_MOVL1_COMPACT
, SEM_FN_NAME (sh64_compact
,movl1_compact
) },
5177 { SH64_COMPACT_INSN_MOVL2_COMPACT
, SEM_FN_NAME (sh64_compact
,movl2_compact
) },
5178 { SH64_COMPACT_INSN_MOVL3_COMPACT
, SEM_FN_NAME (sh64_compact
,movl3_compact
) },
5179 { SH64_COMPACT_INSN_MOVL4_COMPACT
, SEM_FN_NAME (sh64_compact
,movl4_compact
) },
5180 { SH64_COMPACT_INSN_MOVL5_COMPACT
, SEM_FN_NAME (sh64_compact
,movl5_compact
) },
5181 { SH64_COMPACT_INSN_MOVL6_COMPACT
, SEM_FN_NAME (sh64_compact
,movl6_compact
) },
5182 { SH64_COMPACT_INSN_MOVL7_COMPACT
, SEM_FN_NAME (sh64_compact
,movl7_compact
) },
5183 { SH64_COMPACT_INSN_MOVL8_COMPACT
, SEM_FN_NAME (sh64_compact
,movl8_compact
) },
5184 { SH64_COMPACT_INSN_MOVL9_COMPACT
, SEM_FN_NAME (sh64_compact
,movl9_compact
) },
5185 { SH64_COMPACT_INSN_MOVL10_COMPACT
, SEM_FN_NAME (sh64_compact
,movl10_compact
) },
5186 { SH64_COMPACT_INSN_MOVL11_COMPACT
, SEM_FN_NAME (sh64_compact
,movl11_compact
) },
5187 { SH64_COMPACT_INSN_MOVW1_COMPACT
, SEM_FN_NAME (sh64_compact
,movw1_compact
) },
5188 { SH64_COMPACT_INSN_MOVW2_COMPACT
, SEM_FN_NAME (sh64_compact
,movw2_compact
) },
5189 { SH64_COMPACT_INSN_MOVW3_COMPACT
, SEM_FN_NAME (sh64_compact
,movw3_compact
) },
5190 { SH64_COMPACT_INSN_MOVW4_COMPACT
, SEM_FN_NAME (sh64_compact
,movw4_compact
) },
5191 { SH64_COMPACT_INSN_MOVW5_COMPACT
, SEM_FN_NAME (sh64_compact
,movw5_compact
) },
5192 { SH64_COMPACT_INSN_MOVW6_COMPACT
, SEM_FN_NAME (sh64_compact
,movw6_compact
) },
5193 { SH64_COMPACT_INSN_MOVW7_COMPACT
, SEM_FN_NAME (sh64_compact
,movw7_compact
) },
5194 { SH64_COMPACT_INSN_MOVW8_COMPACT
, SEM_FN_NAME (sh64_compact
,movw8_compact
) },
5195 { SH64_COMPACT_INSN_MOVW9_COMPACT
, SEM_FN_NAME (sh64_compact
,movw9_compact
) },
5196 { SH64_COMPACT_INSN_MOVW10_COMPACT
, SEM_FN_NAME (sh64_compact
,movw10_compact
) },
5197 { SH64_COMPACT_INSN_MOVW11_COMPACT
, SEM_FN_NAME (sh64_compact
,movw11_compact
) },
5198 { SH64_COMPACT_INSN_MOVA_COMPACT
, SEM_FN_NAME (sh64_compact
,mova_compact
) },
5199 { SH64_COMPACT_INSN_MOVCAL_COMPACT
, SEM_FN_NAME (sh64_compact
,movcal_compact
) },
5200 { SH64_COMPACT_INSN_MOVT_COMPACT
, SEM_FN_NAME (sh64_compact
,movt_compact
) },
5201 { SH64_COMPACT_INSN_MULL_COMPACT
, SEM_FN_NAME (sh64_compact
,mull_compact
) },
5202 { SH64_COMPACT_INSN_MULSW_COMPACT
, SEM_FN_NAME (sh64_compact
,mulsw_compact
) },
5203 { SH64_COMPACT_INSN_MULUW_COMPACT
, SEM_FN_NAME (sh64_compact
,muluw_compact
) },
5204 { SH64_COMPACT_INSN_NEG_COMPACT
, SEM_FN_NAME (sh64_compact
,neg_compact
) },
5205 { SH64_COMPACT_INSN_NEGC_COMPACT
, SEM_FN_NAME (sh64_compact
,negc_compact
) },
5206 { SH64_COMPACT_INSN_NOP_COMPACT
, SEM_FN_NAME (sh64_compact
,nop_compact
) },
5207 { SH64_COMPACT_INSN_NOT_COMPACT
, SEM_FN_NAME (sh64_compact
,not_compact
) },
5208 { SH64_COMPACT_INSN_OCBI_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbi_compact
) },
5209 { SH64_COMPACT_INSN_OCBP_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbp_compact
) },
5210 { SH64_COMPACT_INSN_OCBWB_COMPACT
, SEM_FN_NAME (sh64_compact
,ocbwb_compact
) },
5211 { SH64_COMPACT_INSN_OR_COMPACT
, SEM_FN_NAME (sh64_compact
,or_compact
) },
5212 { SH64_COMPACT_INSN_ORI_COMPACT
, SEM_FN_NAME (sh64_compact
,ori_compact
) },
5213 { SH64_COMPACT_INSN_ORB_COMPACT
, SEM_FN_NAME (sh64_compact
,orb_compact
) },
5214 { SH64_COMPACT_INSN_PREF_COMPACT
, SEM_FN_NAME (sh64_compact
,pref_compact
) },
5215 { SH64_COMPACT_INSN_ROTCL_COMPACT
, SEM_FN_NAME (sh64_compact
,rotcl_compact
) },
5216 { SH64_COMPACT_INSN_ROTCR_COMPACT
, SEM_FN_NAME (sh64_compact
,rotcr_compact
) },
5217 { SH64_COMPACT_INSN_ROTL_COMPACT
, SEM_FN_NAME (sh64_compact
,rotl_compact
) },
5218 { SH64_COMPACT_INSN_ROTR_COMPACT
, SEM_FN_NAME (sh64_compact
,rotr_compact
) },
5219 { SH64_COMPACT_INSN_RTS_COMPACT
, SEM_FN_NAME (sh64_compact
,rts_compact
) },
5220 { SH64_COMPACT_INSN_SETS_COMPACT
, SEM_FN_NAME (sh64_compact
,sets_compact
) },
5221 { SH64_COMPACT_INSN_SETT_COMPACT
, SEM_FN_NAME (sh64_compact
,sett_compact
) },
5222 { SH64_COMPACT_INSN_SHAD_COMPACT
, SEM_FN_NAME (sh64_compact
,shad_compact
) },
5223 { SH64_COMPACT_INSN_SHAL_COMPACT
, SEM_FN_NAME (sh64_compact
,shal_compact
) },
5224 { SH64_COMPACT_INSN_SHAR_COMPACT
, SEM_FN_NAME (sh64_compact
,shar_compact
) },
5225 { SH64_COMPACT_INSN_SHLD_COMPACT
, SEM_FN_NAME (sh64_compact
,shld_compact
) },
5226 { SH64_COMPACT_INSN_SHLL_COMPACT
, SEM_FN_NAME (sh64_compact
,shll_compact
) },
5227 { SH64_COMPACT_INSN_SHLL2_COMPACT
, SEM_FN_NAME (sh64_compact
,shll2_compact
) },
5228 { SH64_COMPACT_INSN_SHLL8_COMPACT
, SEM_FN_NAME (sh64_compact
,shll8_compact
) },
5229 { SH64_COMPACT_INSN_SHLL16_COMPACT
, SEM_FN_NAME (sh64_compact
,shll16_compact
) },
5230 { SH64_COMPACT_INSN_SHLR_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr_compact
) },
5231 { SH64_COMPACT_INSN_SHLR2_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr2_compact
) },
5232 { SH64_COMPACT_INSN_SHLR8_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr8_compact
) },
5233 { SH64_COMPACT_INSN_SHLR16_COMPACT
, SEM_FN_NAME (sh64_compact
,shlr16_compact
) },
5234 { SH64_COMPACT_INSN_STC_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stc_gbr_compact
) },
5235 { SH64_COMPACT_INSN_STCL_GBR_COMPACT
, SEM_FN_NAME (sh64_compact
,stcl_gbr_compact
) },
5236 { SH64_COMPACT_INSN_STS_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_fpscr_compact
) },
5237 { SH64_COMPACT_INSN_STSL_FPSCR_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_fpscr_compact
) },
5238 { SH64_COMPACT_INSN_STS_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_fpul_compact
) },
5239 { SH64_COMPACT_INSN_STSL_FPUL_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_fpul_compact
) },
5240 { SH64_COMPACT_INSN_STS_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_mach_compact
) },
5241 { SH64_COMPACT_INSN_STSL_MACH_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_mach_compact
) },
5242 { SH64_COMPACT_INSN_STS_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_macl_compact
) },
5243 { SH64_COMPACT_INSN_STSL_MACL_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_macl_compact
) },
5244 { SH64_COMPACT_INSN_STS_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,sts_pr_compact
) },
5245 { SH64_COMPACT_INSN_STSL_PR_COMPACT
, SEM_FN_NAME (sh64_compact
,stsl_pr_compact
) },
5246 { SH64_COMPACT_INSN_SUB_COMPACT
, SEM_FN_NAME (sh64_compact
,sub_compact
) },
5247 { SH64_COMPACT_INSN_SUBC_COMPACT
, SEM_FN_NAME (sh64_compact
,subc_compact
) },
5248 { SH64_COMPACT_INSN_SUBV_COMPACT
, SEM_FN_NAME (sh64_compact
,subv_compact
) },
5249 { SH64_COMPACT_INSN_SWAPB_COMPACT
, SEM_FN_NAME (sh64_compact
,swapb_compact
) },
5250 { SH64_COMPACT_INSN_SWAPW_COMPACT
, SEM_FN_NAME (sh64_compact
,swapw_compact
) },
5251 { SH64_COMPACT_INSN_TASB_COMPACT
, SEM_FN_NAME (sh64_compact
,tasb_compact
) },
5252 { SH64_COMPACT_INSN_TRAPA_COMPACT
, SEM_FN_NAME (sh64_compact
,trapa_compact
) },
5253 { SH64_COMPACT_INSN_TST_COMPACT
, SEM_FN_NAME (sh64_compact
,tst_compact
) },
5254 { SH64_COMPACT_INSN_TSTI_COMPACT
, SEM_FN_NAME (sh64_compact
,tsti_compact
) },
5255 { SH64_COMPACT_INSN_TSTB_COMPACT
, SEM_FN_NAME (sh64_compact
,tstb_compact
) },
5256 { SH64_COMPACT_INSN_XOR_COMPACT
, SEM_FN_NAME (sh64_compact
,xor_compact
) },
5257 { SH64_COMPACT_INSN_XORI_COMPACT
, SEM_FN_NAME (sh64_compact
,xori_compact
) },
5258 { SH64_COMPACT_INSN_XORB_COMPACT
, SEM_FN_NAME (sh64_compact
,xorb_compact
) },
5259 { SH64_COMPACT_INSN_XTRCT_COMPACT
, SEM_FN_NAME (sh64_compact
,xtrct_compact
) },
5263 /* Add the semantic fns to IDESC_TABLE. */
5266 SEM_FN_NAME (sh64_compact
,init_idesc_table
) (SIM_CPU
*current_cpu
)
5268 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
5269 const struct sem_fn_desc
*sf
;
5270 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
5272 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
5274 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
5275 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
5276 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
5279 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
5281 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (sh64_compact
,x_invalid
);
5284 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
5286 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (sh64_compact
,x_invalid
);