1 /* Simulator instruction semantics for sh2a_fpu.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 2000-2010 Red Hat, Inc.
7 This file is part of the Red Hat simulators.
18 using namespace sh2a_fpu; // FIXME: namespace organization still wip
19 using namespace sh2a_fpu; // FIXME: namespace organization still wip
20 #define GET_ATTR(name) GET_ATTR_##name ()
23 // ********** x-invalid: --invalid--
26 sh2a_fpu_sem_x_invalid (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
27 sh2a_fpu::write_stacks &buf)
29 #define FLD(f) abuf->fields.fmt_empty.f
30 sem_status status = SEM_STATUS_NORMAL;
31 sh2a_fpu_scache* abuf = sem;
32 unsigned long long written = 0;
33 PCADDR pc = abuf->addr;
37 current_cpu->invalid_insn (pc);
42 current_cpu->done_insn (npc, status);
46 // ********** add-compact: add $rm, $rn
49 sh2a_fpu_sem_add_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
50 sh2a_fpu::write_stacks &buf)
52 #define FLD(f) abuf->fields.sfmt_macl_compact.f
53 sem_status status = SEM_STATUS_NORMAL;
54 sh2a_fpu_scache* abuf = sem;
55 unsigned long long written = 0;
56 PCADDR pc = abuf->addr;
60 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
61 if (UNLIKELY(current_cpu->trace_result_p))
62 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
63 current_cpu->h_grc_set (FLD (f_rn), opval);
66 current_cpu->done_insn (npc, status);
70 // ********** addi-compact: add #$imm8, $rn
73 sh2a_fpu_sem_addi_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
74 sh2a_fpu::write_stacks &buf)
76 #define FLD(f) abuf->fields.sfmt_addi_compact.f
77 sem_status status = SEM_STATUS_NORMAL;
78 sh2a_fpu_scache* abuf = sem;
79 unsigned long long written = 0;
80 PCADDR pc = abuf->addr;
84 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), EXTQISI (ANDQI (FLD (f_imm8), 255)));
85 if (UNLIKELY(current_cpu->trace_result_p))
86 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
87 current_cpu->h_grc_set (FLD (f_rn), opval);
90 current_cpu->done_insn (npc, status);
94 // ********** addc-compact: addc $rm, $rn
97 sh2a_fpu_sem_addc_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
98 sh2a_fpu::write_stacks &buf)
100 #define FLD(f) abuf->fields.sfmt_macl_compact.f
101 sem_status status = SEM_STATUS_NORMAL;
102 sh2a_fpu_scache* abuf = sem;
103 unsigned long long written = 0;
104 PCADDR pc = abuf->addr;
109 tmp_flag = ADDCFSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
111 SI opval = ADDCSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
112 if (UNLIKELY(current_cpu->trace_result_p))
113 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
114 current_cpu->h_grc_set (FLD (f_rn), opval);
118 if (UNLIKELY(current_cpu->trace_result_p))
119 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
120 current_cpu->h_tbit_set (opval);
124 current_cpu->done_insn (npc, status);
128 // ********** addv-compact: addv $rm, $rn
131 sh2a_fpu_sem_addv_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
132 sh2a_fpu::write_stacks &buf)
134 #define FLD(f) abuf->fields.sfmt_macl_compact.f
135 sem_status status = SEM_STATUS_NORMAL;
136 sh2a_fpu_scache* abuf = sem;
137 unsigned long long written = 0;
138 PCADDR pc = abuf->addr;
143 tmp_t = ADDOFSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), 0);
145 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
146 if (UNLIKELY(current_cpu->trace_result_p))
147 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
148 current_cpu->h_grc_set (FLD (f_rn), opval);
152 if (UNLIKELY(current_cpu->trace_result_p))
153 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
154 current_cpu->h_tbit_set (opval);
158 current_cpu->done_insn (npc, status);
162 // ********** and-compact: and $rm64, $rn64
165 sh2a_fpu_sem_and_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
166 sh2a_fpu::write_stacks &buf)
168 #define FLD(f) abuf->fields.sfmt_and_compact.f
169 sem_status status = SEM_STATUS_NORMAL;
170 sh2a_fpu_scache* abuf = sem;
171 unsigned long long written = 0;
172 PCADDR pc = abuf->addr;
176 DI opval = ANDDI (current_cpu->h_gr_get (FLD (f_rm)), current_cpu->h_gr_get (FLD (f_rn)));
177 if (UNLIKELY(current_cpu->trace_result_p))
178 current_cpu->trace_stream << "gr" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
179 current_cpu->h_gr_set (FLD (f_rn), opval);
182 current_cpu->done_insn (npc, status);
186 // ********** andi-compact: and #$uimm8, r0
189 sh2a_fpu_sem_andi_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
190 sh2a_fpu::write_stacks &buf)
192 #define FLD(f) abuf->fields.sfmt_andi_compact.f
193 sem_status status = SEM_STATUS_NORMAL;
194 sh2a_fpu_scache* abuf = sem;
195 unsigned long long written = 0;
196 PCADDR pc = abuf->addr;
200 SI opval = ANDSI (current_cpu->h_grc_get (((UINT) 0)), ZEXTSIDI (FLD (f_imm8)));
201 if (UNLIKELY(current_cpu->trace_result_p))
202 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
203 current_cpu->h_grc_set (((UINT) 0), opval);
206 current_cpu->done_insn (npc, status);
210 // ********** andb-compact: and.b #$imm8, @(r0, gbr)
213 sh2a_fpu_sem_andb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
214 sh2a_fpu::write_stacks &buf)
216 #define FLD(f) abuf->fields.sfmt_andi_compact.f
217 sem_status status = SEM_STATUS_NORMAL;
218 sh2a_fpu_scache* abuf = sem;
219 unsigned long long written = 0;
220 PCADDR pc = abuf->addr;
226 tmp_addr = ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_gbr_get ());
227 tmp_data = ANDQI (current_cpu->GETMEMUQI (pc, tmp_addr), FLD (f_imm8));
229 UQI opval = tmp_data;
230 if (UNLIKELY(current_cpu->trace_result_p))
231 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
232 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
236 current_cpu->done_insn (npc, status);
240 // ********** bf-compact: bf $disp8
243 sh2a_fpu_sem_bf_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
244 sh2a_fpu::write_stacks &buf)
246 #define FLD(f) abuf->fields.sfmt_bf_compact.f
247 sem_status status = SEM_STATUS_NORMAL;
248 sh2a_fpu_scache* abuf = sem;
249 unsigned long long written = 0;
250 PCADDR pc = abuf->addr;
253 if (NOTBI (current_cpu->h_tbit_get ())) {
255 UDI opval = FLD (i_disp8);
256 written |= (1ULL << 2);
257 if (UNLIKELY(current_cpu->trace_result_p))
258 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
259 current_cpu->branch (opval, npc, status);
263 abuf->written = written;
264 current_cpu->done_cti_insn (npc, status);
268 // ********** bfs-compact: bf/s $disp8
271 sh2a_fpu_sem_bfs_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
272 sh2a_fpu::write_stacks &buf)
274 #define FLD(f) abuf->fields.sfmt_bf_compact.f
275 sem_status status = SEM_STATUS_NORMAL;
276 sh2a_fpu_scache* abuf = sem;
277 unsigned long long written = 0;
278 PCADDR pc = abuf->addr;
281 if (NOTBI (current_cpu->h_tbit_get ())) {
284 UDI opval = ADDDI (pc, 2);
285 written |= (1ULL << 3);
286 if (UNLIKELY(current_cpu->trace_result_p))
287 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
288 current_cpu->branch (opval, npc, status);
290 current_cpu->save_delayed_pc (FLD (i_disp8));
292 UDI opval = FLD (i_disp8);
293 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
294 if (UNLIKELY(current_cpu->trace_result_p))
295 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
300 abuf->written = written;
301 current_cpu->done_cti_insn (npc, status);
305 // ********** bra-compact: bra $disp12
308 sh2a_fpu_sem_bra_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
309 sh2a_fpu::write_stacks &buf)
311 #define FLD(f) abuf->fields.sfmt_bra_compact.f
312 sem_status status = SEM_STATUS_NORMAL;
313 sh2a_fpu_scache* abuf = sem;
314 unsigned long long written = 0;
315 PCADDR pc = abuf->addr;
320 UDI opval = ADDDI (pc, 2);
321 if (UNLIKELY(current_cpu->trace_result_p))
322 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
323 current_cpu->branch (opval, npc, status);
325 current_cpu->save_delayed_pc (FLD (i_disp12));
327 UDI opval = FLD (i_disp12);
328 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
329 if (UNLIKELY(current_cpu->trace_result_p))
330 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
334 current_cpu->done_cti_insn (npc, status);
338 // ********** braf-compact: braf $rn
341 sh2a_fpu_sem_braf_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
342 sh2a_fpu::write_stacks &buf)
344 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
345 sem_status status = SEM_STATUS_NORMAL;
346 sh2a_fpu_scache* abuf = sem;
347 unsigned long long written = 0;
348 PCADDR pc = abuf->addr;
353 UDI opval = ADDDI (pc, 2);
354 if (UNLIKELY(current_cpu->trace_result_p))
355 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
356 current_cpu->branch (opval, npc, status);
358 current_cpu->save_delayed_pc (ADDDI (EXTSIDI (current_cpu->h_grc_get (FLD (f_rn))), ADDDI (pc, 4)));
360 UDI opval = ADDDI (EXTSIDI (current_cpu->h_grc_get (FLD (f_rn))), ADDDI (pc, 4));
361 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
362 if (UNLIKELY(current_cpu->trace_result_p))
363 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
367 current_cpu->done_cti_insn (npc, status);
371 // ********** bsr-compact: bsr $disp12
374 sh2a_fpu_sem_bsr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
375 sh2a_fpu::write_stacks &buf)
377 #define FLD(f) abuf->fields.sfmt_bra_compact.f
378 sem_status status = SEM_STATUS_NORMAL;
379 sh2a_fpu_scache* abuf = sem;
380 unsigned long long written = 0;
381 PCADDR pc = abuf->addr;
386 SI opval = ADDDI (pc, 4);
387 buf.h_pr_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<SI>(pc, opval));
388 if (UNLIKELY(current_cpu->trace_result_p))
389 current_cpu->trace_stream << "pr" << ":=0x" << hex << opval << dec << " ";
392 UDI opval = ADDDI (pc, 2);
393 if (UNLIKELY(current_cpu->trace_result_p))
394 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
395 current_cpu->branch (opval, npc, status);
397 current_cpu->save_delayed_pc (FLD (i_disp12));
399 UDI opval = FLD (i_disp12);
400 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
401 if (UNLIKELY(current_cpu->trace_result_p))
402 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
406 current_cpu->done_cti_insn (npc, status);
410 // ********** bsrf-compact: bsrf $rn
413 sh2a_fpu_sem_bsrf_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
414 sh2a_fpu::write_stacks &buf)
416 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
417 sem_status status = SEM_STATUS_NORMAL;
418 sh2a_fpu_scache* abuf = sem;
419 unsigned long long written = 0;
420 PCADDR pc = abuf->addr;
425 SI opval = ADDDI (pc, 4);
426 buf.h_pr_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<SI>(pc, opval));
427 if (UNLIKELY(current_cpu->trace_result_p))
428 current_cpu->trace_stream << "pr" << ":=0x" << hex << opval << dec << " ";
431 UDI opval = ADDDI (pc, 2);
432 if (UNLIKELY(current_cpu->trace_result_p))
433 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
434 current_cpu->branch (opval, npc, status);
436 current_cpu->save_delayed_pc (ADDDI (EXTSIDI (current_cpu->h_grc_get (FLD (f_rn))), ADDDI (pc, 4)));
438 UDI opval = ADDDI (EXTSIDI (current_cpu->h_grc_get (FLD (f_rn))), ADDDI (pc, 4));
439 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
440 if (UNLIKELY(current_cpu->trace_result_p))
441 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
445 current_cpu->done_cti_insn (npc, status);
449 // ********** bt-compact: bt $disp8
452 sh2a_fpu_sem_bt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
453 sh2a_fpu::write_stacks &buf)
455 #define FLD(f) abuf->fields.sfmt_bf_compact.f
456 sem_status status = SEM_STATUS_NORMAL;
457 sh2a_fpu_scache* abuf = sem;
458 unsigned long long written = 0;
459 PCADDR pc = abuf->addr;
462 if (current_cpu->h_tbit_get ()) {
464 UDI opval = FLD (i_disp8);
465 written |= (1ULL << 2);
466 if (UNLIKELY(current_cpu->trace_result_p))
467 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
468 current_cpu->branch (opval, npc, status);
472 abuf->written = written;
473 current_cpu->done_cti_insn (npc, status);
477 // ********** bts-compact: bt/s $disp8
480 sh2a_fpu_sem_bts_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
481 sh2a_fpu::write_stacks &buf)
483 #define FLD(f) abuf->fields.sfmt_bf_compact.f
484 sem_status status = SEM_STATUS_NORMAL;
485 sh2a_fpu_scache* abuf = sem;
486 unsigned long long written = 0;
487 PCADDR pc = abuf->addr;
490 if (current_cpu->h_tbit_get ()) {
493 UDI opval = ADDDI (pc, 2);
494 written |= (1ULL << 3);
495 if (UNLIKELY(current_cpu->trace_result_p))
496 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
497 current_cpu->branch (opval, npc, status);
499 current_cpu->save_delayed_pc (FLD (i_disp8));
501 UDI opval = FLD (i_disp8);
502 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
503 if (UNLIKELY(current_cpu->trace_result_p))
504 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
509 abuf->written = written;
510 current_cpu->done_cti_insn (npc, status);
514 // ********** clrmac-compact: clrmac
517 sh2a_fpu_sem_clrmac_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
518 sh2a_fpu::write_stacks &buf)
520 #define FLD(f) abuf->fields.fmt_empty.f
521 sem_status status = SEM_STATUS_NORMAL;
522 sh2a_fpu_scache* abuf = sem;
523 unsigned long long written = 0;
524 PCADDR pc = abuf->addr;
530 if (UNLIKELY(current_cpu->trace_result_p))
531 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
532 current_cpu->h_macl_set (opval);
536 if (UNLIKELY(current_cpu->trace_result_p))
537 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
538 current_cpu->h_mach_set (opval);
542 current_cpu->done_insn (npc, status);
546 // ********** clrt-compact: clrt
549 sh2a_fpu_sem_clrt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
550 sh2a_fpu::write_stacks &buf)
552 #define FLD(f) abuf->fields.fmt_empty.f
553 sem_status status = SEM_STATUS_NORMAL;
554 sh2a_fpu_scache* abuf = sem;
555 unsigned long long written = 0;
556 PCADDR pc = abuf->addr;
561 if (UNLIKELY(current_cpu->trace_result_p))
562 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
563 current_cpu->h_tbit_set (opval);
566 current_cpu->done_insn (npc, status);
570 // ********** cmpeq-compact: cmp/eq $rm, $rn
573 sh2a_fpu_sem_cmpeq_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
574 sh2a_fpu::write_stacks &buf)
576 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
577 sem_status status = SEM_STATUS_NORMAL;
578 sh2a_fpu_scache* abuf = sem;
579 unsigned long long written = 0;
580 PCADDR pc = abuf->addr;
584 BI opval = EQSI (current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_grc_get (FLD (f_rn)));
585 if (UNLIKELY(current_cpu->trace_result_p))
586 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
587 current_cpu->h_tbit_set (opval);
590 current_cpu->done_insn (npc, status);
594 // ********** cmpeqi-compact: cmp/eq #$imm8, r0
597 sh2a_fpu_sem_cmpeqi_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
598 sh2a_fpu::write_stacks &buf)
600 #define FLD(f) abuf->fields.sfmt_andi_compact.f
601 sem_status status = SEM_STATUS_NORMAL;
602 sh2a_fpu_scache* abuf = sem;
603 unsigned long long written = 0;
604 PCADDR pc = abuf->addr;
608 BI opval = EQSI (current_cpu->h_grc_get (((UINT) 0)), EXTQISI (ANDQI (FLD (f_imm8), 255)));
609 if (UNLIKELY(current_cpu->trace_result_p))
610 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
611 current_cpu->h_tbit_set (opval);
614 current_cpu->done_insn (npc, status);
618 // ********** cmpge-compact: cmp/ge $rm, $rn
621 sh2a_fpu_sem_cmpge_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
622 sh2a_fpu::write_stacks &buf)
624 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
625 sem_status status = SEM_STATUS_NORMAL;
626 sh2a_fpu_scache* abuf = sem;
627 unsigned long long written = 0;
628 PCADDR pc = abuf->addr;
632 BI opval = GESI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
633 if (UNLIKELY(current_cpu->trace_result_p))
634 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
635 current_cpu->h_tbit_set (opval);
638 current_cpu->done_insn (npc, status);
642 // ********** cmpgt-compact: cmp/gt $rm, $rn
645 sh2a_fpu_sem_cmpgt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
646 sh2a_fpu::write_stacks &buf)
648 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
649 sem_status status = SEM_STATUS_NORMAL;
650 sh2a_fpu_scache* abuf = sem;
651 unsigned long long written = 0;
652 PCADDR pc = abuf->addr;
656 BI opval = GTSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
657 if (UNLIKELY(current_cpu->trace_result_p))
658 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
659 current_cpu->h_tbit_set (opval);
662 current_cpu->done_insn (npc, status);
666 // ********** cmphi-compact: cmp/hi $rm, $rn
669 sh2a_fpu_sem_cmphi_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
670 sh2a_fpu::write_stacks &buf)
672 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
673 sem_status status = SEM_STATUS_NORMAL;
674 sh2a_fpu_scache* abuf = sem;
675 unsigned long long written = 0;
676 PCADDR pc = abuf->addr;
680 BI opval = GTUSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
681 if (UNLIKELY(current_cpu->trace_result_p))
682 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
683 current_cpu->h_tbit_set (opval);
686 current_cpu->done_insn (npc, status);
690 // ********** cmphs-compact: cmp/hs $rm, $rn
693 sh2a_fpu_sem_cmphs_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
694 sh2a_fpu::write_stacks &buf)
696 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
697 sem_status status = SEM_STATUS_NORMAL;
698 sh2a_fpu_scache* abuf = sem;
699 unsigned long long written = 0;
700 PCADDR pc = abuf->addr;
704 BI opval = GEUSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
705 if (UNLIKELY(current_cpu->trace_result_p))
706 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
707 current_cpu->h_tbit_set (opval);
710 current_cpu->done_insn (npc, status);
714 // ********** cmppl-compact: cmp/pl $rn
717 sh2a_fpu_sem_cmppl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
718 sh2a_fpu::write_stacks &buf)
720 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
721 sem_status status = SEM_STATUS_NORMAL;
722 sh2a_fpu_scache* abuf = sem;
723 unsigned long long written = 0;
724 PCADDR pc = abuf->addr;
728 BI opval = GTSI (current_cpu->h_grc_get (FLD (f_rn)), 0);
729 if (UNLIKELY(current_cpu->trace_result_p))
730 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
731 current_cpu->h_tbit_set (opval);
734 current_cpu->done_insn (npc, status);
738 // ********** cmppz-compact: cmp/pz $rn
741 sh2a_fpu_sem_cmppz_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
742 sh2a_fpu::write_stacks &buf)
744 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
745 sem_status status = SEM_STATUS_NORMAL;
746 sh2a_fpu_scache* abuf = sem;
747 unsigned long long written = 0;
748 PCADDR pc = abuf->addr;
752 BI opval = GESI (current_cpu->h_grc_get (FLD (f_rn)), 0);
753 if (UNLIKELY(current_cpu->trace_result_p))
754 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
755 current_cpu->h_tbit_set (opval);
758 current_cpu->done_insn (npc, status);
762 // ********** cmpstr-compact: cmp/str $rm, $rn
765 sh2a_fpu_sem_cmpstr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
766 sh2a_fpu::write_stacks &buf)
768 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
769 sem_status status = SEM_STATUS_NORMAL;
770 sh2a_fpu_scache* abuf = sem;
771 unsigned long long written = 0;
772 PCADDR pc = abuf->addr;
778 tmp_temp = XORSI (current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_grc_get (FLD (f_rn)));
779 tmp_t = EQSI (ANDSI (tmp_temp, 0xff000000), 0);
780 tmp_t = ORBI (EQSI (ANDSI (tmp_temp, 16711680), 0), tmp_t);
781 tmp_t = ORBI (EQSI (ANDSI (tmp_temp, 65280), 0), tmp_t);
782 tmp_t = ORBI (EQSI (ANDSI (tmp_temp, 255), 0), tmp_t);
784 BI opval = ((GTUBI (tmp_t, 0)) ? (1) : (0));
785 if (UNLIKELY(current_cpu->trace_result_p))
786 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
787 current_cpu->h_tbit_set (opval);
791 current_cpu->done_insn (npc, status);
795 // ********** div0s-compact: div0s $rm, $rn
798 sh2a_fpu_sem_div0s_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
799 sh2a_fpu::write_stacks &buf)
801 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
802 sem_status status = SEM_STATUS_NORMAL;
803 sh2a_fpu_scache* abuf = sem;
804 unsigned long long written = 0;
805 PCADDR pc = abuf->addr;
810 BI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
811 if (UNLIKELY(current_cpu->trace_result_p))
812 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
813 current_cpu->h_qbit_set (opval);
816 BI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rm)), 31);
817 if (UNLIKELY(current_cpu->trace_result_p))
818 current_cpu->trace_stream << "mbit" << ":=0x" << hex << opval << dec << " ";
819 current_cpu->h_mbit_set (opval);
822 BI opval = ((EQSI (SRLSI (current_cpu->h_grc_get (FLD (f_rm)), 31), SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31))) ? (0) : (1));
823 if (UNLIKELY(current_cpu->trace_result_p))
824 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
825 current_cpu->h_tbit_set (opval);
829 current_cpu->done_insn (npc, status);
833 // ********** div0u-compact: div0u
836 sh2a_fpu_sem_div0u_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
837 sh2a_fpu::write_stacks &buf)
839 #define FLD(f) abuf->fields.fmt_empty.f
840 sem_status status = SEM_STATUS_NORMAL;
841 sh2a_fpu_scache* abuf = sem;
842 unsigned long long written = 0;
843 PCADDR pc = abuf->addr;
849 if (UNLIKELY(current_cpu->trace_result_p))
850 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
851 current_cpu->h_tbit_set (opval);
855 if (UNLIKELY(current_cpu->trace_result_p))
856 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
857 current_cpu->h_qbit_set (opval);
861 if (UNLIKELY(current_cpu->trace_result_p))
862 current_cpu->trace_stream << "mbit" << ":=0x" << hex << opval << dec << " ";
863 current_cpu->h_mbit_set (opval);
867 current_cpu->done_insn (npc, status);
871 // ********** div1-compact: div1 $rm, $rn
874 sh2a_fpu_sem_div1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
875 sh2a_fpu::write_stacks &buf)
877 #define FLD(f) abuf->fields.sfmt_macl_compact.f
878 sem_status status = SEM_STATUS_NORMAL;
879 sh2a_fpu_scache* abuf = sem;
880 unsigned long long written = 0;
881 PCADDR pc = abuf->addr;
888 tmp_oldq = current_cpu->h_qbit_get ();
890 BI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
891 if (UNLIKELY(current_cpu->trace_result_p))
892 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
893 current_cpu->h_qbit_set (opval);
896 SI opval = ORSI (SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 1), ZEXTBISI (current_cpu->h_tbit_get ()));
897 if (UNLIKELY(current_cpu->trace_result_p))
898 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
899 current_cpu->h_grc_set (FLD (f_rn), opval);
901 if (NOTBI (tmp_oldq)) {
902 if (NOTBI (current_cpu->h_mbit_get ())) {
904 tmp_tmp0 = current_cpu->h_grc_get (FLD (f_rn));
906 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
907 if (UNLIKELY(current_cpu->trace_result_p))
908 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
909 current_cpu->h_grc_set (FLD (f_rn), opval);
911 tmp_tmp1 = GTUSI (current_cpu->h_grc_get (FLD (f_rn)), tmp_tmp0);
912 if (NOTBI (current_cpu->h_qbit_get ())) {
914 BI opval = ((tmp_tmp1) ? (1) : (0));
915 if (UNLIKELY(current_cpu->trace_result_p))
916 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
917 current_cpu->h_qbit_set (opval);
921 BI opval = ((EQQI (tmp_tmp1, 0)) ? (1) : (0));
922 if (UNLIKELY(current_cpu->trace_result_p))
923 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
924 current_cpu->h_qbit_set (opval);
930 tmp_tmp0 = current_cpu->h_grc_get (FLD (f_rn));
932 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
933 if (UNLIKELY(current_cpu->trace_result_p))
934 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
935 current_cpu->h_grc_set (FLD (f_rn), opval);
937 tmp_tmp1 = LTUSI (current_cpu->h_grc_get (FLD (f_rn)), tmp_tmp0);
938 if (NOTBI (current_cpu->h_qbit_get ())) {
940 BI opval = ((EQQI (tmp_tmp1, 0)) ? (1) : (0));
941 if (UNLIKELY(current_cpu->trace_result_p))
942 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
943 current_cpu->h_qbit_set (opval);
947 BI opval = ((tmp_tmp1) ? (1) : (0));
948 if (UNLIKELY(current_cpu->trace_result_p))
949 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
950 current_cpu->h_qbit_set (opval);
956 if (NOTBI (current_cpu->h_mbit_get ())) {
958 tmp_tmp0 = current_cpu->h_grc_get (FLD (f_rn));
960 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_grc_get (FLD (f_rn)));
961 if (UNLIKELY(current_cpu->trace_result_p))
962 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
963 current_cpu->h_grc_set (FLD (f_rn), opval);
965 tmp_tmp1 = LTUSI (current_cpu->h_grc_get (FLD (f_rn)), tmp_tmp0);
966 if (NOTBI (current_cpu->h_qbit_get ())) {
968 BI opval = ((tmp_tmp1) ? (1) : (0));
969 if (UNLIKELY(current_cpu->trace_result_p))
970 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
971 current_cpu->h_qbit_set (opval);
975 BI opval = ((EQQI (tmp_tmp1, 0)) ? (1) : (0));
976 if (UNLIKELY(current_cpu->trace_result_p))
977 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
978 current_cpu->h_qbit_set (opval);
984 tmp_tmp0 = current_cpu->h_grc_get (FLD (f_rn));
986 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
987 if (UNLIKELY(current_cpu->trace_result_p))
988 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
989 current_cpu->h_grc_set (FLD (f_rn), opval);
991 tmp_tmp1 = GTUSI (current_cpu->h_grc_get (FLD (f_rn)), tmp_tmp0);
992 if (NOTBI (current_cpu->h_qbit_get ())) {
994 BI opval = ((EQQI (tmp_tmp1, 0)) ? (1) : (0));
995 if (UNLIKELY(current_cpu->trace_result_p))
996 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
997 current_cpu->h_qbit_set (opval);
1001 BI opval = ((tmp_tmp1) ? (1) : (0));
1002 if (UNLIKELY(current_cpu->trace_result_p))
1003 current_cpu->trace_stream << "qbit" << ":=0x" << hex << opval << dec << " ";
1004 current_cpu->h_qbit_set (opval);
1011 BI opval = ((EQBI (current_cpu->h_qbit_get (), current_cpu->h_mbit_get ())) ? (1) : (0));
1012 if (UNLIKELY(current_cpu->trace_result_p))
1013 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1014 current_cpu->h_tbit_set (opval);
1018 current_cpu->done_insn (npc, status);
1022 // ********** divu-compact: divu r0, $rn
1025 sh2a_fpu_sem_divu_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1026 sh2a_fpu::write_stacks &buf)
1028 #define FLD(f) abuf->fields.sfmt_divu_compact.f
1029 sem_status status = SEM_STATUS_NORMAL;
1030 sh2a_fpu_scache* abuf = sem;
1031 unsigned long long written = 0;
1032 PCADDR pc = abuf->addr;
1033 PCADDR npc = pc + 2;
1036 SI opval = UDIVSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (((UINT) 0)));
1037 if (UNLIKELY(current_cpu->trace_result_p))
1038 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1039 current_cpu->h_grc_set (FLD (f_rn), opval);
1042 current_cpu->done_insn (npc, status);
1046 // ********** mulr-compact: mulr r0, $rn
1049 sh2a_fpu_sem_mulr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1050 sh2a_fpu::write_stacks &buf)
1052 #define FLD(f) abuf->fields.sfmt_divu_compact.f
1053 sem_status status = SEM_STATUS_NORMAL;
1054 sh2a_fpu_scache* abuf = sem;
1055 unsigned long long written = 0;
1056 PCADDR pc = abuf->addr;
1057 PCADDR npc = pc + 2;
1060 SI opval = MULSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (((UINT) 0)));
1061 if (UNLIKELY(current_cpu->trace_result_p))
1062 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1063 current_cpu->h_grc_set (FLD (f_rn), opval);
1066 current_cpu->done_insn (npc, status);
1070 // ********** dmulsl-compact: dmuls.l $rm, $rn
1073 sh2a_fpu_sem_dmulsl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1074 sh2a_fpu::write_stacks &buf)
1076 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
1077 sem_status status = SEM_STATUS_NORMAL;
1078 sh2a_fpu_scache* abuf = sem;
1079 unsigned long long written = 0;
1080 PCADDR pc = abuf->addr;
1081 PCADDR npc = pc + 2;
1085 tmp_result = MULDI (EXTSIDI (current_cpu->h_grc_get (FLD (f_rm))), EXTSIDI (current_cpu->h_grc_get (FLD (f_rn))));
1087 SI opval = SUBWORDDISI (tmp_result, 0);
1088 if (UNLIKELY(current_cpu->trace_result_p))
1089 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
1090 current_cpu->h_mach_set (opval);
1093 SI opval = SUBWORDDISI (tmp_result, 1);
1094 if (UNLIKELY(current_cpu->trace_result_p))
1095 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
1096 current_cpu->h_macl_set (opval);
1100 current_cpu->done_insn (npc, status);
1104 // ********** dmulul-compact: dmulu.l $rm, $rn
1107 sh2a_fpu_sem_dmulul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1108 sh2a_fpu::write_stacks &buf)
1110 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
1111 sem_status status = SEM_STATUS_NORMAL;
1112 sh2a_fpu_scache* abuf = sem;
1113 unsigned long long written = 0;
1114 PCADDR pc = abuf->addr;
1115 PCADDR npc = pc + 2;
1119 tmp_result = MULDI (ZEXTSIDI (current_cpu->h_grc_get (FLD (f_rm))), ZEXTSIDI (current_cpu->h_grc_get (FLD (f_rn))));
1121 SI opval = SUBWORDDISI (tmp_result, 0);
1122 if (UNLIKELY(current_cpu->trace_result_p))
1123 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
1124 current_cpu->h_mach_set (opval);
1127 SI opval = SUBWORDDISI (tmp_result, 1);
1128 if (UNLIKELY(current_cpu->trace_result_p))
1129 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
1130 current_cpu->h_macl_set (opval);
1134 current_cpu->done_insn (npc, status);
1138 // ********** dt-compact: dt $rn
1141 sh2a_fpu_sem_dt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1142 sh2a_fpu::write_stacks &buf)
1144 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
1145 sem_status status = SEM_STATUS_NORMAL;
1146 sh2a_fpu_scache* abuf = sem;
1147 unsigned long long written = 0;
1148 PCADDR pc = abuf->addr;
1149 PCADDR npc = pc + 2;
1153 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
1154 if (UNLIKELY(current_cpu->trace_result_p))
1155 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1156 current_cpu->h_grc_set (FLD (f_rn), opval);
1159 BI opval = EQSI (current_cpu->h_grc_get (FLD (f_rn)), 0);
1160 if (UNLIKELY(current_cpu->trace_result_p))
1161 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1162 current_cpu->h_tbit_set (opval);
1166 current_cpu->done_insn (npc, status);
1170 // ********** extsb-compact: exts.b $rm, $rn
1173 sh2a_fpu_sem_extsb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1174 sh2a_fpu::write_stacks &buf)
1176 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1177 sem_status status = SEM_STATUS_NORMAL;
1178 sh2a_fpu_scache* abuf = sem;
1179 unsigned long long written = 0;
1180 PCADDR pc = abuf->addr;
1181 PCADDR npc = pc + 2;
1184 SI opval = EXTQISI (SUBWORDSIQI (current_cpu->h_grc_get (FLD (f_rm)), 3));
1185 if (UNLIKELY(current_cpu->trace_result_p))
1186 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1187 current_cpu->h_grc_set (FLD (f_rn), opval);
1190 current_cpu->done_insn (npc, status);
1194 // ********** extsw-compact: exts.w $rm, $rn
1197 sh2a_fpu_sem_extsw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1198 sh2a_fpu::write_stacks &buf)
1200 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1201 sem_status status = SEM_STATUS_NORMAL;
1202 sh2a_fpu_scache* abuf = sem;
1203 unsigned long long written = 0;
1204 PCADDR pc = abuf->addr;
1205 PCADDR npc = pc + 2;
1208 SI opval = EXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1));
1209 if (UNLIKELY(current_cpu->trace_result_p))
1210 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1211 current_cpu->h_grc_set (FLD (f_rn), opval);
1214 current_cpu->done_insn (npc, status);
1218 // ********** extub-compact: extu.b $rm, $rn
1221 sh2a_fpu_sem_extub_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1222 sh2a_fpu::write_stacks &buf)
1224 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1225 sem_status status = SEM_STATUS_NORMAL;
1226 sh2a_fpu_scache* abuf = sem;
1227 unsigned long long written = 0;
1228 PCADDR pc = abuf->addr;
1229 PCADDR npc = pc + 2;
1232 SI opval = ZEXTQISI (SUBWORDSIQI (current_cpu->h_grc_get (FLD (f_rm)), 3));
1233 if (UNLIKELY(current_cpu->trace_result_p))
1234 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1235 current_cpu->h_grc_set (FLD (f_rn), opval);
1238 current_cpu->done_insn (npc, status);
1242 // ********** extuw-compact: extu.w $rm, $rn
1245 sh2a_fpu_sem_extuw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1246 sh2a_fpu::write_stacks &buf)
1248 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
1249 sem_status status = SEM_STATUS_NORMAL;
1250 sh2a_fpu_scache* abuf = sem;
1251 unsigned long long written = 0;
1252 PCADDR pc = abuf->addr;
1253 PCADDR npc = pc + 2;
1256 SI opval = ZEXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1));
1257 if (UNLIKELY(current_cpu->trace_result_p))
1258 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1259 current_cpu->h_grc_set (FLD (f_rn), opval);
1262 current_cpu->done_insn (npc, status);
1266 // ********** fabs-compact: fabs $fsdn
1269 sh2a_fpu_sem_fabs_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1270 sh2a_fpu::write_stacks &buf)
1272 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1273 sem_status status = SEM_STATUS_NORMAL;
1274 sh2a_fpu_scache* abuf = sem;
1275 unsigned long long written = 0;
1276 PCADDR pc = abuf->addr;
1277 PCADDR npc = pc + 2;
1279 if (current_cpu->h_prbit_get ()) {
1281 DF opval = current_cpu->sh64_fabsd (current_cpu->h_fsd_get (FLD (f_rn)));
1282 written |= (1ULL << 2);
1283 if (UNLIKELY(current_cpu->trace_result_p))
1284 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1285 current_cpu->h_fsd_set (FLD (f_rn), opval);
1289 DF opval = current_cpu->sh64_fabss (current_cpu->h_fsd_get (FLD (f_rn)));
1290 written |= (1ULL << 2);
1291 if (UNLIKELY(current_cpu->trace_result_p))
1292 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1293 current_cpu->h_fsd_set (FLD (f_rn), opval);
1297 abuf->written = written;
1298 current_cpu->done_insn (npc, status);
1302 // ********** fadd-compact: fadd $fsdm, $fsdn
1305 sh2a_fpu_sem_fadd_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1306 sh2a_fpu::write_stacks &buf)
1308 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1309 sem_status status = SEM_STATUS_NORMAL;
1310 sh2a_fpu_scache* abuf = sem;
1311 unsigned long long written = 0;
1312 PCADDR pc = abuf->addr;
1313 PCADDR npc = pc + 2;
1315 if (current_cpu->h_prbit_get ()) {
1317 DF opval = current_cpu->sh64_faddd (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1318 written |= (1ULL << 3);
1319 if (UNLIKELY(current_cpu->trace_result_p))
1320 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1321 current_cpu->h_fsd_set (FLD (f_rn), opval);
1325 DF opval = current_cpu->sh64_fadds (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1326 written |= (1ULL << 3);
1327 if (UNLIKELY(current_cpu->trace_result_p))
1328 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1329 current_cpu->h_fsd_set (FLD (f_rn), opval);
1333 abuf->written = written;
1334 current_cpu->done_insn (npc, status);
1338 // ********** fcmpeq-compact: fcmp/eq $fsdm, $fsdn
1341 sh2a_fpu_sem_fcmpeq_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1342 sh2a_fpu::write_stacks &buf)
1344 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1345 sem_status status = SEM_STATUS_NORMAL;
1346 sh2a_fpu_scache* abuf = sem;
1347 unsigned long long written = 0;
1348 PCADDR pc = abuf->addr;
1349 PCADDR npc = pc + 2;
1351 if (current_cpu->h_prbit_get ()) {
1353 BI opval = current_cpu->sh64_fcmpeqd (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1354 written |= (1ULL << 3);
1355 if (UNLIKELY(current_cpu->trace_result_p))
1356 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1357 current_cpu->h_tbit_set (opval);
1361 BI opval = current_cpu->sh64_fcmpeqs (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1362 written |= (1ULL << 3);
1363 if (UNLIKELY(current_cpu->trace_result_p))
1364 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1365 current_cpu->h_tbit_set (opval);
1369 abuf->written = written;
1370 current_cpu->done_insn (npc, status);
1374 // ********** fcmpgt-compact: fcmp/gt $fsdm, $fsdn
1377 sh2a_fpu_sem_fcmpgt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1378 sh2a_fpu::write_stacks &buf)
1380 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1381 sem_status status = SEM_STATUS_NORMAL;
1382 sh2a_fpu_scache* abuf = sem;
1383 unsigned long long written = 0;
1384 PCADDR pc = abuf->addr;
1385 PCADDR npc = pc + 2;
1387 if (current_cpu->h_prbit_get ()) {
1389 BI opval = current_cpu->sh64_fcmpgtd (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
1390 written |= (1ULL << 3);
1391 if (UNLIKELY(current_cpu->trace_result_p))
1392 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1393 current_cpu->h_tbit_set (opval);
1397 BI opval = current_cpu->sh64_fcmpgts (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
1398 written |= (1ULL << 3);
1399 if (UNLIKELY(current_cpu->trace_result_p))
1400 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
1401 current_cpu->h_tbit_set (opval);
1405 abuf->written = written;
1406 current_cpu->done_insn (npc, status);
1410 // ********** fcnvds-compact: fcnvds $drn, fpul
1413 sh2a_fpu_sem_fcnvds_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1414 sh2a_fpu::write_stacks &buf)
1416 #define FLD(f) abuf->fields.sfmt_fcnvds_compact.f
1417 sem_status status = SEM_STATUS_NORMAL;
1418 sh2a_fpu_scache* abuf = sem;
1419 unsigned long long written = 0;
1420 PCADDR pc = abuf->addr;
1421 PCADDR npc = pc + 2;
1424 SF opval = current_cpu->sh64_fcnvds (current_cpu->h_drc_get (FLD (f_dn)));
1425 if (UNLIKELY(current_cpu->trace_result_p))
1426 current_cpu->trace_stream << "fr" << '[' << ((UINT) 32) << ']' << ":=0x" << hex << opval << dec << " ";
1427 current_cpu->hardware.h_fr[((UINT) 32)] = opval;
1430 current_cpu->done_insn (npc, status);
1434 // ********** fcnvsd-compact: fcnvsd fpul, $drn
1437 sh2a_fpu_sem_fcnvsd_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1438 sh2a_fpu::write_stacks &buf)
1440 #define FLD(f) abuf->fields.sfmt_fcnvsd_compact.f
1441 sem_status status = SEM_STATUS_NORMAL;
1442 sh2a_fpu_scache* abuf = sem;
1443 unsigned long long written = 0;
1444 PCADDR pc = abuf->addr;
1445 PCADDR npc = pc + 2;
1448 DF opval = current_cpu->sh64_fcnvsd (current_cpu->hardware.h_fr[((UINT) 32)]);
1449 if (UNLIKELY(current_cpu->trace_result_p))
1450 current_cpu->trace_stream << "drc" << '[' << FLD (f_dn) << ']' << ":=0x" << hex << opval << dec << " ";
1451 current_cpu->h_drc_set (FLD (f_dn), opval);
1454 current_cpu->done_insn (npc, status);
1458 // ********** fdiv-compact: fdiv $fsdm, $fsdn
1461 sh2a_fpu_sem_fdiv_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1462 sh2a_fpu::write_stacks &buf)
1464 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1465 sem_status status = SEM_STATUS_NORMAL;
1466 sh2a_fpu_scache* abuf = sem;
1467 unsigned long long written = 0;
1468 PCADDR pc = abuf->addr;
1469 PCADDR npc = pc + 2;
1471 if (current_cpu->h_prbit_get ()) {
1473 DF opval = current_cpu->sh64_fdivd (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
1474 written |= (1ULL << 3);
1475 if (UNLIKELY(current_cpu->trace_result_p))
1476 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1477 current_cpu->h_fsd_set (FLD (f_rn), opval);
1481 DF opval = current_cpu->sh64_fdivs (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
1482 written |= (1ULL << 3);
1483 if (UNLIKELY(current_cpu->trace_result_p))
1484 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1485 current_cpu->h_fsd_set (FLD (f_rn), opval);
1489 abuf->written = written;
1490 current_cpu->done_insn (npc, status);
1494 // ********** flds-compact: flds $frn, fpul
1497 sh2a_fpu_sem_flds_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1498 sh2a_fpu::write_stacks &buf)
1500 #define FLD(f) abuf->fields.sfmt_flds_compact.f
1501 sem_status status = SEM_STATUS_NORMAL;
1502 sh2a_fpu_scache* abuf = sem;
1503 unsigned long long written = 0;
1504 PCADDR pc = abuf->addr;
1505 PCADDR npc = pc + 2;
1508 SF opval = current_cpu->h_frc_get (FLD (f_rn));
1509 if (UNLIKELY(current_cpu->trace_result_p))
1510 current_cpu->trace_stream << "fr" << '[' << ((UINT) 32) << ']' << ":=0x" << hex << opval << dec << " ";
1511 current_cpu->hardware.h_fr[((UINT) 32)] = opval;
1514 current_cpu->done_insn (npc, status);
1518 // ********** fldi0-compact: fldi0 $frn
1521 sh2a_fpu_sem_fldi0_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1522 sh2a_fpu::write_stacks &buf)
1524 #define FLD(f) abuf->fields.sfmt_fsts_compact.f
1525 sem_status status = SEM_STATUS_NORMAL;
1526 sh2a_fpu_scache* abuf = sem;
1527 unsigned long long written = 0;
1528 PCADDR pc = abuf->addr;
1529 PCADDR npc = pc + 2;
1532 SF opval = current_cpu->sh64_fldi0 ();
1533 if (UNLIKELY(current_cpu->trace_result_p))
1534 current_cpu->trace_stream << "frc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1535 current_cpu->h_frc_set (FLD (f_rn), opval);
1538 current_cpu->done_insn (npc, status);
1542 // ********** fldi1-compact: fldi1 $frn
1545 sh2a_fpu_sem_fldi1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1546 sh2a_fpu::write_stacks &buf)
1548 #define FLD(f) abuf->fields.sfmt_fsts_compact.f
1549 sem_status status = SEM_STATUS_NORMAL;
1550 sh2a_fpu_scache* abuf = sem;
1551 unsigned long long written = 0;
1552 PCADDR pc = abuf->addr;
1553 PCADDR npc = pc + 2;
1556 SF opval = current_cpu->sh64_fldi1 ();
1557 if (UNLIKELY(current_cpu->trace_result_p))
1558 current_cpu->trace_stream << "frc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1559 current_cpu->h_frc_set (FLD (f_rn), opval);
1562 current_cpu->done_insn (npc, status);
1566 // ********** float-compact: float fpul, $fsdn
1569 sh2a_fpu_sem_float_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1570 sh2a_fpu::write_stacks &buf)
1572 #define FLD(f) abuf->fields.sfmt_float_compact.f
1573 sem_status status = SEM_STATUS_NORMAL;
1574 sh2a_fpu_scache* abuf = sem;
1575 unsigned long long written = 0;
1576 PCADDR pc = abuf->addr;
1577 PCADDR npc = pc + 2;
1579 if (current_cpu->h_prbit_get ()) {
1581 DF opval = current_cpu->sh64_floatld (current_cpu->hardware.h_fr[((UINT) 32)]);
1582 written |= (1ULL << 2);
1583 if (UNLIKELY(current_cpu->trace_result_p))
1584 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1585 current_cpu->h_fsd_set (FLD (f_rn), opval);
1589 DF opval = current_cpu->sh64_floatls (current_cpu->hardware.h_fr[((UINT) 32)]);
1590 written |= (1ULL << 2);
1591 if (UNLIKELY(current_cpu->trace_result_p))
1592 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1593 current_cpu->h_fsd_set (FLD (f_rn), opval);
1597 abuf->written = written;
1598 current_cpu->done_insn (npc, status);
1602 // ********** fmac-compact: fmac fr0, $frm, $frn
1605 sh2a_fpu_sem_fmac_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1606 sh2a_fpu::write_stacks &buf)
1608 #define FLD(f) abuf->fields.sfmt_fmac_compact.f
1609 sem_status status = SEM_STATUS_NORMAL;
1610 sh2a_fpu_scache* abuf = sem;
1611 unsigned long long written = 0;
1612 PCADDR pc = abuf->addr;
1613 PCADDR npc = pc + 2;
1616 SF opval = current_cpu->sh64_fmacs (current_cpu->h_frc_get (((UINT) 0)), current_cpu->h_frc_get (FLD (f_rm)), current_cpu->h_frc_get (FLD (f_rn)));
1617 if (UNLIKELY(current_cpu->trace_result_p))
1618 current_cpu->trace_stream << "frc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1619 current_cpu->h_frc_set (FLD (f_rn), opval);
1622 current_cpu->done_insn (npc, status);
1626 // ********** fmov1-compact: fmov $fmovm, $fmovn
1629 sh2a_fpu_sem_fmov1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1630 sh2a_fpu::write_stacks &buf)
1632 #define FLD(f) abuf->fields.sfmt_fmov1_compact.f
1633 sem_status status = SEM_STATUS_NORMAL;
1634 sh2a_fpu_scache* abuf = sem;
1635 unsigned long long written = 0;
1636 PCADDR pc = abuf->addr;
1637 PCADDR npc = pc + 2;
1640 DF opval = current_cpu->h_fmov_get (FLD (f_rm));
1641 if (UNLIKELY(current_cpu->trace_result_p))
1642 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1643 current_cpu->h_fmov_set (FLD (f_rn), opval);
1646 current_cpu->done_insn (npc, status);
1650 // ********** fmov2-compact: fmov @$rm, $fmovn
1653 sh2a_fpu_sem_fmov2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1654 sh2a_fpu::write_stacks &buf)
1656 #define FLD(f) abuf->fields.sfmt_fmov4_compact.f
1657 sem_status status = SEM_STATUS_NORMAL;
1658 sh2a_fpu_scache* abuf = sem;
1659 unsigned long long written = 0;
1660 PCADDR pc = abuf->addr;
1661 PCADDR npc = pc + 2;
1663 if (NOTBI (current_cpu->h_szbit_get ())) {
1665 DF opval = current_cpu->GETMEMSF (pc, current_cpu->h_grc_get (FLD (f_rm)));
1666 written |= (1ULL << 4);
1667 if (UNLIKELY(current_cpu->trace_result_p))
1668 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1669 current_cpu->h_fmov_set (FLD (f_rn), opval);
1673 DF opval = current_cpu->GETMEMDF (pc, current_cpu->h_grc_get (FLD (f_rm)));
1674 written |= (1ULL << 4);
1675 if (UNLIKELY(current_cpu->trace_result_p))
1676 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1677 current_cpu->h_fmov_set (FLD (f_rn), opval);
1681 abuf->written = written;
1682 current_cpu->done_insn (npc, status);
1686 // ********** fmov3-compact: fmov @${rm}+, fmovn
1689 sh2a_fpu_sem_fmov3_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1690 sh2a_fpu::write_stacks &buf)
1692 #define FLD(f) abuf->fields.sfmt_fmov3_compact.f
1693 sem_status status = SEM_STATUS_NORMAL;
1694 sh2a_fpu_scache* abuf = sem;
1695 unsigned long long written = 0;
1696 PCADDR pc = abuf->addr;
1697 PCADDR npc = pc + 2;
1699 if (NOTBI (current_cpu->h_szbit_get ())) {
1702 DF opval = current_cpu->GETMEMSF (pc, current_cpu->h_grc_get (FLD (f_rm)));
1703 written |= (1ULL << 4);
1704 if (UNLIKELY(current_cpu->trace_result_p))
1705 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1706 current_cpu->h_fmov_set (FLD (f_rn), opval);
1709 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 4);
1710 written |= (1ULL << 5);
1711 if (UNLIKELY(current_cpu->trace_result_p))
1712 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
1713 current_cpu->h_grc_set (FLD (f_rm), opval);
1719 DF opval = current_cpu->GETMEMDF (pc, current_cpu->h_grc_get (FLD (f_rm)));
1720 written |= (1ULL << 4);
1721 if (UNLIKELY(current_cpu->trace_result_p))
1722 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1723 current_cpu->h_fmov_set (FLD (f_rn), opval);
1726 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 8);
1727 written |= (1ULL << 5);
1728 if (UNLIKELY(current_cpu->trace_result_p))
1729 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
1730 current_cpu->h_grc_set (FLD (f_rm), opval);
1735 abuf->written = written;
1736 current_cpu->done_insn (npc, status);
1740 // ********** fmov4-compact: fmov @(r0, $rm), $fmovn
1743 sh2a_fpu_sem_fmov4_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1744 sh2a_fpu::write_stacks &buf)
1746 #define FLD(f) abuf->fields.sfmt_fmov4_compact.f
1747 sem_status status = SEM_STATUS_NORMAL;
1748 sh2a_fpu_scache* abuf = sem;
1749 unsigned long long written = 0;
1750 PCADDR pc = abuf->addr;
1751 PCADDR npc = pc + 2;
1753 if (NOTBI (current_cpu->h_szbit_get ())) {
1755 DF opval = current_cpu->GETMEMSF (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rm))));
1756 written |= (1ULL << 5);
1757 if (UNLIKELY(current_cpu->trace_result_p))
1758 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1759 current_cpu->h_fmov_set (FLD (f_rn), opval);
1763 DF opval = current_cpu->GETMEMDF (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rm))));
1764 written |= (1ULL << 5);
1765 if (UNLIKELY(current_cpu->trace_result_p))
1766 current_cpu->trace_stream << "fmov" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1767 current_cpu->h_fmov_set (FLD (f_rn), opval);
1771 abuf->written = written;
1772 current_cpu->done_insn (npc, status);
1776 // ********** fmov5-compact: fmov $fmovm, @$rn
1779 sh2a_fpu_sem_fmov5_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1780 sh2a_fpu::write_stacks &buf)
1782 #define FLD(f) abuf->fields.sfmt_fmov7_compact.f
1783 sem_status status = SEM_STATUS_NORMAL;
1784 sh2a_fpu_scache* abuf = sem;
1785 unsigned long long written = 0;
1786 PCADDR pc = abuf->addr;
1787 PCADDR npc = pc + 2;
1789 if (NOTBI (current_cpu->h_szbit_get ())) {
1791 SF opval = current_cpu->h_fmov_get (FLD (f_rm));
1792 written |= (1ULL << 4);
1793 if (UNLIKELY(current_cpu->trace_result_p))
1794 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1795 current_cpu->SETMEMSF (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
1799 DF opval = current_cpu->h_fmov_get (FLD (f_rm));
1800 written |= (1ULL << 3);
1801 if (UNLIKELY(current_cpu->trace_result_p))
1802 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1803 current_cpu->SETMEMDF (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
1807 abuf->written = written;
1808 current_cpu->done_insn (npc, status);
1812 // ********** fmov6-compact: fmov $fmovm, @-$rn
1815 sh2a_fpu_sem_fmov6_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1816 sh2a_fpu::write_stacks &buf)
1818 #define FLD(f) abuf->fields.sfmt_fmov6_compact.f
1819 sem_status status = SEM_STATUS_NORMAL;
1820 sh2a_fpu_scache* abuf = sem;
1821 unsigned long long written = 0;
1822 PCADDR pc = abuf->addr;
1823 PCADDR npc = pc + 2;
1825 if (NOTBI (current_cpu->h_szbit_get ())) {
1828 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
1829 written |= (1ULL << 5);
1830 if (UNLIKELY(current_cpu->trace_result_p))
1831 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1832 current_cpu->h_grc_set (FLD (f_rn), opval);
1835 SF opval = current_cpu->h_fmov_get (FLD (f_rm));
1836 written |= (1ULL << 4);
1837 if (UNLIKELY(current_cpu->trace_result_p))
1838 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1839 current_cpu->SETMEMSF (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
1845 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 8);
1846 written |= (1ULL << 5);
1847 if (UNLIKELY(current_cpu->trace_result_p))
1848 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1849 current_cpu->h_grc_set (FLD (f_rn), opval);
1852 DF opval = current_cpu->h_fmov_get (FLD (f_rm));
1853 written |= (1ULL << 3);
1854 if (UNLIKELY(current_cpu->trace_result_p))
1855 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1856 current_cpu->SETMEMDF (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
1861 abuf->written = written;
1862 current_cpu->done_insn (npc, status);
1866 // ********** fmov7-compact: fmov $fmovm, @(r0, $rn)
1869 sh2a_fpu_sem_fmov7_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1870 sh2a_fpu::write_stacks &buf)
1872 #define FLD(f) abuf->fields.sfmt_fmov7_compact.f
1873 sem_status status = SEM_STATUS_NORMAL;
1874 sh2a_fpu_scache* abuf = sem;
1875 unsigned long long written = 0;
1876 PCADDR pc = abuf->addr;
1877 PCADDR npc = pc + 2;
1879 if (NOTBI (current_cpu->h_szbit_get ())) {
1881 SF opval = current_cpu->h_fmov_get (FLD (f_rm));
1882 written |= (1ULL << 5);
1883 if (UNLIKELY(current_cpu->trace_result_p))
1884 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1885 current_cpu->SETMEMSF (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))), opval);
1889 DF opval = current_cpu->h_fmov_get (FLD (f_rm));
1890 written |= (1ULL << 4);
1891 if (UNLIKELY(current_cpu->trace_result_p))
1892 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1893 current_cpu->SETMEMDF (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))), opval);
1897 abuf->written = written;
1898 current_cpu->done_insn (npc, status);
1902 // ********** fmov8-compact: fmov.d @($imm12x8, $rm), $drn
1905 sh2a_fpu_sem_fmov8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1906 sh2a_fpu::write_stacks &buf)
1908 #define FLD(f) abuf->fields.sfmt_fmov8_compact.f
1909 sem_status status = SEM_STATUS_NORMAL;
1910 sh2a_fpu_scache* abuf = sem;
1911 unsigned long long written = 0;
1912 PCADDR pc = abuf->addr;
1913 PCADDR npc = pc + 4;
1916 DF opval = current_cpu->GETMEMDF (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm12x8)));
1917 if (UNLIKELY(current_cpu->trace_result_p))
1918 current_cpu->trace_stream << "drc" << '[' << FLD (f_dn) << ']' << ":=0x" << hex << opval << dec << " ";
1919 current_cpu->h_drc_set (FLD (f_dn), opval);
1922 current_cpu->done_insn (npc, status);
1926 // ********** fmov9-compact: mov.l $drm, @($imm12x8, $rn)
1929 sh2a_fpu_sem_fmov9_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1930 sh2a_fpu::write_stacks &buf)
1932 #define FLD(f) abuf->fields.sfmt_fmov9_compact.f
1933 sem_status status = SEM_STATUS_NORMAL;
1934 sh2a_fpu_scache* abuf = sem;
1935 unsigned long long written = 0;
1936 PCADDR pc = abuf->addr;
1937 PCADDR npc = pc + 4;
1940 DF opval = current_cpu->h_drc_get (FLD (f_dm));
1941 if (UNLIKELY(current_cpu->trace_result_p))
1942 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm12x8)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
1943 current_cpu->SETMEMDF (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm12x8)), opval);
1946 current_cpu->done_insn (npc, status);
1950 // ********** fmul-compact: fmul $fsdm, $fsdn
1953 sh2a_fpu_sem_fmul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1954 sh2a_fpu::write_stacks &buf)
1956 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1957 sem_status status = SEM_STATUS_NORMAL;
1958 sh2a_fpu_scache* abuf = sem;
1959 unsigned long long written = 0;
1960 PCADDR pc = abuf->addr;
1961 PCADDR npc = pc + 2;
1963 if (current_cpu->h_prbit_get ()) {
1965 DF opval = current_cpu->sh64_fmuld (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1966 written |= (1ULL << 3);
1967 if (UNLIKELY(current_cpu->trace_result_p))
1968 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1969 current_cpu->h_fsd_set (FLD (f_rn), opval);
1973 DF opval = current_cpu->sh64_fmuls (current_cpu->h_fsd_get (FLD (f_rm)), current_cpu->h_fsd_get (FLD (f_rn)));
1974 written |= (1ULL << 3);
1975 if (UNLIKELY(current_cpu->trace_result_p))
1976 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
1977 current_cpu->h_fsd_set (FLD (f_rn), opval);
1981 abuf->written = written;
1982 current_cpu->done_insn (npc, status);
1986 // ********** fneg-compact: fneg $fsdn
1989 sh2a_fpu_sem_fneg_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
1990 sh2a_fpu::write_stacks &buf)
1992 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
1993 sem_status status = SEM_STATUS_NORMAL;
1994 sh2a_fpu_scache* abuf = sem;
1995 unsigned long long written = 0;
1996 PCADDR pc = abuf->addr;
1997 PCADDR npc = pc + 2;
1999 if (current_cpu->h_prbit_get ()) {
2001 DF opval = current_cpu->sh64_fnegd (current_cpu->h_fsd_get (FLD (f_rn)));
2002 written |= (1ULL << 2);
2003 if (UNLIKELY(current_cpu->trace_result_p))
2004 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2005 current_cpu->h_fsd_set (FLD (f_rn), opval);
2009 DF opval = current_cpu->sh64_fnegs (current_cpu->h_fsd_get (FLD (f_rn)));
2010 written |= (1ULL << 2);
2011 if (UNLIKELY(current_cpu->trace_result_p))
2012 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2013 current_cpu->h_fsd_set (FLD (f_rn), opval);
2017 abuf->written = written;
2018 current_cpu->done_insn (npc, status);
2022 // ********** frchg-compact: frchg
2025 sh2a_fpu_sem_frchg_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2026 sh2a_fpu::write_stacks &buf)
2028 #define FLD(f) abuf->fields.fmt_empty.f
2029 sem_status status = SEM_STATUS_NORMAL;
2030 sh2a_fpu_scache* abuf = sem;
2031 unsigned long long written = 0;
2032 PCADDR pc = abuf->addr;
2033 PCADDR npc = pc + 2;
2036 BI opval = NOTBI (current_cpu->h_frbit_get ());
2037 if (UNLIKELY(current_cpu->trace_result_p))
2038 current_cpu->trace_stream << "frbit" << ":=0x" << hex << opval << dec << " ";
2039 current_cpu->h_frbit_set (opval);
2042 current_cpu->done_insn (npc, status);
2046 // ********** fschg-compact: fschg
2049 sh2a_fpu_sem_fschg_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2050 sh2a_fpu::write_stacks &buf)
2052 #define FLD(f) abuf->fields.fmt_empty.f
2053 sem_status status = SEM_STATUS_NORMAL;
2054 sh2a_fpu_scache* abuf = sem;
2055 unsigned long long written = 0;
2056 PCADDR pc = abuf->addr;
2057 PCADDR npc = pc + 2;
2060 BI opval = NOTBI (current_cpu->h_szbit_get ());
2061 if (UNLIKELY(current_cpu->trace_result_p))
2062 current_cpu->trace_stream << "szbit" << ":=0x" << hex << opval << dec << " ";
2063 current_cpu->h_szbit_set (opval);
2066 current_cpu->done_insn (npc, status);
2070 // ********** fsqrt-compact: fsqrt $fsdn
2073 sh2a_fpu_sem_fsqrt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2074 sh2a_fpu::write_stacks &buf)
2076 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
2077 sem_status status = SEM_STATUS_NORMAL;
2078 sh2a_fpu_scache* abuf = sem;
2079 unsigned long long written = 0;
2080 PCADDR pc = abuf->addr;
2081 PCADDR npc = pc + 2;
2083 if (current_cpu->h_prbit_get ()) {
2085 DF opval = current_cpu->sh64_fsqrtd (current_cpu->h_fsd_get (FLD (f_rn)));
2086 written |= (1ULL << 2);
2087 if (UNLIKELY(current_cpu->trace_result_p))
2088 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2089 current_cpu->h_fsd_set (FLD (f_rn), opval);
2093 DF opval = current_cpu->sh64_fsqrts (current_cpu->h_fsd_get (FLD (f_rn)));
2094 written |= (1ULL << 2);
2095 if (UNLIKELY(current_cpu->trace_result_p))
2096 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2097 current_cpu->h_fsd_set (FLD (f_rn), opval);
2101 abuf->written = written;
2102 current_cpu->done_insn (npc, status);
2106 // ********** fsts-compact: fsts fpul, $frn
2109 sh2a_fpu_sem_fsts_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2110 sh2a_fpu::write_stacks &buf)
2112 #define FLD(f) abuf->fields.sfmt_fsts_compact.f
2113 sem_status status = SEM_STATUS_NORMAL;
2114 sh2a_fpu_scache* abuf = sem;
2115 unsigned long long written = 0;
2116 PCADDR pc = abuf->addr;
2117 PCADDR npc = pc + 2;
2120 SF opval = current_cpu->hardware.h_fr[((UINT) 32)];
2121 if (UNLIKELY(current_cpu->trace_result_p))
2122 current_cpu->trace_stream << "frc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2123 current_cpu->h_frc_set (FLD (f_rn), opval);
2126 current_cpu->done_insn (npc, status);
2130 // ********** fsub-compact: fsub $fsdm, $fsdn
2133 sh2a_fpu_sem_fsub_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2134 sh2a_fpu::write_stacks &buf)
2136 #define FLD(f) abuf->fields.sfmt_fadd_compact.f
2137 sem_status status = SEM_STATUS_NORMAL;
2138 sh2a_fpu_scache* abuf = sem;
2139 unsigned long long written = 0;
2140 PCADDR pc = abuf->addr;
2141 PCADDR npc = pc + 2;
2143 if (current_cpu->h_prbit_get ()) {
2145 DF opval = current_cpu->sh64_fsubd (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
2146 written |= (1ULL << 3);
2147 if (UNLIKELY(current_cpu->trace_result_p))
2148 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2149 current_cpu->h_fsd_set (FLD (f_rn), opval);
2153 DF opval = current_cpu->sh64_fsubs (current_cpu->h_fsd_get (FLD (f_rn)), current_cpu->h_fsd_get (FLD (f_rm)));
2154 written |= (1ULL << 3);
2155 if (UNLIKELY(current_cpu->trace_result_p))
2156 current_cpu->trace_stream << "fsd" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2157 current_cpu->h_fsd_set (FLD (f_rn), opval);
2161 abuf->written = written;
2162 current_cpu->done_insn (npc, status);
2166 // ********** ftrc-compact: ftrc $fsdn, fpul
2169 sh2a_fpu_sem_ftrc_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2170 sh2a_fpu::write_stacks &buf)
2172 #define FLD(f) abuf->fields.sfmt_ftrc_compact.f
2173 sem_status status = SEM_STATUS_NORMAL;
2174 sh2a_fpu_scache* abuf = sem;
2175 unsigned long long written = 0;
2176 PCADDR pc = abuf->addr;
2177 PCADDR npc = pc + 2;
2180 SF opval = ((current_cpu->h_prbit_get ()) ? (current_cpu->sh64_ftrcdl (current_cpu->h_fsd_get (FLD (f_rn)))) : (current_cpu->sh64_ftrcsl (current_cpu->h_fsd_get (FLD (f_rn)))));
2181 if (UNLIKELY(current_cpu->trace_result_p))
2182 current_cpu->trace_stream << "fr" << '[' << ((UINT) 32) << ']' << ":=0x" << hex << opval << dec << " ";
2183 current_cpu->hardware.h_fr[((UINT) 32)] = opval;
2186 current_cpu->done_insn (npc, status);
2190 // ********** jmp-compact: jmp @$rn
2193 sh2a_fpu_sem_jmp_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2194 sh2a_fpu::write_stacks &buf)
2196 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2197 sem_status status = SEM_STATUS_NORMAL;
2198 sh2a_fpu_scache* abuf = sem;
2199 unsigned long long written = 0;
2200 PCADDR pc = abuf->addr;
2201 PCADDR npc = pc + 2;
2205 UDI opval = ADDDI (pc, 2);
2206 if (UNLIKELY(current_cpu->trace_result_p))
2207 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
2208 current_cpu->branch (opval, npc, status);
2210 current_cpu->save_delayed_pc (current_cpu->h_grc_get (FLD (f_rn)));
2212 UDI opval = current_cpu->h_grc_get (FLD (f_rn));
2213 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
2214 if (UNLIKELY(current_cpu->trace_result_p))
2215 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
2217 current_cpu->cg_profile (pc, current_cpu->h_grc_get (FLD (f_rn)));
2220 current_cpu->done_cti_insn (npc, status);
2224 // ********** jsr-compact: jsr @$rn
2227 sh2a_fpu_sem_jsr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2228 sh2a_fpu::write_stacks &buf)
2230 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2231 sem_status status = SEM_STATUS_NORMAL;
2232 sh2a_fpu_scache* abuf = sem;
2233 unsigned long long written = 0;
2234 PCADDR pc = abuf->addr;
2235 PCADDR npc = pc + 2;
2239 SI opval = ADDDI (pc, 4);
2240 buf.h_pr_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<SI>(pc, opval));
2241 if (UNLIKELY(current_cpu->trace_result_p))
2242 current_cpu->trace_stream << "pr" << ":=0x" << hex << opval << dec << " ";
2245 UDI opval = ADDDI (pc, 2);
2246 if (UNLIKELY(current_cpu->trace_result_p))
2247 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
2248 current_cpu->branch (opval, npc, status);
2250 current_cpu->save_delayed_pc (current_cpu->h_grc_get (FLD (f_rn)));
2252 UDI opval = current_cpu->h_grc_get (FLD (f_rn));
2253 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
2254 if (UNLIKELY(current_cpu->trace_result_p))
2255 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
2257 current_cpu->cg_profile (pc, current_cpu->h_grc_get (FLD (f_rn)));
2260 current_cpu->done_cti_insn (npc, status);
2264 // ********** ldc-gbr-compact: ldc $rn, gbr
2267 sh2a_fpu_sem_ldc_gbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2268 sh2a_fpu::write_stacks &buf)
2270 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2271 sem_status status = SEM_STATUS_NORMAL;
2272 sh2a_fpu_scache* abuf = sem;
2273 unsigned long long written = 0;
2274 PCADDR pc = abuf->addr;
2275 PCADDR npc = pc + 2;
2278 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2279 if (UNLIKELY(current_cpu->trace_result_p))
2280 current_cpu->trace_stream << "gbr" << ":=0x" << hex << opval << dec << " ";
2281 current_cpu->h_gbr_set (opval);
2284 current_cpu->done_insn (npc, status);
2288 // ********** ldc-vbr-compact: ldc $rn, vbr
2291 sh2a_fpu_sem_ldc_vbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2292 sh2a_fpu::write_stacks &buf)
2294 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2295 sem_status status = SEM_STATUS_NORMAL;
2296 sh2a_fpu_scache* abuf = sem;
2297 unsigned long long written = 0;
2298 PCADDR pc = abuf->addr;
2299 PCADDR npc = pc + 2;
2302 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2303 if (UNLIKELY(current_cpu->trace_result_p))
2304 current_cpu->trace_stream << "vbr" << ":=0x" << hex << opval << dec << " ";
2305 current_cpu->h_vbr_set (opval);
2308 current_cpu->done_insn (npc, status);
2312 // ********** ldc-sr-compact: ldc $rn, sr
2315 sh2a_fpu_sem_ldc_sr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2316 sh2a_fpu::write_stacks &buf)
2318 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2319 sem_status status = SEM_STATUS_NORMAL;
2320 sh2a_fpu_scache* abuf = sem;
2321 unsigned long long written = 0;
2322 PCADDR pc = abuf->addr;
2323 PCADDR npc = pc + 2;
2326 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2327 if (UNLIKELY(current_cpu->trace_result_p))
2328 current_cpu->trace_stream << "sr" << ":=0x" << hex << opval << dec << " ";
2329 current_cpu->hardware.h_sr = opval;
2332 current_cpu->done_insn (npc, status);
2336 // ********** ldcl-gbr-compact: ldc.l @${rn}+, gbr
2339 sh2a_fpu_sem_ldcl_gbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2340 sh2a_fpu::write_stacks &buf)
2342 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2343 sem_status status = SEM_STATUS_NORMAL;
2344 sh2a_fpu_scache* abuf = sem;
2345 unsigned long long written = 0;
2346 PCADDR pc = abuf->addr;
2347 PCADDR npc = pc + 2;
2351 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2352 if (UNLIKELY(current_cpu->trace_result_p))
2353 current_cpu->trace_stream << "gbr" << ":=0x" << hex << opval << dec << " ";
2354 current_cpu->h_gbr_set (opval);
2357 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2358 if (UNLIKELY(current_cpu->trace_result_p))
2359 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2360 current_cpu->h_grc_set (FLD (f_rn), opval);
2364 current_cpu->done_insn (npc, status);
2368 // ********** ldcl-vbr-compact: ldc.l @${rn}+, vbr
2371 sh2a_fpu_sem_ldcl_vbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2372 sh2a_fpu::write_stacks &buf)
2374 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2375 sem_status status = SEM_STATUS_NORMAL;
2376 sh2a_fpu_scache* abuf = sem;
2377 unsigned long long written = 0;
2378 PCADDR pc = abuf->addr;
2379 PCADDR npc = pc + 2;
2383 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2384 if (UNLIKELY(current_cpu->trace_result_p))
2385 current_cpu->trace_stream << "vbr" << ":=0x" << hex << opval << dec << " ";
2386 current_cpu->h_vbr_set (opval);
2389 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2390 if (UNLIKELY(current_cpu->trace_result_p))
2391 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2392 current_cpu->h_grc_set (FLD (f_rn), opval);
2396 current_cpu->done_insn (npc, status);
2400 // ********** lds-fpscr-compact: lds $rn, fpscr
2403 sh2a_fpu_sem_lds_fpscr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2404 sh2a_fpu::write_stacks &buf)
2406 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2407 sem_status status = SEM_STATUS_NORMAL;
2408 sh2a_fpu_scache* abuf = sem;
2409 unsigned long long written = 0;
2410 PCADDR pc = abuf->addr;
2411 PCADDR npc = pc + 2;
2414 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2415 if (UNLIKELY(current_cpu->trace_result_p))
2416 current_cpu->trace_stream << "fpscr" << ":=0x" << hex << opval << dec << " ";
2417 current_cpu->hardware.h_fpscr = opval;
2420 current_cpu->done_insn (npc, status);
2424 // ********** ldsl-fpscr-compact: lds.l @${rn}+, fpscr
2427 sh2a_fpu_sem_ldsl_fpscr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2428 sh2a_fpu::write_stacks &buf)
2430 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2431 sem_status status = SEM_STATUS_NORMAL;
2432 sh2a_fpu_scache* abuf = sem;
2433 unsigned long long written = 0;
2434 PCADDR pc = abuf->addr;
2435 PCADDR npc = pc + 2;
2439 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2440 if (UNLIKELY(current_cpu->trace_result_p))
2441 current_cpu->trace_stream << "fpscr" << ":=0x" << hex << opval << dec << " ";
2442 current_cpu->hardware.h_fpscr = opval;
2445 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2446 if (UNLIKELY(current_cpu->trace_result_p))
2447 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2448 current_cpu->h_grc_set (FLD (f_rn), opval);
2452 current_cpu->done_insn (npc, status);
2456 // ********** lds-fpul-compact: lds $rn, fpul
2459 sh2a_fpu_sem_lds_fpul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2460 sh2a_fpu::write_stacks &buf)
2462 #define FLD(f) abuf->fields.sfmt_ldsl_fpul_compact.f
2463 sem_status status = SEM_STATUS_NORMAL;
2464 sh2a_fpu_scache* abuf = sem;
2465 unsigned long long written = 0;
2466 PCADDR pc = abuf->addr;
2467 PCADDR npc = pc + 2;
2470 SF opval = SUBWORDSISF (current_cpu->h_grc_get (FLD (f_rn)));
2471 if (UNLIKELY(current_cpu->trace_result_p))
2472 current_cpu->trace_stream << "fr" << '[' << ((UINT) 32) << ']' << ":=0x" << hex << opval << dec << " ";
2473 current_cpu->hardware.h_fr[((UINT) 32)] = opval;
2476 current_cpu->done_insn (npc, status);
2480 // ********** ldsl-fpul-compact: lds.l @${rn}+, fpul
2483 sh2a_fpu_sem_ldsl_fpul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2484 sh2a_fpu::write_stacks &buf)
2486 #define FLD(f) abuf->fields.sfmt_ldsl_fpul_compact.f
2487 sem_status status = SEM_STATUS_NORMAL;
2488 sh2a_fpu_scache* abuf = sem;
2489 unsigned long long written = 0;
2490 PCADDR pc = abuf->addr;
2491 PCADDR npc = pc + 2;
2495 SF opval = current_cpu->GETMEMSF (pc, current_cpu->h_grc_get (FLD (f_rn)));
2496 if (UNLIKELY(current_cpu->trace_result_p))
2497 current_cpu->trace_stream << "fr" << '[' << ((UINT) 32) << ']' << ":=0x" << hex << opval << dec << " ";
2498 current_cpu->hardware.h_fr[((UINT) 32)] = opval;
2501 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2502 if (UNLIKELY(current_cpu->trace_result_p))
2503 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2504 current_cpu->h_grc_set (FLD (f_rn), opval);
2508 current_cpu->done_insn (npc, status);
2512 // ********** lds-mach-compact: lds $rn, mach
2515 sh2a_fpu_sem_lds_mach_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2516 sh2a_fpu::write_stacks &buf)
2518 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2519 sem_status status = SEM_STATUS_NORMAL;
2520 sh2a_fpu_scache* abuf = sem;
2521 unsigned long long written = 0;
2522 PCADDR pc = abuf->addr;
2523 PCADDR npc = pc + 2;
2526 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2527 if (UNLIKELY(current_cpu->trace_result_p))
2528 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
2529 current_cpu->h_mach_set (opval);
2532 current_cpu->done_insn (npc, status);
2536 // ********** ldsl-mach-compact: lds.l @${rn}+, mach
2539 sh2a_fpu_sem_ldsl_mach_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2540 sh2a_fpu::write_stacks &buf)
2542 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2543 sem_status status = SEM_STATUS_NORMAL;
2544 sh2a_fpu_scache* abuf = sem;
2545 unsigned long long written = 0;
2546 PCADDR pc = abuf->addr;
2547 PCADDR npc = pc + 2;
2551 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2552 if (UNLIKELY(current_cpu->trace_result_p))
2553 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
2554 current_cpu->h_mach_set (opval);
2557 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2558 if (UNLIKELY(current_cpu->trace_result_p))
2559 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2560 current_cpu->h_grc_set (FLD (f_rn), opval);
2564 current_cpu->done_insn (npc, status);
2568 // ********** lds-macl-compact: lds $rn, macl
2571 sh2a_fpu_sem_lds_macl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2572 sh2a_fpu::write_stacks &buf)
2574 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2575 sem_status status = SEM_STATUS_NORMAL;
2576 sh2a_fpu_scache* abuf = sem;
2577 unsigned long long written = 0;
2578 PCADDR pc = abuf->addr;
2579 PCADDR npc = pc + 2;
2582 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2583 if (UNLIKELY(current_cpu->trace_result_p))
2584 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
2585 current_cpu->h_macl_set (opval);
2588 current_cpu->done_insn (npc, status);
2592 // ********** ldsl-macl-compact: lds.l @${rn}+, macl
2595 sh2a_fpu_sem_ldsl_macl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2596 sh2a_fpu::write_stacks &buf)
2598 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2599 sem_status status = SEM_STATUS_NORMAL;
2600 sh2a_fpu_scache* abuf = sem;
2601 unsigned long long written = 0;
2602 PCADDR pc = abuf->addr;
2603 PCADDR npc = pc + 2;
2607 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2608 if (UNLIKELY(current_cpu->trace_result_p))
2609 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
2610 current_cpu->h_macl_set (opval);
2613 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2614 if (UNLIKELY(current_cpu->trace_result_p))
2615 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2616 current_cpu->h_grc_set (FLD (f_rn), opval);
2620 current_cpu->done_insn (npc, status);
2624 // ********** lds-pr-compact: lds $rn, pr
2627 sh2a_fpu_sem_lds_pr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2628 sh2a_fpu::write_stacks &buf)
2630 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2631 sem_status status = SEM_STATUS_NORMAL;
2632 sh2a_fpu_scache* abuf = sem;
2633 unsigned long long written = 0;
2634 PCADDR pc = abuf->addr;
2635 PCADDR npc = pc + 2;
2638 SI opval = current_cpu->h_grc_get (FLD (f_rn));
2639 if (UNLIKELY(current_cpu->trace_result_p))
2640 current_cpu->trace_stream << "pr" << ":=0x" << hex << opval << dec << " ";
2641 current_cpu->h_pr_set (opval);
2644 current_cpu->done_insn (npc, status);
2648 // ********** ldsl-pr-compact: lds.l @${rn}+, pr
2651 sh2a_fpu_sem_ldsl_pr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2652 sh2a_fpu::write_stacks &buf)
2654 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
2655 sem_status status = SEM_STATUS_NORMAL;
2656 sh2a_fpu_scache* abuf = sem;
2657 unsigned long long written = 0;
2658 PCADDR pc = abuf->addr;
2659 PCADDR npc = pc + 2;
2663 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2664 if (UNLIKELY(current_cpu->trace_result_p))
2665 current_cpu->trace_stream << "pr" << ":=0x" << hex << opval << dec << " ";
2666 current_cpu->h_pr_set (opval);
2669 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2670 if (UNLIKELY(current_cpu->trace_result_p))
2671 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2672 current_cpu->h_grc_set (FLD (f_rn), opval);
2676 current_cpu->done_insn (npc, status);
2680 // ********** macl-compact: mac.l @${rm}+, @${rn}+
2683 sh2a_fpu_sem_macl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2684 sh2a_fpu::write_stacks &buf)
2686 #define FLD(f) abuf->fields.sfmt_macl_compact.f
2687 sem_status status = SEM_STATUS_NORMAL;
2688 sh2a_fpu_scache* abuf = sem;
2689 unsigned long long written = 0;
2690 PCADDR pc = abuf->addr;
2691 PCADDR npc = pc + 2;
2699 tmp_x = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2701 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2702 if (UNLIKELY(current_cpu->trace_result_p))
2703 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2704 current_cpu->h_grc_set (FLD (f_rn), opval);
2706 if (EQSI (FLD (f_rn), FLD (f_rm))) {
2709 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
2710 if (UNLIKELY(current_cpu->trace_result_p))
2711 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2712 current_cpu->h_grc_set (FLD (f_rn), opval);
2715 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 4);
2716 written |= (1ULL << 11);
2717 if (UNLIKELY(current_cpu->trace_result_p))
2718 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
2719 current_cpu->h_grc_set (FLD (f_rm), opval);
2723 tmp_y = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rm)));
2725 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 4);
2726 written |= (1ULL << 11);
2727 if (UNLIKELY(current_cpu->trace_result_p))
2728 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
2729 current_cpu->h_grc_set (FLD (f_rm), opval);
2731 tmp_tmpry = MULDI (ZEXTSIDI (tmp_x), ZEXTSIDI (tmp_y));
2732 tmp_mac = ORDI (SLLDI (ZEXTSIDI (current_cpu->h_mach_get ()), 32), ZEXTSIDI (current_cpu->h_macl_get ()));
2733 tmp_result = ADDDI (tmp_mac, tmp_tmpry);
2735 if (current_cpu->h_sbit_get ()) {
2739 tmp_max = SRLDI (INVDI (0), 16);
2740 tmp_min = SRLDI (INVDI (0), 15);
2741 if (GTDI (tmp_result, tmp_max)) {
2742 tmp_result = tmp_max;
2744 if (LTDI (tmp_result, tmp_min)) {
2745 tmp_result = tmp_min;
2751 SI opval = SUBWORDDISI (tmp_result, 0);
2752 if (UNLIKELY(current_cpu->trace_result_p))
2753 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
2754 current_cpu->h_mach_set (opval);
2757 SI opval = SUBWORDDISI (tmp_result, 1);
2758 if (UNLIKELY(current_cpu->trace_result_p))
2759 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
2760 current_cpu->h_macl_set (opval);
2765 abuf->written = written;
2766 current_cpu->done_insn (npc, status);
2770 // ********** macw-compact: mac.w @${rm}+, @${rn}+
2773 sh2a_fpu_sem_macw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2774 sh2a_fpu::write_stacks &buf)
2776 #define FLD(f) abuf->fields.sfmt_macl_compact.f
2777 sem_status status = SEM_STATUS_NORMAL;
2778 sh2a_fpu_scache* abuf = sem;
2779 unsigned long long written = 0;
2780 PCADDR pc = abuf->addr;
2781 PCADDR npc = pc + 2;
2789 tmp_x = current_cpu->GETMEMHI (pc, current_cpu->h_grc_get (FLD (f_rn)));
2791 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 2);
2792 if (UNLIKELY(current_cpu->trace_result_p))
2793 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2794 current_cpu->h_grc_set (FLD (f_rn), opval);
2796 if (EQSI (FLD (f_rn), FLD (f_rm))) {
2799 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rn)), 2);
2800 if (UNLIKELY(current_cpu->trace_result_p))
2801 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2802 current_cpu->h_grc_set (FLD (f_rn), opval);
2805 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 2);
2806 written |= (1ULL << 11);
2807 if (UNLIKELY(current_cpu->trace_result_p))
2808 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
2809 current_cpu->h_grc_set (FLD (f_rm), opval);
2813 tmp_y = current_cpu->GETMEMHI (pc, current_cpu->h_grc_get (FLD (f_rm)));
2815 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 2);
2816 written |= (1ULL << 11);
2817 if (UNLIKELY(current_cpu->trace_result_p))
2818 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
2819 current_cpu->h_grc_set (FLD (f_rm), opval);
2821 tmp_tmpry = MULSI (ZEXTHISI (tmp_x), ZEXTHISI (tmp_y));
2822 if (current_cpu->h_sbit_get ()) {
2824 if (ADDOFSI (tmp_tmpry, current_cpu->h_macl_get (), 0)) {
2827 written |= (1ULL << 9);
2828 if (UNLIKELY(current_cpu->trace_result_p))
2829 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
2830 current_cpu->h_mach_set (opval);
2834 SI opval = ADDSI (tmp_tmpry, current_cpu->h_macl_get ());
2835 written |= (1ULL << 10);
2836 if (UNLIKELY(current_cpu->trace_result_p))
2837 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
2838 current_cpu->h_macl_set (opval);
2843 tmp_mac = ORDI (SLLDI (ZEXTSIDI (current_cpu->h_mach_get ()), 32), ZEXTSIDI (current_cpu->h_macl_get ()));
2844 tmp_result = ADDDI (tmp_mac, EXTSIDI (tmp_tmpry));
2846 SI opval = SUBWORDDISI (tmp_result, 0);
2847 written |= (1ULL << 9);
2848 if (UNLIKELY(current_cpu->trace_result_p))
2849 current_cpu->trace_stream << "mach" << ":=0x" << hex << opval << dec << " ";
2850 current_cpu->h_mach_set (opval);
2853 SI opval = SUBWORDDISI (tmp_result, 1);
2854 written |= (1ULL << 10);
2855 if (UNLIKELY(current_cpu->trace_result_p))
2856 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
2857 current_cpu->h_macl_set (opval);
2863 abuf->written = written;
2864 current_cpu->done_insn (npc, status);
2868 // ********** mov-compact: mov $rm64, $rn64
2871 sh2a_fpu_sem_mov_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2872 sh2a_fpu::write_stacks &buf)
2874 #define FLD(f) abuf->fields.sfmt_and_compact.f
2875 sem_status status = SEM_STATUS_NORMAL;
2876 sh2a_fpu_scache* abuf = sem;
2877 unsigned long long written = 0;
2878 PCADDR pc = abuf->addr;
2879 PCADDR npc = pc + 2;
2882 DI opval = current_cpu->h_gr_get (FLD (f_rm));
2883 if (UNLIKELY(current_cpu->trace_result_p))
2884 current_cpu->trace_stream << "gr" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2885 current_cpu->h_gr_set (FLD (f_rn), opval);
2888 current_cpu->done_insn (npc, status);
2892 // ********** movi-compact: mov #$imm8, $rn
2895 sh2a_fpu_sem_movi_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2896 sh2a_fpu::write_stacks &buf)
2898 #define FLD(f) abuf->fields.sfmt_addi_compact.f
2899 sem_status status = SEM_STATUS_NORMAL;
2900 sh2a_fpu_scache* abuf = sem;
2901 unsigned long long written = 0;
2902 PCADDR pc = abuf->addr;
2903 PCADDR npc = pc + 2;
2906 SI opval = EXTQIDI (ANDQI (FLD (f_imm8), 255));
2907 if (UNLIKELY(current_cpu->trace_result_p))
2908 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2909 current_cpu->h_grc_set (FLD (f_rn), opval);
2912 current_cpu->done_insn (npc, status);
2916 // ********** movi20-compact: movi20 #$imm20, $rn
2919 sh2a_fpu_sem_movi20_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2920 sh2a_fpu::write_stacks &buf)
2922 #define FLD(f) abuf->fields.sfmt_movi20_compact.f
2923 sem_status status = SEM_STATUS_NORMAL;
2924 sh2a_fpu_scache* abuf = sem;
2925 unsigned long long written = 0;
2926 PCADDR pc = abuf->addr;
2927 PCADDR npc = pc + 4;
2930 SI opval = FLD (f_imm20);
2931 if (UNLIKELY(current_cpu->trace_result_p))
2932 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2933 current_cpu->h_grc_set (FLD (f_rn), opval);
2936 current_cpu->done_insn (npc, status);
2940 // ********** movb1-compact: mov.b $rm, @$rn
2943 sh2a_fpu_sem_movb1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2944 sh2a_fpu::write_stacks &buf)
2946 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
2947 sem_status status = SEM_STATUS_NORMAL;
2948 sh2a_fpu_scache* abuf = sem;
2949 unsigned long long written = 0;
2950 PCADDR pc = abuf->addr;
2951 PCADDR npc = pc + 2;
2954 UQI opval = SUBWORDSIUQI (current_cpu->h_grc_get (FLD (f_rm)), 3);
2955 if (UNLIKELY(current_cpu->trace_result_p))
2956 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
2957 current_cpu->SETMEMUQI (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
2960 current_cpu->done_insn (npc, status);
2964 // ********** movb2-compact: mov.b $rm, @-$rn
2967 sh2a_fpu_sem_movb2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
2968 sh2a_fpu::write_stacks &buf)
2970 #define FLD(f) abuf->fields.sfmt_macl_compact.f
2971 sem_status status = SEM_STATUS_NORMAL;
2972 sh2a_fpu_scache* abuf = sem;
2973 unsigned long long written = 0;
2974 PCADDR pc = abuf->addr;
2975 PCADDR npc = pc + 2;
2979 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
2981 UQI opval = SUBWORDSIUQI (current_cpu->h_grc_get (FLD (f_rm)), 3);
2982 if (UNLIKELY(current_cpu->trace_result_p))
2983 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
2984 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
2987 SI opval = tmp_addr;
2988 if (UNLIKELY(current_cpu->trace_result_p))
2989 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
2990 current_cpu->h_grc_set (FLD (f_rn), opval);
2994 current_cpu->done_insn (npc, status);
2998 // ********** movb3-compact: mov.b $rm, @(r0,$rn)
3001 sh2a_fpu_sem_movb3_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3002 sh2a_fpu::write_stacks &buf)
3004 #define FLD(f) abuf->fields.sfmt_movb3_compact.f
3005 sem_status status = SEM_STATUS_NORMAL;
3006 sh2a_fpu_scache* abuf = sem;
3007 unsigned long long written = 0;
3008 PCADDR pc = abuf->addr;
3009 PCADDR npc = pc + 2;
3012 UQI opval = SUBWORDSIUQI (current_cpu->h_grc_get (FLD (f_rm)), 3);
3013 if (UNLIKELY(current_cpu->trace_result_p))
3014 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))) << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
3015 current_cpu->SETMEMUQI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))), opval);
3018 current_cpu->done_insn (npc, status);
3022 // ********** movb4-compact: mov.b r0, @($imm8, gbr)
3025 sh2a_fpu_sem_movb4_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3026 sh2a_fpu::write_stacks &buf)
3028 #define FLD(f) abuf->fields.sfmt_andi_compact.f
3029 sem_status status = SEM_STATUS_NORMAL;
3030 sh2a_fpu_scache* abuf = sem;
3031 unsigned long long written = 0;
3032 PCADDR pc = abuf->addr;
3033 PCADDR npc = pc + 2;
3037 tmp_addr = ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8));
3039 UQI opval = SUBWORDSIUQI (current_cpu->h_grc_get (((UINT) 0)), 3);
3040 if (UNLIKELY(current_cpu->trace_result_p))
3041 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
3042 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
3046 current_cpu->done_insn (npc, status);
3050 // ********** movb5-compact: mov.b r0, @($imm4, $rm)
3053 sh2a_fpu_sem_movb5_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3054 sh2a_fpu::write_stacks &buf)
3056 #define FLD(f) abuf->fields.sfmt_movb5_compact.f
3057 sem_status status = SEM_STATUS_NORMAL;
3058 sh2a_fpu_scache* abuf = sem;
3059 unsigned long long written = 0;
3060 PCADDR pc = abuf->addr;
3061 PCADDR npc = pc + 2;
3065 tmp_addr = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4));
3067 UQI opval = SUBWORDSIUQI (current_cpu->h_grc_get (((UINT) 0)), 3);
3068 if (UNLIKELY(current_cpu->trace_result_p))
3069 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
3070 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
3074 current_cpu->done_insn (npc, status);
3078 // ********** movb6-compact: mov.b @$rm, $rn
3081 sh2a_fpu_sem_movb6_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3082 sh2a_fpu::write_stacks &buf)
3084 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3085 sem_status status = SEM_STATUS_NORMAL;
3086 sh2a_fpu_scache* abuf = sem;
3087 unsigned long long written = 0;
3088 PCADDR pc = abuf->addr;
3089 PCADDR npc = pc + 2;
3092 SI opval = EXTQISI (current_cpu->GETMEMQI (pc, current_cpu->h_grc_get (FLD (f_rm))));
3093 if (UNLIKELY(current_cpu->trace_result_p))
3094 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3095 current_cpu->h_grc_set (FLD (f_rn), opval);
3098 current_cpu->done_insn (npc, status);
3102 // ********** movb7-compact: mov.b @${rm}+, $rn
3105 sh2a_fpu_sem_movb7_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3106 sh2a_fpu::write_stacks &buf)
3108 #define FLD(f) abuf->fields.sfmt_macl_compact.f
3109 sem_status status = SEM_STATUS_NORMAL;
3110 sh2a_fpu_scache* abuf = sem;
3111 unsigned long long written = 0;
3112 PCADDR pc = abuf->addr;
3113 PCADDR npc = pc + 2;
3117 tmp_data = current_cpu->GETMEMQI (pc, current_cpu->h_grc_get (FLD (f_rm)));
3118 if (EQSI (FLD (f_rm), FLD (f_rn))) {
3120 SI opval = EXTQISI (tmp_data);
3121 written |= (1ULL << 4);
3122 if (UNLIKELY(current_cpu->trace_result_p))
3123 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3124 current_cpu->h_grc_set (FLD (f_rm), opval);
3128 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 1);
3129 written |= (1ULL << 4);
3130 if (UNLIKELY(current_cpu->trace_result_p))
3131 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3132 current_cpu->h_grc_set (FLD (f_rm), opval);
3136 SI opval = EXTQISI (tmp_data);
3137 if (UNLIKELY(current_cpu->trace_result_p))
3138 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3139 current_cpu->h_grc_set (FLD (f_rn), opval);
3143 abuf->written = written;
3144 current_cpu->done_insn (npc, status);
3148 // ********** movb8-compact: mov.b @(r0, $rm), $rn
3151 sh2a_fpu_sem_movb8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3152 sh2a_fpu::write_stacks &buf)
3154 #define FLD(f) abuf->fields.sfmt_movb8_compact.f
3155 sem_status status = SEM_STATUS_NORMAL;
3156 sh2a_fpu_scache* abuf = sem;
3157 unsigned long long written = 0;
3158 PCADDR pc = abuf->addr;
3159 PCADDR npc = pc + 2;
3162 SI opval = EXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rm)))));
3163 if (UNLIKELY(current_cpu->trace_result_p))
3164 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3165 current_cpu->h_grc_set (FLD (f_rn), opval);
3168 current_cpu->done_insn (npc, status);
3172 // ********** movb9-compact: mov.b @($imm8, gbr), r0
3175 sh2a_fpu_sem_movb9_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3176 sh2a_fpu::write_stacks &buf)
3178 #define FLD(f) abuf->fields.sfmt_andi_compact.f
3179 sem_status status = SEM_STATUS_NORMAL;
3180 sh2a_fpu_scache* abuf = sem;
3181 unsigned long long written = 0;
3182 PCADDR pc = abuf->addr;
3183 PCADDR npc = pc + 2;
3186 SI opval = EXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8))));
3187 if (UNLIKELY(current_cpu->trace_result_p))
3188 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3189 current_cpu->h_grc_set (((UINT) 0), opval);
3192 current_cpu->done_insn (npc, status);
3196 // ********** movb10-compact: mov.b @($imm4, $rm), r0
3199 sh2a_fpu_sem_movb10_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3200 sh2a_fpu::write_stacks &buf)
3202 #define FLD(f) abuf->fields.sfmt_movb10_compact.f
3203 sem_status status = SEM_STATUS_NORMAL;
3204 sh2a_fpu_scache* abuf = sem;
3205 unsigned long long written = 0;
3206 PCADDR pc = abuf->addr;
3207 PCADDR npc = pc + 2;
3210 SI opval = EXTQISI (current_cpu->GETMEMQI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4))));
3211 if (UNLIKELY(current_cpu->trace_result_p))
3212 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3213 current_cpu->h_grc_set (((UINT) 0), opval);
3216 current_cpu->done_insn (npc, status);
3220 // ********** movl1-compact: mov.l $rm, @$rn
3223 sh2a_fpu_sem_movl1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3224 sh2a_fpu::write_stacks &buf)
3226 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3227 sem_status status = SEM_STATUS_NORMAL;
3228 sh2a_fpu_scache* abuf = sem;
3229 unsigned long long written = 0;
3230 PCADDR pc = abuf->addr;
3231 PCADDR npc = pc + 2;
3234 SI opval = current_cpu->h_grc_get (FLD (f_rm));
3235 if (UNLIKELY(current_cpu->trace_result_p))
3236 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3237 current_cpu->SETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
3240 current_cpu->done_insn (npc, status);
3244 // ********** movl2-compact: mov.l $rm, @-$rn
3247 sh2a_fpu_sem_movl2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3248 sh2a_fpu::write_stacks &buf)
3250 #define FLD(f) abuf->fields.sfmt_macl_compact.f
3251 sem_status status = SEM_STATUS_NORMAL;
3252 sh2a_fpu_scache* abuf = sem;
3253 unsigned long long written = 0;
3254 PCADDR pc = abuf->addr;
3255 PCADDR npc = pc + 2;
3259 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
3261 SI opval = current_cpu->h_grc_get (FLD (f_rm));
3262 if (UNLIKELY(current_cpu->trace_result_p))
3263 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
3264 current_cpu->SETMEMSI (pc, tmp_addr, opval);
3267 SI opval = tmp_addr;
3268 if (UNLIKELY(current_cpu->trace_result_p))
3269 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3270 current_cpu->h_grc_set (FLD (f_rn), opval);
3274 current_cpu->done_insn (npc, status);
3278 // ********** movl3-compact: mov.l $rm, @(r0, $rn)
3281 sh2a_fpu_sem_movl3_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3282 sh2a_fpu::write_stacks &buf)
3284 #define FLD(f) abuf->fields.sfmt_movb3_compact.f
3285 sem_status status = SEM_STATUS_NORMAL;
3286 sh2a_fpu_scache* abuf = sem;
3287 unsigned long long written = 0;
3288 PCADDR pc = abuf->addr;
3289 PCADDR npc = pc + 2;
3292 SI opval = current_cpu->h_grc_get (FLD (f_rm));
3293 if (UNLIKELY(current_cpu->trace_result_p))
3294 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3295 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))), opval);
3298 current_cpu->done_insn (npc, status);
3302 // ********** movl4-compact: mov.l r0, @($imm8x4, gbr)
3305 sh2a_fpu_sem_movl4_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3306 sh2a_fpu::write_stacks &buf)
3308 #define FLD(f) abuf->fields.sfmt_movl4_compact.f
3309 sem_status status = SEM_STATUS_NORMAL;
3310 sh2a_fpu_scache* abuf = sem;
3311 unsigned long long written = 0;
3312 PCADDR pc = abuf->addr;
3313 PCADDR npc = pc + 2;
3316 SI opval = current_cpu->h_grc_get (((UINT) 0));
3317 if (UNLIKELY(current_cpu->trace_result_p))
3318 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x4)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3319 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x4)), opval);
3322 current_cpu->done_insn (npc, status);
3326 // ********** movl5-compact: mov.l $rm, @($imm4x4, $rn)
3329 sh2a_fpu_sem_movl5_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3330 sh2a_fpu::write_stacks &buf)
3332 #define FLD(f) abuf->fields.sfmt_movl5_compact.f
3333 sem_status status = SEM_STATUS_NORMAL;
3334 sh2a_fpu_scache* abuf = sem;
3335 unsigned long long written = 0;
3336 PCADDR pc = abuf->addr;
3337 PCADDR npc = pc + 2;
3340 SI opval = current_cpu->h_grc_get (FLD (f_rm));
3341 if (UNLIKELY(current_cpu->trace_result_p))
3342 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm4x4)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3343 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm4x4)), opval);
3346 current_cpu->done_insn (npc, status);
3350 // ********** movl6-compact: mov.l @$rm, $rn
3353 sh2a_fpu_sem_movl6_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3354 sh2a_fpu::write_stacks &buf)
3356 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3357 sem_status status = SEM_STATUS_NORMAL;
3358 sh2a_fpu_scache* abuf = sem;
3359 unsigned long long written = 0;
3360 PCADDR pc = abuf->addr;
3361 PCADDR npc = pc + 2;
3364 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rm)));
3365 if (UNLIKELY(current_cpu->trace_result_p))
3366 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3367 current_cpu->h_grc_set (FLD (f_rn), opval);
3370 current_cpu->done_insn (npc, status);
3374 // ********** movl7-compact: mov.l @${rm}+, $rn
3377 sh2a_fpu_sem_movl7_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3378 sh2a_fpu::write_stacks &buf)
3380 #define FLD(f) abuf->fields.sfmt_macl_compact.f
3381 sem_status status = SEM_STATUS_NORMAL;
3382 sh2a_fpu_scache* abuf = sem;
3383 unsigned long long written = 0;
3384 PCADDR pc = abuf->addr;
3385 PCADDR npc = pc + 2;
3389 SI opval = current_cpu->GETMEMSI (pc, current_cpu->h_grc_get (FLD (f_rm)));
3390 if (UNLIKELY(current_cpu->trace_result_p))
3391 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3392 current_cpu->h_grc_set (FLD (f_rn), opval);
3394 if (EQSI (FLD (f_rm), FLD (f_rn))) {
3396 SI opval = current_cpu->h_grc_get (FLD (f_rn));
3397 written |= (1ULL << 5);
3398 if (UNLIKELY(current_cpu->trace_result_p))
3399 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3400 current_cpu->h_grc_set (FLD (f_rm), opval);
3404 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 4);
3405 written |= (1ULL << 5);
3406 if (UNLIKELY(current_cpu->trace_result_p))
3407 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3408 current_cpu->h_grc_set (FLD (f_rm), opval);
3413 abuf->written = written;
3414 current_cpu->done_insn (npc, status);
3418 // ********** movl8-compact: mov.l @(r0, $rm), $rn
3421 sh2a_fpu_sem_movl8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3422 sh2a_fpu::write_stacks &buf)
3424 #define FLD(f) abuf->fields.sfmt_movb8_compact.f
3425 sem_status status = SEM_STATUS_NORMAL;
3426 sh2a_fpu_scache* abuf = sem;
3427 unsigned long long written = 0;
3428 PCADDR pc = abuf->addr;
3429 PCADDR npc = pc + 2;
3432 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rm))));
3433 if (UNLIKELY(current_cpu->trace_result_p))
3434 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3435 current_cpu->h_grc_set (FLD (f_rn), opval);
3438 current_cpu->done_insn (npc, status);
3442 // ********** movl9-compact: mov.l @($imm8x4, gbr), r0
3445 sh2a_fpu_sem_movl9_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3446 sh2a_fpu::write_stacks &buf)
3448 #define FLD(f) abuf->fields.sfmt_movl9_compact.f
3449 sem_status status = SEM_STATUS_NORMAL;
3450 sh2a_fpu_scache* abuf = sem;
3451 unsigned long long written = 0;
3452 PCADDR pc = abuf->addr;
3453 PCADDR npc = pc + 2;
3456 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x4)));
3457 if (UNLIKELY(current_cpu->trace_result_p))
3458 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3459 current_cpu->h_grc_set (((UINT) 0), opval);
3462 current_cpu->done_insn (npc, status);
3466 // ********** movl10-compact: mov.l @($imm8x4, pc), $rn
3469 sh2a_fpu_sem_movl10_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3470 sh2a_fpu::write_stacks &buf)
3472 #define FLD(f) abuf->fields.sfmt_movl10_compact.f
3473 sem_status status = SEM_STATUS_NORMAL;
3474 sh2a_fpu_scache* abuf = sem;
3475 unsigned long long written = 0;
3476 PCADDR pc = abuf->addr;
3477 PCADDR npc = pc + 2;
3480 SI opval = current_cpu->GETMEMSI (pc, ADDSI (FLD (f_imm8x4), ANDDI (ADDDI (pc, 4), INVSI (3))));
3481 if (UNLIKELY(current_cpu->trace_result_p))
3482 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3483 current_cpu->h_grc_set (FLD (f_rn), opval);
3486 current_cpu->done_insn (npc, status);
3490 // ********** movl11-compact: mov.l @($imm4x4, $rm), $rn
3493 sh2a_fpu_sem_movl11_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3494 sh2a_fpu::write_stacks &buf)
3496 #define FLD(f) abuf->fields.sfmt_movl11_compact.f
3497 sem_status status = SEM_STATUS_NORMAL;
3498 sh2a_fpu_scache* abuf = sem;
3499 unsigned long long written = 0;
3500 PCADDR pc = abuf->addr;
3501 PCADDR npc = pc + 2;
3504 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4x4)));
3505 if (UNLIKELY(current_cpu->trace_result_p))
3506 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3507 current_cpu->h_grc_set (FLD (f_rn), opval);
3510 current_cpu->done_insn (npc, status);
3514 // ********** movl12-compact: mov.l @($imm12x4, $rm), $rn
3517 sh2a_fpu_sem_movl12_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3518 sh2a_fpu::write_stacks &buf)
3520 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3521 sem_status status = SEM_STATUS_NORMAL;
3522 sh2a_fpu_scache* abuf = sem;
3523 unsigned long long written = 0;
3524 PCADDR pc = abuf->addr;
3525 PCADDR npc = pc + 4;
3528 SI opval = current_cpu->GETMEMSI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm12x4)));
3529 if (UNLIKELY(current_cpu->trace_result_p))
3530 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3531 current_cpu->h_grc_set (FLD (f_rn), opval);
3534 current_cpu->done_insn (npc, status);
3538 // ********** movl13-compact: mov.l $rm, @($imm12x4, $rn)
3541 sh2a_fpu_sem_movl13_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3542 sh2a_fpu::write_stacks &buf)
3544 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3545 sem_status status = SEM_STATUS_NORMAL;
3546 sh2a_fpu_scache* abuf = sem;
3547 unsigned long long written = 0;
3548 PCADDR pc = abuf->addr;
3549 PCADDR npc = pc + 4;
3552 SI opval = current_cpu->h_grc_get (FLD (f_rm));
3553 if (UNLIKELY(current_cpu->trace_result_p))
3554 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm12x4)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3555 current_cpu->SETMEMSI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rn)), FLD (f_imm12x4)), opval);
3558 current_cpu->done_insn (npc, status);
3562 // ********** movw1-compact: mov.w $rm, @$rn
3565 sh2a_fpu_sem_movw1_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3566 sh2a_fpu::write_stacks &buf)
3568 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3569 sem_status status = SEM_STATUS_NORMAL;
3570 sh2a_fpu_scache* abuf = sem;
3571 unsigned long long written = 0;
3572 PCADDR pc = abuf->addr;
3573 PCADDR npc = pc + 2;
3576 HI opval = SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1);
3577 if (UNLIKELY(current_cpu->trace_result_p))
3578 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3579 current_cpu->SETMEMHI (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
3582 current_cpu->done_insn (npc, status);
3586 // ********** movw2-compact: mov.w $rm, @-$rn
3589 sh2a_fpu_sem_movw2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3590 sh2a_fpu::write_stacks &buf)
3592 #define FLD(f) abuf->fields.sfmt_macl_compact.f
3593 sem_status status = SEM_STATUS_NORMAL;
3594 sh2a_fpu_scache* abuf = sem;
3595 unsigned long long written = 0;
3596 PCADDR pc = abuf->addr;
3597 PCADDR npc = pc + 2;
3601 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 2);
3603 HI opval = SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1);
3604 if (UNLIKELY(current_cpu->trace_result_p))
3605 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
3606 current_cpu->SETMEMHI (pc, tmp_addr, opval);
3609 SI opval = tmp_addr;
3610 if (UNLIKELY(current_cpu->trace_result_p))
3611 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3612 current_cpu->h_grc_set (FLD (f_rn), opval);
3616 current_cpu->done_insn (npc, status);
3620 // ********** movw3-compact: mov.w $rm, @(r0, $rn)
3623 sh2a_fpu_sem_movw3_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3624 sh2a_fpu::write_stacks &buf)
3626 #define FLD(f) abuf->fields.sfmt_movb3_compact.f
3627 sem_status status = SEM_STATUS_NORMAL;
3628 sh2a_fpu_scache* abuf = sem;
3629 unsigned long long written = 0;
3630 PCADDR pc = abuf->addr;
3631 PCADDR npc = pc + 2;
3634 HI opval = SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1);
3635 if (UNLIKELY(current_cpu->trace_result_p))
3636 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3637 current_cpu->SETMEMHI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rn))), opval);
3640 current_cpu->done_insn (npc, status);
3644 // ********** movw4-compact: mov.w r0, @($imm8x2, gbr)
3647 sh2a_fpu_sem_movw4_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3648 sh2a_fpu::write_stacks &buf)
3650 #define FLD(f) abuf->fields.sfmt_movw4_compact.f
3651 sem_status status = SEM_STATUS_NORMAL;
3652 sh2a_fpu_scache* abuf = sem;
3653 unsigned long long written = 0;
3654 PCADDR pc = abuf->addr;
3655 PCADDR npc = pc + 2;
3658 HI opval = SUBWORDSIHI (current_cpu->h_grc_get (((UINT) 0)), 1);
3659 if (UNLIKELY(current_cpu->trace_result_p))
3660 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x2)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3661 current_cpu->SETMEMHI (pc, ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x2)), opval);
3664 current_cpu->done_insn (npc, status);
3668 // ********** movw5-compact: mov.w r0, @($imm4x2, $rm)
3671 sh2a_fpu_sem_movw5_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3672 sh2a_fpu::write_stacks &buf)
3674 #define FLD(f) abuf->fields.sfmt_movw5_compact.f
3675 sem_status status = SEM_STATUS_NORMAL;
3676 sh2a_fpu_scache* abuf = sem;
3677 unsigned long long written = 0;
3678 PCADDR pc = abuf->addr;
3679 PCADDR npc = pc + 2;
3682 HI opval = SUBWORDSIHI (current_cpu->h_grc_get (((UINT) 0)), 1);
3683 if (UNLIKELY(current_cpu->trace_result_p))
3684 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4x2)) << dec << ']' << ":=0x" << hex << opval << dec << " ";
3685 current_cpu->SETMEMHI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4x2)), opval);
3688 current_cpu->done_insn (npc, status);
3692 // ********** movw6-compact: mov.w @$rm, $rn
3695 sh2a_fpu_sem_movw6_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3696 sh2a_fpu::write_stacks &buf)
3698 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3699 sem_status status = SEM_STATUS_NORMAL;
3700 sh2a_fpu_scache* abuf = sem;
3701 unsigned long long written = 0;
3702 PCADDR pc = abuf->addr;
3703 PCADDR npc = pc + 2;
3706 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, current_cpu->h_grc_get (FLD (f_rm))));
3707 if (UNLIKELY(current_cpu->trace_result_p))
3708 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3709 current_cpu->h_grc_set (FLD (f_rn), opval);
3712 current_cpu->done_insn (npc, status);
3716 // ********** movw7-compact: mov.w @${rm}+, $rn
3719 sh2a_fpu_sem_movw7_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3720 sh2a_fpu::write_stacks &buf)
3722 #define FLD(f) abuf->fields.sfmt_macl_compact.f
3723 sem_status status = SEM_STATUS_NORMAL;
3724 sh2a_fpu_scache* abuf = sem;
3725 unsigned long long written = 0;
3726 PCADDR pc = abuf->addr;
3727 PCADDR npc = pc + 2;
3731 tmp_data = current_cpu->GETMEMHI (pc, current_cpu->h_grc_get (FLD (f_rm)));
3732 if (EQSI (FLD (f_rm), FLD (f_rn))) {
3734 SI opval = EXTHISI (tmp_data);
3735 written |= (1ULL << 4);
3736 if (UNLIKELY(current_cpu->trace_result_p))
3737 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3738 current_cpu->h_grc_set (FLD (f_rm), opval);
3742 SI opval = ADDSI (current_cpu->h_grc_get (FLD (f_rm)), 2);
3743 written |= (1ULL << 4);
3744 if (UNLIKELY(current_cpu->trace_result_p))
3745 current_cpu->trace_stream << "grc" << '[' << FLD (f_rm) << ']' << ":=0x" << hex << opval << dec << " ";
3746 current_cpu->h_grc_set (FLD (f_rm), opval);
3750 SI opval = EXTHISI (tmp_data);
3751 if (UNLIKELY(current_cpu->trace_result_p))
3752 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3753 current_cpu->h_grc_set (FLD (f_rn), opval);
3757 abuf->written = written;
3758 current_cpu->done_insn (npc, status);
3762 // ********** movw8-compact: mov.w @(r0, $rm), $rn
3765 sh2a_fpu_sem_movw8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3766 sh2a_fpu::write_stacks &buf)
3768 #define FLD(f) abuf->fields.sfmt_movb8_compact.f
3769 sem_status status = SEM_STATUS_NORMAL;
3770 sh2a_fpu_scache* abuf = sem;
3771 unsigned long long written = 0;
3772 PCADDR pc = abuf->addr;
3773 PCADDR npc = pc + 2;
3776 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_grc_get (FLD (f_rm)))));
3777 if (UNLIKELY(current_cpu->trace_result_p))
3778 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3779 current_cpu->h_grc_set (FLD (f_rn), opval);
3782 current_cpu->done_insn (npc, status);
3786 // ********** movw9-compact: mov.w @($imm8x2, gbr), r0
3789 sh2a_fpu_sem_movw9_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3790 sh2a_fpu::write_stacks &buf)
3792 #define FLD(f) abuf->fields.sfmt_movw9_compact.f
3793 sem_status status = SEM_STATUS_NORMAL;
3794 sh2a_fpu_scache* abuf = sem;
3795 unsigned long long written = 0;
3796 PCADDR pc = abuf->addr;
3797 PCADDR npc = pc + 2;
3800 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->h_gbr_get (), FLD (f_imm8x2))));
3801 if (UNLIKELY(current_cpu->trace_result_p))
3802 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3803 current_cpu->h_grc_set (((UINT) 0), opval);
3806 current_cpu->done_insn (npc, status);
3810 // ********** movw10-compact: mov.w @($imm8x2, pc), $rn
3813 sh2a_fpu_sem_movw10_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3814 sh2a_fpu::write_stacks &buf)
3816 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3817 sem_status status = SEM_STATUS_NORMAL;
3818 sh2a_fpu_scache* abuf = sem;
3819 unsigned long long written = 0;
3820 PCADDR pc = abuf->addr;
3821 PCADDR npc = pc + 2;
3824 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, ADDDI (ADDDI (pc, 4), FLD (f_imm8x2))));
3825 if (UNLIKELY(current_cpu->trace_result_p))
3826 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3827 current_cpu->h_grc_set (FLD (f_rn), opval);
3830 current_cpu->done_insn (npc, status);
3834 // ********** movw11-compact: mov.w @($imm4x2, $rm), r0
3837 sh2a_fpu_sem_movw11_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3838 sh2a_fpu::write_stacks &buf)
3840 #define FLD(f) abuf->fields.sfmt_movw11_compact.f
3841 sem_status status = SEM_STATUS_NORMAL;
3842 sh2a_fpu_scache* abuf = sem;
3843 unsigned long long written = 0;
3844 PCADDR pc = abuf->addr;
3845 PCADDR npc = pc + 2;
3848 SI opval = EXTHISI (current_cpu->GETMEMHI (pc, ADDSI (current_cpu->h_grc_get (FLD (f_rm)), FLD (f_imm4x2))));
3849 if (UNLIKELY(current_cpu->trace_result_p))
3850 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3851 current_cpu->h_grc_set (((UINT) 0), opval);
3854 current_cpu->done_insn (npc, status);
3858 // ********** mova-compact: mova @($imm8x4, pc), r0
3861 sh2a_fpu_sem_mova_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3862 sh2a_fpu::write_stacks &buf)
3864 #define FLD(f) abuf->fields.sfmt_movl9_compact.f
3865 sem_status status = SEM_STATUS_NORMAL;
3866 sh2a_fpu_scache* abuf = sem;
3867 unsigned long long written = 0;
3868 PCADDR pc = abuf->addr;
3869 PCADDR npc = pc + 2;
3872 SI opval = ADDDI (ANDDI (ADDDI (pc, 4), INVSI (3)), FLD (f_imm8x4));
3873 if (UNLIKELY(current_cpu->trace_result_p))
3874 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
3875 current_cpu->h_grc_set (((UINT) 0), opval);
3878 current_cpu->done_insn (npc, status);
3882 // ********** movt-compact: movt $rn
3885 sh2a_fpu_sem_movt_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3886 sh2a_fpu::write_stacks &buf)
3888 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
3889 sem_status status = SEM_STATUS_NORMAL;
3890 sh2a_fpu_scache* abuf = sem;
3891 unsigned long long written = 0;
3892 PCADDR pc = abuf->addr;
3893 PCADDR npc = pc + 2;
3896 SI opval = ZEXTBISI (current_cpu->h_tbit_get ());
3897 if (UNLIKELY(current_cpu->trace_result_p))
3898 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3899 current_cpu->h_grc_set (FLD (f_rn), opval);
3902 current_cpu->done_insn (npc, status);
3906 // ********** mull-compact: mul.l $rm, $rn
3909 sh2a_fpu_sem_mull_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3910 sh2a_fpu::write_stacks &buf)
3912 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3913 sem_status status = SEM_STATUS_NORMAL;
3914 sh2a_fpu_scache* abuf = sem;
3915 unsigned long long written = 0;
3916 PCADDR pc = abuf->addr;
3917 PCADDR npc = pc + 2;
3920 SI opval = MULSI (current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_grc_get (FLD (f_rn)));
3921 if (UNLIKELY(current_cpu->trace_result_p))
3922 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
3923 current_cpu->h_macl_set (opval);
3926 current_cpu->done_insn (npc, status);
3930 // ********** mulsw-compact: muls.w $rm, $rn
3933 sh2a_fpu_sem_mulsw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3934 sh2a_fpu::write_stacks &buf)
3936 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3937 sem_status status = SEM_STATUS_NORMAL;
3938 sh2a_fpu_scache* abuf = sem;
3939 unsigned long long written = 0;
3940 PCADDR pc = abuf->addr;
3941 PCADDR npc = pc + 2;
3944 SI opval = MULSI (EXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1)), EXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rn)), 1)));
3945 if (UNLIKELY(current_cpu->trace_result_p))
3946 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
3947 current_cpu->h_macl_set (opval);
3950 current_cpu->done_insn (npc, status);
3954 // ********** muluw-compact: mulu.w $rm, $rn
3957 sh2a_fpu_sem_muluw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3958 sh2a_fpu::write_stacks &buf)
3960 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
3961 sem_status status = SEM_STATUS_NORMAL;
3962 sh2a_fpu_scache* abuf = sem;
3963 unsigned long long written = 0;
3964 PCADDR pc = abuf->addr;
3965 PCADDR npc = pc + 2;
3968 SI opval = MULSI (ZEXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 1)), ZEXTHISI (SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rn)), 1)));
3969 if (UNLIKELY(current_cpu->trace_result_p))
3970 current_cpu->trace_stream << "macl" << ":=0x" << hex << opval << dec << " ";
3971 current_cpu->h_macl_set (opval);
3974 current_cpu->done_insn (npc, status);
3978 // ********** neg-compact: neg $rm, $rn
3981 sh2a_fpu_sem_neg_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
3982 sh2a_fpu::write_stacks &buf)
3984 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
3985 sem_status status = SEM_STATUS_NORMAL;
3986 sh2a_fpu_scache* abuf = sem;
3987 unsigned long long written = 0;
3988 PCADDR pc = abuf->addr;
3989 PCADDR npc = pc + 2;
3992 SI opval = NEGSI (current_cpu->h_grc_get (FLD (f_rm)));
3993 if (UNLIKELY(current_cpu->trace_result_p))
3994 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
3995 current_cpu->h_grc_set (FLD (f_rn), opval);
3998 current_cpu->done_insn (npc, status);
4002 // ********** negc-compact: negc $rm, $rn
4005 sh2a_fpu_sem_negc_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4006 sh2a_fpu::write_stacks &buf)
4008 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
4009 sem_status status = SEM_STATUS_NORMAL;
4010 sh2a_fpu_scache* abuf = sem;
4011 unsigned long long written = 0;
4012 PCADDR pc = abuf->addr;
4013 PCADDR npc = pc + 2;
4017 tmp_flag = SUBCFSI (0, current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
4019 SI opval = SUBCSI (0, current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
4020 if (UNLIKELY(current_cpu->trace_result_p))
4021 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4022 current_cpu->h_grc_set (FLD (f_rn), opval);
4025 BI opval = tmp_flag;
4026 if (UNLIKELY(current_cpu->trace_result_p))
4027 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4028 current_cpu->h_tbit_set (opval);
4032 current_cpu->done_insn (npc, status);
4036 // ********** nop-compact: nop
4039 sh2a_fpu_sem_nop_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4040 sh2a_fpu::write_stacks &buf)
4042 #define FLD(f) abuf->fields.fmt_empty.f
4043 sem_status status = SEM_STATUS_NORMAL;
4044 sh2a_fpu_scache* abuf = sem;
4045 unsigned long long written = 0;
4046 PCADDR pc = abuf->addr;
4047 PCADDR npc = pc + 2;
4051 current_cpu->done_insn (npc, status);
4055 // ********** not-compact: not $rm64, $rn64
4058 sh2a_fpu_sem_not_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4059 sh2a_fpu::write_stacks &buf)
4061 #define FLD(f) abuf->fields.sfmt_and_compact.f
4062 sem_status status = SEM_STATUS_NORMAL;
4063 sh2a_fpu_scache* abuf = sem;
4064 unsigned long long written = 0;
4065 PCADDR pc = abuf->addr;
4066 PCADDR npc = pc + 2;
4069 DI opval = INVDI (current_cpu->h_gr_get (FLD (f_rm)));
4070 if (UNLIKELY(current_cpu->trace_result_p))
4071 current_cpu->trace_stream << "gr" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4072 current_cpu->h_gr_set (FLD (f_rn), opval);
4075 current_cpu->done_insn (npc, status);
4079 // ********** or-compact: or $rm64, $rn64
4082 sh2a_fpu_sem_or_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4083 sh2a_fpu::write_stacks &buf)
4085 #define FLD(f) abuf->fields.sfmt_and_compact.f
4086 sem_status status = SEM_STATUS_NORMAL;
4087 sh2a_fpu_scache* abuf = sem;
4088 unsigned long long written = 0;
4089 PCADDR pc = abuf->addr;
4090 PCADDR npc = pc + 2;
4093 DI opval = ORDI (current_cpu->h_gr_get (FLD (f_rm)), current_cpu->h_gr_get (FLD (f_rn)));
4094 if (UNLIKELY(current_cpu->trace_result_p))
4095 current_cpu->trace_stream << "gr" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4096 current_cpu->h_gr_set (FLD (f_rn), opval);
4099 current_cpu->done_insn (npc, status);
4103 // ********** ori-compact: or #$uimm8, r0
4106 sh2a_fpu_sem_ori_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4107 sh2a_fpu::write_stacks &buf)
4109 #define FLD(f) abuf->fields.sfmt_andi_compact.f
4110 sem_status status = SEM_STATUS_NORMAL;
4111 sh2a_fpu_scache* abuf = sem;
4112 unsigned long long written = 0;
4113 PCADDR pc = abuf->addr;
4114 PCADDR npc = pc + 2;
4117 SI opval = ORSI (current_cpu->h_grc_get (((UINT) 0)), ZEXTSIDI (FLD (f_imm8)));
4118 if (UNLIKELY(current_cpu->trace_result_p))
4119 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
4120 current_cpu->h_grc_set (((UINT) 0), opval);
4123 current_cpu->done_insn (npc, status);
4127 // ********** orb-compact: or.b #$imm8, @(r0, gbr)
4130 sh2a_fpu_sem_orb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4131 sh2a_fpu::write_stacks &buf)
4133 #define FLD(f) abuf->fields.sfmt_andi_compact.f
4134 sem_status status = SEM_STATUS_NORMAL;
4135 sh2a_fpu_scache* abuf = sem;
4136 unsigned long long written = 0;
4137 PCADDR pc = abuf->addr;
4138 PCADDR npc = pc + 2;
4143 tmp_addr = ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_gbr_get ());
4144 tmp_data = ORQI (current_cpu->GETMEMUQI (pc, tmp_addr), FLD (f_imm8));
4146 UQI opval = tmp_data;
4147 if (UNLIKELY(current_cpu->trace_result_p))
4148 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
4149 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
4153 current_cpu->done_insn (npc, status);
4157 // ********** rotcl-compact: rotcl $rn
4160 sh2a_fpu_sem_rotcl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4161 sh2a_fpu::write_stacks &buf)
4163 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4164 sem_status status = SEM_STATUS_NORMAL;
4165 sh2a_fpu_scache* abuf = sem;
4166 unsigned long long written = 0;
4167 PCADDR pc = abuf->addr;
4168 PCADDR npc = pc + 2;
4172 tmp_temp = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
4174 SI opval = ORSI (SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 1), current_cpu->h_tbit_get ());
4175 if (UNLIKELY(current_cpu->trace_result_p))
4176 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4177 current_cpu->h_grc_set (FLD (f_rn), opval);
4180 BI opval = ((tmp_temp) ? (1) : (0));
4181 if (UNLIKELY(current_cpu->trace_result_p))
4182 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4183 current_cpu->h_tbit_set (opval);
4187 current_cpu->done_insn (npc, status);
4191 // ********** rotcr-compact: rotcr $rn
4194 sh2a_fpu_sem_rotcr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4195 sh2a_fpu::write_stacks &buf)
4197 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4198 sem_status status = SEM_STATUS_NORMAL;
4199 sh2a_fpu_scache* abuf = sem;
4200 unsigned long long written = 0;
4201 PCADDR pc = abuf->addr;
4202 PCADDR npc = pc + 2;
4207 tmp_lsbit = ((EQSI (ANDSI (current_cpu->h_grc_get (FLD (f_rn)), 1), 0)) ? (0) : (1));
4208 tmp_temp = current_cpu->h_tbit_get ();
4210 SI opval = ORSI (SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 1), SLLSI (tmp_temp, 31));
4211 if (UNLIKELY(current_cpu->trace_result_p))
4212 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4213 current_cpu->h_grc_set (FLD (f_rn), opval);
4216 BI opval = ((tmp_lsbit) ? (1) : (0));
4217 if (UNLIKELY(current_cpu->trace_result_p))
4218 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4219 current_cpu->h_tbit_set (opval);
4223 current_cpu->done_insn (npc, status);
4227 // ********** rotl-compact: rotl $rn
4230 sh2a_fpu_sem_rotl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4231 sh2a_fpu::write_stacks &buf)
4233 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4234 sem_status status = SEM_STATUS_NORMAL;
4235 sh2a_fpu_scache* abuf = sem;
4236 unsigned long long written = 0;
4237 PCADDR pc = abuf->addr;
4238 PCADDR npc = pc + 2;
4242 tmp_temp = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
4244 SI opval = ORSI (SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 1), tmp_temp);
4245 if (UNLIKELY(current_cpu->trace_result_p))
4246 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4247 current_cpu->h_grc_set (FLD (f_rn), opval);
4250 BI opval = ((tmp_temp) ? (1) : (0));
4251 if (UNLIKELY(current_cpu->trace_result_p))
4252 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4253 current_cpu->h_tbit_set (opval);
4257 current_cpu->done_insn (npc, status);
4261 // ********** rotr-compact: rotr $rn
4264 sh2a_fpu_sem_rotr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4265 sh2a_fpu::write_stacks &buf)
4267 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4268 sem_status status = SEM_STATUS_NORMAL;
4269 sh2a_fpu_scache* abuf = sem;
4270 unsigned long long written = 0;
4271 PCADDR pc = abuf->addr;
4272 PCADDR npc = pc + 2;
4277 tmp_lsbit = ((EQSI (ANDSI (current_cpu->h_grc_get (FLD (f_rn)), 1), 0)) ? (0) : (1));
4278 tmp_temp = tmp_lsbit;
4280 SI opval = ORSI (SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 1), SLLSI (tmp_temp, 31));
4281 if (UNLIKELY(current_cpu->trace_result_p))
4282 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4283 current_cpu->h_grc_set (FLD (f_rn), opval);
4286 BI opval = ((tmp_lsbit) ? (1) : (0));
4287 if (UNLIKELY(current_cpu->trace_result_p))
4288 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4289 current_cpu->h_tbit_set (opval);
4293 current_cpu->done_insn (npc, status);
4297 // ********** rts-compact: rts
4300 sh2a_fpu_sem_rts_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4301 sh2a_fpu::write_stacks &buf)
4303 #define FLD(f) abuf->fields.fmt_empty.f
4304 sem_status status = SEM_STATUS_NORMAL;
4305 sh2a_fpu_scache* abuf = sem;
4306 unsigned long long written = 0;
4307 PCADDR pc = abuf->addr;
4308 PCADDR npc = pc + 2;
4312 UDI opval = ADDDI (pc, 2);
4313 if (UNLIKELY(current_cpu->trace_result_p))
4314 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
4315 current_cpu->branch (opval, npc, status);
4317 current_cpu->save_delayed_pc (current_cpu->h_pr_get ());
4319 UDI opval = current_cpu->h_pr_get ();
4320 buf.h_pc_writes [(tick + 1) % sh2a_fpu::pipe_sz].push (sh2a_fpu::write<UDI>(pc, opval));
4321 if (UNLIKELY(current_cpu->trace_result_p))
4322 current_cpu->trace_stream << "pc" << ":=0x" << hex << opval << dec << " ";
4324 current_cpu->notify_ret (current_cpu->h_pr_get ());
4327 current_cpu->done_cti_insn (npc, status);
4331 // ********** sett-compact: sett
4334 sh2a_fpu_sem_sett_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4335 sh2a_fpu::write_stacks &buf)
4337 #define FLD(f) abuf->fields.fmt_empty.f
4338 sem_status status = SEM_STATUS_NORMAL;
4339 sh2a_fpu_scache* abuf = sem;
4340 unsigned long long written = 0;
4341 PCADDR pc = abuf->addr;
4342 PCADDR npc = pc + 2;
4346 if (UNLIKELY(current_cpu->trace_result_p))
4347 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4348 current_cpu->h_tbit_set (opval);
4351 current_cpu->done_insn (npc, status);
4355 // ********** shad-compact: shad $rm, $rn
4358 sh2a_fpu_sem_shad_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4359 sh2a_fpu::write_stacks &buf)
4361 #define FLD(f) abuf->fields.sfmt_macl_compact.f
4362 sem_status status = SEM_STATUS_NORMAL;
4363 sh2a_fpu_scache* abuf = sem;
4364 unsigned long long written = 0;
4365 PCADDR pc = abuf->addr;
4366 PCADDR npc = pc + 2;
4370 tmp_shamt = ANDSI (current_cpu->h_grc_get (FLD (f_rm)), 31);
4371 if (GESI (current_cpu->h_grc_get (FLD (f_rm)), 0)) {
4373 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), tmp_shamt);
4374 written |= (1ULL << 2);
4375 if (UNLIKELY(current_cpu->trace_result_p))
4376 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4377 current_cpu->h_grc_set (FLD (f_rn), opval);
4380 if (NESI (tmp_shamt, 0)) {
4382 SI opval = SRASI (current_cpu->h_grc_get (FLD (f_rn)), SUBSI (32, tmp_shamt));
4383 written |= (1ULL << 2);
4384 if (UNLIKELY(current_cpu->trace_result_p))
4385 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4386 current_cpu->h_grc_set (FLD (f_rn), opval);
4389 if (LTSI (current_cpu->h_grc_get (FLD (f_rn)), 0)) {
4391 SI opval = NEGSI (1);
4392 written |= (1ULL << 2);
4393 if (UNLIKELY(current_cpu->trace_result_p))
4394 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4395 current_cpu->h_grc_set (FLD (f_rn), opval);
4400 written |= (1ULL << 2);
4401 if (UNLIKELY(current_cpu->trace_result_p))
4402 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4403 current_cpu->h_grc_set (FLD (f_rn), opval);
4410 abuf->written = written;
4411 current_cpu->done_insn (npc, status);
4415 // ********** shal-compact: shal $rn
4418 sh2a_fpu_sem_shal_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4419 sh2a_fpu::write_stacks &buf)
4421 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4422 sem_status status = SEM_STATUS_NORMAL;
4423 sh2a_fpu_scache* abuf = sem;
4424 unsigned long long written = 0;
4425 PCADDR pc = abuf->addr;
4426 PCADDR npc = pc + 2;
4430 tmp_t = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
4432 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4433 if (UNLIKELY(current_cpu->trace_result_p))
4434 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4435 current_cpu->h_grc_set (FLD (f_rn), opval);
4438 BI opval = ((tmp_t) ? (1) : (0));
4439 if (UNLIKELY(current_cpu->trace_result_p))
4440 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4441 current_cpu->h_tbit_set (opval);
4445 current_cpu->done_insn (npc, status);
4449 // ********** shar-compact: shar $rn
4452 sh2a_fpu_sem_shar_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4453 sh2a_fpu::write_stacks &buf)
4455 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4456 sem_status status = SEM_STATUS_NORMAL;
4457 sh2a_fpu_scache* abuf = sem;
4458 unsigned long long written = 0;
4459 PCADDR pc = abuf->addr;
4460 PCADDR npc = pc + 2;
4464 tmp_t = ANDSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4466 SI opval = SRASI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4467 if (UNLIKELY(current_cpu->trace_result_p))
4468 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4469 current_cpu->h_grc_set (FLD (f_rn), opval);
4472 BI opval = ((tmp_t) ? (1) : (0));
4473 if (UNLIKELY(current_cpu->trace_result_p))
4474 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4475 current_cpu->h_tbit_set (opval);
4479 current_cpu->done_insn (npc, status);
4483 // ********** shll-compact: shll $rn
4486 sh2a_fpu_sem_shll_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4487 sh2a_fpu::write_stacks &buf)
4489 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4490 sem_status status = SEM_STATUS_NORMAL;
4491 sh2a_fpu_scache* abuf = sem;
4492 unsigned long long written = 0;
4493 PCADDR pc = abuf->addr;
4494 PCADDR npc = pc + 2;
4498 tmp_t = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 31);
4500 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4501 if (UNLIKELY(current_cpu->trace_result_p))
4502 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4503 current_cpu->h_grc_set (FLD (f_rn), opval);
4506 BI opval = ((tmp_t) ? (1) : (0));
4507 if (UNLIKELY(current_cpu->trace_result_p))
4508 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4509 current_cpu->h_tbit_set (opval);
4513 current_cpu->done_insn (npc, status);
4517 // ********** shll2-compact: shll2 $rn
4520 sh2a_fpu_sem_shll2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4521 sh2a_fpu::write_stacks &buf)
4523 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4524 sem_status status = SEM_STATUS_NORMAL;
4525 sh2a_fpu_scache* abuf = sem;
4526 unsigned long long written = 0;
4527 PCADDR pc = abuf->addr;
4528 PCADDR npc = pc + 2;
4531 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 2);
4532 if (UNLIKELY(current_cpu->trace_result_p))
4533 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4534 current_cpu->h_grc_set (FLD (f_rn), opval);
4537 current_cpu->done_insn (npc, status);
4541 // ********** shll8-compact: shll8 $rn
4544 sh2a_fpu_sem_shll8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4545 sh2a_fpu::write_stacks &buf)
4547 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4548 sem_status status = SEM_STATUS_NORMAL;
4549 sh2a_fpu_scache* abuf = sem;
4550 unsigned long long written = 0;
4551 PCADDR pc = abuf->addr;
4552 PCADDR npc = pc + 2;
4555 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 8);
4556 if (UNLIKELY(current_cpu->trace_result_p))
4557 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4558 current_cpu->h_grc_set (FLD (f_rn), opval);
4561 current_cpu->done_insn (npc, status);
4565 // ********** shll16-compact: shll16 $rn
4568 sh2a_fpu_sem_shll16_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4569 sh2a_fpu::write_stacks &buf)
4571 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4572 sem_status status = SEM_STATUS_NORMAL;
4573 sh2a_fpu_scache* abuf = sem;
4574 unsigned long long written = 0;
4575 PCADDR pc = abuf->addr;
4576 PCADDR npc = pc + 2;
4579 SI opval = SLLSI (current_cpu->h_grc_get (FLD (f_rn)), 16);
4580 if (UNLIKELY(current_cpu->trace_result_p))
4581 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4582 current_cpu->h_grc_set (FLD (f_rn), opval);
4585 current_cpu->done_insn (npc, status);
4589 // ********** shlr-compact: shlr $rn
4592 sh2a_fpu_sem_shlr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4593 sh2a_fpu::write_stacks &buf)
4595 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4596 sem_status status = SEM_STATUS_NORMAL;
4597 sh2a_fpu_scache* abuf = sem;
4598 unsigned long long written = 0;
4599 PCADDR pc = abuf->addr;
4600 PCADDR npc = pc + 2;
4604 tmp_t = ANDSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4606 SI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 1);
4607 if (UNLIKELY(current_cpu->trace_result_p))
4608 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4609 current_cpu->h_grc_set (FLD (f_rn), opval);
4612 BI opval = ((tmp_t) ? (1) : (0));
4613 if (UNLIKELY(current_cpu->trace_result_p))
4614 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
4615 current_cpu->h_tbit_set (opval);
4619 current_cpu->done_insn (npc, status);
4623 // ********** shlr2-compact: shlr2 $rn
4626 sh2a_fpu_sem_shlr2_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4627 sh2a_fpu::write_stacks &buf)
4629 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4630 sem_status status = SEM_STATUS_NORMAL;
4631 sh2a_fpu_scache* abuf = sem;
4632 unsigned long long written = 0;
4633 PCADDR pc = abuf->addr;
4634 PCADDR npc = pc + 2;
4637 SI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 2);
4638 if (UNLIKELY(current_cpu->trace_result_p))
4639 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4640 current_cpu->h_grc_set (FLD (f_rn), opval);
4643 current_cpu->done_insn (npc, status);
4647 // ********** shlr8-compact: shlr8 $rn
4650 sh2a_fpu_sem_shlr8_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4651 sh2a_fpu::write_stacks &buf)
4653 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4654 sem_status status = SEM_STATUS_NORMAL;
4655 sh2a_fpu_scache* abuf = sem;
4656 unsigned long long written = 0;
4657 PCADDR pc = abuf->addr;
4658 PCADDR npc = pc + 2;
4661 SI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 8);
4662 if (UNLIKELY(current_cpu->trace_result_p))
4663 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4664 current_cpu->h_grc_set (FLD (f_rn), opval);
4667 current_cpu->done_insn (npc, status);
4671 // ********** shlr16-compact: shlr16 $rn
4674 sh2a_fpu_sem_shlr16_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4675 sh2a_fpu::write_stacks &buf)
4677 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4678 sem_status status = SEM_STATUS_NORMAL;
4679 sh2a_fpu_scache* abuf = sem;
4680 unsigned long long written = 0;
4681 PCADDR pc = abuf->addr;
4682 PCADDR npc = pc + 2;
4685 SI opval = SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 16);
4686 if (UNLIKELY(current_cpu->trace_result_p))
4687 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4688 current_cpu->h_grc_set (FLD (f_rn), opval);
4691 current_cpu->done_insn (npc, status);
4695 // ********** stc-gbr-compact: stc gbr, $rn
4698 sh2a_fpu_sem_stc_gbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4699 sh2a_fpu::write_stacks &buf)
4701 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4702 sem_status status = SEM_STATUS_NORMAL;
4703 sh2a_fpu_scache* abuf = sem;
4704 unsigned long long written = 0;
4705 PCADDR pc = abuf->addr;
4706 PCADDR npc = pc + 2;
4709 SI opval = current_cpu->h_gbr_get ();
4710 if (UNLIKELY(current_cpu->trace_result_p))
4711 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4712 current_cpu->h_grc_set (FLD (f_rn), opval);
4715 current_cpu->done_insn (npc, status);
4719 // ********** stc-vbr-compact: stc vbr, $rn
4722 sh2a_fpu_sem_stc_vbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4723 sh2a_fpu::write_stacks &buf)
4725 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4726 sem_status status = SEM_STATUS_NORMAL;
4727 sh2a_fpu_scache* abuf = sem;
4728 unsigned long long written = 0;
4729 PCADDR pc = abuf->addr;
4730 PCADDR npc = pc + 2;
4733 SI opval = current_cpu->h_vbr_get ();
4734 if (UNLIKELY(current_cpu->trace_result_p))
4735 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4736 current_cpu->h_grc_set (FLD (f_rn), opval);
4739 current_cpu->done_insn (npc, status);
4743 // ********** stcl-gbr-compact: stc.l gbr, @-$rn
4746 sh2a_fpu_sem_stcl_gbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4747 sh2a_fpu::write_stacks &buf)
4749 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4750 sem_status status = SEM_STATUS_NORMAL;
4751 sh2a_fpu_scache* abuf = sem;
4752 unsigned long long written = 0;
4753 PCADDR pc = abuf->addr;
4754 PCADDR npc = pc + 2;
4758 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
4760 SI opval = current_cpu->h_gbr_get ();
4761 if (UNLIKELY(current_cpu->trace_result_p))
4762 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
4763 current_cpu->SETMEMSI (pc, tmp_addr, opval);
4766 SI opval = tmp_addr;
4767 if (UNLIKELY(current_cpu->trace_result_p))
4768 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4769 current_cpu->h_grc_set (FLD (f_rn), opval);
4773 current_cpu->done_insn (npc, status);
4777 // ********** stcl-vbr-compact: stc.l vbr, @-$rn
4780 sh2a_fpu_sem_stcl_vbr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4781 sh2a_fpu::write_stacks &buf)
4783 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4784 sem_status status = SEM_STATUS_NORMAL;
4785 sh2a_fpu_scache* abuf = sem;
4786 unsigned long long written = 0;
4787 PCADDR pc = abuf->addr;
4788 PCADDR npc = pc + 2;
4792 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
4794 SI opval = current_cpu->h_vbr_get ();
4795 if (UNLIKELY(current_cpu->trace_result_p))
4796 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
4797 current_cpu->SETMEMSI (pc, tmp_addr, opval);
4800 SI opval = tmp_addr;
4801 if (UNLIKELY(current_cpu->trace_result_p))
4802 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4803 current_cpu->h_grc_set (FLD (f_rn), opval);
4807 current_cpu->done_insn (npc, status);
4811 // ********** sts-fpscr-compact: sts fpscr, $rn
4814 sh2a_fpu_sem_sts_fpscr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4815 sh2a_fpu::write_stacks &buf)
4817 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4818 sem_status status = SEM_STATUS_NORMAL;
4819 sh2a_fpu_scache* abuf = sem;
4820 unsigned long long written = 0;
4821 PCADDR pc = abuf->addr;
4822 PCADDR npc = pc + 2;
4825 SI opval = current_cpu->hardware.h_fpscr;
4826 if (UNLIKELY(current_cpu->trace_result_p))
4827 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4828 current_cpu->h_grc_set (FLD (f_rn), opval);
4831 current_cpu->done_insn (npc, status);
4835 // ********** stsl-fpscr-compact: sts.l fpscr, @-$rn
4838 sh2a_fpu_sem_stsl_fpscr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4839 sh2a_fpu::write_stacks &buf)
4841 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4842 sem_status status = SEM_STATUS_NORMAL;
4843 sh2a_fpu_scache* abuf = sem;
4844 unsigned long long written = 0;
4845 PCADDR pc = abuf->addr;
4846 PCADDR npc = pc + 2;
4850 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
4852 SI opval = current_cpu->hardware.h_fpscr;
4853 if (UNLIKELY(current_cpu->trace_result_p))
4854 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
4855 current_cpu->SETMEMSI (pc, tmp_addr, opval);
4858 SI opval = tmp_addr;
4859 if (UNLIKELY(current_cpu->trace_result_p))
4860 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4861 current_cpu->h_grc_set (FLD (f_rn), opval);
4865 current_cpu->done_insn (npc, status);
4869 // ********** sts-fpul-compact: sts fpul, $rn
4872 sh2a_fpu_sem_sts_fpul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4873 sh2a_fpu::write_stacks &buf)
4875 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4876 sem_status status = SEM_STATUS_NORMAL;
4877 sh2a_fpu_scache* abuf = sem;
4878 unsigned long long written = 0;
4879 PCADDR pc = abuf->addr;
4880 PCADDR npc = pc + 2;
4883 SI opval = SUBWORDSFSI (current_cpu->hardware.h_fr[((UINT) 32)]);
4884 if (UNLIKELY(current_cpu->trace_result_p))
4885 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4886 current_cpu->h_grc_set (FLD (f_rn), opval);
4889 current_cpu->done_insn (npc, status);
4893 // ********** stsl-fpul-compact: sts.l fpul, @-$rn
4896 sh2a_fpu_sem_stsl_fpul_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4897 sh2a_fpu::write_stacks &buf)
4899 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4900 sem_status status = SEM_STATUS_NORMAL;
4901 sh2a_fpu_scache* abuf = sem;
4902 unsigned long long written = 0;
4903 PCADDR pc = abuf->addr;
4904 PCADDR npc = pc + 2;
4908 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
4910 SF opval = current_cpu->hardware.h_fr[((UINT) 32)];
4911 if (UNLIKELY(current_cpu->trace_result_p))
4912 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
4913 current_cpu->SETMEMSF (pc, tmp_addr, opval);
4916 SI opval = tmp_addr;
4917 if (UNLIKELY(current_cpu->trace_result_p))
4918 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4919 current_cpu->h_grc_set (FLD (f_rn), opval);
4923 current_cpu->done_insn (npc, status);
4927 // ********** sts-mach-compact: sts mach, $rn
4930 sh2a_fpu_sem_sts_mach_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4931 sh2a_fpu::write_stacks &buf)
4933 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4934 sem_status status = SEM_STATUS_NORMAL;
4935 sh2a_fpu_scache* abuf = sem;
4936 unsigned long long written = 0;
4937 PCADDR pc = abuf->addr;
4938 PCADDR npc = pc + 2;
4941 SI opval = current_cpu->h_mach_get ();
4942 if (UNLIKELY(current_cpu->trace_result_p))
4943 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4944 current_cpu->h_grc_set (FLD (f_rn), opval);
4947 current_cpu->done_insn (npc, status);
4951 // ********** stsl-mach-compact: sts.l mach, @-$rn
4954 sh2a_fpu_sem_stsl_mach_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4955 sh2a_fpu::write_stacks &buf)
4957 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
4958 sem_status status = SEM_STATUS_NORMAL;
4959 sh2a_fpu_scache* abuf = sem;
4960 unsigned long long written = 0;
4961 PCADDR pc = abuf->addr;
4962 PCADDR npc = pc + 2;
4966 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
4968 SI opval = current_cpu->h_mach_get ();
4969 if (UNLIKELY(current_cpu->trace_result_p))
4970 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
4971 current_cpu->SETMEMSI (pc, tmp_addr, opval);
4974 SI opval = tmp_addr;
4975 if (UNLIKELY(current_cpu->trace_result_p))
4976 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
4977 current_cpu->h_grc_set (FLD (f_rn), opval);
4981 current_cpu->done_insn (npc, status);
4985 // ********** sts-macl-compact: sts macl, $rn
4988 sh2a_fpu_sem_sts_macl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
4989 sh2a_fpu::write_stacks &buf)
4991 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
4992 sem_status status = SEM_STATUS_NORMAL;
4993 sh2a_fpu_scache* abuf = sem;
4994 unsigned long long written = 0;
4995 PCADDR pc = abuf->addr;
4996 PCADDR npc = pc + 2;
4999 SI opval = current_cpu->h_macl_get ();
5000 if (UNLIKELY(current_cpu->trace_result_p))
5001 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5002 current_cpu->h_grc_set (FLD (f_rn), opval);
5005 current_cpu->done_insn (npc, status);
5009 // ********** stsl-macl-compact: sts.l macl, @-$rn
5012 sh2a_fpu_sem_stsl_macl_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5013 sh2a_fpu::write_stacks &buf)
5015 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
5016 sem_status status = SEM_STATUS_NORMAL;
5017 sh2a_fpu_scache* abuf = sem;
5018 unsigned long long written = 0;
5019 PCADDR pc = abuf->addr;
5020 PCADDR npc = pc + 2;
5024 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
5026 SI opval = current_cpu->h_macl_get ();
5027 if (UNLIKELY(current_cpu->trace_result_p))
5028 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
5029 current_cpu->SETMEMSI (pc, tmp_addr, opval);
5032 SI opval = tmp_addr;
5033 if (UNLIKELY(current_cpu->trace_result_p))
5034 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5035 current_cpu->h_grc_set (FLD (f_rn), opval);
5039 current_cpu->done_insn (npc, status);
5043 // ********** sts-pr-compact: sts pr, $rn
5046 sh2a_fpu_sem_sts_pr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5047 sh2a_fpu::write_stacks &buf)
5049 #define FLD(f) abuf->fields.sfmt_movw10_compact.f
5050 sem_status status = SEM_STATUS_NORMAL;
5051 sh2a_fpu_scache* abuf = sem;
5052 unsigned long long written = 0;
5053 PCADDR pc = abuf->addr;
5054 PCADDR npc = pc + 2;
5057 SI opval = current_cpu->h_pr_get ();
5058 if (UNLIKELY(current_cpu->trace_result_p))
5059 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5060 current_cpu->h_grc_set (FLD (f_rn), opval);
5063 current_cpu->done_insn (npc, status);
5067 // ********** stsl-pr-compact: sts.l pr, @-$rn
5070 sh2a_fpu_sem_stsl_pr_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5071 sh2a_fpu::write_stacks &buf)
5073 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
5074 sem_status status = SEM_STATUS_NORMAL;
5075 sh2a_fpu_scache* abuf = sem;
5076 unsigned long long written = 0;
5077 PCADDR pc = abuf->addr;
5078 PCADDR npc = pc + 2;
5082 tmp_addr = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), 4);
5084 SI opval = current_cpu->h_pr_get ();
5085 if (UNLIKELY(current_cpu->trace_result_p))
5086 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << opval << dec << " ";
5087 current_cpu->SETMEMSI (pc, tmp_addr, opval);
5090 SI opval = tmp_addr;
5091 if (UNLIKELY(current_cpu->trace_result_p))
5092 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5093 current_cpu->h_grc_set (FLD (f_rn), opval);
5097 current_cpu->done_insn (npc, status);
5101 // ********** sub-compact: sub $rm, $rn
5104 sh2a_fpu_sem_sub_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5105 sh2a_fpu::write_stacks &buf)
5107 #define FLD(f) abuf->fields.sfmt_macl_compact.f
5108 sem_status status = SEM_STATUS_NORMAL;
5109 sh2a_fpu_scache* abuf = sem;
5110 unsigned long long written = 0;
5111 PCADDR pc = abuf->addr;
5112 PCADDR npc = pc + 2;
5115 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
5116 if (UNLIKELY(current_cpu->trace_result_p))
5117 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5118 current_cpu->h_grc_set (FLD (f_rn), opval);
5121 current_cpu->done_insn (npc, status);
5125 // ********** subc-compact: subc $rm, $rn
5128 sh2a_fpu_sem_subc_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5129 sh2a_fpu::write_stacks &buf)
5131 #define FLD(f) abuf->fields.sfmt_macl_compact.f
5132 sem_status status = SEM_STATUS_NORMAL;
5133 sh2a_fpu_scache* abuf = sem;
5134 unsigned long long written = 0;
5135 PCADDR pc = abuf->addr;
5136 PCADDR npc = pc + 2;
5140 tmp_flag = SUBCFSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
5142 SI opval = SUBCSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_tbit_get ());
5143 if (UNLIKELY(current_cpu->trace_result_p))
5144 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5145 current_cpu->h_grc_set (FLD (f_rn), opval);
5148 BI opval = tmp_flag;
5149 if (UNLIKELY(current_cpu->trace_result_p))
5150 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5151 current_cpu->h_tbit_set (opval);
5155 current_cpu->done_insn (npc, status);
5159 // ********** subv-compact: subv $rm, $rn
5162 sh2a_fpu_sem_subv_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5163 sh2a_fpu::write_stacks &buf)
5165 #define FLD(f) abuf->fields.sfmt_macl_compact.f
5166 sem_status status = SEM_STATUS_NORMAL;
5167 sh2a_fpu_scache* abuf = sem;
5168 unsigned long long written = 0;
5169 PCADDR pc = abuf->addr;
5170 PCADDR npc = pc + 2;
5174 tmp_t = SUBOFSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)), 0);
5176 SI opval = SUBSI (current_cpu->h_grc_get (FLD (f_rn)), current_cpu->h_grc_get (FLD (f_rm)));
5177 if (UNLIKELY(current_cpu->trace_result_p))
5178 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5179 current_cpu->h_grc_set (FLD (f_rn), opval);
5182 BI opval = ((tmp_t) ? (1) : (0));
5183 if (UNLIKELY(current_cpu->trace_result_p))
5184 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5185 current_cpu->h_tbit_set (opval);
5189 current_cpu->done_insn (npc, status);
5193 // ********** swapb-compact: swap.b $rm, $rn
5196 sh2a_fpu_sem_swapb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5197 sh2a_fpu::write_stacks &buf)
5199 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5200 sem_status status = SEM_STATUS_NORMAL;
5201 sh2a_fpu_scache* abuf = sem;
5202 unsigned long long written = 0;
5203 PCADDR pc = abuf->addr;
5204 PCADDR npc = pc + 2;
5210 tmp_top_half = SUBWORDSIHI (current_cpu->h_grc_get (FLD (f_rm)), 0);
5211 tmp_byte1 = SUBWORDSIQI (current_cpu->h_grc_get (FLD (f_rm)), 2);
5212 tmp_byte0 = SUBWORDSIQI (current_cpu->h_grc_get (FLD (f_rm)), 3);
5214 SI opval = ORSI (SLLSI (tmp_top_half, 16), ORSI (SLLSI (tmp_byte0, 8), tmp_byte1));
5215 if (UNLIKELY(current_cpu->trace_result_p))
5216 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5217 current_cpu->h_grc_set (FLD (f_rn), opval);
5221 current_cpu->done_insn (npc, status);
5225 // ********** swapw-compact: swap.w $rm, $rn
5228 sh2a_fpu_sem_swapw_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5229 sh2a_fpu::write_stacks &buf)
5231 #define FLD(f) abuf->fields.sfmt_movl12_compact.f
5232 sem_status status = SEM_STATUS_NORMAL;
5233 sh2a_fpu_scache* abuf = sem;
5234 unsigned long long written = 0;
5235 PCADDR pc = abuf->addr;
5236 PCADDR npc = pc + 2;
5239 SI opval = ORSI (SRLSI (current_cpu->h_grc_get (FLD (f_rm)), 16), SLLSI (current_cpu->h_grc_get (FLD (f_rm)), 16));
5240 if (UNLIKELY(current_cpu->trace_result_p))
5241 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5242 current_cpu->h_grc_set (FLD (f_rn), opval);
5245 current_cpu->done_insn (npc, status);
5249 // ********** tasb-compact: tas.b @$rn
5252 sh2a_fpu_sem_tasb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5253 sh2a_fpu::write_stacks &buf)
5255 #define FLD(f) abuf->fields.sfmt_stsl_fpul_compact.f
5256 sem_status status = SEM_STATUS_NORMAL;
5257 sh2a_fpu_scache* abuf = sem;
5258 unsigned long long written = 0;
5259 PCADDR pc = abuf->addr;
5260 PCADDR npc = pc + 2;
5264 tmp_byte = current_cpu->GETMEMUQI (pc, current_cpu->h_grc_get (FLD (f_rn)));
5266 BI opval = ((EQQI (tmp_byte, 0)) ? (1) : (0));
5267 if (UNLIKELY(current_cpu->trace_result_p))
5268 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5269 current_cpu->h_tbit_set (opval);
5271 tmp_byte = ORQI (tmp_byte, 128);
5273 UQI opval = tmp_byte;
5274 if (UNLIKELY(current_cpu->trace_result_p))
5275 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) current_cpu->h_grc_get (FLD (f_rn)) << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
5276 current_cpu->SETMEMUQI (pc, current_cpu->h_grc_get (FLD (f_rn)), opval);
5280 current_cpu->done_insn (npc, status);
5284 // ********** trapa-compact: trapa #$uimm8
5287 sh2a_fpu_sem_trapa_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5288 sh2a_fpu::write_stacks &buf)
5290 #define FLD(f) abuf->fields.sfmt_andi_compact.f
5291 sem_status status = SEM_STATUS_NORMAL;
5292 sh2a_fpu_scache* abuf = sem;
5293 unsigned long long written = 0;
5294 PCADDR pc = abuf->addr;
5295 PCADDR npc = pc + 2;
5297 current_cpu->sh64_compact_trapa (FLD (f_imm8), pc);
5299 current_cpu->done_insn (npc, status);
5303 // ********** tst-compact: tst $rm, $rn
5306 sh2a_fpu_sem_tst_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5307 sh2a_fpu::write_stacks &buf)
5309 #define FLD(f) abuf->fields.sfmt_movl13_compact.f
5310 sem_status status = SEM_STATUS_NORMAL;
5311 sh2a_fpu_scache* abuf = sem;
5312 unsigned long long written = 0;
5313 PCADDR pc = abuf->addr;
5314 PCADDR npc = pc + 2;
5317 BI opval = ((EQSI (ANDSI (current_cpu->h_grc_get (FLD (f_rm)), current_cpu->h_grc_get (FLD (f_rn))), 0)) ? (1) : (0));
5318 if (UNLIKELY(current_cpu->trace_result_p))
5319 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5320 current_cpu->h_tbit_set (opval);
5323 current_cpu->done_insn (npc, status);
5327 // ********** tsti-compact: tst #$uimm8, r0
5330 sh2a_fpu_sem_tsti_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5331 sh2a_fpu::write_stacks &buf)
5333 #define FLD(f) abuf->fields.sfmt_andi_compact.f
5334 sem_status status = SEM_STATUS_NORMAL;
5335 sh2a_fpu_scache* abuf = sem;
5336 unsigned long long written = 0;
5337 PCADDR pc = abuf->addr;
5338 PCADDR npc = pc + 2;
5341 BI opval = ((EQSI (ANDSI (current_cpu->h_grc_get (((UINT) 0)), ZEXTSISI (FLD (f_imm8))), 0)) ? (1) : (0));
5342 if (UNLIKELY(current_cpu->trace_result_p))
5343 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5344 current_cpu->h_tbit_set (opval);
5347 current_cpu->done_insn (npc, status);
5351 // ********** tstb-compact: tst.b #$imm8, @(r0, gbr)
5354 sh2a_fpu_sem_tstb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5355 sh2a_fpu::write_stacks &buf)
5357 #define FLD(f) abuf->fields.sfmt_andi_compact.f
5358 sem_status status = SEM_STATUS_NORMAL;
5359 sh2a_fpu_scache* abuf = sem;
5360 unsigned long long written = 0;
5361 PCADDR pc = abuf->addr;
5362 PCADDR npc = pc + 2;
5366 tmp_addr = ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_gbr_get ());
5368 BI opval = ((EQQI (ANDQI (current_cpu->GETMEMUQI (pc, tmp_addr), FLD (f_imm8)), 0)) ? (1) : (0));
5369 if (UNLIKELY(current_cpu->trace_result_p))
5370 current_cpu->trace_stream << "tbit" << ":=0x" << hex << opval << dec << " ";
5371 current_cpu->h_tbit_set (opval);
5375 current_cpu->done_insn (npc, status);
5379 // ********** xor-compact: xor $rm64, $rn64
5382 sh2a_fpu_sem_xor_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5383 sh2a_fpu::write_stacks &buf)
5385 #define FLD(f) abuf->fields.sfmt_and_compact.f
5386 sem_status status = SEM_STATUS_NORMAL;
5387 sh2a_fpu_scache* abuf = sem;
5388 unsigned long long written = 0;
5389 PCADDR pc = abuf->addr;
5390 PCADDR npc = pc + 2;
5393 DI opval = XORDI (current_cpu->h_gr_get (FLD (f_rn)), current_cpu->h_gr_get (FLD (f_rm)));
5394 if (UNLIKELY(current_cpu->trace_result_p))
5395 current_cpu->trace_stream << "gr" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5396 current_cpu->h_gr_set (FLD (f_rn), opval);
5399 current_cpu->done_insn (npc, status);
5403 // ********** xori-compact: xor #$uimm8, r0
5406 sh2a_fpu_sem_xori_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5407 sh2a_fpu::write_stacks &buf)
5409 #define FLD(f) abuf->fields.sfmt_andi_compact.f
5410 sem_status status = SEM_STATUS_NORMAL;
5411 sh2a_fpu_scache* abuf = sem;
5412 unsigned long long written = 0;
5413 PCADDR pc = abuf->addr;
5414 PCADDR npc = pc + 2;
5417 SI opval = XORSI (current_cpu->h_grc_get (((UINT) 0)), ZEXTSIDI (FLD (f_imm8)));
5418 if (UNLIKELY(current_cpu->trace_result_p))
5419 current_cpu->trace_stream << "grc" << '[' << ((UINT) 0) << ']' << ":=0x" << hex << opval << dec << " ";
5420 current_cpu->h_grc_set (((UINT) 0), opval);
5423 current_cpu->done_insn (npc, status);
5427 // ********** xorb-compact: xor.b #$imm8, @(r0, gbr)
5430 sh2a_fpu_sem_xorb_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5431 sh2a_fpu::write_stacks &buf)
5433 #define FLD(f) abuf->fields.sfmt_andi_compact.f
5434 sem_status status = SEM_STATUS_NORMAL;
5435 sh2a_fpu_scache* abuf = sem;
5436 unsigned long long written = 0;
5437 PCADDR pc = abuf->addr;
5438 PCADDR npc = pc + 2;
5443 tmp_addr = ADDSI (current_cpu->h_grc_get (((UINT) 0)), current_cpu->h_gbr_get ());
5444 tmp_data = XORQI (current_cpu->GETMEMUQI (pc, tmp_addr), FLD (f_imm8));
5446 UQI opval = tmp_data;
5447 if (UNLIKELY(current_cpu->trace_result_p))
5448 current_cpu->trace_stream << "memory" << '[' << "0x" << hex << (UDI) tmp_addr << dec << ']' << ":=0x" << hex << (USI) opval << dec << " ";
5449 current_cpu->SETMEMUQI (pc, tmp_addr, opval);
5453 current_cpu->done_insn (npc, status);
5457 // ********** xtrct-compact: xtrct $rm, $rn
5460 sh2a_fpu_sem_xtrct_compact (sh2a_fpu_cpu* current_cpu, sh2a_fpu_scache* sem, const int tick,
5461 sh2a_fpu::write_stacks &buf)
5463 #define FLD(f) abuf->fields.sfmt_macl_compact.f
5464 sem_status status = SEM_STATUS_NORMAL;
5465 sh2a_fpu_scache* abuf = sem;
5466 unsigned long long written = 0;
5467 PCADDR pc = abuf->addr;
5468 PCADDR npc = pc + 2;
5471 SI opval = ORSI (SLLSI (current_cpu->h_grc_get (FLD (f_rm)), 16), SRLSI (current_cpu->h_grc_get (FLD (f_rn)), 16));
5472 if (UNLIKELY(current_cpu->trace_result_p))
5473 current_cpu->trace_stream << "grc" << '[' << FLD (f_rn) << ']' << ":=0x" << hex << opval << dec << " ";
5474 current_cpu->h_grc_set (FLD (f_rn), opval);
5477 current_cpu->done_insn (npc, status);