1 /* Simulator instruction semantics for sh64.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2020 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
32 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
34 /* This is used so that we can compile two copies of the semantic code,
35 one with full feature support and one without that runs fast(er).
36 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
38 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
39 #undef CGEN_TRACE_RESULT
40 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
42 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
45 /* x-invalid: --invalid-- */
48 SEM_FN_NAME (sh64_media
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
50 #define FLD(f) abuf->fields.sfmt_empty.f
51 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
52 int UNUSED written
= 0;
53 IADDR UNUSED pc
= abuf
->addr
;
54 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
57 /* Update the recorded pc in the cpu state struct.
58 Only necessary for WITH_SCACHE case, but to avoid the
59 conditional compilation .... */
61 /* Virtual insns have zero size. Overwrite vpc with address of next insn
62 using the default-insn-bitsize spec. When executing insns in parallel
63 we may want to queue the fault and continue execution. */
64 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
65 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
72 /* x-after: --after-- */
75 SEM_FN_NAME (sh64_media
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
77 #define FLD(f) abuf->fields.sfmt_empty.f
78 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
79 int UNUSED written
= 0;
80 IADDR UNUSED pc
= abuf
->addr
;
81 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
84 #if WITH_SCACHE_PBB_SH64_MEDIA
85 sh64_media_pbb_after (current_cpu
, sem_arg
);
93 /* x-before: --before-- */
96 SEM_FN_NAME (sh64_media
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
98 #define FLD(f) abuf->fields.sfmt_empty.f
99 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
100 int UNUSED written
= 0;
101 IADDR UNUSED pc
= abuf
->addr
;
102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
105 #if WITH_SCACHE_PBB_SH64_MEDIA
106 sh64_media_pbb_before (current_cpu
, sem_arg
);
114 /* x-cti-chain: --cti-chain-- */
117 SEM_FN_NAME (sh64_media
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
119 #define FLD(f) abuf->fields.sfmt_empty.f
120 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
121 int UNUSED written
= 0;
122 IADDR UNUSED pc
= abuf
->addr
;
123 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
126 #if WITH_SCACHE_PBB_SH64_MEDIA
128 vpc
= sh64_media_pbb_cti_chain (current_cpu
, sem_arg
,
129 pbb_br_type
, pbb_br_npc
);
132 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
133 vpc
= sh64_media_pbb_cti_chain (current_cpu
, sem_arg
,
134 CPU_PBB_BR_TYPE (current_cpu
),
135 CPU_PBB_BR_NPC (current_cpu
));
144 /* x-chain: --chain-- */
147 SEM_FN_NAME (sh64_media
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
149 #define FLD(f) abuf->fields.sfmt_empty.f
150 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
151 int UNUSED written
= 0;
152 IADDR UNUSED pc
= abuf
->addr
;
153 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
156 #if WITH_SCACHE_PBB_SH64_MEDIA
157 vpc
= sh64_media_pbb_chain (current_cpu
, sem_arg
);
168 /* x-begin: --begin-- */
171 SEM_FN_NAME (sh64_media
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
173 #define FLD(f) abuf->fields.sfmt_empty.f
174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
175 int UNUSED written
= 0;
176 IADDR UNUSED pc
= abuf
->addr
;
177 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
180 #if WITH_SCACHE_PBB_SH64_MEDIA
181 #if defined DEFINE_SWITCH || defined FAST_P
182 /* In the switch case FAST_P is a constant, allowing several optimizations
183 in any called inline functions. */
184 vpc
= sh64_media_pbb_begin (current_cpu
, FAST_P
);
186 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
187 vpc
= sh64_media_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
189 vpc
= sh64_media_pbb_begin (current_cpu
, 0);
199 /* add: add $rm, $rn, $rd */
202 SEM_FN_NAME (sh64_media
,add
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
204 #define FLD(f) abuf->fields.sfmt_add.f
205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
206 int UNUSED written
= 0;
207 IADDR UNUSED pc
= abuf
->addr
;
208 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
211 DI opval
= ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
212 SET_H_GR (FLD (f_dest
), opval
);
213 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
220 /* addl: add.l $rm, $rn, $rd */
223 SEM_FN_NAME (sh64_media
,addl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
225 #define FLD(f) abuf->fields.sfmt_add.f
226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
227 int UNUSED written
= 0;
228 IADDR UNUSED pc
= abuf
->addr
;
229 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
232 DI opval
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
233 SET_H_GR (FLD (f_dest
), opval
);
234 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
241 /* addi: addi $rm, $disp10, $rd */
244 SEM_FN_NAME (sh64_media
,addi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
246 #define FLD(f) abuf->fields.sfmt_addi.f
247 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
248 int UNUSED written
= 0;
249 IADDR UNUSED pc
= abuf
->addr
;
250 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
253 DI opval
= ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)));
254 SET_H_GR (FLD (f_dest
), opval
);
255 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
262 /* addil: addi.l $rm, $disp10, $rd */
265 SEM_FN_NAME (sh64_media
,addil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
267 #define FLD(f) abuf->fields.sfmt_addi.f
268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
269 int UNUSED written
= 0;
270 IADDR UNUSED pc
= abuf
->addr
;
271 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
274 DI opval
= EXTSIDI (ADDSI (EXTSISI (FLD (f_disp10
)), SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)));
275 SET_H_GR (FLD (f_dest
), opval
);
276 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
283 /* addzl: addz.l $rm, $rn, $rd */
286 SEM_FN_NAME (sh64_media
,addzl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
288 #define FLD(f) abuf->fields.sfmt_add.f
289 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
290 int UNUSED written
= 0;
291 IADDR UNUSED pc
= abuf
->addr
;
292 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
295 DI opval
= ZEXTSIDI (ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
296 SET_H_GR (FLD (f_dest
), opval
);
297 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
304 /* alloco: alloco $rm, $disp6x32 */
307 SEM_FN_NAME (sh64_media
,alloco
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
309 #define FLD(f) abuf->fields.sfmt_xori.f
310 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
311 int UNUSED written
= 0;
312 IADDR UNUSED pc
= abuf
->addr
;
313 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
317 DI opval
= GET_H_GR (FLD (f_left
));
318 SET_H_GR (FLD (f_left
), opval
);
319 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
328 /* and: and $rm, $rn, $rd */
331 SEM_FN_NAME (sh64_media
,and) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
333 #define FLD(f) abuf->fields.sfmt_add.f
334 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
335 int UNUSED written
= 0;
336 IADDR UNUSED pc
= abuf
->addr
;
337 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
340 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
341 SET_H_GR (FLD (f_dest
), opval
);
342 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
349 /* andc: andc $rm, $rn, $rd */
352 SEM_FN_NAME (sh64_media
,andc
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
354 #define FLD(f) abuf->fields.sfmt_add.f
355 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
356 int UNUSED written
= 0;
357 IADDR UNUSED pc
= abuf
->addr
;
358 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
361 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), INVDI (GET_H_GR (FLD (f_right
))));
362 SET_H_GR (FLD (f_dest
), opval
);
363 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
370 /* andi: andi $rm, $disp10, $rd */
373 SEM_FN_NAME (sh64_media
,andi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
375 #define FLD(f) abuf->fields.sfmt_addi.f
376 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
377 int UNUSED written
= 0;
378 IADDR UNUSED pc
= abuf
->addr
;
379 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
382 DI opval
= ANDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)));
383 SET_H_GR (FLD (f_dest
), opval
);
384 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
391 /* beq: beq$likely $rm, $rn, $tra */
394 SEM_FN_NAME (sh64_media
,beq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
396 #define FLD(f) abuf->fields.sfmt_beq.f
397 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
398 int UNUSED written
= 0;
399 IADDR UNUSED pc
= abuf
->addr
;
401 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
405 if (EQDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
407 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
408 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
410 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
415 abuf
->written
= written
;
416 SEM_BRANCH_FINI (vpc
);
421 /* beqi: beqi$likely $rm, $imm6, $tra */
424 SEM_FN_NAME (sh64_media
,beqi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
426 #define FLD(f) abuf->fields.sfmt_beqi.f
427 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
428 int UNUSED written
= 0;
429 IADDR UNUSED pc
= abuf
->addr
;
431 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
435 if (EQDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)))) {
437 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
438 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
440 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
445 abuf
->written
= written
;
446 SEM_BRANCH_FINI (vpc
);
451 /* bge: bge$likely $rm, $rn, $tra */
454 SEM_FN_NAME (sh64_media
,bge
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
456 #define FLD(f) abuf->fields.sfmt_beq.f
457 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
458 int UNUSED written
= 0;
459 IADDR UNUSED pc
= abuf
->addr
;
461 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
465 if (GEDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
467 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
468 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
470 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
475 abuf
->written
= written
;
476 SEM_BRANCH_FINI (vpc
);
481 /* bgeu: bgeu$likely $rm, $rn, $tra */
484 SEM_FN_NAME (sh64_media
,bgeu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
486 #define FLD(f) abuf->fields.sfmt_beq.f
487 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
488 int UNUSED written
= 0;
489 IADDR UNUSED pc
= abuf
->addr
;
491 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
495 if (GEUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
497 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
498 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
500 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
505 abuf
->written
= written
;
506 SEM_BRANCH_FINI (vpc
);
511 /* bgt: bgt$likely $rm, $rn, $tra */
514 SEM_FN_NAME (sh64_media
,bgt
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
516 #define FLD(f) abuf->fields.sfmt_beq.f
517 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
518 int UNUSED written
= 0;
519 IADDR UNUSED pc
= abuf
->addr
;
521 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
525 if (GTDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
527 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
528 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
530 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
535 abuf
->written
= written
;
536 SEM_BRANCH_FINI (vpc
);
541 /* bgtu: bgtu$likely $rm, $rn, $tra */
544 SEM_FN_NAME (sh64_media
,bgtu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
546 #define FLD(f) abuf->fields.sfmt_beq.f
547 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
548 int UNUSED written
= 0;
549 IADDR UNUSED pc
= abuf
->addr
;
551 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
555 if (GTUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
557 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
558 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
560 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
565 abuf
->written
= written
;
566 SEM_BRANCH_FINI (vpc
);
571 /* blink: blink $trb, $rd */
574 SEM_FN_NAME (sh64_media
,blink
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
576 #define FLD(f) abuf->fields.sfmt_blink.f
577 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
578 int UNUSED written
= 0;
579 IADDR UNUSED pc
= abuf
->addr
;
581 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
585 DI opval
= ORDI (ADDDI (pc
, 4), 1);
586 SET_H_GR (FLD (f_dest
), opval
);
587 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
590 UDI opval
= CPU (h_tr
[FLD (f_trb
)]);
591 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
592 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
594 if (EQSI (FLD (f_dest
), 63)) {
601 SEM_BRANCH_FINI (vpc
);
606 /* bne: bne$likely $rm, $rn, $tra */
609 SEM_FN_NAME (sh64_media
,bne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
611 #define FLD(f) abuf->fields.sfmt_beq.f
612 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
613 int UNUSED written
= 0;
614 IADDR UNUSED pc
= abuf
->addr
;
616 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
620 if (NEDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) {
622 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
623 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
625 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
630 abuf
->written
= written
;
631 SEM_BRANCH_FINI (vpc
);
636 /* bnei: bnei$likely $rm, $imm6, $tra */
639 SEM_FN_NAME (sh64_media
,bnei
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
641 #define FLD(f) abuf->fields.sfmt_beqi.f
642 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
643 int UNUSED written
= 0;
644 IADDR UNUSED pc
= abuf
->addr
;
646 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
650 if (NEDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)))) {
652 UDI opval
= CPU (h_tr
[FLD (f_tra
)]);
653 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'D', opval
);
660 abuf
->written
= written
;
661 SEM_BRANCH_FINI (vpc
);
669 SEM_FN_NAME (sh64_media
,brk
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
671 #define FLD(f) abuf->fields.sfmt_empty.f
672 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
673 int UNUSED written
= 0;
674 IADDR UNUSED pc
= abuf
->addr
;
675 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
677 sh64_break (current_cpu
, pc
);
683 /* byterev: byterev $rm, $rd */
686 SEM_FN_NAME (sh64_media
,byterev
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
688 #define FLD(f) abuf->fields.sfmt_xori.f
689 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
690 int UNUSED written
= 0;
691 IADDR UNUSED pc
= abuf
->addr
;
692 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
697 tmp_source
= GET_H_GR (FLD (f_left
));
700 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
701 tmp_source
= SRLDI (tmp_source
, 8);
704 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
705 tmp_source
= SRLDI (tmp_source
, 8);
708 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
709 tmp_source
= SRLDI (tmp_source
, 8);
712 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
713 tmp_source
= SRLDI (tmp_source
, 8);
716 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
717 tmp_source
= SRLDI (tmp_source
, 8);
720 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
721 tmp_source
= SRLDI (tmp_source
, 8);
724 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
725 tmp_source
= SRLDI (tmp_source
, 8);
728 tmp_result
= ORDI (SLLDI (tmp_result
, 8), ANDDI (tmp_source
, 255));
729 tmp_source
= SRLDI (tmp_source
, 8);
732 DI opval
= tmp_result
;
733 SET_H_GR (FLD (f_dest
), opval
);
734 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
742 /* cmpeq: cmpeq $rm, $rn, $rd */
745 SEM_FN_NAME (sh64_media
,cmpeq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
747 #define FLD(f) abuf->fields.sfmt_add.f
748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
749 int UNUSED written
= 0;
750 IADDR UNUSED pc
= abuf
->addr
;
751 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
754 DI opval
= ((EQDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
755 SET_H_GR (FLD (f_dest
), opval
);
756 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
763 /* cmpgt: cmpgt $rm, $rn, $rd */
766 SEM_FN_NAME (sh64_media
,cmpgt
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
768 #define FLD(f) abuf->fields.sfmt_add.f
769 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
770 int UNUSED written
= 0;
771 IADDR UNUSED pc
= abuf
->addr
;
772 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
775 DI opval
= ((GTDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
776 SET_H_GR (FLD (f_dest
), opval
);
777 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
784 /* cmpgtu: cmpgtu $rm,$rn, $rd */
787 SEM_FN_NAME (sh64_media
,cmpgtu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
789 #define FLD(f) abuf->fields.sfmt_add.f
790 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
791 int UNUSED written
= 0;
792 IADDR UNUSED pc
= abuf
->addr
;
793 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
796 DI opval
= ((GTUDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))) ? (1) : (0));
797 SET_H_GR (FLD (f_dest
), opval
);
798 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
805 /* cmveq: cmveq $rm, $rn, $rd */
808 SEM_FN_NAME (sh64_media
,cmveq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
810 #define FLD(f) abuf->fields.sfmt_add.f
811 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
812 int UNUSED written
= 0;
813 IADDR UNUSED pc
= abuf
->addr
;
814 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
816 if (EQDI (GET_H_GR (FLD (f_left
)), 0)) {
818 DI opval
= GET_H_GR (FLD (f_right
));
819 SET_H_GR (FLD (f_dest
), opval
);
821 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
825 abuf
->written
= written
;
830 /* cmvne: cmvne $rm, $rn, $rd */
833 SEM_FN_NAME (sh64_media
,cmvne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
835 #define FLD(f) abuf->fields.sfmt_add.f
836 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
837 int UNUSED written
= 0;
838 IADDR UNUSED pc
= abuf
->addr
;
839 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
841 if (NEDI (GET_H_GR (FLD (f_left
)), 0)) {
843 DI opval
= GET_H_GR (FLD (f_right
));
844 SET_H_GR (FLD (f_dest
), opval
);
846 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
850 abuf
->written
= written
;
855 /* fabsd: fabs.d $drgh, $drf */
858 SEM_FN_NAME (sh64_media
,fabsd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
860 #define FLD(f) abuf->fields.sfmt_fabsd.f
861 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
862 int UNUSED written
= 0;
863 IADDR UNUSED pc
= abuf
->addr
;
864 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
867 DF opval
= sh64_fabsd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
868 SET_H_DR (FLD (f_dest
), opval
);
869 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
876 /* fabss: fabs.s $frgh, $frf */
879 SEM_FN_NAME (sh64_media
,fabss
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
881 #define FLD(f) abuf->fields.sfmt_fabsd.f
882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
883 int UNUSED written
= 0;
884 IADDR UNUSED pc
= abuf
->addr
;
885 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
888 SF opval
= sh64_fabss (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
889 CPU (h_fr
[FLD (f_dest
)]) = opval
;
890 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
897 /* faddd: fadd.d $drg, $drh, $drf */
900 SEM_FN_NAME (sh64_media
,faddd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
902 #define FLD(f) abuf->fields.sfmt_add.f
903 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
904 int UNUSED written
= 0;
905 IADDR UNUSED pc
= abuf
->addr
;
906 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
909 DF opval
= sh64_faddd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
910 SET_H_DR (FLD (f_dest
), opval
);
911 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
918 /* fadds: fadd.s $frg, $frh, $frf */
921 SEM_FN_NAME (sh64_media
,fadds
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
923 #define FLD(f) abuf->fields.sfmt_add.f
924 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
925 int UNUSED written
= 0;
926 IADDR UNUSED pc
= abuf
->addr
;
927 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
930 SF opval
= sh64_fadds (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
931 CPU (h_fr
[FLD (f_dest
)]) = opval
;
932 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
939 /* fcmpeqd: fcmpeq.d $drg, $drh, $rd */
942 SEM_FN_NAME (sh64_media
,fcmpeqd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
944 #define FLD(f) abuf->fields.sfmt_add.f
945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
946 int UNUSED written
= 0;
947 IADDR UNUSED pc
= abuf
->addr
;
948 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
951 DI opval
= ZEXTBIDI (sh64_fcmpeqd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
952 SET_H_GR (FLD (f_dest
), opval
);
953 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
960 /* fcmpeqs: fcmpeq.s $frg, $frh, $rd */
963 SEM_FN_NAME (sh64_media
,fcmpeqs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
965 #define FLD(f) abuf->fields.sfmt_add.f
966 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
967 int UNUSED written
= 0;
968 IADDR UNUSED pc
= abuf
->addr
;
969 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
972 DI opval
= ZEXTBIDI (sh64_fcmpeqs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
973 SET_H_GR (FLD (f_dest
), opval
);
974 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
981 /* fcmpged: fcmpge.d $drg, $drh, $rd */
984 SEM_FN_NAME (sh64_media
,fcmpged
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
986 #define FLD(f) abuf->fields.sfmt_add.f
987 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
988 int UNUSED written
= 0;
989 IADDR UNUSED pc
= abuf
->addr
;
990 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
993 DI opval
= ZEXTBIDI (sh64_fcmpged (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
994 SET_H_GR (FLD (f_dest
), opval
);
995 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1002 /* fcmpges: fcmpge.s $frg, $frh, $rd */
1005 SEM_FN_NAME (sh64_media
,fcmpges
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1007 #define FLD(f) abuf->fields.sfmt_add.f
1008 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1009 int UNUSED written
= 0;
1010 IADDR UNUSED pc
= abuf
->addr
;
1011 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1014 DI opval
= ZEXTBIDI (sh64_fcmpges (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1015 SET_H_GR (FLD (f_dest
), opval
);
1016 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1023 /* fcmpgtd: fcmpgt.d $drg, $drh, $rd */
1026 SEM_FN_NAME (sh64_media
,fcmpgtd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1028 #define FLD(f) abuf->fields.sfmt_add.f
1029 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1030 int UNUSED written
= 0;
1031 IADDR UNUSED pc
= abuf
->addr
;
1032 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1035 DI opval
= ZEXTBIDI (sh64_fcmpgtd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1036 SET_H_GR (FLD (f_dest
), opval
);
1037 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1044 /* fcmpgts: fcmpgt.s $frg, $frh, $rd */
1047 SEM_FN_NAME (sh64_media
,fcmpgts
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1049 #define FLD(f) abuf->fields.sfmt_add.f
1050 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1051 int UNUSED written
= 0;
1052 IADDR UNUSED pc
= abuf
->addr
;
1053 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1056 DI opval
= ZEXTBIDI (sh64_fcmpgts (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1057 SET_H_GR (FLD (f_dest
), opval
);
1058 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1065 /* fcmpund: fcmpun.d $drg, $drh, $rd */
1068 SEM_FN_NAME (sh64_media
,fcmpund
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1070 #define FLD(f) abuf->fields.sfmt_add.f
1071 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1072 int UNUSED written
= 0;
1073 IADDR UNUSED pc
= abuf
->addr
;
1074 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1077 DI opval
= ZEXTBIDI (sh64_fcmpund (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
))));
1078 SET_H_GR (FLD (f_dest
), opval
);
1079 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1086 /* fcmpuns: fcmpun.s $frg, $frh, $rd */
1089 SEM_FN_NAME (sh64_media
,fcmpuns
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1091 #define FLD(f) abuf->fields.sfmt_add.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
, 4);
1098 DI opval
= ZEXTBIDI (sh64_fcmpuns (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1099 SET_H_GR (FLD (f_dest
), opval
);
1100 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1107 /* fcnvds: fcnv.ds $drgh, $frf */
1110 SEM_FN_NAME (sh64_media
,fcnvds
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1112 #define FLD(f) abuf->fields.sfmt_fabsd.f
1113 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1114 int UNUSED written
= 0;
1115 IADDR UNUSED pc
= abuf
->addr
;
1116 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1119 SF opval
= sh64_fcnvds (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1120 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1121 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1128 /* fcnvsd: fcnv.sd $frgh, $drf */
1131 SEM_FN_NAME (sh64_media
,fcnvsd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1133 #define FLD(f) abuf->fields.sfmt_fabsd.f
1134 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1135 int UNUSED written
= 0;
1136 IADDR UNUSED pc
= abuf
->addr
;
1137 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1140 DF opval
= sh64_fcnvsd (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1141 SET_H_DR (FLD (f_dest
), opval
);
1142 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1149 /* fdivd: fdiv.d $drg, $drh, $drf */
1152 SEM_FN_NAME (sh64_media
,fdivd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1154 #define FLD(f) abuf->fields.sfmt_add.f
1155 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1156 int UNUSED written
= 0;
1157 IADDR UNUSED pc
= abuf
->addr
;
1158 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1161 DF opval
= sh64_fdivd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1162 SET_H_DR (FLD (f_dest
), opval
);
1163 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1170 /* fdivs: fdiv.s $frg, $frh, $frf */
1173 SEM_FN_NAME (sh64_media
,fdivs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1175 #define FLD(f) abuf->fields.sfmt_add.f
1176 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1177 int UNUSED written
= 0;
1178 IADDR UNUSED pc
= abuf
->addr
;
1179 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1182 SF opval
= sh64_fdivs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1183 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1184 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1191 /* fgetscr: fgetscr $frf */
1194 SEM_FN_NAME (sh64_media
,fgetscr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1196 #define FLD(f) abuf->fields.sfmt_shori.f
1197 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1198 int UNUSED written
= 0;
1199 IADDR UNUSED pc
= abuf
->addr
;
1200 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1203 SF opval
= SUBWORDSISF (CPU (h_fpscr
));
1204 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1205 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1212 /* fiprs: fipr.s $fvg, $fvh, $frf */
1215 SEM_FN_NAME (sh64_media
,fiprs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1217 #define FLD(f) abuf->fields.sfmt_add.f
1218 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1219 int UNUSED written
= 0;
1220 IADDR UNUSED pc
= abuf
->addr
;
1221 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1225 SF opval
= GET_H_FV (FLD (f_left
));
1226 SET_H_FV (FLD (f_left
), opval
);
1227 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
1230 SF opval
= GET_H_FV (FLD (f_right
));
1231 SET_H_FV (FLD (f_right
), opval
);
1232 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
1235 SF opval
= sh64_fiprs (current_cpu
, FLD (f_left
), FLD (f_right
));
1236 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1237 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1245 /* fldd: fld.d $rm, $disp10x8, $drf */
1248 SEM_FN_NAME (sh64_media
,fldd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1250 #define FLD(f) abuf->fields.sfmt_fldd.f
1251 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1252 int UNUSED written
= 0;
1253 IADDR UNUSED pc
= abuf
->addr
;
1254 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1257 DF opval
= GETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
)));
1258 SET_H_DR (FLD (f_dest
), opval
);
1259 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1266 /* fldp: fld.p $rm, $disp10x8, $fpf */
1269 SEM_FN_NAME (sh64_media
,fldp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1271 #define FLD(f) abuf->fields.sfmt_fldd.f
1272 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1273 int UNUSED written
= 0;
1274 IADDR UNUSED pc
= abuf
->addr
;
1275 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1279 SF opval
= GET_H_FP (FLD (f_dest
));
1280 SET_H_FP (FLD (f_dest
), opval
);
1281 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1283 sh64_fldp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
), FLD (f_dest
));
1290 /* flds: fld.s $rm, $disp10x4, $frf */
1293 SEM_FN_NAME (sh64_media
,flds
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1295 #define FLD(f) abuf->fields.sfmt_flds.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
, 4);
1302 SF opval
= GETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x4
)));
1303 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1304 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1311 /* fldxd: fldx.d $rm, $rn, $drf */
1314 SEM_FN_NAME (sh64_media
,fldxd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1316 #define FLD(f) abuf->fields.sfmt_add.f
1317 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1318 int UNUSED written
= 0;
1319 IADDR UNUSED pc
= abuf
->addr
;
1320 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1323 DF opval
= GETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
1324 SET_H_DR (FLD (f_dest
), opval
);
1325 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1332 /* fldxp: fldx.p $rm, $rn, $fpf */
1335 SEM_FN_NAME (sh64_media
,fldxp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1337 #define FLD(f) abuf->fields.sfmt_add.f
1338 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1339 int UNUSED written
= 0;
1340 IADDR UNUSED pc
= abuf
->addr
;
1341 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1345 SF opval
= GET_H_FP (FLD (f_dest
));
1346 SET_H_FP (FLD (f_dest
), opval
);
1347 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1349 sh64_fldp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)), FLD (f_dest
));
1356 /* fldxs: fldx.s $rm, $rn, $frf */
1359 SEM_FN_NAME (sh64_media
,fldxs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1361 #define FLD(f) abuf->fields.sfmt_add.f
1362 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1363 int UNUSED written
= 0;
1364 IADDR UNUSED pc
= abuf
->addr
;
1365 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1368 SF opval
= GETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
1369 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1370 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1377 /* floatld: float.ld $frgh, $drf */
1380 SEM_FN_NAME (sh64_media
,floatld
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1382 #define FLD(f) abuf->fields.sfmt_fabsd.f
1383 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1384 int UNUSED written
= 0;
1385 IADDR UNUSED pc
= abuf
->addr
;
1386 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1389 DF opval
= sh64_floatld (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1390 SET_H_DR (FLD (f_dest
), opval
);
1391 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1398 /* floatls: float.ls $frgh, $frf */
1401 SEM_FN_NAME (sh64_media
,floatls
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1403 #define FLD(f) abuf->fields.sfmt_fabsd.f
1404 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1405 int UNUSED written
= 0;
1406 IADDR UNUSED pc
= abuf
->addr
;
1407 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1410 SF opval
= sh64_floatls (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1411 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1412 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1419 /* floatqd: float.qd $drgh, $drf */
1422 SEM_FN_NAME (sh64_media
,floatqd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1424 #define FLD(f) abuf->fields.sfmt_fabsd.f
1425 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1426 int UNUSED written
= 0;
1427 IADDR UNUSED pc
= abuf
->addr
;
1428 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1431 DF opval
= sh64_floatqd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1432 SET_H_DR (FLD (f_dest
), opval
);
1433 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1440 /* floatqs: float.qs $drgh, $frf */
1443 SEM_FN_NAME (sh64_media
,floatqs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1445 #define FLD(f) abuf->fields.sfmt_fabsd.f
1446 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1447 int UNUSED written
= 0;
1448 IADDR UNUSED pc
= abuf
->addr
;
1449 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1452 SF opval
= sh64_floatqs (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1453 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1454 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1461 /* fmacs: fmac.s $frg, $frh, $frf */
1464 SEM_FN_NAME (sh64_media
,fmacs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1466 #define FLD(f) abuf->fields.sfmt_add.f
1467 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1468 int UNUSED written
= 0;
1469 IADDR UNUSED pc
= abuf
->addr
;
1470 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1473 SF opval
= sh64_fadds (current_cpu
, CPU (h_fr
[FLD (f_dest
)]), sh64_fmuls (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)])));
1474 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1475 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1482 /* fmovd: fmov.d $drgh, $drf */
1485 SEM_FN_NAME (sh64_media
,fmovd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1487 #define FLD(f) abuf->fields.sfmt_fabsd.f
1488 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1489 int UNUSED written
= 0;
1490 IADDR UNUSED pc
= abuf
->addr
;
1491 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1494 DF opval
= GET_H_DR (FLD (f_left_right
));
1495 SET_H_DR (FLD (f_dest
), opval
);
1496 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1503 /* fmovdq: fmov.dq $drgh, $rd */
1506 SEM_FN_NAME (sh64_media
,fmovdq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1508 #define FLD(f) abuf->fields.sfmt_fabsd.f
1509 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1510 int UNUSED written
= 0;
1511 IADDR UNUSED pc
= abuf
->addr
;
1512 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1515 DI opval
= SUBWORDDFDI (GET_H_DR (FLD (f_left_right
)));
1516 SET_H_GR (FLD (f_dest
), opval
);
1517 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1524 /* fmovls: fmov.ls $rm, $frf */
1527 SEM_FN_NAME (sh64_media
,fmovls
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1529 #define FLD(f) abuf->fields.sfmt_xori.f
1530 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1531 int UNUSED written
= 0;
1532 IADDR UNUSED pc
= abuf
->addr
;
1533 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1536 SF opval
= SUBWORDSISF (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1));
1537 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1538 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1545 /* fmovqd: fmov.qd $rm, $drf */
1548 SEM_FN_NAME (sh64_media
,fmovqd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1550 #define FLD(f) abuf->fields.sfmt_xori.f
1551 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1552 int UNUSED written
= 0;
1553 IADDR UNUSED pc
= abuf
->addr
;
1554 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1557 DF opval
= SUBWORDDIDF (GET_H_GR (FLD (f_left
)));
1558 SET_H_DR (FLD (f_dest
), opval
);
1559 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1566 /* fmovs: fmov.s $frgh, $frf */
1569 SEM_FN_NAME (sh64_media
,fmovs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1571 #define FLD(f) abuf->fields.sfmt_fabsd.f
1572 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1573 int UNUSED written
= 0;
1574 IADDR UNUSED pc
= abuf
->addr
;
1575 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1578 SF opval
= CPU (h_fr
[FLD (f_left_right
)]);
1579 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1580 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1587 /* fmovsl: fmov.sl $frgh, $rd */
1590 SEM_FN_NAME (sh64_media
,fmovsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1592 #define FLD(f) abuf->fields.sfmt_fabsd.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
, 4);
1599 DI opval
= EXTSIDI (SUBWORDSFSI (CPU (h_fr
[FLD (f_left_right
)])));
1600 SET_H_GR (FLD (f_dest
), opval
);
1601 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
1608 /* fmuld: fmul.d $drg, $drh, $drf */
1611 SEM_FN_NAME (sh64_media
,fmuld
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1613 #define FLD(f) abuf->fields.sfmt_add.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
, 4);
1620 DF opval
= sh64_fmuld (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1621 SET_H_DR (FLD (f_dest
), opval
);
1622 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1629 /* fmuls: fmul.s $frg, $frh, $frf */
1632 SEM_FN_NAME (sh64_media
,fmuls
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1634 #define FLD(f) abuf->fields.sfmt_add.f
1635 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1636 int UNUSED written
= 0;
1637 IADDR UNUSED pc
= abuf
->addr
;
1638 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1641 SF opval
= sh64_fmuls (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1642 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1643 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1650 /* fnegd: fneg.d $drgh, $drf */
1653 SEM_FN_NAME (sh64_media
,fnegd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1655 #define FLD(f) abuf->fields.sfmt_fabsd.f
1656 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1657 int UNUSED written
= 0;
1658 IADDR UNUSED pc
= abuf
->addr
;
1659 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1662 DF opval
= sh64_fnegd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1663 SET_H_DR (FLD (f_dest
), opval
);
1664 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1671 /* fnegs: fneg.s $frgh, $frf */
1674 SEM_FN_NAME (sh64_media
,fnegs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1676 #define FLD(f) abuf->fields.sfmt_fabsd.f
1677 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1678 int UNUSED written
= 0;
1679 IADDR UNUSED pc
= abuf
->addr
;
1680 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1683 SF opval
= sh64_fnegs (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1684 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1685 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1692 /* fputscr: fputscr $frgh */
1695 SEM_FN_NAME (sh64_media
,fputscr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1697 #define FLD(f) abuf->fields.sfmt_fabsd.f
1698 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1699 int UNUSED written
= 0;
1700 IADDR UNUSED pc
= abuf
->addr
;
1701 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1704 SI opval
= SUBWORDSFSI (CPU (h_fr
[FLD (f_left_right
)]));
1705 CPU (h_fpscr
) = opval
;
1706 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fpscr", 'x', opval
);
1713 /* fsqrtd: fsqrt.d $drgh, $drf */
1716 SEM_FN_NAME (sh64_media
,fsqrtd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1718 #define FLD(f) abuf->fields.sfmt_fabsd.f
1719 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1720 int UNUSED written
= 0;
1721 IADDR UNUSED pc
= abuf
->addr
;
1722 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1725 DF opval
= sh64_fsqrtd (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1726 SET_H_DR (FLD (f_dest
), opval
);
1727 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1734 /* fsqrts: fsqrt.s $frgh, $frf */
1737 SEM_FN_NAME (sh64_media
,fsqrts
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1739 #define FLD(f) abuf->fields.sfmt_fabsd.f
1740 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1741 int UNUSED written
= 0;
1742 IADDR UNUSED pc
= abuf
->addr
;
1743 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1746 SF opval
= sh64_fsqrts (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1747 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1748 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1755 /* fstd: fst.d $rm, $disp10x8, $drf */
1758 SEM_FN_NAME (sh64_media
,fstd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1760 #define FLD(f) abuf->fields.sfmt_fldd.f
1761 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1762 int UNUSED written
= 0;
1763 IADDR UNUSED pc
= abuf
->addr
;
1764 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1767 DF opval
= GET_H_DR (FLD (f_dest
));
1768 SETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
)), opval
);
1769 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1776 /* fstp: fst.p $rm, $disp10x8, $fpf */
1779 SEM_FN_NAME (sh64_media
,fstp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1781 #define FLD(f) abuf->fields.sfmt_fldd.f
1782 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1783 int UNUSED written
= 0;
1784 IADDR UNUSED pc
= abuf
->addr
;
1785 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1789 SF opval
= GET_H_FP (FLD (f_dest
));
1790 SET_H_FP (FLD (f_dest
), opval
);
1791 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1793 sh64_fstp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), FLD (f_disp10x8
), FLD (f_dest
));
1800 /* fsts: fst.s $rm, $disp10x4, $frf */
1803 SEM_FN_NAME (sh64_media
,fsts
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1805 #define FLD(f) abuf->fields.sfmt_flds.f
1806 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1807 int UNUSED written
= 0;
1808 IADDR UNUSED pc
= abuf
->addr
;
1809 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1812 SF opval
= CPU (h_fr
[FLD (f_dest
)]);
1813 SETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp10x4
)), opval
);
1814 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1821 /* fstxd: fstx.d $rm, $rn, $drf */
1824 SEM_FN_NAME (sh64_media
,fstxd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1826 #define FLD(f) abuf->fields.sfmt_add.f
1827 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1828 int UNUSED written
= 0;
1829 IADDR UNUSED pc
= abuf
->addr
;
1830 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1833 DF opval
= GET_H_DR (FLD (f_dest
));
1834 SETMEMDF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
1835 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1842 /* fstxp: fstx.p $rm, $rn, $fpf */
1845 SEM_FN_NAME (sh64_media
,fstxp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1847 #define FLD(f) abuf->fields.sfmt_add.f
1848 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1849 int UNUSED written
= 0;
1850 IADDR UNUSED pc
= abuf
->addr
;
1851 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1855 SF opval
= GET_H_FP (FLD (f_dest
));
1856 SET_H_FP (FLD (f_dest
), opval
);
1857 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fp", 'f', opval
);
1859 sh64_fstp (current_cpu
, pc
, GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)), FLD (f_dest
));
1866 /* fstxs: fstx.s $rm, $rn, $frf */
1869 SEM_FN_NAME (sh64_media
,fstxs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1871 #define FLD(f) abuf->fields.sfmt_add.f
1872 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1873 int UNUSED written
= 0;
1874 IADDR UNUSED pc
= abuf
->addr
;
1875 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1878 SF opval
= CPU (h_fr
[FLD (f_dest
)]);
1879 SETMEMSF (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
1880 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'f', opval
);
1887 /* fsubd: fsub.d $drg, $drh, $drf */
1890 SEM_FN_NAME (sh64_media
,fsubd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1892 #define FLD(f) abuf->fields.sfmt_add.f
1893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1894 int UNUSED written
= 0;
1895 IADDR UNUSED pc
= abuf
->addr
;
1896 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1899 DF opval
= sh64_fsubd (current_cpu
, GET_H_DR (FLD (f_left
)), GET_H_DR (FLD (f_right
)));
1900 SET_H_DR (FLD (f_dest
), opval
);
1901 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1908 /* fsubs: fsub.s $frg, $frh, $frf */
1911 SEM_FN_NAME (sh64_media
,fsubs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1913 #define FLD(f) abuf->fields.sfmt_add.f
1914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1915 int UNUSED written
= 0;
1916 IADDR UNUSED pc
= abuf
->addr
;
1917 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1920 SF opval
= sh64_fsubs (current_cpu
, CPU (h_fr
[FLD (f_left
)]), CPU (h_fr
[FLD (f_right
)]));
1921 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1922 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1929 /* ftrcdl: ftrc.dl $drgh, $frf */
1932 SEM_FN_NAME (sh64_media
,ftrcdl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1934 #define FLD(f) abuf->fields.sfmt_fabsd.f
1935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1936 int UNUSED written
= 0;
1937 IADDR UNUSED pc
= abuf
->addr
;
1938 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1941 SF opval
= sh64_ftrcdl (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1942 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1943 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1950 /* ftrcsl: ftrc.sl $frgh, $frf */
1953 SEM_FN_NAME (sh64_media
,ftrcsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1955 #define FLD(f) abuf->fields.sfmt_fabsd.f
1956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1957 int UNUSED written
= 0;
1958 IADDR UNUSED pc
= abuf
->addr
;
1959 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1962 SF opval
= sh64_ftrcsl (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
1963 CPU (h_fr
[FLD (f_dest
)]) = opval
;
1964 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fr", 'f', opval
);
1971 /* ftrcdq: ftrc.dq $drgh, $drf */
1974 SEM_FN_NAME (sh64_media
,ftrcdq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1976 #define FLD(f) abuf->fields.sfmt_fabsd.f
1977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1978 int UNUSED written
= 0;
1979 IADDR UNUSED pc
= abuf
->addr
;
1980 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1983 DF opval
= sh64_ftrcdq (current_cpu
, GET_H_DR (FLD (f_left_right
)));
1984 SET_H_DR (FLD (f_dest
), opval
);
1985 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
1992 /* ftrcsq: ftrc.sq $frgh, $drf */
1995 SEM_FN_NAME (sh64_media
,ftrcsq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1997 #define FLD(f) abuf->fields.sfmt_fabsd.f
1998 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1999 int UNUSED written
= 0;
2000 IADDR UNUSED pc
= abuf
->addr
;
2001 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2004 DF opval
= sh64_ftrcsq (current_cpu
, CPU (h_fr
[FLD (f_left_right
)]));
2005 SET_H_DR (FLD (f_dest
), opval
);
2006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "dr", 'f', opval
);
2013 /* ftrvs: ftrv.s $mtrxg, $fvh, $fvf */
2016 SEM_FN_NAME (sh64_media
,ftrvs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2018 #define FLD(f) abuf->fields.sfmt_add.f
2019 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2020 int UNUSED written
= 0;
2021 IADDR UNUSED pc
= abuf
->addr
;
2022 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2026 SF opval
= GET_H_FMTX (FLD (f_left
));
2027 SET_H_FMTX (FLD (f_left
), opval
);
2028 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fmtx", 'f', opval
);
2031 SF opval
= GET_H_FV (FLD (f_right
));
2032 SET_H_FV (FLD (f_right
), opval
);
2033 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
2036 SF opval
= GET_H_FV (FLD (f_dest
));
2037 SET_H_FV (FLD (f_dest
), opval
);
2038 CGEN_TRACE_RESULT (current_cpu
, abuf
, "fv", 'f', opval
);
2040 sh64_ftrvs (current_cpu
, FLD (f_left
), FLD (f_right
), FLD (f_dest
));
2047 /* getcfg: getcfg $rm, $disp6, $rd */
2050 SEM_FN_NAME (sh64_media
,getcfg
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2052 #define FLD(f) abuf->fields.sfmt_getcfg.f
2053 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2054 int UNUSED written
= 0;
2055 IADDR UNUSED pc
= abuf
->addr
;
2056 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2060 tmp_address
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2063 DI opval
= GETMEMSI (current_cpu
, pc
, tmp_address
);
2064 SET_H_GR (FLD (f_dest
), opval
);
2065 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2073 /* getcon: getcon $crk, $rd */
2076 SEM_FN_NAME (sh64_media
,getcon
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2078 #define FLD(f) abuf->fields.sfmt_xori.f
2079 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2080 int UNUSED written
= 0;
2081 IADDR UNUSED pc
= abuf
->addr
;
2082 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2085 DI opval
= GET_H_CR (FLD (f_left
));
2086 SET_H_GR (FLD (f_dest
), opval
);
2087 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2094 /* gettr: gettr $trb, $rd */
2097 SEM_FN_NAME (sh64_media
,gettr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2099 #define FLD(f) abuf->fields.sfmt_blink.f
2100 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2101 int UNUSED written
= 0;
2102 IADDR UNUSED pc
= abuf
->addr
;
2103 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2106 DI opval
= CPU (h_tr
[FLD (f_trb
)]);
2107 SET_H_GR (FLD (f_dest
), opval
);
2108 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2115 /* icbi: icbi $rm, $disp6x32 */
2118 SEM_FN_NAME (sh64_media
,icbi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2120 #define FLD(f) abuf->fields.sfmt_xori.f
2121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2122 int UNUSED written
= 0;
2123 IADDR UNUSED pc
= abuf
->addr
;
2124 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2128 DI opval
= GET_H_GR (FLD (f_left
));
2129 SET_H_GR (FLD (f_left
), opval
);
2130 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2139 /* ldb: ld.b $rm, $disp10, $rd */
2142 SEM_FN_NAME (sh64_media
,ldb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2144 #define FLD(f) abuf->fields.sfmt_addi.f
2145 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2146 int UNUSED written
= 0;
2147 IADDR UNUSED pc
= abuf
->addr
;
2148 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2151 DI opval
= EXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)))));
2152 SET_H_GR (FLD (f_dest
), opval
);
2153 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2160 /* ldl: ld.l $rm, $disp10x4, $rd */
2163 SEM_FN_NAME (sh64_media
,ldl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2165 #define FLD(f) abuf->fields.sfmt_flds.f
2166 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2167 int UNUSED written
= 0;
2168 IADDR UNUSED pc
= abuf
->addr
;
2169 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2172 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x4
)))));
2173 SET_H_GR (FLD (f_dest
), opval
);
2174 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2181 /* ldq: ld.q $rm, $disp10x8, $rd */
2184 SEM_FN_NAME (sh64_media
,ldq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2186 #define FLD(f) abuf->fields.sfmt_fldd.f
2187 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2188 int UNUSED written
= 0;
2189 IADDR UNUSED pc
= abuf
->addr
;
2190 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2193 DI opval
= GETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x8
))));
2194 SET_H_GR (FLD (f_dest
), opval
);
2195 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2202 /* ldub: ld.ub $rm, $disp10, $rd */
2205 SEM_FN_NAME (sh64_media
,ldub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2207 #define FLD(f) abuf->fields.sfmt_addi.f
2208 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2209 int UNUSED written
= 0;
2210 IADDR UNUSED pc
= abuf
->addr
;
2211 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2214 DI opval
= ZEXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
)))));
2215 SET_H_GR (FLD (f_dest
), opval
);
2216 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2223 /* lduw: ld.uw $rm, $disp10x2, $rd */
2226 SEM_FN_NAME (sh64_media
,lduw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2228 #define FLD(f) abuf->fields.sfmt_lduw.f
2229 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2230 int UNUSED written
= 0;
2231 IADDR UNUSED pc
= abuf
->addr
;
2232 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2235 DI opval
= ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
)))));
2236 SET_H_GR (FLD (f_dest
), opval
);
2237 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2244 /* ldw: ld.w $rm, $disp10x2, $rd */
2247 SEM_FN_NAME (sh64_media
,ldw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2249 #define FLD(f) abuf->fields.sfmt_lduw.f
2250 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2251 int UNUSED written
= 0;
2252 IADDR UNUSED pc
= abuf
->addr
;
2253 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2256 DI opval
= EXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
)))));
2257 SET_H_GR (FLD (f_dest
), opval
);
2258 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2265 /* ldhil: ldhi.l $rm, $disp6, $rd */
2268 SEM_FN_NAME (sh64_media
,ldhil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2270 #define FLD(f) abuf->fields.sfmt_getcfg.f
2271 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2272 int UNUSED written
= 0;
2273 IADDR UNUSED pc
= abuf
->addr
;
2274 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2280 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2281 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 3), 1);
2283 if (ANDQI (tmp_bytecount
, 4)) {
2285 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -4)));
2286 SET_H_GR (FLD (f_dest
), opval
);
2287 written
|= (1 << 6);
2288 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2291 if (GET_H_ENDIAN ()) {
2293 if (ANDQI (tmp_bytecount
, 2)) {
2294 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2296 if (ANDQI (tmp_bytecount
, 1)) {
2297 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2300 DI opval
= EXTSIDI (tmp_val
);
2301 SET_H_GR (FLD (f_dest
), opval
);
2302 written
|= (1 << 6);
2303 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2308 if (ANDQI (tmp_bytecount
, 1)) {
2309 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2311 if (ANDQI (tmp_bytecount
, 2)) {
2312 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2315 DI opval
= EXTSIDI (SLLSI (tmp_val
, SUBSI (32, MULSI (8, tmp_bytecount
))));
2316 SET_H_GR (FLD (f_dest
), opval
);
2317 written
|= (1 << 6);
2318 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2325 abuf
->written
= written
;
2330 /* ldhiq: ldhi.q $rm, $disp6, $rd */
2333 SEM_FN_NAME (sh64_media
,ldhiq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2335 #define FLD(f) abuf->fields.sfmt_getcfg.f
2336 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2337 int UNUSED written
= 0;
2338 IADDR UNUSED pc
= abuf
->addr
;
2339 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2345 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2346 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 7), 1);
2348 if (ANDQI (tmp_bytecount
, 8)) {
2350 DI opval
= GETMEMDI (current_cpu
, pc
, ANDDI (tmp_addr
, -8));
2351 SET_H_GR (FLD (f_dest
), opval
);
2352 written
|= (1 << 7);
2353 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2356 if (GET_H_ENDIAN ()) {
2358 if (ANDQI (tmp_bytecount
, 4)) {
2359 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8))));
2361 if (ANDQI (tmp_bytecount
, 2)) {
2362 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2364 if (ANDQI (tmp_bytecount
, 1)) {
2365 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2369 SET_H_GR (FLD (f_dest
), opval
);
2370 written
|= (1 << 7);
2371 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2376 if (ANDQI (tmp_bytecount
, 1)) {
2377 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2379 if (ANDQI (tmp_bytecount
, 2)) {
2380 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4))));
2382 if (ANDQI (tmp_bytecount
, 4)) {
2383 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8))));
2386 DI opval
= SLLDI (tmp_val
, SUBSI (64, MULSI (8, tmp_bytecount
)));
2387 SET_H_GR (FLD (f_dest
), opval
);
2388 written
|= (1 << 7);
2389 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2396 abuf
->written
= written
;
2401 /* ldlol: ldlo.l $rm, $disp6, $rd */
2404 SEM_FN_NAME (sh64_media
,ldlol
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2406 #define FLD(f) abuf->fields.sfmt_getcfg.f
2407 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2408 int UNUSED written
= 0;
2409 IADDR UNUSED pc
= abuf
->addr
;
2410 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2416 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2417 tmp_bytecount
= SUBSI (4, ANDDI (tmp_addr
, 3));
2419 if (ANDQI (tmp_bytecount
, 4)) {
2421 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, tmp_addr
));
2422 SET_H_GR (FLD (f_dest
), opval
);
2423 written
|= (1 << 6);
2424 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2427 if (GET_H_ENDIAN ()) {
2429 if (ANDQI (tmp_bytecount
, 1)) {
2430 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2432 if (ANDQI (tmp_bytecount
, 2)) {
2433 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2436 DI opval
= EXTSIDI (SLLSI (tmp_val
, SUBSI (32, MULSI (8, tmp_bytecount
))));
2437 SET_H_GR (FLD (f_dest
), opval
);
2438 written
|= (1 << 6);
2439 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2444 if (ANDQI (tmp_bytecount
, 2)) {
2445 tmp_val
= ADDSI (SLLSI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2447 if (ANDQI (tmp_bytecount
, 1)) {
2448 tmp_val
= ADDSI (SLLSI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2451 DI opval
= EXTSIDI (tmp_val
);
2452 SET_H_GR (FLD (f_dest
), opval
);
2453 written
|= (1 << 6);
2454 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2461 abuf
->written
= written
;
2466 /* ldloq: ldlo.q $rm, $disp6, $rd */
2469 SEM_FN_NAME (sh64_media
,ldloq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2471 #define FLD(f) abuf->fields.sfmt_getcfg.f
2472 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2473 int UNUSED written
= 0;
2474 IADDR UNUSED pc
= abuf
->addr
;
2475 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2481 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
2482 tmp_bytecount
= SUBSI (8, ANDDI (tmp_addr
, 7));
2484 if (ANDQI (tmp_bytecount
, 8)) {
2486 DI opval
= GETMEMDI (current_cpu
, pc
, tmp_addr
);
2487 SET_H_GR (FLD (f_dest
), opval
);
2488 written
|= (1 << 7);
2489 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2492 if (GET_H_ENDIAN ()) {
2494 if (ANDQI (tmp_bytecount
, 1)) {
2495 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2497 if (ANDQI (tmp_bytecount
, 2)) {
2498 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2500 if (ANDQI (tmp_bytecount
, 4)) {
2501 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4))));
2504 DI opval
= SLLDI (tmp_val
, SUBSI (64, MULSI (8, tmp_bytecount
)));
2505 SET_H_GR (FLD (f_dest
), opval
);
2506 written
|= (1 << 7);
2507 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2512 if (ANDQI (tmp_bytecount
, 4)) {
2513 tmp_val
= ADDDI (SLLDI (tmp_val
, 32), ZEXTSIDI (GETMEMSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4))));
2515 if (ANDQI (tmp_bytecount
, 2)) {
2516 tmp_val
= ADDDI (SLLDI (tmp_val
, 16), ZEXTHIDI (GETMEMHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2))));
2518 if (ANDQI (tmp_bytecount
, 1)) {
2519 tmp_val
= ADDDI (SLLDI (tmp_val
, 8), ZEXTQIDI (GETMEMQI (current_cpu
, pc
, tmp_addr
)));
2523 SET_H_GR (FLD (f_dest
), opval
);
2524 written
|= (1 << 7);
2525 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2532 abuf
->written
= written
;
2537 /* ldxb: ldx.b $rm, $rn, $rd */
2540 SEM_FN_NAME (sh64_media
,ldxb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2542 #define FLD(f) abuf->fields.sfmt_add.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
, 4);
2549 DI opval
= EXTQIDI (GETMEMQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2550 SET_H_GR (FLD (f_dest
), opval
);
2551 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2558 /* ldxl: ldx.l $rm, $rn, $rd */
2561 SEM_FN_NAME (sh64_media
,ldxl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2563 #define FLD(f) abuf->fields.sfmt_add.f
2564 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2565 int UNUSED written
= 0;
2566 IADDR UNUSED pc
= abuf
->addr
;
2567 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2570 DI opval
= EXTSIDI (GETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2571 SET_H_GR (FLD (f_dest
), opval
);
2572 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2579 /* ldxq: ldx.q $rm, $rn, $rd */
2582 SEM_FN_NAME (sh64_media
,ldxq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2584 #define FLD(f) abuf->fields.sfmt_add.f
2585 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2586 int UNUSED written
= 0;
2587 IADDR UNUSED pc
= abuf
->addr
;
2588 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2591 DI opval
= GETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))));
2592 SET_H_GR (FLD (f_dest
), opval
);
2593 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2600 /* ldxub: ldx.ub $rm, $rn, $rd */
2603 SEM_FN_NAME (sh64_media
,ldxub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2605 #define FLD(f) abuf->fields.sfmt_add.f
2606 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2607 int UNUSED written
= 0;
2608 IADDR UNUSED pc
= abuf
->addr
;
2609 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2612 DI opval
= ZEXTQIDI (GETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2613 SET_H_GR (FLD (f_dest
), opval
);
2614 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2621 /* ldxuw: ldx.uw $rm, $rn, $rd */
2624 SEM_FN_NAME (sh64_media
,ldxuw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2626 #define FLD(f) abuf->fields.sfmt_add.f
2627 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2628 int UNUSED written
= 0;
2629 IADDR UNUSED pc
= abuf
->addr
;
2630 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2633 DI opval
= ZEXTHIDI (GETMEMUHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2634 SET_H_GR (FLD (f_dest
), opval
);
2635 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2642 /* ldxw: ldx.w $rm, $rn, $rd */
2645 SEM_FN_NAME (sh64_media
,ldxw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2647 #define FLD(f) abuf->fields.sfmt_add.f
2648 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2649 int UNUSED written
= 0;
2650 IADDR UNUSED pc
= abuf
->addr
;
2651 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2654 DI opval
= EXTHIDI (GETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)))));
2655 SET_H_GR (FLD (f_dest
), opval
);
2656 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2663 /* mabsl: mabs.l $rm, $rd */
2666 SEM_FN_NAME (sh64_media
,mabsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2668 #define FLD(f) abuf->fields.sfmt_xori.f
2669 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2670 int UNUSED written
= 0;
2671 IADDR UNUSED pc
= abuf
->addr
;
2672 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2677 tmp_result0
= ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1));
2678 tmp_result1
= ABSSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0));
2680 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2681 SET_H_GR (FLD (f_dest
), opval
);
2682 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2690 /* mabsw: mabs.w $rm, $rd */
2693 SEM_FN_NAME (sh64_media
,mabsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2695 #define FLD(f) abuf->fields.sfmt_xori.f
2696 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2697 int UNUSED written
= 0;
2698 IADDR UNUSED pc
= abuf
->addr
;
2699 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2706 tmp_result0
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3));
2707 tmp_result1
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2));
2708 tmp_result2
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1));
2709 tmp_result3
= ABSHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0));
2711 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2712 SET_H_GR (FLD (f_dest
), opval
);
2713 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2721 /* maddl: madd.l $rm, $rn, $rd */
2724 SEM_FN_NAME (sh64_media
,maddl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2726 #define FLD(f) abuf->fields.sfmt_add.f
2727 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2728 int UNUSED written
= 0;
2729 IADDR UNUSED pc
= abuf
->addr
;
2730 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2735 tmp_result0
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
2736 tmp_result1
= ADDSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
2738 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2739 SET_H_GR (FLD (f_dest
), opval
);
2740 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2748 /* maddw: madd.w $rm, $rn, $rd */
2751 SEM_FN_NAME (sh64_media
,maddw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2753 #define FLD(f) abuf->fields.sfmt_add.f
2754 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2755 int UNUSED written
= 0;
2756 IADDR UNUSED pc
= abuf
->addr
;
2757 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2764 tmp_result0
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
2765 tmp_result1
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
2766 tmp_result2
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
2767 tmp_result3
= ADDHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
2769 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2770 SET_H_GR (FLD (f_dest
), opval
);
2771 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2779 /* maddsl: madds.l $rm, $rn, $rd */
2782 SEM_FN_NAME (sh64_media
,maddsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2784 #define FLD(f) abuf->fields.sfmt_add.f
2785 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2786 int UNUSED written
= 0;
2787 IADDR UNUSED pc
= abuf
->addr
;
2788 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2793 tmp_result0
= ((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
2794 tmp_result1
= ((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
2796 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2797 SET_H_GR (FLD (f_dest
), opval
);
2798 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2806 /* maddsub: madds.ub $rm, $rn, $rd */
2809 SEM_FN_NAME (sh64_media
,maddsub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2811 #define FLD(f) abuf->fields.sfmt_add.f
2812 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2813 int UNUSED written
= 0;
2814 IADDR UNUSED pc
= abuf
->addr
;
2815 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2826 tmp_result0
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7)))) : (SUBQI (SLLQI (1, 8), 1)))));
2827 tmp_result1
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6)))) : (SUBQI (SLLQI (1, 8), 1)))));
2828 tmp_result2
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5)))) : (SUBQI (SLLQI (1, 8), 1)))));
2829 tmp_result3
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4)))) : (SUBQI (SLLQI (1, 8), 1)))));
2830 tmp_result4
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3)))) : (SUBQI (SLLQI (1, 8), 1)))));
2831 tmp_result5
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2)))) : (SUBQI (SLLQI (1, 8), 1)))));
2832 tmp_result6
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBQI (SLLQI (1, 8), 1)))));
2833 tmp_result7
= ((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), MAKEDI (0, 0))) ? (0) : (((LTDI (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, 8))) ? (ADDDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBQI (SLLQI (1, 8), 1)))));
2835 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
2836 SET_H_GR (FLD (f_dest
), opval
);
2837 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2845 /* maddsw: madds.w $rm, $rn, $rd */
2848 SEM_FN_NAME (sh64_media
,maddsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2850 #define FLD(f) abuf->fields.sfmt_add.f
2851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2852 int UNUSED written
= 0;
2853 IADDR UNUSED pc
= abuf
->addr
;
2854 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2861 tmp_result0
= ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2862 tmp_result1
= ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2863 tmp_result2
= ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2864 tmp_result3
= ((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, SUBSI (16, 1)))) ? (ADDDI (EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), EXTHIDI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
2866 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2867 SET_H_GR (FLD (f_dest
), opval
);
2868 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2876 /* mcmpeqb: mcmpeq.b $rm, $rn, $rd */
2879 SEM_FN_NAME (sh64_media
,mcmpeqb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2881 #define FLD(f) abuf->fields.sfmt_add.f
2882 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2883 int UNUSED written
= 0;
2884 IADDR UNUSED pc
= abuf
->addr
;
2885 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2896 tmp_result0
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))) ? (INVQI (0)) : (0));
2897 tmp_result1
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))) ? (INVQI (0)) : (0));
2898 tmp_result2
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))) ? (INVQI (0)) : (0));
2899 tmp_result3
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))) ? (INVQI (0)) : (0));
2900 tmp_result4
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))) ? (INVQI (0)) : (0));
2901 tmp_result5
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))) ? (INVQI (0)) : (0));
2902 tmp_result6
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))) ? (INVQI (0)) : (0));
2903 tmp_result7
= ((EQQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))) ? (INVQI (0)) : (0));
2905 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
2906 SET_H_GR (FLD (f_dest
), opval
);
2907 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2915 /* mcmpeql: mcmpeq.l $rm, $rn, $rd */
2918 SEM_FN_NAME (sh64_media
,mcmpeql
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2920 #define FLD(f) abuf->fields.sfmt_add.f
2921 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2922 int UNUSED written
= 0;
2923 IADDR UNUSED pc
= abuf
->addr
;
2924 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2929 tmp_result0
= ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))) ? (INVSI (0)) : (0));
2930 tmp_result1
= ((EQSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))) ? (INVSI (0)) : (0));
2932 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2933 SET_H_GR (FLD (f_dest
), opval
);
2934 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2942 /* mcmpeqw: mcmpeq.w $rm, $rn, $rd */
2945 SEM_FN_NAME (sh64_media
,mcmpeqw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2947 #define FLD(f) abuf->fields.sfmt_add.f
2948 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2949 int UNUSED written
= 0;
2950 IADDR UNUSED pc
= abuf
->addr
;
2951 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2958 tmp_result0
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))) ? (INVHI (0)) : (0));
2959 tmp_result1
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))) ? (INVHI (0)) : (0));
2960 tmp_result2
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))) ? (INVHI (0)) : (0));
2961 tmp_result3
= ((EQHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))) ? (INVHI (0)) : (0));
2963 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
2964 SET_H_GR (FLD (f_dest
), opval
);
2965 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
2973 /* mcmpgtl: mcmpgt.l $rm, $rn, $rd */
2976 SEM_FN_NAME (sh64_media
,mcmpgtl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2978 #define FLD(f) abuf->fields.sfmt_add.f
2979 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2980 int UNUSED written
= 0;
2981 IADDR UNUSED pc
= abuf
->addr
;
2982 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2987 tmp_result0
= ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))) ? (INVSI (0)) : (0));
2988 tmp_result1
= ((GTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))) ? (INVSI (0)) : (0));
2990 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
2991 SET_H_GR (FLD (f_dest
), opval
);
2992 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3000 /* mcmpgtub: mcmpgt.ub $rm, $rn, $rd */
3003 SEM_FN_NAME (sh64_media
,mcmpgtub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3005 #define FLD(f) abuf->fields.sfmt_add.f
3006 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3007 int UNUSED written
= 0;
3008 IADDR UNUSED pc
= abuf
->addr
;
3009 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3020 tmp_result0
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))) ? (INVQI (0)) : (0));
3021 tmp_result1
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))) ? (INVQI (0)) : (0));
3022 tmp_result2
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))) ? (INVQI (0)) : (0));
3023 tmp_result3
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))) ? (INVQI (0)) : (0));
3024 tmp_result4
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))) ? (INVQI (0)) : (0));
3025 tmp_result5
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))) ? (INVQI (0)) : (0));
3026 tmp_result6
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))) ? (INVQI (0)) : (0));
3027 tmp_result7
= ((GTUQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))) ? (INVQI (0)) : (0));
3029 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
3030 SET_H_GR (FLD (f_dest
), opval
);
3031 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3039 /* mcmpgtw: mcmpgt.w $rm, $rn, $rd */
3042 SEM_FN_NAME (sh64_media
,mcmpgtw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3044 #define FLD(f) abuf->fields.sfmt_add.f
3045 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3046 int UNUSED written
= 0;
3047 IADDR UNUSED pc
= abuf
->addr
;
3048 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3055 tmp_result0
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))) ? (INVHI (0)) : (0));
3056 tmp_result1
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))) ? (INVHI (0)) : (0));
3057 tmp_result2
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))) ? (INVHI (0)) : (0));
3058 tmp_result3
= ((GTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0))) ? (INVHI (0)) : (0));
3060 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3061 SET_H_GR (FLD (f_dest
), opval
);
3062 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3070 /* mcmv: mcmv $rm, $rn, $rd */
3073 SEM_FN_NAME (sh64_media
,mcmv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3075 #define FLD(f) abuf->fields.sfmt_add.f
3076 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3077 int UNUSED written
= 0;
3078 IADDR UNUSED pc
= abuf
->addr
;
3079 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3082 DI opval
= ORDI (ANDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), ANDDI (GET_H_GR (FLD (f_dest
)), INVDI (GET_H_GR (FLD (f_right
)))));
3083 SET_H_GR (FLD (f_dest
), opval
);
3084 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3091 /* mcnvslw: mcnvs.lw $rm, $rn, $rd */
3094 SEM_FN_NAME (sh64_media
,mcnvslw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3096 #define FLD(f) abuf->fields.sfmt_add.f
3097 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3098 int UNUSED written
= 0;
3099 IADDR UNUSED pc
= abuf
->addr
;
3100 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3107 tmp_result0
= ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3108 tmp_result1
= ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3109 tmp_result2
= ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3110 tmp_result3
= ((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0), SLLDI (1, SUBSI (16, 1)))) ? (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3112 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3113 SET_H_GR (FLD (f_dest
), opval
);
3114 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3122 /* mcnvswb: mcnvs.wb $rm, $rn, $rd */
3125 SEM_FN_NAME (sh64_media
,mcnvswb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3127 #define FLD(f) abuf->fields.sfmt_add.f
3128 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3129 int UNUSED written
= 0;
3130 IADDR UNUSED pc
= abuf
->addr
;
3131 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3142 tmp_result0
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3143 tmp_result1
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3144 tmp_result2
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3145 tmp_result3
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3146 tmp_result4
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3147 tmp_result5
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3148 tmp_result6
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3149 tmp_result7
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0), NEGDI (SLLDI (1, SUBSI (8, 1))))) ? (NEGQI (SLLQI (1, SUBSI (8, 1)))) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0), SLLDI (1, SUBSI (8, 1)))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)) : (SUBQI (SLLQI (1, SUBSI (8, 1)), 1)))));
3151 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
3152 SET_H_GR (FLD (f_dest
), opval
);
3153 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3161 /* mcnvswub: mcnvs.wub $rm, $rn, $rd */
3164 SEM_FN_NAME (sh64_media
,mcnvswub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3166 #define FLD(f) abuf->fields.sfmt_add.f
3167 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3168 int UNUSED written
= 0;
3169 IADDR UNUSED pc
= abuf
->addr
;
3170 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3181 tmp_result0
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)) : (SUBQI (SLLQI (1, 8), 1)))));
3182 tmp_result1
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)) : (SUBQI (SLLQI (1, 8), 1)))));
3183 tmp_result2
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)) : (SUBQI (SLLQI (1, 8), 1)))));
3184 tmp_result3
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)) : (SUBQI (SLLQI (1, 8), 1)))));
3185 tmp_result4
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)) : (SUBQI (SLLQI (1, 8), 1)))));
3186 tmp_result5
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)) : (SUBQI (SLLQI (1, 8), 1)))));
3187 tmp_result6
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)) : (SUBQI (SLLQI (1, 8), 1)))));
3188 tmp_result7
= ((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0), MAKEDI (0, 0))) ? (0) : (((LTHI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0), SLLDI (1, 8))) ? (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)) : (SUBQI (SLLQI (1, 8), 1)))));
3190 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
3191 SET_H_GR (FLD (f_dest
), opval
);
3192 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3200 /* mextr1: mextr1 $rm, $rn, $rd */
3203 SEM_FN_NAME (sh64_media
,mextr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3205 #define FLD(f) abuf->fields.sfmt_add.f
3206 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3207 int UNUSED written
= 0;
3208 IADDR UNUSED pc
= abuf
->addr
;
3209 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3215 tmp_count
= MULQI (8, 1);
3216 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3217 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3218 tmp_count
= MULQI (8, SUBQI (8, 1));
3219 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3221 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3222 SET_H_GR (FLD (f_dest
), opval
);
3223 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3231 /* mextr2: mextr2 $rm, $rn, $rd */
3234 SEM_FN_NAME (sh64_media
,mextr2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3236 #define FLD(f) abuf->fields.sfmt_add.f
3237 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3238 int UNUSED written
= 0;
3239 IADDR UNUSED pc
= abuf
->addr
;
3240 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3246 tmp_count
= MULQI (8, 2);
3247 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3248 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3249 tmp_count
= MULQI (8, SUBQI (8, 2));
3250 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3252 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3253 SET_H_GR (FLD (f_dest
), opval
);
3254 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3262 /* mextr3: mextr3 $rm, $rn, $rd */
3265 SEM_FN_NAME (sh64_media
,mextr3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3267 #define FLD(f) abuf->fields.sfmt_add.f
3268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3269 int UNUSED written
= 0;
3270 IADDR UNUSED pc
= abuf
->addr
;
3271 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3277 tmp_count
= MULQI (8, 3);
3278 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3279 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3280 tmp_count
= MULQI (8, SUBQI (8, 3));
3281 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3283 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3284 SET_H_GR (FLD (f_dest
), opval
);
3285 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3293 /* mextr4: mextr4 $rm, $rn, $rd */
3296 SEM_FN_NAME (sh64_media
,mextr4
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3298 #define FLD(f) abuf->fields.sfmt_add.f
3299 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3300 int UNUSED written
= 0;
3301 IADDR UNUSED pc
= abuf
->addr
;
3302 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3308 tmp_count
= MULQI (8, 4);
3309 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3310 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3311 tmp_count
= MULQI (8, SUBQI (8, 4));
3312 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3314 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3315 SET_H_GR (FLD (f_dest
), opval
);
3316 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3324 /* mextr5: mextr5 $rm, $rn, $rd */
3327 SEM_FN_NAME (sh64_media
,mextr5
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3329 #define FLD(f) abuf->fields.sfmt_add.f
3330 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3331 int UNUSED written
= 0;
3332 IADDR UNUSED pc
= abuf
->addr
;
3333 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3339 tmp_count
= MULQI (8, 5);
3340 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3341 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3342 tmp_count
= MULQI (8, SUBQI (8, 5));
3343 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3345 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3346 SET_H_GR (FLD (f_dest
), opval
);
3347 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3355 /* mextr6: mextr6 $rm, $rn, $rd */
3358 SEM_FN_NAME (sh64_media
,mextr6
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3360 #define FLD(f) abuf->fields.sfmt_add.f
3361 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3362 int UNUSED written
= 0;
3363 IADDR UNUSED pc
= abuf
->addr
;
3364 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3370 tmp_count
= MULQI (8, 6);
3371 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3372 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3373 tmp_count
= MULQI (8, SUBQI (8, 6));
3374 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3376 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3377 SET_H_GR (FLD (f_dest
), opval
);
3378 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3386 /* mextr7: mextr7 $rm, $rn, $rd */
3389 SEM_FN_NAME (sh64_media
,mextr7
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3391 #define FLD(f) abuf->fields.sfmt_add.f
3392 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3393 int UNUSED written
= 0;
3394 IADDR UNUSED pc
= abuf
->addr
;
3395 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3401 tmp_count
= MULQI (8, 7);
3402 tmp_mask
= SLLDI (INVSI (0), tmp_count
);
3403 tmp_rhs
= SRLDI (ANDDI (GET_H_GR (FLD (f_left
)), tmp_mask
), tmp_count
);
3404 tmp_count
= MULQI (8, SUBQI (8, 7));
3405 tmp_mask
= SRLDI (INVSI (0), tmp_count
);
3407 DI opval
= ORDI (tmp_rhs
, SLLDI (ANDDI (GET_H_GR (FLD (f_right
)), tmp_mask
), tmp_count
));
3408 SET_H_GR (FLD (f_dest
), opval
);
3409 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3417 /* mmacfxwl: mmacfx.wl $rm, $rn, $rd */
3420 SEM_FN_NAME (sh64_media
,mmacfxwl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3422 #define FLD(f) abuf->fields.sfmt_add.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
, 4);
3432 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
3433 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 0);
3434 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3435 tmp_temp
= ((LTDI (SLLDI (tmp_temp
, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp
, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp
, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3436 tmp_result0
= ((LTDI (ADDDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
)), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3437 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3438 tmp_temp
= ((LTDI (SLLDI (tmp_temp
, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp
, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp
, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3439 tmp_result1
= ((LTDI (ADDDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (ADDDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
)), SLLDI (1, SUBSI (32, 1)))) ? (ADDDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3441 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3442 SET_H_GR (FLD (f_dest
), opval
);
3443 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3451 /* mmacnfx.wl: mmacnfx.wl $rm, $rn, $rd */
3454 SEM_FN_NAME (sh64_media
,mmacnfx_wl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3456 #define FLD(f) abuf->fields.sfmt_add.f
3457 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3458 int UNUSED written
= 0;
3459 IADDR UNUSED pc
= abuf
->addr
;
3460 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3466 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
3467 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 0);
3468 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3469 tmp_temp
= ((LTDI (SLLDI (tmp_temp
, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp
, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp
, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3470 tmp_result0
= ((LTDI (SUBDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
)), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (tmp_result0
), EXTSIDI (tmp_temp
))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3471 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3472 tmp_temp
= ((LTDI (SLLDI (tmp_temp
, 1), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (tmp_temp
, 1), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (tmp_temp
, 1)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3473 tmp_result1
= ((LTDI (SUBDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
)), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (tmp_result1
), EXTSIDI (tmp_temp
))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3475 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3476 SET_H_GR (FLD (f_dest
), opval
);
3477 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3485 /* mmull: mmul.l $rm, $rn, $rd */
3488 SEM_FN_NAME (sh64_media
,mmull
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3490 #define FLD(f) abuf->fields.sfmt_add.f
3491 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3492 int UNUSED written
= 0;
3493 IADDR UNUSED pc
= abuf
->addr
;
3494 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3499 tmp_result0
= MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
3500 tmp_result1
= MULSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
3502 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3503 SET_H_GR (FLD (f_dest
), opval
);
3504 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3512 /* mmulw: mmul.w $rm, $rn, $rd */
3515 SEM_FN_NAME (sh64_media
,mmulw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3517 #define FLD(f) abuf->fields.sfmt_add.f
3518 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3519 int UNUSED written
= 0;
3520 IADDR UNUSED pc
= abuf
->addr
;
3521 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3528 tmp_result0
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
3529 tmp_result1
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
3530 tmp_result2
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
3531 tmp_result3
= MULHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
3533 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3534 SET_H_GR (FLD (f_dest
), opval
);
3535 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3543 /* mmulfxl: mmulfx.l $rm, $rn, $rd */
3546 SEM_FN_NAME (sh64_media
,mmulfxl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3548 #define FLD(f) abuf->fields.sfmt_add.f
3549 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3550 int UNUSED written
= 0;
3551 IADDR UNUSED pc
= abuf
->addr
;
3552 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3558 tmp_temp
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
3559 tmp_result0
= ((LTDI (SRADI (tmp_temp
, 31), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SRADI (tmp_temp
, 31), SLLDI (1, SUBSI (32, 1)))) ? (SRADI (tmp_temp
, 31)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3560 tmp_temp
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0)));
3561 tmp_result1
= ((LTDI (SRADI (tmp_temp
, 31), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SRADI (tmp_temp
, 31), SLLDI (1, SUBSI (32, 1)))) ? (SRADI (tmp_temp
, 31)) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3563 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3564 SET_H_GR (FLD (f_dest
), opval
);
3565 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3573 /* mmulfxw: mmulfx.w $rm, $rn, $rd */
3576 SEM_FN_NAME (sh64_media
,mmulfxw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3578 #define FLD(f) abuf->fields.sfmt_add.f
3579 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3580 int UNUSED written
= 0;
3581 IADDR UNUSED pc
= abuf
->addr
;
3582 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3590 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3591 tmp_result0
= ((LTSI (SRASI (tmp_temp
, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp
, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp
, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3592 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3593 tmp_result1
= ((LTSI (SRASI (tmp_temp
, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp
, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp
, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3594 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3595 tmp_result2
= ((LTSI (SRASI (tmp_temp
, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp
, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp
, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3596 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3597 tmp_result3
= ((LTSI (SRASI (tmp_temp
, 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (tmp_temp
, 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (tmp_temp
, 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3599 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3600 SET_H_GR (FLD (f_dest
), opval
);
3601 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3609 /* mmulfxrpw: mmulfxrp.w $rm, $rn, $rd */
3612 SEM_FN_NAME (sh64_media
,mmulfxrpw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3614 #define FLD(f) abuf->fields.sfmt_add.f
3615 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3616 int UNUSED written
= 0;
3617 IADDR UNUSED pc
= abuf
->addr
;
3618 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3627 tmp_c
= SLLSI (1, 14);
3628 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3629 tmp_result0
= ((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp
, tmp_c
), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3630 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3631 tmp_result1
= ((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp
, tmp_c
), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3632 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3633 tmp_result2
= ((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp
, tmp_c
), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3634 tmp_temp
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3635 tmp_result3
= ((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTSI (SRASI (ADDSI (tmp_temp
, tmp_c
), 15), SLLDI (1, SUBSI (16, 1)))) ? (SRASI (ADDSI (tmp_temp
, tmp_c
), 15)) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3637 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3638 SET_H_GR (FLD (f_dest
), opval
);
3639 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3647 /* mmulhiwl: mmulhi.wl $rm, $rn, $rd */
3650 SEM_FN_NAME (sh64_media
,mmulhiwl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3652 #define FLD(f) abuf->fields.sfmt_add.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
, 4);
3661 tmp_result0
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1)));
3662 tmp_result1
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3664 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3665 SET_H_GR (FLD (f_dest
), opval
);
3666 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3674 /* mmullowl: mmullo.wl $rm, $rn, $rd */
3677 SEM_FN_NAME (sh64_media
,mmullowl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3679 #define FLD(f) abuf->fields.sfmt_add.f
3680 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3681 int UNUSED written
= 0;
3682 IADDR UNUSED pc
= abuf
->addr
;
3683 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3688 tmp_result0
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3)));
3689 tmp_result1
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2)));
3691 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3692 SET_H_GR (FLD (f_dest
), opval
);
3693 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3701 /* mmulsumwq: mmulsum.wq $rm, $rn, $rd */
3704 SEM_FN_NAME (sh64_media
,mmulsumwq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3706 #define FLD(f) abuf->fields.sfmt_add.f
3707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3708 int UNUSED written
= 0;
3709 IADDR UNUSED pc
= abuf
->addr
;
3710 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3714 tmp_acc
= MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0)));
3715 tmp_acc
= ADDDI (tmp_acc
, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1))));
3716 tmp_acc
= ADDDI (tmp_acc
, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2))));
3717 tmp_acc
= ADDDI (tmp_acc
, MULSI (ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3)), ZEXTHISI (SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3))));
3719 DI opval
= ADDDI (GET_H_GR (FLD (f_dest
)), tmp_acc
);
3720 SET_H_GR (FLD (f_dest
), opval
);
3721 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3729 /* movi: movi $imm16, $rd */
3732 SEM_FN_NAME (sh64_media
,movi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3734 #define FLD(f) abuf->fields.sfmt_movi.f
3735 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3736 int UNUSED written
= 0;
3737 IADDR UNUSED pc
= abuf
->addr
;
3738 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3741 DI opval
= EXTSIDI (FLD (f_imm16
));
3742 SET_H_GR (FLD (f_dest
), opval
);
3743 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3750 /* mpermw: mperm.w $rm, $rn, $rd */
3753 SEM_FN_NAME (sh64_media
,mpermw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3755 #define FLD(f) abuf->fields.sfmt_add.f
3756 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3757 int UNUSED written
= 0;
3758 IADDR UNUSED pc
= abuf
->addr
;
3759 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3767 tmp_control
= ANDQI (GET_H_GR (FLD (f_right
)), 255);
3768 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (tmp_control
, 3)));
3769 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 2), 3)));
3770 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 4), 3)));
3771 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), SUBSI (3, ANDQI (SRLQI (tmp_control
, 6), 3)));
3773 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3774 SET_H_GR (FLD (f_dest
), opval
);
3775 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3783 /* msadubq: msad.ubq $rm, $rn, $rd */
3786 SEM_FN_NAME (sh64_media
,msadubq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3788 #define FLD(f) abuf->fields.sfmt_add.f
3789 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3790 int UNUSED written
= 0;
3791 IADDR UNUSED pc
= abuf
->addr
;
3792 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3796 tmp_acc
= ABSDI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0)));
3797 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))));
3798 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))));
3799 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))));
3800 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))));
3801 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))));
3802 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))));
3803 tmp_acc
= ADDDI (tmp_acc
, ABSQI (SUBQI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7), SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))));
3805 DI opval
= ADDDI (GET_H_GR (FLD (f_dest
)), tmp_acc
);
3806 SET_H_GR (FLD (f_dest
), opval
);
3807 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3815 /* mshaldsl: mshalds.l $rm, $rn, $rd */
3818 SEM_FN_NAME (sh64_media
,mshaldsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3820 #define FLD(f) abuf->fields.sfmt_add.f
3821 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3822 int UNUSED written
= 0;
3823 IADDR UNUSED pc
= abuf
->addr
;
3824 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3829 tmp_result0
= ((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31)), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3830 tmp_result1
= ((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31)), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31)), SLLDI (1, SUBSI (32, 1)))) ? (SLLDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
3832 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3833 SET_H_GR (FLD (f_dest
), opval
);
3834 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3842 /* mshaldsw: mshalds.w $rm, $rn, $rd */
3845 SEM_FN_NAME (sh64_media
,mshaldsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3847 #define FLD(f) abuf->fields.sfmt_add.f
3848 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3849 int UNUSED written
= 0;
3850 IADDR UNUSED pc
= abuf
->addr
;
3851 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3858 tmp_result0
= ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3859 tmp_result1
= ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3860 tmp_result2
= ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3861 tmp_result3
= ((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15)), SLLDI (1, SUBSI (16, 1)))) ? (SLLDI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
3863 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3864 SET_H_GR (FLD (f_dest
), opval
);
3865 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3873 /* mshardl: mshard.l $rm, $rn, $rd */
3876 SEM_FN_NAME (sh64_media
,mshardl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3878 #define FLD(f) abuf->fields.sfmt_add.f
3879 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3880 int UNUSED written
= 0;
3881 IADDR UNUSED pc
= abuf
->addr
;
3882 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3887 tmp_result0
= SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
3888 tmp_result1
= SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
3890 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
3891 SET_H_GR (FLD (f_dest
), opval
);
3892 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3900 /* mshardw: mshard.w $rm, $rn, $rd */
3903 SEM_FN_NAME (sh64_media
,mshardw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3905 #define FLD(f) abuf->fields.sfmt_add.f
3906 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3907 int UNUSED written
= 0;
3908 IADDR UNUSED pc
= abuf
->addr
;
3909 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3916 tmp_result0
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3917 tmp_result1
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3918 tmp_result2
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3919 tmp_result3
= SRAHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
3921 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
3922 SET_H_GR (FLD (f_dest
), opval
);
3923 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3931 /* mshardsq: mshards.q $rm, $rn, $rd */
3934 SEM_FN_NAME (sh64_media
,mshardsq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3936 #define FLD(f) abuf->fields.sfmt_add.f
3937 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3938 int UNUSED written
= 0;
3939 IADDR UNUSED pc
= abuf
->addr
;
3940 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3943 DI opval
= ((LTDI (SRADI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63)), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGDI (SLLDI (1, SUBSI (16, 1)))) : (((LTDI (SRADI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63)), SLLDI (1, SUBSI (16, 1)))) ? (SRADI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63))) : (SUBDI (SLLDI (1, SUBSI (16, 1)), 1)))));
3944 SET_H_GR (FLD (f_dest
), opval
);
3945 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3952 /* mshfhib: mshfhi.b $rm, $rn, $rd */
3955 SEM_FN_NAME (sh64_media
,mshfhib
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3957 #define FLD(f) abuf->fields.sfmt_add.f
3958 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3959 int UNUSED written
= 0;
3960 IADDR UNUSED pc
= abuf
->addr
;
3961 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3972 tmp_result0
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3);
3973 tmp_result1
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3);
3974 tmp_result2
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2);
3975 tmp_result3
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2);
3976 tmp_result4
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1);
3977 tmp_result5
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1);
3978 tmp_result6
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0);
3979 tmp_result7
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0);
3981 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
3982 SET_H_GR (FLD (f_dest
), opval
);
3983 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
3991 /* mshfhil: mshfhi.l $rm, $rn, $rd */
3994 SEM_FN_NAME (sh64_media
,mshfhil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3996 #define FLD(f) abuf->fields.sfmt_add.f
3997 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3998 int UNUSED written
= 0;
3999 IADDR UNUSED pc
= abuf
->addr
;
4000 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4005 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0);
4006 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0);
4008 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4009 SET_H_GR (FLD (f_dest
), opval
);
4010 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4018 /* mshfhiw: mshfhi.w $rm, $rn, $rd */
4021 SEM_FN_NAME (sh64_media
,mshfhiw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4023 #define FLD(f) abuf->fields.sfmt_add.f
4024 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4025 int UNUSED written
= 0;
4026 IADDR UNUSED pc
= abuf
->addr
;
4027 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4034 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1);
4035 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1);
4036 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0);
4037 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0);
4039 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4040 SET_H_GR (FLD (f_dest
), opval
);
4041 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4049 /* mshflob: mshflo.b $rm, $rn, $rd */
4052 SEM_FN_NAME (sh64_media
,mshflob
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4054 #define FLD(f) abuf->fields.sfmt_add.f
4055 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4056 int UNUSED written
= 0;
4057 IADDR UNUSED pc
= abuf
->addr
;
4058 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4069 tmp_result0
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7);
4070 tmp_result1
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7);
4071 tmp_result2
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6);
4072 tmp_result3
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6);
4073 tmp_result4
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5);
4074 tmp_result5
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5);
4075 tmp_result6
= SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4);
4076 tmp_result7
= SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4);
4078 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
4079 SET_H_GR (FLD (f_dest
), opval
);
4080 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4088 /* mshflol: mshflo.l $rm, $rn, $rd */
4091 SEM_FN_NAME (sh64_media
,mshflol
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4093 #define FLD(f) abuf->fields.sfmt_add.f
4094 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4095 int UNUSED written
= 0;
4096 IADDR UNUSED pc
= abuf
->addr
;
4097 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4102 tmp_result0
= SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1);
4103 tmp_result1
= SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1);
4105 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4106 SET_H_GR (FLD (f_dest
), opval
);
4107 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4115 /* mshflow: mshflo.w $rm, $rn, $rd */
4118 SEM_FN_NAME (sh64_media
,mshflow
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4120 #define FLD(f) abuf->fields.sfmt_add.f
4121 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4122 int UNUSED written
= 0;
4123 IADDR UNUSED pc
= abuf
->addr
;
4124 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4131 tmp_result0
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3);
4132 tmp_result1
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3);
4133 tmp_result2
= SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2);
4134 tmp_result3
= SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2);
4136 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4137 SET_H_GR (FLD (f_dest
), opval
);
4138 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4146 /* mshlldl: mshlld.l $rm, $rn, $rd */
4149 SEM_FN_NAME (sh64_media
,mshlldl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4151 #define FLD(f) abuf->fields.sfmt_add.f
4152 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4153 int UNUSED written
= 0;
4154 IADDR UNUSED pc
= abuf
->addr
;
4155 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4160 tmp_result0
= SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4161 tmp_result1
= SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4163 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4164 SET_H_GR (FLD (f_dest
), opval
);
4165 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4173 /* mshlldw: mshlld.w $rm, $rn, $rd */
4176 SEM_FN_NAME (sh64_media
,mshlldw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4178 #define FLD(f) abuf->fields.sfmt_add.f
4179 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4180 int UNUSED written
= 0;
4181 IADDR UNUSED pc
= abuf
->addr
;
4182 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4189 tmp_result0
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4190 tmp_result1
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4191 tmp_result2
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4192 tmp_result3
= SLLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4194 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4195 SET_H_GR (FLD (f_dest
), opval
);
4196 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4204 /* mshlrdl: mshlrd.l $rm, $rn, $rd */
4207 SEM_FN_NAME (sh64_media
,mshlrdl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4209 #define FLD(f) abuf->fields.sfmt_add.f
4210 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4211 int UNUSED written
= 0;
4212 IADDR UNUSED pc
= abuf
->addr
;
4213 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4218 tmp_result0
= SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4219 tmp_result1
= SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 31));
4221 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4222 SET_H_GR (FLD (f_dest
), opval
);
4223 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4231 /* mshlrdw: mshlrd.w $rm, $rn, $rd */
4234 SEM_FN_NAME (sh64_media
,mshlrdw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4236 #define FLD(f) abuf->fields.sfmt_add.f
4237 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4238 int UNUSED written
= 0;
4239 IADDR UNUSED pc
= abuf
->addr
;
4240 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4247 tmp_result0
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4248 tmp_result1
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4249 tmp_result2
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4250 tmp_result3
= SRLHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), ANDDI (GET_H_GR (FLD (f_right
)), 15));
4252 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4253 SET_H_GR (FLD (f_dest
), opval
);
4254 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4262 /* msubl: msub.l $rm, $rn, $rd */
4265 SEM_FN_NAME (sh64_media
,msubl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4267 #define FLD(f) abuf->fields.sfmt_add.f
4268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4269 int UNUSED written
= 0;
4270 IADDR UNUSED pc
= abuf
->addr
;
4271 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4276 tmp_result0
= SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1));
4277 tmp_result1
= SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0));
4279 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4280 SET_H_GR (FLD (f_dest
), opval
);
4281 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4289 /* msubw: msub.w $rm, $rn, $rd */
4292 SEM_FN_NAME (sh64_media
,msubw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4294 #define FLD(f) abuf->fields.sfmt_add.f
4295 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4296 int UNUSED written
= 0;
4297 IADDR UNUSED pc
= abuf
->addr
;
4298 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4305 tmp_result0
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 3), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 3));
4306 tmp_result1
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 2), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 2));
4307 tmp_result2
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 1));
4308 tmp_result3
= SUBHI (SUBWORDDIHI (GET_H_GR (FLD (f_left
)), 0), SUBWORDDIHI (GET_H_GR (FLD (f_right
)), 0));
4310 DI opval
= ORDI (SLLDI (ZEXTHIDI (tmp_result3
), 48), ORDI (SLLDI (ZEXTHIDI (tmp_result2
), 32), ORDI (SLLDI (ZEXTHIDI (tmp_result1
), 16), ZEXTHIDI (tmp_result0
))));
4311 SET_H_GR (FLD (f_dest
), opval
);
4312 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4320 /* msubsl: msubs.l $rm, $rn, $rd */
4323 SEM_FN_NAME (sh64_media
,msubsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4325 #define FLD(f) abuf->fields.sfmt_add.f
4326 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4327 int UNUSED written
= 0;
4328 IADDR UNUSED pc
= abuf
->addr
;
4329 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4334 tmp_result0
= ((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
4335 tmp_result1
= ((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))), NEGDI (SLLDI (1, SUBSI (32, 1))))) ? (NEGSI (SLLSI (1, SUBSI (32, 1)))) : (((LTDI (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, SUBSI (32, 1)))) ? (SUBDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 0)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBSI (SLLSI (1, SUBSI (32, 1)), 1)))));
4337 DI opval
= ORDI (SLLDI (ZEXTSIDI (tmp_result1
), 32), ZEXTSIDI (tmp_result0
));
4338 SET_H_GR (FLD (f_dest
), opval
);
4339 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4347 /* msubsub: msubs.ub $rm, $rn, $rd */
4350 SEM_FN_NAME (sh64_media
,msubsub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4352 #define FLD(f) abuf->fields.sfmt_add.f
4353 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4354 int UNUSED written
= 0;
4355 IADDR UNUSED pc
= abuf
->addr
;
4356 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4367 tmp_result0
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7)))) : (SUBQI (SLLQI (1, 8), 1)))));
4368 tmp_result1
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6)))) : (SUBQI (SLLQI (1, 8), 1)))));
4369 tmp_result2
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5)))) : (SUBQI (SLLQI (1, 8), 1)))));
4370 tmp_result3
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4)))) : (SUBQI (SLLQI (1, 8), 1)))));
4371 tmp_result4
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3)))) : (SUBQI (SLLQI (1, 8), 1)))));
4372 tmp_result5
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2)))) : (SUBQI (SLLQI (1, 8), 1)))));
4373 tmp_result6
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBQI (SLLQI (1, 8), 1)))));
4374 tmp_result7
= ((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), MAKEDI (0, 0))) ? (0) : (((LTDI (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, 8))) ? (SUBDI (ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), ZEXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBQI (SLLQI (1, 8), 1)))));
4376 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
4377 SET_H_GR (FLD (f_dest
), opval
);
4378 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4386 /* msubsw: msubs.w $rm, $rn, $rd */
4389 SEM_FN_NAME (sh64_media
,msubsw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4391 #define FLD(f) abuf->fields.sfmt_add.f
4392 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4393 int UNUSED written
= 0;
4394 IADDR UNUSED pc
= abuf
->addr
;
4395 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4406 tmp_result0
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 7)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 7)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4407 tmp_result1
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 6)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 6)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4408 tmp_result2
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 5)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 5)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4409 tmp_result3
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 4)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 4)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4410 tmp_result4
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 3)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 3)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4411 tmp_result5
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 2)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 2)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4412 tmp_result6
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 1)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 1)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4413 tmp_result7
= ((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), NEGDI (SLLDI (1, SUBSI (16, 1))))) ? (NEGHI (SLLHI (1, SUBSI (16, 1)))) : (((LTDI (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0))), SLLDI (1, SUBSI (16, 1)))) ? (SUBDI (EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_left
)), 0)), EXTQIDI (SUBWORDDIQI (GET_H_GR (FLD (f_right
)), 0)))) : (SUBHI (SLLHI (1, SUBSI (16, 1)), 1)))));
4415 DI opval
= ORDI (SLLDI (ZEXTQIDI (tmp_result7
), 56), ORDI (SLLDI (ZEXTQIDI (tmp_result6
), 48), ORDI (SLLDI (ZEXTQIDI (tmp_result5
), 40), ORDI (SLLDI (ZEXTQIDI (tmp_result4
), 32), ORDI (SLLDI (ZEXTQIDI (tmp_result3
), 24), ORDI (SLLDI (ZEXTQIDI (tmp_result2
), 16), ORDI (SLLDI (ZEXTQIDI (tmp_result1
), 8), ZEXTQIDI (tmp_result0
))))))));
4416 SET_H_GR (FLD (f_dest
), opval
);
4417 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4425 /* mulsl: muls.l $rm, $rn, $rd */
4428 SEM_FN_NAME (sh64_media
,mulsl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4430 #define FLD(f) abuf->fields.sfmt_add.f
4431 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4432 int UNUSED written
= 0;
4433 IADDR UNUSED pc
= abuf
->addr
;
4434 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4437 DI opval
= MULDI (EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), EXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
4438 SET_H_GR (FLD (f_dest
), opval
);
4439 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4446 /* mulul: mulu.l $rm, $rn, $rd */
4449 SEM_FN_NAME (sh64_media
,mulul
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4451 #define FLD(f) abuf->fields.sfmt_add.f
4452 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4453 int UNUSED written
= 0;
4454 IADDR UNUSED pc
= abuf
->addr
;
4455 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4458 DI opval
= MULDI (ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1)), ZEXTSIDI (SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
4459 SET_H_GR (FLD (f_dest
), opval
);
4460 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4470 SEM_FN_NAME (sh64_media
,nop
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4472 #define FLD(f) abuf->fields.sfmt_empty.f
4473 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4474 int UNUSED written
= 0;
4475 IADDR UNUSED pc
= abuf
->addr
;
4476 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4484 /* nsb: nsb $rm, $rd */
4487 SEM_FN_NAME (sh64_media
,nsb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4489 #define FLD(f) abuf->fields.sfmt_xori.f
4490 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4491 int UNUSED written
= 0;
4492 IADDR UNUSED pc
= abuf
->addr
;
4493 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4496 DI opval
= sh64_nsb (current_cpu
, GET_H_GR (FLD (f_left
)));
4497 SET_H_GR (FLD (f_dest
), opval
);
4498 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4505 /* ocbi: ocbi $rm, $disp6x32 */
4508 SEM_FN_NAME (sh64_media
,ocbi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4510 #define FLD(f) abuf->fields.sfmt_xori.f
4511 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4512 int UNUSED written
= 0;
4513 IADDR UNUSED pc
= abuf
->addr
;
4514 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4518 DI opval
= GET_H_GR (FLD (f_left
));
4519 SET_H_GR (FLD (f_left
), opval
);
4520 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4529 /* ocbp: ocbp $rm, $disp6x32 */
4532 SEM_FN_NAME (sh64_media
,ocbp
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4534 #define FLD(f) abuf->fields.sfmt_xori.f
4535 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4536 int UNUSED written
= 0;
4537 IADDR UNUSED pc
= abuf
->addr
;
4538 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4542 DI opval
= GET_H_GR (FLD (f_left
));
4543 SET_H_GR (FLD (f_left
), opval
);
4544 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4553 /* ocbwb: ocbwb $rm, $disp6x32 */
4556 SEM_FN_NAME (sh64_media
,ocbwb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4558 #define FLD(f) abuf->fields.sfmt_xori.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
, 4);
4566 DI opval
= GET_H_GR (FLD (f_left
));
4567 SET_H_GR (FLD (f_left
), opval
);
4568 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4577 /* or: or $rm, $rn, $rd */
4580 SEM_FN_NAME (sh64_media
,or) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4582 #define FLD(f) abuf->fields.sfmt_add.f
4583 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4584 int UNUSED written
= 0;
4585 IADDR UNUSED pc
= abuf
->addr
;
4586 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4589 DI opval
= ORDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
4590 SET_H_GR (FLD (f_dest
), opval
);
4591 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4598 /* ori: ori $rm, $imm10, $rd */
4601 SEM_FN_NAME (sh64_media
,ori
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4603 #define FLD(f) abuf->fields.sfmt_ori.f
4604 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4605 int UNUSED written
= 0;
4606 IADDR UNUSED pc
= abuf
->addr
;
4607 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4610 DI opval
= ORDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm10
)));
4611 SET_H_GR (FLD (f_dest
), opval
);
4612 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4619 /* prefi: prefi $rm, $disp6x32 */
4622 SEM_FN_NAME (sh64_media
,prefi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4624 #define FLD(f) abuf->fields.sfmt_xori.f
4625 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4626 int UNUSED written
= 0;
4627 IADDR UNUSED pc
= abuf
->addr
;
4628 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4632 DI opval
= GET_H_GR (FLD (f_left
));
4633 SET_H_GR (FLD (f_left
), opval
);
4634 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4643 /* pta: pta$likely $disp16, $tra */
4646 SEM_FN_NAME (sh64_media
,pta
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4648 #define FLD(f) abuf->fields.sfmt_pta.f
4649 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4650 int UNUSED written
= 0;
4651 IADDR UNUSED pc
= abuf
->addr
;
4652 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4657 DI opval
= ADDSI (FLD (f_disp16
), 1);
4658 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4659 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4667 /* ptabs: ptabs$likely $rn, $tra */
4670 SEM_FN_NAME (sh64_media
,ptabs
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4672 #define FLD(f) abuf->fields.sfmt_beq.f
4673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4674 int UNUSED written
= 0;
4675 IADDR UNUSED pc
= abuf
->addr
;
4676 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4681 DI opval
= GET_H_GR (FLD (f_right
));
4682 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4683 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4691 /* ptb: ptb$likely $disp16, $tra */
4694 SEM_FN_NAME (sh64_media
,ptb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4696 #define FLD(f) abuf->fields.sfmt_pta.f
4697 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4698 int UNUSED written
= 0;
4699 IADDR UNUSED pc
= abuf
->addr
;
4700 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4705 DI opval
= FLD (f_disp16
);
4706 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4707 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4715 /* ptrel: ptrel$likely $rn, $tra */
4718 SEM_FN_NAME (sh64_media
,ptrel
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4720 #define FLD(f) abuf->fields.sfmt_beq.f
4721 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4722 int UNUSED written
= 0;
4723 IADDR UNUSED pc
= abuf
->addr
;
4724 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4729 DI opval
= ADDDI (pc
, GET_H_GR (FLD (f_right
)));
4730 CPU (h_tr
[FLD (f_tra
)]) = opval
;
4731 CGEN_TRACE_RESULT (current_cpu
, abuf
, "tr", 'D', opval
);
4739 /* putcfg: putcfg $rm, $disp6, $rd */
4742 SEM_FN_NAME (sh64_media
,putcfg
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4744 #define FLD(f) abuf->fields.sfmt_getcfg.f
4745 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4746 int UNUSED written
= 0;
4747 IADDR UNUSED pc
= abuf
->addr
;
4748 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4752 tmp_address
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
4755 SI opval
= GET_H_GR (FLD (f_dest
));
4756 SETMEMSI (current_cpu
, pc
, tmp_address
, opval
);
4757 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
4765 /* putcon: putcon $rm, $crj */
4768 SEM_FN_NAME (sh64_media
,putcon
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4770 #define FLD(f) abuf->fields.sfmt_xori.f
4771 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4772 int UNUSED written
= 0;
4773 IADDR UNUSED pc
= abuf
->addr
;
4774 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4777 DI opval
= GET_H_GR (FLD (f_left
));
4778 SET_H_CR (FLD (f_dest
), opval
);
4779 CGEN_TRACE_RESULT (current_cpu
, abuf
, "cr", 'D', opval
);
4789 SEM_FN_NAME (sh64_media
,rte
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4791 #define FLD(f) abuf->fields.sfmt_empty.f
4792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4793 int UNUSED written
= 0;
4794 IADDR UNUSED pc
= abuf
->addr
;
4795 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4803 /* shard: shard $rm, $rn, $rd */
4806 SEM_FN_NAME (sh64_media
,shard
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4808 #define FLD(f) abuf->fields.sfmt_add.f
4809 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4810 int UNUSED written
= 0;
4811 IADDR UNUSED pc
= abuf
->addr
;
4812 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4815 DI opval
= SRADI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4816 SET_H_GR (FLD (f_dest
), opval
);
4817 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4824 /* shardl: shard.l $rm, $rn, $rd */
4827 SEM_FN_NAME (sh64_media
,shardl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4829 #define FLD(f) abuf->fields.sfmt_add.f
4830 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4831 int UNUSED written
= 0;
4832 IADDR UNUSED pc
= abuf
->addr
;
4833 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4836 DI opval
= EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
4837 SET_H_GR (FLD (f_dest
), opval
);
4838 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4845 /* shari: shari $rm, $uimm6, $rd */
4848 SEM_FN_NAME (sh64_media
,shari
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4850 #define FLD(f) abuf->fields.sfmt_shari.f
4851 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4852 int UNUSED written
= 0;
4853 IADDR UNUSED pc
= abuf
->addr
;
4854 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4857 DI opval
= SRADI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
4858 SET_H_GR (FLD (f_dest
), opval
);
4859 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4866 /* sharil: shari.l $rm, $uimm6, $rd */
4869 SEM_FN_NAME (sh64_media
,sharil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4871 #define FLD(f) abuf->fields.sfmt_shari.f
4872 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4873 int UNUSED written
= 0;
4874 IADDR UNUSED pc
= abuf
->addr
;
4875 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4878 DI opval
= EXTSIDI (SRASI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
4879 SET_H_GR (FLD (f_dest
), opval
);
4880 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4887 /* shlld: shlld $rm, $rn, $rd */
4890 SEM_FN_NAME (sh64_media
,shlld
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4892 #define FLD(f) abuf->fields.sfmt_add.f
4893 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4894 int UNUSED written
= 0;
4895 IADDR UNUSED pc
= abuf
->addr
;
4896 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4899 DI opval
= SLLDI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4900 SET_H_GR (FLD (f_dest
), opval
);
4901 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4908 /* shlldl: shlld.l $rm, $rn, $rd */
4911 SEM_FN_NAME (sh64_media
,shlldl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4913 #define FLD(f) abuf->fields.sfmt_add.f
4914 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4915 int UNUSED written
= 0;
4916 IADDR UNUSED pc
= abuf
->addr
;
4917 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4920 DI opval
= EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
4921 SET_H_GR (FLD (f_dest
), opval
);
4922 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4929 /* shlli: shlli $rm, $uimm6, $rd */
4932 SEM_FN_NAME (sh64_media
,shlli
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4934 #define FLD(f) abuf->fields.sfmt_shari.f
4935 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4936 int UNUSED written
= 0;
4937 IADDR UNUSED pc
= abuf
->addr
;
4938 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4941 DI opval
= SLLDI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
4942 SET_H_GR (FLD (f_dest
), opval
);
4943 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4950 /* shllil: shlli.l $rm, $uimm6, $rd */
4953 SEM_FN_NAME (sh64_media
,shllil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4955 #define FLD(f) abuf->fields.sfmt_shari.f
4956 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4957 int UNUSED written
= 0;
4958 IADDR UNUSED pc
= abuf
->addr
;
4959 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4962 DI opval
= EXTSIDI (SLLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
4963 SET_H_GR (FLD (f_dest
), opval
);
4964 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4971 /* shlrd: shlrd $rm, $rn, $rd */
4974 SEM_FN_NAME (sh64_media
,shlrd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4976 #define FLD(f) abuf->fields.sfmt_add.f
4977 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4978 int UNUSED written
= 0;
4979 IADDR UNUSED pc
= abuf
->addr
;
4980 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
4983 DI opval
= SRLDI (GET_H_GR (FLD (f_left
)), ANDDI (GET_H_GR (FLD (f_right
)), 63));
4984 SET_H_GR (FLD (f_dest
), opval
);
4985 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
4992 /* shlrdl: shlrd.l $rm, $rn, $rd */
4995 SEM_FN_NAME (sh64_media
,shlrdl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
4997 #define FLD(f) abuf->fields.sfmt_add.f
4998 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
4999 int UNUSED written
= 0;
5000 IADDR UNUSED pc
= abuf
->addr
;
5001 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5004 DI opval
= EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDDI (GET_H_GR (FLD (f_right
)), 63)));
5005 SET_H_GR (FLD (f_dest
), opval
);
5006 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5013 /* shlri: shlri $rm, $uimm6, $rd */
5016 SEM_FN_NAME (sh64_media
,shlri
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5018 #define FLD(f) abuf->fields.sfmt_shari.f
5019 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5020 int UNUSED written
= 0;
5021 IADDR UNUSED pc
= abuf
->addr
;
5022 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5025 DI opval
= SRLDI (GET_H_GR (FLD (f_left
)), FLD (f_uimm6
));
5026 SET_H_GR (FLD (f_dest
), opval
);
5027 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5034 /* shlril: shlri.l $rm, $uimm6, $rd */
5037 SEM_FN_NAME (sh64_media
,shlril
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5039 #define FLD(f) abuf->fields.sfmt_shari.f
5040 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5041 int UNUSED written
= 0;
5042 IADDR UNUSED pc
= abuf
->addr
;
5043 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5046 DI opval
= EXTSIDI (SRLSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), ANDSI (FLD (f_uimm6
), 63)));
5047 SET_H_GR (FLD (f_dest
), opval
);
5048 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5055 /* shori: shori $uimm16, $rd */
5058 SEM_FN_NAME (sh64_media
,shori
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5060 #define FLD(f) abuf->fields.sfmt_shori.f
5061 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5062 int UNUSED written
= 0;
5063 IADDR UNUSED pc
= abuf
->addr
;
5064 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5067 DI opval
= ORDI (SLLDI (GET_H_GR (FLD (f_dest
)), 16), ZEXTSIDI (FLD (f_uimm16
)));
5068 SET_H_GR (FLD (f_dest
), opval
);
5069 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5079 SEM_FN_NAME (sh64_media
,sleep
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5081 #define FLD(f) abuf->fields.sfmt_empty.f
5082 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5083 int UNUSED written
= 0;
5084 IADDR UNUSED pc
= abuf
->addr
;
5085 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5093 /* stb: st.b $rm, $disp10, $rd */
5096 SEM_FN_NAME (sh64_media
,stb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5098 #define FLD(f) abuf->fields.sfmt_addi.f
5099 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5100 int UNUSED written
= 0;
5101 IADDR UNUSED pc
= abuf
->addr
;
5102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5105 UQI opval
= ANDQI (GET_H_GR (FLD (f_dest
)), 255);
5106 SETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10
))), opval
);
5107 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5114 /* stl: st.l $rm, $disp10x4, $rd */
5117 SEM_FN_NAME (sh64_media
,stl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5119 #define FLD(f) abuf->fields.sfmt_flds.f
5120 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5121 int UNUSED written
= 0;
5122 IADDR UNUSED pc
= abuf
->addr
;
5123 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5126 SI opval
= ANDSI (GET_H_GR (FLD (f_dest
)), 0xffffffff);
5127 SETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x4
))), opval
);
5128 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5135 /* stq: st.q $rm, $disp10x8, $rd */
5138 SEM_FN_NAME (sh64_media
,stq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5140 #define FLD(f) abuf->fields.sfmt_fldd.f
5141 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5142 int UNUSED written
= 0;
5143 IADDR UNUSED pc
= abuf
->addr
;
5144 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5147 DI opval
= GET_H_GR (FLD (f_dest
));
5148 SETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x8
))), opval
);
5149 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5156 /* stw: st.w $rm, $disp10x2, $rd */
5159 SEM_FN_NAME (sh64_media
,stw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5161 #define FLD(f) abuf->fields.sfmt_lduw.f
5162 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5163 int UNUSED written
= 0;
5164 IADDR UNUSED pc
= abuf
->addr
;
5165 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5168 HI opval
= ANDHI (GET_H_GR (FLD (f_dest
)), 65535);
5169 SETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_disp10x2
))), opval
);
5170 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5177 /* sthil: sthi.l $rm, $disp6, $rd */
5180 SEM_FN_NAME (sh64_media
,sthil
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5182 #define FLD(f) abuf->fields.sfmt_getcfg.f
5183 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5184 int UNUSED written
= 0;
5185 IADDR UNUSED pc
= abuf
->addr
;
5186 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5192 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5193 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 3), 1);
5194 if (ANDQI (tmp_bytecount
, 4)) {
5196 SI opval
= GET_H_GR (FLD (f_dest
));
5197 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5198 written
|= (1 << 5);
5199 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5202 if (GET_H_ENDIAN ()) {
5204 tmp_val
= GET_H_GR (FLD (f_dest
));
5205 if (ANDQI (tmp_bytecount
, 1)) {
5208 UQI opval
= ANDQI (tmp_val
, 255);
5209 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5210 written
|= (1 << 6);
5211 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5213 tmp_val
= SRLDI (tmp_val
, 8);
5216 if (ANDQI (tmp_bytecount
, 2)) {
5219 HI opval
= ANDHI (tmp_val
, 65535);
5220 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5221 written
|= (1 << 4);
5222 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5224 tmp_val
= SRLDI (tmp_val
, 16);
5230 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (32, MULSI (8, tmp_bytecount
)));
5231 if (ANDQI (tmp_bytecount
, 2)) {
5234 HI opval
= ANDHI (tmp_val
, 65535);
5235 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5236 written
|= (1 << 4);
5237 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5239 tmp_val
= SRLDI (tmp_val
, 16);
5242 if (ANDQI (tmp_bytecount
, 1)) {
5245 UQI opval
= ANDQI (tmp_val
, 255);
5246 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5247 written
|= (1 << 6);
5248 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5250 tmp_val
= SRLDI (tmp_val
, 8);
5258 abuf
->written
= written
;
5263 /* sthiq: sthi.q $rm, $disp6, $rd */
5266 SEM_FN_NAME (sh64_media
,sthiq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5268 #define FLD(f) abuf->fields.sfmt_getcfg.f
5269 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5270 int UNUSED written
= 0;
5271 IADDR UNUSED pc
= abuf
->addr
;
5272 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5278 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5279 tmp_bytecount
= ADDDI (ANDDI (tmp_addr
, 7), 1);
5280 if (ANDQI (tmp_bytecount
, 8)) {
5282 DI opval
= GET_H_GR (FLD (f_dest
));
5283 SETMEMDI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5284 written
|= (1 << 4);
5285 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5288 if (GET_H_ENDIAN ()) {
5290 tmp_val
= GET_H_GR (FLD (f_dest
));
5291 if (ANDQI (tmp_bytecount
, 1)) {
5294 UQI opval
= ANDQI (tmp_val
, 255);
5295 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5296 written
|= (1 << 7);
5297 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5299 tmp_val
= SRLDI (tmp_val
, 8);
5302 if (ANDQI (tmp_bytecount
, 2)) {
5305 HI opval
= ANDHI (tmp_val
, 65535);
5306 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5307 written
|= (1 << 5);
5308 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5310 tmp_val
= SRLDI (tmp_val
, 16);
5313 if (ANDQI (tmp_bytecount
, 4)) {
5316 SI opval
= ANDSI (tmp_val
, 0xffffffff);
5317 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5318 written
|= (1 << 6);
5319 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5321 tmp_val
= SRLDI (tmp_val
, 32);
5327 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (64, MULSI (8, tmp_bytecount
)));
5328 if (ANDQI (tmp_bytecount
, 4)) {
5331 SI opval
= ANDSI (tmp_val
, 0xffffffff);
5332 SETMEMSI (current_cpu
, pc
, ANDDI (tmp_addr
, -8), opval
);
5333 written
|= (1 << 6);
5334 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5336 tmp_val
= SRLDI (tmp_val
, 32);
5339 if (ANDQI (tmp_bytecount
, 2)) {
5342 HI opval
= ANDHI (tmp_val
, 65535);
5343 SETMEMHI (current_cpu
, pc
, ANDDI (tmp_addr
, -4), opval
);
5344 written
|= (1 << 5);
5345 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5347 tmp_val
= SRLDI (tmp_val
, 16);
5350 if (ANDQI (tmp_bytecount
, 1)) {
5353 UQI opval
= ANDQI (tmp_val
, 255);
5354 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5355 written
|= (1 << 7);
5356 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5358 tmp_val
= SRLDI (tmp_val
, 8);
5366 abuf
->written
= written
;
5371 /* stlol: stlo.l $rm, $disp6, $rd */
5374 SEM_FN_NAME (sh64_media
,stlol
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5376 #define FLD(f) abuf->fields.sfmt_getcfg.f
5377 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5378 int UNUSED written
= 0;
5379 IADDR UNUSED pc
= abuf
->addr
;
5380 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5386 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5387 tmp_bytecount
= SUBSI (4, ANDDI (tmp_addr
, 3));
5388 if (ANDQI (tmp_bytecount
, 4)) {
5390 USI opval
= GET_H_GR (FLD (f_dest
));
5391 SETMEMUSI (current_cpu
, pc
, tmp_addr
, opval
);
5392 written
|= (1 << 6);
5393 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5396 if (GET_H_ENDIAN ()) {
5398 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (32, MULSI (8, tmp_bytecount
)));
5399 if (ANDQI (tmp_bytecount
, 2)) {
5402 UHI opval
= ANDHI (tmp_val
, 65535);
5403 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5404 written
|= (1 << 4);
5405 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5407 tmp_val
= SRLDI (tmp_val
, 16);
5410 if (ANDQI (tmp_bytecount
, 1)) {
5413 UQI opval
= ANDQI (tmp_val
, 255);
5414 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5415 written
|= (1 << 5);
5416 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5418 tmp_val
= SRLDI (tmp_val
, 8);
5424 tmp_val
= GET_H_GR (FLD (f_dest
));
5425 if (ANDQI (tmp_bytecount
, 1)) {
5428 UQI opval
= ANDQI (tmp_val
, 255);
5429 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5430 written
|= (1 << 5);
5431 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5433 tmp_val
= SRLDI (tmp_val
, 8);
5436 if (ANDQI (tmp_bytecount
, 2)) {
5439 UHI opval
= ANDHI (tmp_val
, 65535);
5440 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5441 written
|= (1 << 4);
5442 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5444 tmp_val
= SRLDI (tmp_val
, 16);
5452 abuf
->written
= written
;
5457 /* stloq: stlo.q $rm, $disp6, $rd */
5460 SEM_FN_NAME (sh64_media
,stloq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5462 #define FLD(f) abuf->fields.sfmt_getcfg.f
5463 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5464 int UNUSED written
= 0;
5465 IADDR UNUSED pc
= abuf
->addr
;
5466 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5472 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), FLD (f_disp6
));
5473 tmp_bytecount
= SUBSI (8, ANDDI (tmp_addr
, 7));
5474 if (ANDQI (tmp_bytecount
, 8)) {
5476 UDI opval
= GET_H_GR (FLD (f_dest
));
5477 SETMEMUDI (current_cpu
, pc
, tmp_addr
, opval
);
5478 written
|= (1 << 4);
5479 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5482 if (GET_H_ENDIAN ()) {
5484 tmp_val
= SRLDI (GET_H_GR (FLD (f_dest
)), SUBSI (64, MULSI (8, tmp_bytecount
)));
5485 if (ANDQI (tmp_bytecount
, 4)) {
5488 USI opval
= ANDSI (tmp_val
, 0xffffffff);
5489 SETMEMUSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4), opval
);
5490 written
|= (1 << 7);
5491 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5493 tmp_val
= SRLDI (tmp_val
, 32);
5496 if (ANDQI (tmp_bytecount
, 2)) {
5499 UHI opval
= ANDHI (tmp_val
, 65535);
5500 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5501 written
|= (1 << 5);
5502 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5504 tmp_val
= SRLDI (tmp_val
, 16);
5507 if (ANDQI (tmp_bytecount
, 1)) {
5510 UQI opval
= ANDQI (tmp_val
, 255);
5511 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5512 written
|= (1 << 6);
5513 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5515 tmp_val
= SRLDI (tmp_val
, 8);
5521 tmp_val
= GET_H_GR (FLD (f_dest
));
5522 if (ANDQI (tmp_bytecount
, 1)) {
5525 UQI opval
= ANDQI (tmp_val
, 255);
5526 SETMEMUQI (current_cpu
, pc
, tmp_addr
, opval
);
5527 written
|= (1 << 6);
5528 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5530 tmp_val
= SRLDI (tmp_val
, 8);
5533 if (ANDQI (tmp_bytecount
, 2)) {
5536 UHI opval
= ANDHI (tmp_val
, 65535);
5537 SETMEMUHI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 1), -2), opval
);
5538 written
|= (1 << 5);
5539 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5541 tmp_val
= SRLDI (tmp_val
, 16);
5544 if (ANDQI (tmp_bytecount
, 4)) {
5547 USI opval
= ANDSI (tmp_val
, 0xffffffff);
5548 SETMEMUSI (current_cpu
, pc
, ANDDI (ADDDI (tmp_addr
, 3), -4), opval
);
5549 written
|= (1 << 7);
5550 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5552 tmp_val
= SRLDI (tmp_val
, 32);
5560 abuf
->written
= written
;
5565 /* stxb: stx.b $rm, $rn, $rd */
5568 SEM_FN_NAME (sh64_media
,stxb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5570 #define FLD(f) abuf->fields.sfmt_add.f
5571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5572 int UNUSED written
= 0;
5573 IADDR UNUSED pc
= abuf
->addr
;
5574 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5577 UQI opval
= SUBWORDDIQI (GET_H_GR (FLD (f_dest
)), 7);
5578 SETMEMUQI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5579 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5586 /* stxl: stx.l $rm, $rn, $rd */
5589 SEM_FN_NAME (sh64_media
,stxl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5591 #define FLD(f) abuf->fields.sfmt_add.f
5592 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5593 int UNUSED written
= 0;
5594 IADDR UNUSED pc
= abuf
->addr
;
5595 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5598 SI opval
= SUBWORDDISI (GET_H_GR (FLD (f_dest
)), 1);
5599 SETMEMSI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5600 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5607 /* stxq: stx.q $rm, $rn, $rd */
5610 SEM_FN_NAME (sh64_media
,stxq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5612 #define FLD(f) abuf->fields.sfmt_add.f
5613 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5614 int UNUSED written
= 0;
5615 IADDR UNUSED pc
= abuf
->addr
;
5616 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5619 DI opval
= GET_H_GR (FLD (f_dest
));
5620 SETMEMDI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5621 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5628 /* stxw: stx.w $rm, $rn, $rd */
5631 SEM_FN_NAME (sh64_media
,stxw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5633 #define FLD(f) abuf->fields.sfmt_add.f
5634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5635 int UNUSED written
= 0;
5636 IADDR UNUSED pc
= abuf
->addr
;
5637 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5640 HI opval
= SUBWORDDIHI (GET_H_GR (FLD (f_dest
)), 3);
5641 SETMEMHI (current_cpu
, pc
, ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
))), opval
);
5642 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
5649 /* sub: sub $rm, $rn, $rd */
5652 SEM_FN_NAME (sh64_media
,sub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5654 #define FLD(f) abuf->fields.sfmt_add.f
5655 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5656 int UNUSED written
= 0;
5657 IADDR UNUSED pc
= abuf
->addr
;
5658 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5661 DI opval
= SUBDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5662 SET_H_GR (FLD (f_dest
), opval
);
5663 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5670 /* subl: sub.l $rm, $rn, $rd */
5673 SEM_FN_NAME (sh64_media
,subl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5675 #define FLD(f) abuf->fields.sfmt_add.f
5676 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5677 int UNUSED written
= 0;
5678 IADDR UNUSED pc
= abuf
->addr
;
5679 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5682 DI opval
= EXTSIDI (SUBSI (SUBWORDDISI (GET_H_GR (FLD (f_left
)), 1), SUBWORDDISI (GET_H_GR (FLD (f_right
)), 1)));
5683 SET_H_GR (FLD (f_dest
), opval
);
5684 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5691 /* swapq: swap.q $rm, $rn, $rd */
5694 SEM_FN_NAME (sh64_media
,swapq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5696 #define FLD(f) abuf->fields.sfmt_add.f
5697 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5698 int UNUSED written
= 0;
5699 IADDR UNUSED pc
= abuf
->addr
;
5700 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5705 tmp_addr
= ADDDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5706 tmp_temp
= GETMEMDI (current_cpu
, pc
, tmp_addr
);
5708 DI opval
= GET_H_GR (FLD (f_dest
));
5709 SETMEMDI (current_cpu
, pc
, tmp_addr
, opval
);
5710 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'D', opval
);
5713 DI opval
= tmp_temp
;
5714 SET_H_GR (FLD (f_dest
), opval
);
5715 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5726 SEM_FN_NAME (sh64_media
,synci
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5728 #define FLD(f) abuf->fields.sfmt_empty.f
5729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5730 int UNUSED written
= 0;
5731 IADDR UNUSED pc
= abuf
->addr
;
5732 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5743 SEM_FN_NAME (sh64_media
,synco
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5745 #define FLD(f) abuf->fields.sfmt_empty.f
5746 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5747 int UNUSED written
= 0;
5748 IADDR UNUSED pc
= abuf
->addr
;
5749 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5757 /* trapa: trapa $rm */
5760 SEM_FN_NAME (sh64_media
,trapa
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5762 #define FLD(f) abuf->fields.sfmt_xori.f
5763 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5764 int UNUSED written
= 0;
5765 IADDR UNUSED pc
= abuf
->addr
;
5766 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5768 sh64_trapa (current_cpu
, GET_H_GR (FLD (f_left
)), pc
);
5774 /* xor: xor $rm, $rn, $rd */
5777 SEM_FN_NAME (sh64_media
,xor) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5779 #define FLD(f) abuf->fields.sfmt_add.f
5780 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5781 int UNUSED written
= 0;
5782 IADDR UNUSED pc
= abuf
->addr
;
5783 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5786 DI opval
= XORDI (GET_H_GR (FLD (f_left
)), GET_H_GR (FLD (f_right
)));
5787 SET_H_GR (FLD (f_dest
), opval
);
5788 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5795 /* xori: xori $rm, $imm6, $rd */
5798 SEM_FN_NAME (sh64_media
,xori
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
5800 #define FLD(f) abuf->fields.sfmt_xori.f
5801 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
5802 int UNUSED written
= 0;
5803 IADDR UNUSED pc
= abuf
->addr
;
5804 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
5807 DI opval
= XORDI (GET_H_GR (FLD (f_left
)), EXTSIDI (FLD (f_imm6
)));
5808 SET_H_GR (FLD (f_dest
), opval
);
5809 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'D', opval
);
5816 /* Table of all semantic fns. */
5818 static const struct sem_fn_desc sem_fns
[] = {
5819 { SH64_MEDIA_INSN_X_INVALID
, SEM_FN_NAME (sh64_media
,x_invalid
) },
5820 { SH64_MEDIA_INSN_X_AFTER
, SEM_FN_NAME (sh64_media
,x_after
) },
5821 { SH64_MEDIA_INSN_X_BEFORE
, SEM_FN_NAME (sh64_media
,x_before
) },
5822 { SH64_MEDIA_INSN_X_CTI_CHAIN
, SEM_FN_NAME (sh64_media
,x_cti_chain
) },
5823 { SH64_MEDIA_INSN_X_CHAIN
, SEM_FN_NAME (sh64_media
,x_chain
) },
5824 { SH64_MEDIA_INSN_X_BEGIN
, SEM_FN_NAME (sh64_media
,x_begin
) },
5825 { SH64_MEDIA_INSN_ADD
, SEM_FN_NAME (sh64_media
,add
) },
5826 { SH64_MEDIA_INSN_ADDL
, SEM_FN_NAME (sh64_media
,addl
) },
5827 { SH64_MEDIA_INSN_ADDI
, SEM_FN_NAME (sh64_media
,addi
) },
5828 { SH64_MEDIA_INSN_ADDIL
, SEM_FN_NAME (sh64_media
,addil
) },
5829 { SH64_MEDIA_INSN_ADDZL
, SEM_FN_NAME (sh64_media
,addzl
) },
5830 { SH64_MEDIA_INSN_ALLOCO
, SEM_FN_NAME (sh64_media
,alloco
) },
5831 { SH64_MEDIA_INSN_AND
, SEM_FN_NAME (sh64_media
,and) },
5832 { SH64_MEDIA_INSN_ANDC
, SEM_FN_NAME (sh64_media
,andc
) },
5833 { SH64_MEDIA_INSN_ANDI
, SEM_FN_NAME (sh64_media
,andi
) },
5834 { SH64_MEDIA_INSN_BEQ
, SEM_FN_NAME (sh64_media
,beq
) },
5835 { SH64_MEDIA_INSN_BEQI
, SEM_FN_NAME (sh64_media
,beqi
) },
5836 { SH64_MEDIA_INSN_BGE
, SEM_FN_NAME (sh64_media
,bge
) },
5837 { SH64_MEDIA_INSN_BGEU
, SEM_FN_NAME (sh64_media
,bgeu
) },
5838 { SH64_MEDIA_INSN_BGT
, SEM_FN_NAME (sh64_media
,bgt
) },
5839 { SH64_MEDIA_INSN_BGTU
, SEM_FN_NAME (sh64_media
,bgtu
) },
5840 { SH64_MEDIA_INSN_BLINK
, SEM_FN_NAME (sh64_media
,blink
) },
5841 { SH64_MEDIA_INSN_BNE
, SEM_FN_NAME (sh64_media
,bne
) },
5842 { SH64_MEDIA_INSN_BNEI
, SEM_FN_NAME (sh64_media
,bnei
) },
5843 { SH64_MEDIA_INSN_BRK
, SEM_FN_NAME (sh64_media
,brk
) },
5844 { SH64_MEDIA_INSN_BYTEREV
, SEM_FN_NAME (sh64_media
,byterev
) },
5845 { SH64_MEDIA_INSN_CMPEQ
, SEM_FN_NAME (sh64_media
,cmpeq
) },
5846 { SH64_MEDIA_INSN_CMPGT
, SEM_FN_NAME (sh64_media
,cmpgt
) },
5847 { SH64_MEDIA_INSN_CMPGTU
, SEM_FN_NAME (sh64_media
,cmpgtu
) },
5848 { SH64_MEDIA_INSN_CMVEQ
, SEM_FN_NAME (sh64_media
,cmveq
) },
5849 { SH64_MEDIA_INSN_CMVNE
, SEM_FN_NAME (sh64_media
,cmvne
) },
5850 { SH64_MEDIA_INSN_FABSD
, SEM_FN_NAME (sh64_media
,fabsd
) },
5851 { SH64_MEDIA_INSN_FABSS
, SEM_FN_NAME (sh64_media
,fabss
) },
5852 { SH64_MEDIA_INSN_FADDD
, SEM_FN_NAME (sh64_media
,faddd
) },
5853 { SH64_MEDIA_INSN_FADDS
, SEM_FN_NAME (sh64_media
,fadds
) },
5854 { SH64_MEDIA_INSN_FCMPEQD
, SEM_FN_NAME (sh64_media
,fcmpeqd
) },
5855 { SH64_MEDIA_INSN_FCMPEQS
, SEM_FN_NAME (sh64_media
,fcmpeqs
) },
5856 { SH64_MEDIA_INSN_FCMPGED
, SEM_FN_NAME (sh64_media
,fcmpged
) },
5857 { SH64_MEDIA_INSN_FCMPGES
, SEM_FN_NAME (sh64_media
,fcmpges
) },
5858 { SH64_MEDIA_INSN_FCMPGTD
, SEM_FN_NAME (sh64_media
,fcmpgtd
) },
5859 { SH64_MEDIA_INSN_FCMPGTS
, SEM_FN_NAME (sh64_media
,fcmpgts
) },
5860 { SH64_MEDIA_INSN_FCMPUND
, SEM_FN_NAME (sh64_media
,fcmpund
) },
5861 { SH64_MEDIA_INSN_FCMPUNS
, SEM_FN_NAME (sh64_media
,fcmpuns
) },
5862 { SH64_MEDIA_INSN_FCNVDS
, SEM_FN_NAME (sh64_media
,fcnvds
) },
5863 { SH64_MEDIA_INSN_FCNVSD
, SEM_FN_NAME (sh64_media
,fcnvsd
) },
5864 { SH64_MEDIA_INSN_FDIVD
, SEM_FN_NAME (sh64_media
,fdivd
) },
5865 { SH64_MEDIA_INSN_FDIVS
, SEM_FN_NAME (sh64_media
,fdivs
) },
5866 { SH64_MEDIA_INSN_FGETSCR
, SEM_FN_NAME (sh64_media
,fgetscr
) },
5867 { SH64_MEDIA_INSN_FIPRS
, SEM_FN_NAME (sh64_media
,fiprs
) },
5868 { SH64_MEDIA_INSN_FLDD
, SEM_FN_NAME (sh64_media
,fldd
) },
5869 { SH64_MEDIA_INSN_FLDP
, SEM_FN_NAME (sh64_media
,fldp
) },
5870 { SH64_MEDIA_INSN_FLDS
, SEM_FN_NAME (sh64_media
,flds
) },
5871 { SH64_MEDIA_INSN_FLDXD
, SEM_FN_NAME (sh64_media
,fldxd
) },
5872 { SH64_MEDIA_INSN_FLDXP
, SEM_FN_NAME (sh64_media
,fldxp
) },
5873 { SH64_MEDIA_INSN_FLDXS
, SEM_FN_NAME (sh64_media
,fldxs
) },
5874 { SH64_MEDIA_INSN_FLOATLD
, SEM_FN_NAME (sh64_media
,floatld
) },
5875 { SH64_MEDIA_INSN_FLOATLS
, SEM_FN_NAME (sh64_media
,floatls
) },
5876 { SH64_MEDIA_INSN_FLOATQD
, SEM_FN_NAME (sh64_media
,floatqd
) },
5877 { SH64_MEDIA_INSN_FLOATQS
, SEM_FN_NAME (sh64_media
,floatqs
) },
5878 { SH64_MEDIA_INSN_FMACS
, SEM_FN_NAME (sh64_media
,fmacs
) },
5879 { SH64_MEDIA_INSN_FMOVD
, SEM_FN_NAME (sh64_media
,fmovd
) },
5880 { SH64_MEDIA_INSN_FMOVDQ
, SEM_FN_NAME (sh64_media
,fmovdq
) },
5881 { SH64_MEDIA_INSN_FMOVLS
, SEM_FN_NAME (sh64_media
,fmovls
) },
5882 { SH64_MEDIA_INSN_FMOVQD
, SEM_FN_NAME (sh64_media
,fmovqd
) },
5883 { SH64_MEDIA_INSN_FMOVS
, SEM_FN_NAME (sh64_media
,fmovs
) },
5884 { SH64_MEDIA_INSN_FMOVSL
, SEM_FN_NAME (sh64_media
,fmovsl
) },
5885 { SH64_MEDIA_INSN_FMULD
, SEM_FN_NAME (sh64_media
,fmuld
) },
5886 { SH64_MEDIA_INSN_FMULS
, SEM_FN_NAME (sh64_media
,fmuls
) },
5887 { SH64_MEDIA_INSN_FNEGD
, SEM_FN_NAME (sh64_media
,fnegd
) },
5888 { SH64_MEDIA_INSN_FNEGS
, SEM_FN_NAME (sh64_media
,fnegs
) },
5889 { SH64_MEDIA_INSN_FPUTSCR
, SEM_FN_NAME (sh64_media
,fputscr
) },
5890 { SH64_MEDIA_INSN_FSQRTD
, SEM_FN_NAME (sh64_media
,fsqrtd
) },
5891 { SH64_MEDIA_INSN_FSQRTS
, SEM_FN_NAME (sh64_media
,fsqrts
) },
5892 { SH64_MEDIA_INSN_FSTD
, SEM_FN_NAME (sh64_media
,fstd
) },
5893 { SH64_MEDIA_INSN_FSTP
, SEM_FN_NAME (sh64_media
,fstp
) },
5894 { SH64_MEDIA_INSN_FSTS
, SEM_FN_NAME (sh64_media
,fsts
) },
5895 { SH64_MEDIA_INSN_FSTXD
, SEM_FN_NAME (sh64_media
,fstxd
) },
5896 { SH64_MEDIA_INSN_FSTXP
, SEM_FN_NAME (sh64_media
,fstxp
) },
5897 { SH64_MEDIA_INSN_FSTXS
, SEM_FN_NAME (sh64_media
,fstxs
) },
5898 { SH64_MEDIA_INSN_FSUBD
, SEM_FN_NAME (sh64_media
,fsubd
) },
5899 { SH64_MEDIA_INSN_FSUBS
, SEM_FN_NAME (sh64_media
,fsubs
) },
5900 { SH64_MEDIA_INSN_FTRCDL
, SEM_FN_NAME (sh64_media
,ftrcdl
) },
5901 { SH64_MEDIA_INSN_FTRCSL
, SEM_FN_NAME (sh64_media
,ftrcsl
) },
5902 { SH64_MEDIA_INSN_FTRCDQ
, SEM_FN_NAME (sh64_media
,ftrcdq
) },
5903 { SH64_MEDIA_INSN_FTRCSQ
, SEM_FN_NAME (sh64_media
,ftrcsq
) },
5904 { SH64_MEDIA_INSN_FTRVS
, SEM_FN_NAME (sh64_media
,ftrvs
) },
5905 { SH64_MEDIA_INSN_GETCFG
, SEM_FN_NAME (sh64_media
,getcfg
) },
5906 { SH64_MEDIA_INSN_GETCON
, SEM_FN_NAME (sh64_media
,getcon
) },
5907 { SH64_MEDIA_INSN_GETTR
, SEM_FN_NAME (sh64_media
,gettr
) },
5908 { SH64_MEDIA_INSN_ICBI
, SEM_FN_NAME (sh64_media
,icbi
) },
5909 { SH64_MEDIA_INSN_LDB
, SEM_FN_NAME (sh64_media
,ldb
) },
5910 { SH64_MEDIA_INSN_LDL
, SEM_FN_NAME (sh64_media
,ldl
) },
5911 { SH64_MEDIA_INSN_LDQ
, SEM_FN_NAME (sh64_media
,ldq
) },
5912 { SH64_MEDIA_INSN_LDUB
, SEM_FN_NAME (sh64_media
,ldub
) },
5913 { SH64_MEDIA_INSN_LDUW
, SEM_FN_NAME (sh64_media
,lduw
) },
5914 { SH64_MEDIA_INSN_LDW
, SEM_FN_NAME (sh64_media
,ldw
) },
5915 { SH64_MEDIA_INSN_LDHIL
, SEM_FN_NAME (sh64_media
,ldhil
) },
5916 { SH64_MEDIA_INSN_LDHIQ
, SEM_FN_NAME (sh64_media
,ldhiq
) },
5917 { SH64_MEDIA_INSN_LDLOL
, SEM_FN_NAME (sh64_media
,ldlol
) },
5918 { SH64_MEDIA_INSN_LDLOQ
, SEM_FN_NAME (sh64_media
,ldloq
) },
5919 { SH64_MEDIA_INSN_LDXB
, SEM_FN_NAME (sh64_media
,ldxb
) },
5920 { SH64_MEDIA_INSN_LDXL
, SEM_FN_NAME (sh64_media
,ldxl
) },
5921 { SH64_MEDIA_INSN_LDXQ
, SEM_FN_NAME (sh64_media
,ldxq
) },
5922 { SH64_MEDIA_INSN_LDXUB
, SEM_FN_NAME (sh64_media
,ldxub
) },
5923 { SH64_MEDIA_INSN_LDXUW
, SEM_FN_NAME (sh64_media
,ldxuw
) },
5924 { SH64_MEDIA_INSN_LDXW
, SEM_FN_NAME (sh64_media
,ldxw
) },
5925 { SH64_MEDIA_INSN_MABSL
, SEM_FN_NAME (sh64_media
,mabsl
) },
5926 { SH64_MEDIA_INSN_MABSW
, SEM_FN_NAME (sh64_media
,mabsw
) },
5927 { SH64_MEDIA_INSN_MADDL
, SEM_FN_NAME (sh64_media
,maddl
) },
5928 { SH64_MEDIA_INSN_MADDW
, SEM_FN_NAME (sh64_media
,maddw
) },
5929 { SH64_MEDIA_INSN_MADDSL
, SEM_FN_NAME (sh64_media
,maddsl
) },
5930 { SH64_MEDIA_INSN_MADDSUB
, SEM_FN_NAME (sh64_media
,maddsub
) },
5931 { SH64_MEDIA_INSN_MADDSW
, SEM_FN_NAME (sh64_media
,maddsw
) },
5932 { SH64_MEDIA_INSN_MCMPEQB
, SEM_FN_NAME (sh64_media
,mcmpeqb
) },
5933 { SH64_MEDIA_INSN_MCMPEQL
, SEM_FN_NAME (sh64_media
,mcmpeql
) },
5934 { SH64_MEDIA_INSN_MCMPEQW
, SEM_FN_NAME (sh64_media
,mcmpeqw
) },
5935 { SH64_MEDIA_INSN_MCMPGTL
, SEM_FN_NAME (sh64_media
,mcmpgtl
) },
5936 { SH64_MEDIA_INSN_MCMPGTUB
, SEM_FN_NAME (sh64_media
,mcmpgtub
) },
5937 { SH64_MEDIA_INSN_MCMPGTW
, SEM_FN_NAME (sh64_media
,mcmpgtw
) },
5938 { SH64_MEDIA_INSN_MCMV
, SEM_FN_NAME (sh64_media
,mcmv
) },
5939 { SH64_MEDIA_INSN_MCNVSLW
, SEM_FN_NAME (sh64_media
,mcnvslw
) },
5940 { SH64_MEDIA_INSN_MCNVSWB
, SEM_FN_NAME (sh64_media
,mcnvswb
) },
5941 { SH64_MEDIA_INSN_MCNVSWUB
, SEM_FN_NAME (sh64_media
,mcnvswub
) },
5942 { SH64_MEDIA_INSN_MEXTR1
, SEM_FN_NAME (sh64_media
,mextr1
) },
5943 { SH64_MEDIA_INSN_MEXTR2
, SEM_FN_NAME (sh64_media
,mextr2
) },
5944 { SH64_MEDIA_INSN_MEXTR3
, SEM_FN_NAME (sh64_media
,mextr3
) },
5945 { SH64_MEDIA_INSN_MEXTR4
, SEM_FN_NAME (sh64_media
,mextr4
) },
5946 { SH64_MEDIA_INSN_MEXTR5
, SEM_FN_NAME (sh64_media
,mextr5
) },
5947 { SH64_MEDIA_INSN_MEXTR6
, SEM_FN_NAME (sh64_media
,mextr6
) },
5948 { SH64_MEDIA_INSN_MEXTR7
, SEM_FN_NAME (sh64_media
,mextr7
) },
5949 { SH64_MEDIA_INSN_MMACFXWL
, SEM_FN_NAME (sh64_media
,mmacfxwl
) },
5950 { SH64_MEDIA_INSN_MMACNFX_WL
, SEM_FN_NAME (sh64_media
,mmacnfx_wl
) },
5951 { SH64_MEDIA_INSN_MMULL
, SEM_FN_NAME (sh64_media
,mmull
) },
5952 { SH64_MEDIA_INSN_MMULW
, SEM_FN_NAME (sh64_media
,mmulw
) },
5953 { SH64_MEDIA_INSN_MMULFXL
, SEM_FN_NAME (sh64_media
,mmulfxl
) },
5954 { SH64_MEDIA_INSN_MMULFXW
, SEM_FN_NAME (sh64_media
,mmulfxw
) },
5955 { SH64_MEDIA_INSN_MMULFXRPW
, SEM_FN_NAME (sh64_media
,mmulfxrpw
) },
5956 { SH64_MEDIA_INSN_MMULHIWL
, SEM_FN_NAME (sh64_media
,mmulhiwl
) },
5957 { SH64_MEDIA_INSN_MMULLOWL
, SEM_FN_NAME (sh64_media
,mmullowl
) },
5958 { SH64_MEDIA_INSN_MMULSUMWQ
, SEM_FN_NAME (sh64_media
,mmulsumwq
) },
5959 { SH64_MEDIA_INSN_MOVI
, SEM_FN_NAME (sh64_media
,movi
) },
5960 { SH64_MEDIA_INSN_MPERMW
, SEM_FN_NAME (sh64_media
,mpermw
) },
5961 { SH64_MEDIA_INSN_MSADUBQ
, SEM_FN_NAME (sh64_media
,msadubq
) },
5962 { SH64_MEDIA_INSN_MSHALDSL
, SEM_FN_NAME (sh64_media
,mshaldsl
) },
5963 { SH64_MEDIA_INSN_MSHALDSW
, SEM_FN_NAME (sh64_media
,mshaldsw
) },
5964 { SH64_MEDIA_INSN_MSHARDL
, SEM_FN_NAME (sh64_media
,mshardl
) },
5965 { SH64_MEDIA_INSN_MSHARDW
, SEM_FN_NAME (sh64_media
,mshardw
) },
5966 { SH64_MEDIA_INSN_MSHARDSQ
, SEM_FN_NAME (sh64_media
,mshardsq
) },
5967 { SH64_MEDIA_INSN_MSHFHIB
, SEM_FN_NAME (sh64_media
,mshfhib
) },
5968 { SH64_MEDIA_INSN_MSHFHIL
, SEM_FN_NAME (sh64_media
,mshfhil
) },
5969 { SH64_MEDIA_INSN_MSHFHIW
, SEM_FN_NAME (sh64_media
,mshfhiw
) },
5970 { SH64_MEDIA_INSN_MSHFLOB
, SEM_FN_NAME (sh64_media
,mshflob
) },
5971 { SH64_MEDIA_INSN_MSHFLOL
, SEM_FN_NAME (sh64_media
,mshflol
) },
5972 { SH64_MEDIA_INSN_MSHFLOW
, SEM_FN_NAME (sh64_media
,mshflow
) },
5973 { SH64_MEDIA_INSN_MSHLLDL
, SEM_FN_NAME (sh64_media
,mshlldl
) },
5974 { SH64_MEDIA_INSN_MSHLLDW
, SEM_FN_NAME (sh64_media
,mshlldw
) },
5975 { SH64_MEDIA_INSN_MSHLRDL
, SEM_FN_NAME (sh64_media
,mshlrdl
) },
5976 { SH64_MEDIA_INSN_MSHLRDW
, SEM_FN_NAME (sh64_media
,mshlrdw
) },
5977 { SH64_MEDIA_INSN_MSUBL
, SEM_FN_NAME (sh64_media
,msubl
) },
5978 { SH64_MEDIA_INSN_MSUBW
, SEM_FN_NAME (sh64_media
,msubw
) },
5979 { SH64_MEDIA_INSN_MSUBSL
, SEM_FN_NAME (sh64_media
,msubsl
) },
5980 { SH64_MEDIA_INSN_MSUBSUB
, SEM_FN_NAME (sh64_media
,msubsub
) },
5981 { SH64_MEDIA_INSN_MSUBSW
, SEM_FN_NAME (sh64_media
,msubsw
) },
5982 { SH64_MEDIA_INSN_MULSL
, SEM_FN_NAME (sh64_media
,mulsl
) },
5983 { SH64_MEDIA_INSN_MULUL
, SEM_FN_NAME (sh64_media
,mulul
) },
5984 { SH64_MEDIA_INSN_NOP
, SEM_FN_NAME (sh64_media
,nop
) },
5985 { SH64_MEDIA_INSN_NSB
, SEM_FN_NAME (sh64_media
,nsb
) },
5986 { SH64_MEDIA_INSN_OCBI
, SEM_FN_NAME (sh64_media
,ocbi
) },
5987 { SH64_MEDIA_INSN_OCBP
, SEM_FN_NAME (sh64_media
,ocbp
) },
5988 { SH64_MEDIA_INSN_OCBWB
, SEM_FN_NAME (sh64_media
,ocbwb
) },
5989 { SH64_MEDIA_INSN_OR
, SEM_FN_NAME (sh64_media
,or) },
5990 { SH64_MEDIA_INSN_ORI
, SEM_FN_NAME (sh64_media
,ori
) },
5991 { SH64_MEDIA_INSN_PREFI
, SEM_FN_NAME (sh64_media
,prefi
) },
5992 { SH64_MEDIA_INSN_PTA
, SEM_FN_NAME (sh64_media
,pta
) },
5993 { SH64_MEDIA_INSN_PTABS
, SEM_FN_NAME (sh64_media
,ptabs
) },
5994 { SH64_MEDIA_INSN_PTB
, SEM_FN_NAME (sh64_media
,ptb
) },
5995 { SH64_MEDIA_INSN_PTREL
, SEM_FN_NAME (sh64_media
,ptrel
) },
5996 { SH64_MEDIA_INSN_PUTCFG
, SEM_FN_NAME (sh64_media
,putcfg
) },
5997 { SH64_MEDIA_INSN_PUTCON
, SEM_FN_NAME (sh64_media
,putcon
) },
5998 { SH64_MEDIA_INSN_RTE
, SEM_FN_NAME (sh64_media
,rte
) },
5999 { SH64_MEDIA_INSN_SHARD
, SEM_FN_NAME (sh64_media
,shard
) },
6000 { SH64_MEDIA_INSN_SHARDL
, SEM_FN_NAME (sh64_media
,shardl
) },
6001 { SH64_MEDIA_INSN_SHARI
, SEM_FN_NAME (sh64_media
,shari
) },
6002 { SH64_MEDIA_INSN_SHARIL
, SEM_FN_NAME (sh64_media
,sharil
) },
6003 { SH64_MEDIA_INSN_SHLLD
, SEM_FN_NAME (sh64_media
,shlld
) },
6004 { SH64_MEDIA_INSN_SHLLDL
, SEM_FN_NAME (sh64_media
,shlldl
) },
6005 { SH64_MEDIA_INSN_SHLLI
, SEM_FN_NAME (sh64_media
,shlli
) },
6006 { SH64_MEDIA_INSN_SHLLIL
, SEM_FN_NAME (sh64_media
,shllil
) },
6007 { SH64_MEDIA_INSN_SHLRD
, SEM_FN_NAME (sh64_media
,shlrd
) },
6008 { SH64_MEDIA_INSN_SHLRDL
, SEM_FN_NAME (sh64_media
,shlrdl
) },
6009 { SH64_MEDIA_INSN_SHLRI
, SEM_FN_NAME (sh64_media
,shlri
) },
6010 { SH64_MEDIA_INSN_SHLRIL
, SEM_FN_NAME (sh64_media
,shlril
) },
6011 { SH64_MEDIA_INSN_SHORI
, SEM_FN_NAME (sh64_media
,shori
) },
6012 { SH64_MEDIA_INSN_SLEEP
, SEM_FN_NAME (sh64_media
,sleep
) },
6013 { SH64_MEDIA_INSN_STB
, SEM_FN_NAME (sh64_media
,stb
) },
6014 { SH64_MEDIA_INSN_STL
, SEM_FN_NAME (sh64_media
,stl
) },
6015 { SH64_MEDIA_INSN_STQ
, SEM_FN_NAME (sh64_media
,stq
) },
6016 { SH64_MEDIA_INSN_STW
, SEM_FN_NAME (sh64_media
,stw
) },
6017 { SH64_MEDIA_INSN_STHIL
, SEM_FN_NAME (sh64_media
,sthil
) },
6018 { SH64_MEDIA_INSN_STHIQ
, SEM_FN_NAME (sh64_media
,sthiq
) },
6019 { SH64_MEDIA_INSN_STLOL
, SEM_FN_NAME (sh64_media
,stlol
) },
6020 { SH64_MEDIA_INSN_STLOQ
, SEM_FN_NAME (sh64_media
,stloq
) },
6021 { SH64_MEDIA_INSN_STXB
, SEM_FN_NAME (sh64_media
,stxb
) },
6022 { SH64_MEDIA_INSN_STXL
, SEM_FN_NAME (sh64_media
,stxl
) },
6023 { SH64_MEDIA_INSN_STXQ
, SEM_FN_NAME (sh64_media
,stxq
) },
6024 { SH64_MEDIA_INSN_STXW
, SEM_FN_NAME (sh64_media
,stxw
) },
6025 { SH64_MEDIA_INSN_SUB
, SEM_FN_NAME (sh64_media
,sub
) },
6026 { SH64_MEDIA_INSN_SUBL
, SEM_FN_NAME (sh64_media
,subl
) },
6027 { SH64_MEDIA_INSN_SWAPQ
, SEM_FN_NAME (sh64_media
,swapq
) },
6028 { SH64_MEDIA_INSN_SYNCI
, SEM_FN_NAME (sh64_media
,synci
) },
6029 { SH64_MEDIA_INSN_SYNCO
, SEM_FN_NAME (sh64_media
,synco
) },
6030 { SH64_MEDIA_INSN_TRAPA
, SEM_FN_NAME (sh64_media
,trapa
) },
6031 { SH64_MEDIA_INSN_XOR
, SEM_FN_NAME (sh64_media
,xor) },
6032 { SH64_MEDIA_INSN_XORI
, SEM_FN_NAME (sh64_media
,xori
) },
6036 /* Add the semantic fns to IDESC_TABLE. */
6039 SEM_FN_NAME (sh64_media
,init_idesc_table
) (SIM_CPU
*current_cpu
)
6041 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
6042 const struct sem_fn_desc
*sf
;
6043 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
6045 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
6047 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
6048 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
6049 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
6052 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
6054 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (sh64_media
,x_invalid
);
6057 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
6059 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (sh64_media
,x_invalid
);