This commit was generated by cvs2svn to track changes on a CVS vendor
[binutils-gdb.git] / sim / fr30 / sem.c
1 /* Simulator instruction semantics for fr30bf.
2
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5 Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
6
7 This file is part of the GNU Simulators.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 */
24
25 #define WANT_CPU fr30bf
26 #define WANT_CPU_FR30BF
27
28 #include "sim-main.h"
29 #include "cgen-mem.h"
30 #include "cgen-ops.h"
31
32 #undef GET_ATTR
33 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
34
35 /* x-invalid: --invalid-- */
36
37 SEM_PC
38 SEM_FN_NAME (fr30bf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
39 {
40 #define FLD(f) abuf->fields.fmt_empty.f
41 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
42 int UNUSED written = 0;
43 IADDR UNUSED pc = abuf->addr;
44 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
45
46 {
47 #if WITH_SCACHE
48 /* Update the recorded pc in the cpu state struct. */
49 SET_H_PC (pc);
50 #endif
51 sim_engine_invalid_insn (current_cpu, pc);
52 sim_io_error (CPU_STATE (current_cpu), "invalid insn not handled\n");
53 /* NOTREACHED */
54 }
55
56 return vpc;
57 #undef FLD
58 }
59
60 /* x-after: --after-- */
61
62 SEM_PC
63 SEM_FN_NAME (fr30bf,x_after) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
64 {
65 #define FLD(f) abuf->fields.fmt_empty.f
66 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
67 int UNUSED written = 0;
68 IADDR UNUSED pc = abuf->addr;
69 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
70
71 {
72 #if WITH_SCACHE_PBB_FR30BF
73 fr30bf_pbb_after (current_cpu, sem_arg);
74 #endif
75 }
76
77 return vpc;
78 #undef FLD
79 }
80
81 /* x-before: --before-- */
82
83 SEM_PC
84 SEM_FN_NAME (fr30bf,x_before) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
85 {
86 #define FLD(f) abuf->fields.fmt_empty.f
87 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
88 int UNUSED written = 0;
89 IADDR UNUSED pc = abuf->addr;
90 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
91
92 {
93 #if WITH_SCACHE_PBB_FR30BF
94 fr30bf_pbb_before (current_cpu, sem_arg);
95 #endif
96 }
97
98 return vpc;
99 #undef FLD
100 }
101
102 /* x-cti-chain: --cti-chain-- */
103
104 SEM_PC
105 SEM_FN_NAME (fr30bf,x_cti_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
106 {
107 #define FLD(f) abuf->fields.fmt_empty.f
108 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
109 int UNUSED written = 0;
110 IADDR UNUSED pc = abuf->addr;
111 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
112
113 {
114 #if WITH_SCACHE_PBB_FR30BF
115 #ifdef DEFINE_SWITCH
116 vpc = fr30bf_pbb_cti_chain (current_cpu, sem_arg,
117 pbb_br_npc_ptr, pbb_br_npc);
118 BREAK (sem);
119 #else
120 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
121 vpc = fr30bf_pbb_cti_chain (current_cpu, sem_arg,
122 CPU_PBB_BR_NPC_PTR (current_cpu),
123 CPU_PBB_BR_NPC (current_cpu));
124 #endif
125 #endif
126 }
127
128 return vpc;
129 #undef FLD
130 }
131
132 /* x-chain: --chain-- */
133
134 SEM_PC
135 SEM_FN_NAME (fr30bf,x_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
136 {
137 #define FLD(f) abuf->fields.fmt_empty.f
138 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
139 int UNUSED written = 0;
140 IADDR UNUSED pc = abuf->addr;
141 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
142
143 {
144 #if WITH_SCACHE_PBB_FR30BF
145 vpc = fr30bf_pbb_chain (current_cpu, sem_arg);
146 #ifdef DEFINE_SWITCH
147 BREAK (sem);
148 #endif
149 #endif
150 }
151
152 return vpc;
153 #undef FLD
154 }
155
156 /* x-begin: --begin-- */
157
158 SEM_PC
159 SEM_FN_NAME (fr30bf,x_begin) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
160 {
161 #define FLD(f) abuf->fields.fmt_empty.f
162 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
163 int UNUSED written = 0;
164 IADDR UNUSED pc = abuf->addr;
165 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
166
167 {
168 #if WITH_SCACHE_PBB_FR30BF
169 #ifdef DEFINE_SWITCH
170 /* In the switch case FAST_P is a constant, allowing several optimizations
171 in any called inline functions. */
172 vpc = fr30bf_pbb_begin (current_cpu, FAST_P);
173 #else
174 vpc = fr30bf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
175 #endif
176 #endif
177 }
178
179 return vpc;
180 #undef FLD
181 }
182
183 /* add: add $Rj,$Ri */
184
185 SEM_PC
186 SEM_FN_NAME (fr30bf,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
187 {
188 #define FLD(f) abuf->fields.fmt_add.f
189 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
190 int UNUSED written = 0;
191 IADDR UNUSED pc = abuf->addr;
192 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
193
194 {
195 {
196 BI opval = ADDOFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
197 CPU (h_vbit) = opval;
198 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
199 }
200 {
201 BI opval = ADDCFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
202 CPU (h_cbit) = opval;
203 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
204 }
205 {
206 SI opval = ADDSI (* FLD (i_Ri), * FLD (i_Rj));
207 * FLD (i_Ri) = opval;
208 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
209 }
210 {
211 {
212 BI opval = EQSI (* FLD (i_Ri), 0);
213 CPU (h_zbit) = opval;
214 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
215 }
216 {
217 BI opval = LTSI (* FLD (i_Ri), 0);
218 CPU (h_nbit) = opval;
219 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
220 }
221 }
222 }
223
224 return vpc;
225 #undef FLD
226 }
227
228 /* addi: add $u4,$Ri */
229
230 SEM_PC
231 SEM_FN_NAME (fr30bf,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
232 {
233 #define FLD(f) abuf->fields.fmt_addi.f
234 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
235 int UNUSED written = 0;
236 IADDR UNUSED pc = abuf->addr;
237 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
238
239 {
240 {
241 BI opval = ADDOFSI (* FLD (i_Ri), FLD (f_u4), 0);
242 CPU (h_vbit) = opval;
243 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
244 }
245 {
246 BI opval = ADDCFSI (* FLD (i_Ri), FLD (f_u4), 0);
247 CPU (h_cbit) = opval;
248 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
249 }
250 {
251 SI opval = ADDSI (* FLD (i_Ri), FLD (f_u4));
252 * FLD (i_Ri) = opval;
253 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
254 }
255 {
256 {
257 BI opval = EQSI (* FLD (i_Ri), 0);
258 CPU (h_zbit) = opval;
259 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
260 }
261 {
262 BI opval = LTSI (* FLD (i_Ri), 0);
263 CPU (h_nbit) = opval;
264 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
265 }
266 }
267 }
268
269 return vpc;
270 #undef FLD
271 }
272
273 /* add2: add2 $m4,$Ri */
274
275 SEM_PC
276 SEM_FN_NAME (fr30bf,add2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
277 {
278 #define FLD(f) abuf->fields.fmt_add2.f
279 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
280 int UNUSED written = 0;
281 IADDR UNUSED pc = abuf->addr;
282 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
283
284 {
285 {
286 BI opval = ADDOFSI (* FLD (i_Ri), FLD (f_m4), 0);
287 CPU (h_vbit) = opval;
288 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
289 }
290 {
291 BI opval = ADDCFSI (* FLD (i_Ri), FLD (f_m4), 0);
292 CPU (h_cbit) = opval;
293 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
294 }
295 {
296 SI opval = ADDSI (* FLD (i_Ri), FLD (f_m4));
297 * FLD (i_Ri) = opval;
298 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
299 }
300 {
301 {
302 BI opval = EQSI (* FLD (i_Ri), 0);
303 CPU (h_zbit) = opval;
304 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
305 }
306 {
307 BI opval = LTSI (* FLD (i_Ri), 0);
308 CPU (h_nbit) = opval;
309 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
310 }
311 }
312 }
313
314 return vpc;
315 #undef FLD
316 }
317
318 /* addc: addc $Rj,$Ri */
319
320 SEM_PC
321 SEM_FN_NAME (fr30bf,addc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
322 {
323 #define FLD(f) abuf->fields.fmt_addc.f
324 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
325 int UNUSED written = 0;
326 IADDR UNUSED pc = abuf->addr;
327 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
328
329 {
330 SI tmp_tmp;
331 tmp_tmp = ADDCSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
332 {
333 BI opval = ADDOFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
334 CPU (h_vbit) = opval;
335 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
336 }
337 {
338 BI opval = ADDCFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
339 CPU (h_cbit) = opval;
340 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
341 }
342 {
343 SI opval = tmp_tmp;
344 * FLD (i_Ri) = opval;
345 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
346 }
347 {
348 {
349 BI opval = EQSI (* FLD (i_Ri), 0);
350 CPU (h_zbit) = opval;
351 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
352 }
353 {
354 BI opval = LTSI (* FLD (i_Ri), 0);
355 CPU (h_nbit) = opval;
356 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
357 }
358 }
359 }
360
361 return vpc;
362 #undef FLD
363 }
364
365 /* addn: addn $Rj,$Ri */
366
367 SEM_PC
368 SEM_FN_NAME (fr30bf,addn) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
369 {
370 #define FLD(f) abuf->fields.fmt_addn.f
371 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
372 int UNUSED written = 0;
373 IADDR UNUSED pc = abuf->addr;
374 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
375
376 {
377 SI opval = ADDSI (* FLD (i_Ri), * FLD (i_Rj));
378 * FLD (i_Ri) = opval;
379 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
380 }
381
382 return vpc;
383 #undef FLD
384 }
385
386 /* addni: addn $u4,$Ri */
387
388 SEM_PC
389 SEM_FN_NAME (fr30bf,addni) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
390 {
391 #define FLD(f) abuf->fields.fmt_addni.f
392 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
393 int UNUSED written = 0;
394 IADDR UNUSED pc = abuf->addr;
395 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
396
397 {
398 SI opval = ADDSI (* FLD (i_Ri), FLD (f_u4));
399 * FLD (i_Ri) = opval;
400 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
401 }
402
403 return vpc;
404 #undef FLD
405 }
406
407 /* addn2: addn2 $m4,$Ri */
408
409 SEM_PC
410 SEM_FN_NAME (fr30bf,addn2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
411 {
412 #define FLD(f) abuf->fields.fmt_addn2.f
413 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
414 int UNUSED written = 0;
415 IADDR UNUSED pc = abuf->addr;
416 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
417
418 {
419 SI opval = ADDSI (* FLD (i_Ri), FLD (f_m4));
420 * FLD (i_Ri) = opval;
421 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
422 }
423
424 return vpc;
425 #undef FLD
426 }
427
428 /* sub: sub $Rj,$Ri */
429
430 SEM_PC
431 SEM_FN_NAME (fr30bf,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
432 {
433 #define FLD(f) abuf->fields.fmt_add.f
434 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
435 int UNUSED written = 0;
436 IADDR UNUSED pc = abuf->addr;
437 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
438
439 {
440 {
441 BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
442 CPU (h_vbit) = opval;
443 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
444 }
445 {
446 BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
447 CPU (h_cbit) = opval;
448 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
449 }
450 {
451 SI opval = SUBSI (* FLD (i_Ri), * FLD (i_Rj));
452 * FLD (i_Ri) = opval;
453 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
454 }
455 {
456 {
457 BI opval = EQSI (* FLD (i_Ri), 0);
458 CPU (h_zbit) = opval;
459 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
460 }
461 {
462 BI opval = LTSI (* FLD (i_Ri), 0);
463 CPU (h_nbit) = opval;
464 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
465 }
466 }
467 }
468
469 return vpc;
470 #undef FLD
471 }
472
473 /* subc: subc $Rj,$Ri */
474
475 SEM_PC
476 SEM_FN_NAME (fr30bf,subc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
477 {
478 #define FLD(f) abuf->fields.fmt_addc.f
479 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
480 int UNUSED written = 0;
481 IADDR UNUSED pc = abuf->addr;
482 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
483
484 {
485 SI tmp_tmp;
486 tmp_tmp = SUBCSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
487 {
488 BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
489 CPU (h_vbit) = opval;
490 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
491 }
492 {
493 BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), CPU (h_cbit));
494 CPU (h_cbit) = opval;
495 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
496 }
497 {
498 SI opval = tmp_tmp;
499 * FLD (i_Ri) = opval;
500 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
501 }
502 {
503 {
504 BI opval = EQSI (* FLD (i_Ri), 0);
505 CPU (h_zbit) = opval;
506 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
507 }
508 {
509 BI opval = LTSI (* FLD (i_Ri), 0);
510 CPU (h_nbit) = opval;
511 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
512 }
513 }
514 }
515
516 return vpc;
517 #undef FLD
518 }
519
520 /* subn: subn $Rj,$Ri */
521
522 SEM_PC
523 SEM_FN_NAME (fr30bf,subn) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
524 {
525 #define FLD(f) abuf->fields.fmt_addn.f
526 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
527 int UNUSED written = 0;
528 IADDR UNUSED pc = abuf->addr;
529 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
530
531 {
532 SI opval = SUBSI (* FLD (i_Ri), * FLD (i_Rj));
533 * FLD (i_Ri) = opval;
534 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
535 }
536
537 return vpc;
538 #undef FLD
539 }
540
541 /* cmp: cmp $Rj,$Ri */
542
543 SEM_PC
544 SEM_FN_NAME (fr30bf,cmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
545 {
546 #define FLD(f) abuf->fields.fmt_cmp.f
547 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
548 int UNUSED written = 0;
549 IADDR UNUSED pc = abuf->addr;
550 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
551
552 {
553 SI tmp_tmp1;
554 {
555 BI opval = SUBOFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
556 CPU (h_vbit) = opval;
557 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
558 }
559 {
560 BI opval = SUBCFSI (* FLD (i_Ri), * FLD (i_Rj), 0);
561 CPU (h_cbit) = opval;
562 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
563 }
564 tmp_tmp1 = SUBSI (* FLD (i_Ri), * FLD (i_Rj));
565 {
566 {
567 BI opval = EQSI (tmp_tmp1, 0);
568 CPU (h_zbit) = opval;
569 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
570 }
571 {
572 BI opval = LTSI (tmp_tmp1, 0);
573 CPU (h_nbit) = opval;
574 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
575 }
576 }
577 }
578
579 return vpc;
580 #undef FLD
581 }
582
583 /* cmpi: cmp $u4,$Ri */
584
585 SEM_PC
586 SEM_FN_NAME (fr30bf,cmpi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
587 {
588 #define FLD(f) abuf->fields.fmt_cmpi.f
589 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
590 int UNUSED written = 0;
591 IADDR UNUSED pc = abuf->addr;
592 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
593
594 {
595 SI tmp_tmp1;
596 {
597 BI opval = SUBOFSI (* FLD (i_Ri), FLD (f_u4), 0);
598 CPU (h_vbit) = opval;
599 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
600 }
601 {
602 BI opval = SUBCFSI (* FLD (i_Ri), FLD (f_u4), 0);
603 CPU (h_cbit) = opval;
604 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
605 }
606 tmp_tmp1 = SUBSI (* FLD (i_Ri), FLD (f_u4));
607 {
608 {
609 BI opval = EQSI (tmp_tmp1, 0);
610 CPU (h_zbit) = opval;
611 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
612 }
613 {
614 BI opval = LTSI (tmp_tmp1, 0);
615 CPU (h_nbit) = opval;
616 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
617 }
618 }
619 }
620
621 return vpc;
622 #undef FLD
623 }
624
625 /* cmp2: cmp2 $m4,$Ri */
626
627 SEM_PC
628 SEM_FN_NAME (fr30bf,cmp2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
629 {
630 #define FLD(f) abuf->fields.fmt_cmp2.f
631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
632 int UNUSED written = 0;
633 IADDR UNUSED pc = abuf->addr;
634 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
635
636 {
637 SI tmp_tmp1;
638 {
639 BI opval = SUBOFSI (* FLD (i_Ri), FLD (f_m4), 0);
640 CPU (h_vbit) = opval;
641 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
642 }
643 {
644 BI opval = SUBCFSI (* FLD (i_Ri), FLD (f_m4), 0);
645 CPU (h_cbit) = opval;
646 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
647 }
648 tmp_tmp1 = SUBSI (* FLD (i_Ri), FLD (f_m4));
649 {
650 {
651 BI opval = EQSI (tmp_tmp1, 0);
652 CPU (h_zbit) = opval;
653 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
654 }
655 {
656 BI opval = LTSI (tmp_tmp1, 0);
657 CPU (h_nbit) = opval;
658 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
659 }
660 }
661 }
662
663 return vpc;
664 #undef FLD
665 }
666
667 /* and: and $Rj,$Ri */
668
669 SEM_PC
670 SEM_FN_NAME (fr30bf,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
671 {
672 #define FLD(f) abuf->fields.fmt_and.f
673 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
674 int UNUSED written = 0;
675 IADDR UNUSED pc = abuf->addr;
676 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
677
678 {
679 {
680 SI opval = ANDSI (* FLD (i_Ri), * FLD (i_Rj));
681 * FLD (i_Ri) = opval;
682 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
683 }
684 {
685 {
686 BI opval = EQSI (* FLD (i_Ri), 0);
687 CPU (h_zbit) = opval;
688 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
689 }
690 {
691 BI opval = LTSI (* FLD (i_Ri), 0);
692 CPU (h_nbit) = opval;
693 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
694 }
695 }
696 }
697
698 return vpc;
699 #undef FLD
700 }
701
702 /* or: or $Rj,$Ri */
703
704 SEM_PC
705 SEM_FN_NAME (fr30bf,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
706 {
707 #define FLD(f) abuf->fields.fmt_and.f
708 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
709 int UNUSED written = 0;
710 IADDR UNUSED pc = abuf->addr;
711 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
712
713 {
714 {
715 SI opval = ORSI (* FLD (i_Ri), * FLD (i_Rj));
716 * FLD (i_Ri) = opval;
717 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
718 }
719 {
720 {
721 BI opval = EQSI (* FLD (i_Ri), 0);
722 CPU (h_zbit) = opval;
723 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
724 }
725 {
726 BI opval = LTSI (* FLD (i_Ri), 0);
727 CPU (h_nbit) = opval;
728 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
729 }
730 }
731 }
732
733 return vpc;
734 #undef FLD
735 }
736
737 /* eor: eor $Rj,$Ri */
738
739 SEM_PC
740 SEM_FN_NAME (fr30bf,eor) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
741 {
742 #define FLD(f) abuf->fields.fmt_and.f
743 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
744 int UNUSED written = 0;
745 IADDR UNUSED pc = abuf->addr;
746 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
747
748 {
749 {
750 SI opval = XORSI (* FLD (i_Ri), * FLD (i_Rj));
751 * FLD (i_Ri) = opval;
752 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
753 }
754 {
755 {
756 BI opval = EQSI (* FLD (i_Ri), 0);
757 CPU (h_zbit) = opval;
758 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
759 }
760 {
761 BI opval = LTSI (* FLD (i_Ri), 0);
762 CPU (h_nbit) = opval;
763 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
764 }
765 }
766 }
767
768 return vpc;
769 #undef FLD
770 }
771
772 /* andm: and $Rj,@$Ri */
773
774 SEM_PC
775 SEM_FN_NAME (fr30bf,andm) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
776 {
777 #define FLD(f) abuf->fields.fmt_andm.f
778 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
779 int UNUSED written = 0;
780 IADDR UNUSED pc = abuf->addr;
781 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
782
783 {
784 SI tmp_tmp;
785 tmp_tmp = ANDSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
786 {
787 {
788 BI opval = EQSI (tmp_tmp, 0);
789 CPU (h_zbit) = opval;
790 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
791 }
792 {
793 BI opval = LTSI (tmp_tmp, 0);
794 CPU (h_nbit) = opval;
795 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
796 }
797 }
798 {
799 SI opval = tmp_tmp;
800 SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval);
801 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
802 }
803 }
804
805 return vpc;
806 #undef FLD
807 }
808
809 /* andh: andh $Rj,@$Ri */
810
811 SEM_PC
812 SEM_FN_NAME (fr30bf,andh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
813 {
814 #define FLD(f) abuf->fields.fmt_andh.f
815 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
816 int UNUSED written = 0;
817 IADDR UNUSED pc = abuf->addr;
818 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
819
820 {
821 HI tmp_tmp;
822 tmp_tmp = ANDHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
823 {
824 {
825 BI opval = EQHI (tmp_tmp, 0);
826 CPU (h_zbit) = opval;
827 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
828 }
829 {
830 BI opval = LTHI (tmp_tmp, 0);
831 CPU (h_nbit) = opval;
832 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
833 }
834 }
835 {
836 HI opval = tmp_tmp;
837 SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval);
838 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
839 }
840 }
841
842 return vpc;
843 #undef FLD
844 }
845
846 /* andb: andb $Rj,@$Ri */
847
848 SEM_PC
849 SEM_FN_NAME (fr30bf,andb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
850 {
851 #define FLD(f) abuf->fields.fmt_andb.f
852 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
853 int UNUSED written = 0;
854 IADDR UNUSED pc = abuf->addr;
855 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
856
857 {
858 QI tmp_tmp;
859 tmp_tmp = ANDQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
860 {
861 {
862 BI opval = EQQI (tmp_tmp, 0);
863 CPU (h_zbit) = opval;
864 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
865 }
866 {
867 BI opval = LTQI (tmp_tmp, 0);
868 CPU (h_nbit) = opval;
869 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
870 }
871 }
872 {
873 QI opval = tmp_tmp;
874 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
875 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
876 }
877 }
878
879 return vpc;
880 #undef FLD
881 }
882
883 /* orm: or $Rj,@$Ri */
884
885 SEM_PC
886 SEM_FN_NAME (fr30bf,orm) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
887 {
888 #define FLD(f) abuf->fields.fmt_andm.f
889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
890 int UNUSED written = 0;
891 IADDR UNUSED pc = abuf->addr;
892 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
893
894 {
895 SI tmp_tmp;
896 tmp_tmp = ORSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
897 {
898 {
899 BI opval = EQSI (tmp_tmp, 0);
900 CPU (h_zbit) = opval;
901 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
902 }
903 {
904 BI opval = LTSI (tmp_tmp, 0);
905 CPU (h_nbit) = opval;
906 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
907 }
908 }
909 {
910 SI opval = tmp_tmp;
911 SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval);
912 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
913 }
914 }
915
916 return vpc;
917 #undef FLD
918 }
919
920 /* orh: orh $Rj,@$Ri */
921
922 SEM_PC
923 SEM_FN_NAME (fr30bf,orh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
924 {
925 #define FLD(f) abuf->fields.fmt_andh.f
926 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
927 int UNUSED written = 0;
928 IADDR UNUSED pc = abuf->addr;
929 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
930
931 {
932 HI tmp_tmp;
933 tmp_tmp = ORHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
934 {
935 {
936 BI opval = EQHI (tmp_tmp, 0);
937 CPU (h_zbit) = opval;
938 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
939 }
940 {
941 BI opval = LTHI (tmp_tmp, 0);
942 CPU (h_nbit) = opval;
943 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
944 }
945 }
946 {
947 HI opval = tmp_tmp;
948 SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval);
949 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
950 }
951 }
952
953 return vpc;
954 #undef FLD
955 }
956
957 /* orb: orb $Rj,@$Ri */
958
959 SEM_PC
960 SEM_FN_NAME (fr30bf,orb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
961 {
962 #define FLD(f) abuf->fields.fmt_andb.f
963 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
964 int UNUSED written = 0;
965 IADDR UNUSED pc = abuf->addr;
966 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
967
968 {
969 QI tmp_tmp;
970 tmp_tmp = ORQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
971 {
972 {
973 BI opval = EQQI (tmp_tmp, 0);
974 CPU (h_zbit) = opval;
975 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
976 }
977 {
978 BI opval = LTQI (tmp_tmp, 0);
979 CPU (h_nbit) = opval;
980 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
981 }
982 }
983 {
984 QI opval = tmp_tmp;
985 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
986 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
987 }
988 }
989
990 return vpc;
991 #undef FLD
992 }
993
994 /* eorm: eor $Rj,@$Ri */
995
996 SEM_PC
997 SEM_FN_NAME (fr30bf,eorm) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
998 {
999 #define FLD(f) abuf->fields.fmt_andm.f
1000 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1001 int UNUSED written = 0;
1002 IADDR UNUSED pc = abuf->addr;
1003 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1004
1005 {
1006 SI tmp_tmp;
1007 tmp_tmp = XORSI (GETMEMSI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
1008 {
1009 {
1010 BI opval = EQSI (tmp_tmp, 0);
1011 CPU (h_zbit) = opval;
1012 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1013 }
1014 {
1015 BI opval = LTSI (tmp_tmp, 0);
1016 CPU (h_nbit) = opval;
1017 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1018 }
1019 }
1020 {
1021 SI opval = tmp_tmp;
1022 SETMEMSI (current_cpu, pc, * FLD (i_Ri), opval);
1023 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1024 }
1025 }
1026
1027 return vpc;
1028 #undef FLD
1029 }
1030
1031 /* eorh: eorh $Rj,@$Ri */
1032
1033 SEM_PC
1034 SEM_FN_NAME (fr30bf,eorh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1035 {
1036 #define FLD(f) abuf->fields.fmt_andh.f
1037 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1038 int UNUSED written = 0;
1039 IADDR UNUSED pc = abuf->addr;
1040 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1041
1042 {
1043 HI tmp_tmp;
1044 tmp_tmp = XORHI (GETMEMHI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
1045 {
1046 {
1047 BI opval = EQHI (tmp_tmp, 0);
1048 CPU (h_zbit) = opval;
1049 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1050 }
1051 {
1052 BI opval = LTHI (tmp_tmp, 0);
1053 CPU (h_nbit) = opval;
1054 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1055 }
1056 }
1057 {
1058 HI opval = tmp_tmp;
1059 SETMEMHI (current_cpu, pc, * FLD (i_Ri), opval);
1060 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1061 }
1062 }
1063
1064 return vpc;
1065 #undef FLD
1066 }
1067
1068 /* eorb: eorb $Rj,@$Ri */
1069
1070 SEM_PC
1071 SEM_FN_NAME (fr30bf,eorb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1072 {
1073 #define FLD(f) abuf->fields.fmt_andb.f
1074 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1075 int UNUSED written = 0;
1076 IADDR UNUSED pc = abuf->addr;
1077 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1078
1079 {
1080 QI tmp_tmp;
1081 tmp_tmp = XORQI (GETMEMQI (current_cpu, pc, * FLD (i_Ri)), * FLD (i_Rj));
1082 {
1083 {
1084 BI opval = EQQI (tmp_tmp, 0);
1085 CPU (h_zbit) = opval;
1086 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1087 }
1088 {
1089 BI opval = LTQI (tmp_tmp, 0);
1090 CPU (h_nbit) = opval;
1091 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1092 }
1093 }
1094 {
1095 QI opval = tmp_tmp;
1096 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1097 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1098 }
1099 }
1100
1101 return vpc;
1102 #undef FLD
1103 }
1104
1105 /* bandl: bandl $u4,@$Ri */
1106
1107 SEM_PC
1108 SEM_FN_NAME (fr30bf,bandl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1109 {
1110 #define FLD(f) abuf->fields.fmt_bandl.f
1111 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1112 int UNUSED written = 0;
1113 IADDR UNUSED pc = abuf->addr;
1114 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1115
1116 {
1117 QI opval = ANDQI (ORQI (FLD (f_u4), 240), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1118 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1119 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1120 }
1121
1122 return vpc;
1123 #undef FLD
1124 }
1125
1126 /* borl: borl $u4,@$Ri */
1127
1128 SEM_PC
1129 SEM_FN_NAME (fr30bf,borl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1130 {
1131 #define FLD(f) abuf->fields.fmt_bandl.f
1132 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1133 int UNUSED written = 0;
1134 IADDR UNUSED pc = abuf->addr;
1135 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1136
1137 {
1138 QI opval = ORQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1139 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1140 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1141 }
1142
1143 return vpc;
1144 #undef FLD
1145 }
1146
1147 /* beorl: beorl $u4,@$Ri */
1148
1149 SEM_PC
1150 SEM_FN_NAME (fr30bf,beorl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1151 {
1152 #define FLD(f) abuf->fields.fmt_bandl.f
1153 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1154 int UNUSED written = 0;
1155 IADDR UNUSED pc = abuf->addr;
1156 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1157
1158 {
1159 QI opval = XORQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1160 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1161 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1162 }
1163
1164 return vpc;
1165 #undef FLD
1166 }
1167
1168 /* bandh: bandh $u4,@$Ri */
1169
1170 SEM_PC
1171 SEM_FN_NAME (fr30bf,bandh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1172 {
1173 #define FLD(f) abuf->fields.fmt_bandl.f
1174 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1175 int UNUSED written = 0;
1176 IADDR UNUSED pc = abuf->addr;
1177 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1178
1179 {
1180 QI opval = ANDQI (ORQI (SLLQI (FLD (f_u4), 4), 15), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1181 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1182 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1183 }
1184
1185 return vpc;
1186 #undef FLD
1187 }
1188
1189 /* borh: borh $u4,@$Ri */
1190
1191 SEM_PC
1192 SEM_FN_NAME (fr30bf,borh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1193 {
1194 #define FLD(f) abuf->fields.fmt_bandl.f
1195 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1196 int UNUSED written = 0;
1197 IADDR UNUSED pc = abuf->addr;
1198 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1199
1200 {
1201 QI opval = ORQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1202 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1203 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1204 }
1205
1206 return vpc;
1207 #undef FLD
1208 }
1209
1210 /* beorh: beorh $u4,@$Ri */
1211
1212 SEM_PC
1213 SEM_FN_NAME (fr30bf,beorh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1214 {
1215 #define FLD(f) abuf->fields.fmt_bandl.f
1216 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1217 int UNUSED written = 0;
1218 IADDR UNUSED pc = abuf->addr;
1219 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1220
1221 {
1222 QI opval = XORQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1223 SETMEMQI (current_cpu, pc, * FLD (i_Ri), opval);
1224 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1225 }
1226
1227 return vpc;
1228 #undef FLD
1229 }
1230
1231 /* btstl: btstl $u4,@$Ri */
1232
1233 SEM_PC
1234 SEM_FN_NAME (fr30bf,btstl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1235 {
1236 #define FLD(f) abuf->fields.fmt_btstl.f
1237 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1238 int UNUSED written = 0;
1239 IADDR UNUSED pc = abuf->addr;
1240 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1241
1242 {
1243 QI tmp_tmp;
1244 tmp_tmp = ANDQI (FLD (f_u4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1245 {
1246 BI opval = EQQI (tmp_tmp, 0);
1247 CPU (h_zbit) = opval;
1248 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1249 }
1250 {
1251 BI opval = 0;
1252 CPU (h_nbit) = opval;
1253 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1254 }
1255 }
1256
1257 return vpc;
1258 #undef FLD
1259 }
1260
1261 /* btsth: btsth $u4,@$Ri */
1262
1263 SEM_PC
1264 SEM_FN_NAME (fr30bf,btsth) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1265 {
1266 #define FLD(f) abuf->fields.fmt_btstl.f
1267 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1268 int UNUSED written = 0;
1269 IADDR UNUSED pc = abuf->addr;
1270 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1271
1272 {
1273 QI tmp_tmp;
1274 tmp_tmp = ANDQI (SLLQI (FLD (f_u4), 4), GETMEMQI (current_cpu, pc, * FLD (i_Ri)));
1275 {
1276 BI opval = EQQI (tmp_tmp, 0);
1277 CPU (h_zbit) = opval;
1278 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1279 }
1280 {
1281 BI opval = LTQI (tmp_tmp, 0);
1282 CPU (h_nbit) = opval;
1283 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1284 }
1285 }
1286
1287 return vpc;
1288 #undef FLD
1289 }
1290
1291 /* mul: mul $Rj,$Ri */
1292
1293 SEM_PC
1294 SEM_FN_NAME (fr30bf,mul) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1295 {
1296 #define FLD(f) abuf->fields.fmt_mul.f
1297 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1298 int UNUSED written = 0;
1299 IADDR UNUSED pc = abuf->addr;
1300 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1301
1302 {
1303 DI tmp_tmp;
1304 tmp_tmp = MULDI (EXTSIDI (* FLD (i_Rj)), EXTSIDI (* FLD (i_Ri)));
1305 {
1306 SI opval = TRUNCDISI (tmp_tmp);
1307 SET_H_DR (((UINT) 5), opval);
1308 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1309 }
1310 {
1311 SI opval = TRUNCDISI (SRLDI (tmp_tmp, 32));
1312 SET_H_DR (((UINT) 4), opval);
1313 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1314 }
1315 {
1316 BI opval = LTSI (GET_H_DR (((UINT) 5)), 0);
1317 CPU (h_nbit) = opval;
1318 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1319 }
1320 {
1321 BI opval = EQDI (tmp_tmp, MAKEDI (0, 0));
1322 CPU (h_zbit) = opval;
1323 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1324 }
1325 {
1326 BI opval = ORIF (GTDI (tmp_tmp, MAKEDI (0, 2147483647)), LTDI (tmp_tmp, NEGDI (MAKEDI (0, 0x80000000))));
1327 CPU (h_vbit) = opval;
1328 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1329 }
1330 }
1331
1332 return vpc;
1333 #undef FLD
1334 }
1335
1336 /* mulu: mulu $Rj,$Ri */
1337
1338 SEM_PC
1339 SEM_FN_NAME (fr30bf,mulu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1340 {
1341 #define FLD(f) abuf->fields.fmt_mulu.f
1342 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1343 int UNUSED written = 0;
1344 IADDR UNUSED pc = abuf->addr;
1345 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1346
1347 {
1348 DI tmp_tmp;
1349 tmp_tmp = MULDI (ZEXTSIDI (* FLD (i_Rj)), ZEXTSIDI (* FLD (i_Ri)));
1350 {
1351 SI opval = TRUNCDISI (tmp_tmp);
1352 SET_H_DR (((UINT) 5), opval);
1353 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1354 }
1355 {
1356 SI opval = TRUNCDISI (SRLDI (tmp_tmp, 32));
1357 SET_H_DR (((UINT) 4), opval);
1358 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1359 }
1360 {
1361 BI opval = LTSI (GET_H_DR (((UINT) 4)), 0);
1362 CPU (h_nbit) = opval;
1363 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1364 }
1365 {
1366 BI opval = EQSI (GET_H_DR (((UINT) 5)), 0);
1367 CPU (h_zbit) = opval;
1368 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1369 }
1370 {
1371 BI opval = NESI (GET_H_DR (((UINT) 4)), 0);
1372 CPU (h_vbit) = opval;
1373 TRACE_RESULT (current_cpu, abuf, "vbit", 'x', opval);
1374 }
1375 }
1376
1377 return vpc;
1378 #undef FLD
1379 }
1380
1381 /* mulh: mulh $Rj,$Ri */
1382
1383 SEM_PC
1384 SEM_FN_NAME (fr30bf,mulh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1385 {
1386 #define FLD(f) abuf->fields.fmt_mulh.f
1387 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1388 int UNUSED written = 0;
1389 IADDR UNUSED pc = abuf->addr;
1390 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1391
1392 {
1393 {
1394 SI opval = MULHI (TRUNCSIHI (* FLD (i_Rj)), TRUNCSIHI (* FLD (i_Ri)));
1395 SET_H_DR (((UINT) 5), opval);
1396 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1397 }
1398 {
1399 BI opval = LTSI (GET_H_DR (((UINT) 5)), 0);
1400 CPU (h_nbit) = opval;
1401 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1402 }
1403 {
1404 BI opval = GESI (GET_H_DR (((UINT) 5)), 0);
1405 CPU (h_zbit) = opval;
1406 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1407 }
1408 }
1409
1410 return vpc;
1411 #undef FLD
1412 }
1413
1414 /* muluh: muluh $Rj,$Ri */
1415
1416 SEM_PC
1417 SEM_FN_NAME (fr30bf,muluh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1418 {
1419 #define FLD(f) abuf->fields.fmt_mulh.f
1420 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1421 int UNUSED written = 0;
1422 IADDR UNUSED pc = abuf->addr;
1423 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1424
1425 {
1426 {
1427 SI opval = MULSI (ANDSI (* FLD (i_Rj), 65535), ANDSI (* FLD (i_Ri), 65535));
1428 SET_H_DR (((UINT) 5), opval);
1429 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1430 }
1431 {
1432 BI opval = LTSI (GET_H_DR (((UINT) 5)), 0);
1433 CPU (h_nbit) = opval;
1434 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1435 }
1436 {
1437 BI opval = GESI (GET_H_DR (((UINT) 5)), 0);
1438 CPU (h_zbit) = opval;
1439 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1440 }
1441 }
1442
1443 return vpc;
1444 #undef FLD
1445 }
1446
1447 /* div0s: div0s $Ri */
1448
1449 SEM_PC
1450 SEM_FN_NAME (fr30bf,div0s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1451 {
1452 #define FLD(f) abuf->fields.fmt_div0s.f
1453 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1454 int UNUSED written = 0;
1455 IADDR UNUSED pc = abuf->addr;
1456 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1457
1458 {
1459 {
1460 BI opval = LTSI (GET_H_DR (((UINT) 5)), 0);
1461 CPU (h_d0bit) = opval;
1462 TRACE_RESULT (current_cpu, abuf, "d0bit", 'x', opval);
1463 }
1464 {
1465 BI opval = XORBI (CPU (h_d0bit), LTSI (* FLD (i_Ri), 0));
1466 CPU (h_d1bit) = opval;
1467 TRACE_RESULT (current_cpu, abuf, "d1bit", 'x', opval);
1468 }
1469 if (NEBI (CPU (h_d0bit), 0)) {
1470 {
1471 SI opval = 0xffffffff;
1472 SET_H_DR (((UINT) 4), opval);
1473 written |= (1 << 5);
1474 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1475 }
1476 } else {
1477 {
1478 SI opval = 0;
1479 SET_H_DR (((UINT) 4), opval);
1480 written |= (1 << 5);
1481 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1482 }
1483 }
1484 }
1485
1486 abuf->written = written;
1487 return vpc;
1488 #undef FLD
1489 }
1490
1491 /* div0u: div0u $Ri */
1492
1493 SEM_PC
1494 SEM_FN_NAME (fr30bf,div0u) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1495 {
1496 #define FLD(f) abuf->fields.fmt_div0u.f
1497 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1498 int UNUSED written = 0;
1499 IADDR UNUSED pc = abuf->addr;
1500 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1501
1502 {
1503 {
1504 BI opval = 0;
1505 CPU (h_d0bit) = opval;
1506 TRACE_RESULT (current_cpu, abuf, "d0bit", 'x', opval);
1507 }
1508 {
1509 BI opval = 0;
1510 CPU (h_d1bit) = opval;
1511 TRACE_RESULT (current_cpu, abuf, "d1bit", 'x', opval);
1512 }
1513 {
1514 SI opval = 0;
1515 SET_H_DR (((UINT) 4), opval);
1516 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1517 }
1518 }
1519
1520 return vpc;
1521 #undef FLD
1522 }
1523
1524 /* div1: div1 $Ri */
1525
1526 SEM_PC
1527 SEM_FN_NAME (fr30bf,div1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1528 {
1529 #define FLD(f) abuf->fields.fmt_div1.f
1530 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1531 int UNUSED written = 0;
1532 IADDR UNUSED pc = abuf->addr;
1533 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1534
1535 {
1536 SI tmp_tmp;
1537 {
1538 SI opval = SLLSI (GET_H_DR (((UINT) 4)), 1);
1539 SET_H_DR (((UINT) 4), opval);
1540 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1541 }
1542 if (LTSI (GET_H_DR (((UINT) 5)), 0)) {
1543 {
1544 SI opval = ADDSI (GET_H_DR (((UINT) 4)), 1);
1545 SET_H_DR (((UINT) 4), opval);
1546 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1547 }
1548 }
1549 {
1550 SI opval = SLLSI (GET_H_DR (((UINT) 5)), 1);
1551 SET_H_DR (((UINT) 5), opval);
1552 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1553 }
1554 if (EQBI (CPU (h_d1bit), 1)) {
1555 {
1556 tmp_tmp = ADDSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri));
1557 {
1558 BI opval = ADDCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0);
1559 CPU (h_cbit) = opval;
1560 written |= (1 << 6);
1561 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1562 }
1563 }
1564 } else {
1565 {
1566 tmp_tmp = SUBSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri));
1567 {
1568 BI opval = SUBCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0);
1569 CPU (h_cbit) = opval;
1570 written |= (1 << 6);
1571 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1572 }
1573 }
1574 }
1575 if (NOTBI (XORBI (XORBI (CPU (h_d0bit), CPU (h_d1bit)), CPU (h_cbit)))) {
1576 {
1577 {
1578 SI opval = tmp_tmp;
1579 SET_H_DR (((UINT) 4), opval);
1580 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1581 }
1582 {
1583 SI opval = ORSI (GET_H_DR (((UINT) 5)), 1);
1584 SET_H_DR (((UINT) 5), opval);
1585 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1586 }
1587 }
1588 }
1589 {
1590 BI opval = EQSI (GET_H_DR (((UINT) 4)), 0);
1591 CPU (h_zbit) = opval;
1592 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1593 }
1594 }
1595
1596 abuf->written = written;
1597 return vpc;
1598 #undef FLD
1599 }
1600
1601 /* div2: div2 $Ri */
1602
1603 SEM_PC
1604 SEM_FN_NAME (fr30bf,div2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1605 {
1606 #define FLD(f) abuf->fields.fmt_div2.f
1607 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1608 int UNUSED written = 0;
1609 IADDR UNUSED pc = abuf->addr;
1610 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1611
1612 {
1613 SI tmp_tmp;
1614 if (EQBI (CPU (h_d1bit), 1)) {
1615 {
1616 tmp_tmp = ADDSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri));
1617 {
1618 BI opval = ADDCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0);
1619 CPU (h_cbit) = opval;
1620 written |= (1 << 3);
1621 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1622 }
1623 }
1624 } else {
1625 {
1626 tmp_tmp = SUBSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri));
1627 {
1628 BI opval = SUBCFSI (GET_H_DR (((UINT) 4)), * FLD (i_Ri), 0);
1629 CPU (h_cbit) = opval;
1630 written |= (1 << 3);
1631 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1632 }
1633 }
1634 }
1635 if (EQSI (tmp_tmp, 0)) {
1636 {
1637 {
1638 BI opval = 1;
1639 CPU (h_zbit) = opval;
1640 written |= (1 << 5);
1641 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1642 }
1643 {
1644 SI opval = 0;
1645 SET_H_DR (((UINT) 4), opval);
1646 written |= (1 << 4);
1647 TRACE_RESULT (current_cpu, abuf, "dr-4", 'x', opval);
1648 }
1649 }
1650 } else {
1651 {
1652 BI opval = 0;
1653 CPU (h_zbit) = opval;
1654 written |= (1 << 5);
1655 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1656 }
1657 }
1658 }
1659
1660 abuf->written = written;
1661 return vpc;
1662 #undef FLD
1663 }
1664
1665 /* div3: div3 */
1666
1667 SEM_PC
1668 SEM_FN_NAME (fr30bf,div3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1669 {
1670 #define FLD(f) abuf->fields.fmt_div3.f
1671 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1672 int UNUSED written = 0;
1673 IADDR UNUSED pc = abuf->addr;
1674 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1675
1676 if (EQBI (CPU (h_zbit), 1)) {
1677 {
1678 SI opval = ADDSI (GET_H_DR (((UINT) 5)), 1);
1679 SET_H_DR (((UINT) 5), opval);
1680 written |= (1 << 2);
1681 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1682 }
1683 }
1684
1685 abuf->written = written;
1686 return vpc;
1687 #undef FLD
1688 }
1689
1690 /* div4s: div4s */
1691
1692 SEM_PC
1693 SEM_FN_NAME (fr30bf,div4s) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1694 {
1695 #define FLD(f) abuf->fields.fmt_div4s.f
1696 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1697 int UNUSED written = 0;
1698 IADDR UNUSED pc = abuf->addr;
1699 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1700
1701 if (EQBI (CPU (h_d1bit), 1)) {
1702 {
1703 SI opval = NEGSI (GET_H_DR (((UINT) 5)));
1704 SET_H_DR (((UINT) 5), opval);
1705 written |= (1 << 2);
1706 TRACE_RESULT (current_cpu, abuf, "dr-5", 'x', opval);
1707 }
1708 }
1709
1710 abuf->written = written;
1711 return vpc;
1712 #undef FLD
1713 }
1714
1715 /* lsl: lsl $Rj,$Ri */
1716
1717 SEM_PC
1718 SEM_FN_NAME (fr30bf,lsl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1719 {
1720 #define FLD(f) abuf->fields.fmt_lsl.f
1721 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1722 int UNUSED written = 0;
1723 IADDR UNUSED pc = abuf->addr;
1724 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1725
1726 {
1727 SI tmp_shift;
1728 tmp_shift = ANDSI (* FLD (i_Rj), 31);
1729 if (NESI (tmp_shift, 0)) {
1730 {
1731 {
1732 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0);
1733 CPU (h_cbit) = opval;
1734 written |= (1 << 3);
1735 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1736 }
1737 {
1738 SI opval = SLLSI (* FLD (i_Ri), tmp_shift);
1739 * FLD (i_Ri) = opval;
1740 written |= (1 << 2);
1741 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
1742 }
1743 }
1744 } else {
1745 {
1746 BI opval = 0;
1747 CPU (h_cbit) = opval;
1748 written |= (1 << 3);
1749 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1750 }
1751 }
1752 {
1753 BI opval = LTSI (* FLD (i_Ri), 0);
1754 CPU (h_nbit) = opval;
1755 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1756 }
1757 {
1758 BI opval = EQSI (* FLD (i_Ri), 0);
1759 CPU (h_zbit) = opval;
1760 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1761 }
1762 }
1763
1764 abuf->written = written;
1765 return vpc;
1766 #undef FLD
1767 }
1768
1769 /* lsli: lsl $u4,$Ri */
1770
1771 SEM_PC
1772 SEM_FN_NAME (fr30bf,lsli) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1773 {
1774 #define FLD(f) abuf->fields.fmt_lsli.f
1775 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1776 int UNUSED written = 0;
1777 IADDR UNUSED pc = abuf->addr;
1778 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1779
1780 {
1781 SI tmp_shift;
1782 tmp_shift = FLD (f_u4);
1783 if (NESI (tmp_shift, 0)) {
1784 {
1785 {
1786 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0);
1787 CPU (h_cbit) = opval;
1788 written |= (1 << 3);
1789 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1790 }
1791 {
1792 SI opval = SLLSI (* FLD (i_Ri), tmp_shift);
1793 * FLD (i_Ri) = opval;
1794 written |= (1 << 2);
1795 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
1796 }
1797 }
1798 } else {
1799 {
1800 BI opval = 0;
1801 CPU (h_cbit) = opval;
1802 written |= (1 << 3);
1803 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1804 }
1805 }
1806 {
1807 BI opval = LTSI (* FLD (i_Ri), 0);
1808 CPU (h_nbit) = opval;
1809 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1810 }
1811 {
1812 BI opval = EQSI (* FLD (i_Ri), 0);
1813 CPU (h_zbit) = opval;
1814 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1815 }
1816 }
1817
1818 abuf->written = written;
1819 return vpc;
1820 #undef FLD
1821 }
1822
1823 /* lsl2: lsl2 $u4,$Ri */
1824
1825 SEM_PC
1826 SEM_FN_NAME (fr30bf,lsl2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1827 {
1828 #define FLD(f) abuf->fields.fmt_lsli.f
1829 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1830 int UNUSED written = 0;
1831 IADDR UNUSED pc = abuf->addr;
1832 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1833
1834 {
1835 SI tmp_shift;
1836 tmp_shift = ADDSI (FLD (f_u4), 16);
1837 if (NESI (tmp_shift, 0)) {
1838 {
1839 {
1840 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (32, tmp_shift))), 0);
1841 CPU (h_cbit) = opval;
1842 written |= (1 << 3);
1843 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1844 }
1845 {
1846 SI opval = SLLSI (* FLD (i_Ri), tmp_shift);
1847 * FLD (i_Ri) = opval;
1848 written |= (1 << 2);
1849 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
1850 }
1851 }
1852 } else {
1853 {
1854 BI opval = 0;
1855 CPU (h_cbit) = opval;
1856 written |= (1 << 3);
1857 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1858 }
1859 }
1860 {
1861 BI opval = LTSI (* FLD (i_Ri), 0);
1862 CPU (h_nbit) = opval;
1863 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1864 }
1865 {
1866 BI opval = EQSI (* FLD (i_Ri), 0);
1867 CPU (h_zbit) = opval;
1868 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1869 }
1870 }
1871
1872 abuf->written = written;
1873 return vpc;
1874 #undef FLD
1875 }
1876
1877 /* lsr: lsr $Rj,$Ri */
1878
1879 SEM_PC
1880 SEM_FN_NAME (fr30bf,lsr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1881 {
1882 #define FLD(f) abuf->fields.fmt_lsl.f
1883 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1884 int UNUSED written = 0;
1885 IADDR UNUSED pc = abuf->addr;
1886 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1887
1888 {
1889 SI tmp_shift;
1890 tmp_shift = ANDSI (* FLD (i_Rj), 31);
1891 if (NESI (tmp_shift, 0)) {
1892 {
1893 {
1894 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
1895 CPU (h_cbit) = opval;
1896 written |= (1 << 3);
1897 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1898 }
1899 {
1900 SI opval = SRLSI (* FLD (i_Ri), tmp_shift);
1901 * FLD (i_Ri) = opval;
1902 written |= (1 << 2);
1903 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
1904 }
1905 }
1906 } else {
1907 {
1908 BI opval = 0;
1909 CPU (h_cbit) = opval;
1910 written |= (1 << 3);
1911 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1912 }
1913 }
1914 {
1915 BI opval = LTSI (* FLD (i_Ri), 0);
1916 CPU (h_nbit) = opval;
1917 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1918 }
1919 {
1920 BI opval = EQSI (* FLD (i_Ri), 0);
1921 CPU (h_zbit) = opval;
1922 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1923 }
1924 }
1925
1926 abuf->written = written;
1927 return vpc;
1928 #undef FLD
1929 }
1930
1931 /* lsri: lsr $u4,$Ri */
1932
1933 SEM_PC
1934 SEM_FN_NAME (fr30bf,lsri) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1935 {
1936 #define FLD(f) abuf->fields.fmt_lsli.f
1937 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1938 int UNUSED written = 0;
1939 IADDR UNUSED pc = abuf->addr;
1940 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1941
1942 {
1943 SI tmp_shift;
1944 tmp_shift = FLD (f_u4);
1945 if (NESI (tmp_shift, 0)) {
1946 {
1947 {
1948 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
1949 CPU (h_cbit) = opval;
1950 written |= (1 << 3);
1951 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1952 }
1953 {
1954 SI opval = SRLSI (* FLD (i_Ri), tmp_shift);
1955 * FLD (i_Ri) = opval;
1956 written |= (1 << 2);
1957 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
1958 }
1959 }
1960 } else {
1961 {
1962 BI opval = 0;
1963 CPU (h_cbit) = opval;
1964 written |= (1 << 3);
1965 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
1966 }
1967 }
1968 {
1969 BI opval = LTSI (* FLD (i_Ri), 0);
1970 CPU (h_nbit) = opval;
1971 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
1972 }
1973 {
1974 BI opval = EQSI (* FLD (i_Ri), 0);
1975 CPU (h_zbit) = opval;
1976 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
1977 }
1978 }
1979
1980 abuf->written = written;
1981 return vpc;
1982 #undef FLD
1983 }
1984
1985 /* lsr2: lsr2 $u4,$Ri */
1986
1987 SEM_PC
1988 SEM_FN_NAME (fr30bf,lsr2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1989 {
1990 #define FLD(f) abuf->fields.fmt_lsli.f
1991 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1992 int UNUSED written = 0;
1993 IADDR UNUSED pc = abuf->addr;
1994 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
1995
1996 {
1997 SI tmp_shift;
1998 tmp_shift = ADDSI (FLD (f_u4), 16);
1999 if (NESI (tmp_shift, 0)) {
2000 {
2001 {
2002 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
2003 CPU (h_cbit) = opval;
2004 written |= (1 << 3);
2005 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2006 }
2007 {
2008 SI opval = SRLSI (* FLD (i_Ri), tmp_shift);
2009 * FLD (i_Ri) = opval;
2010 written |= (1 << 2);
2011 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2012 }
2013 }
2014 } else {
2015 {
2016 BI opval = 0;
2017 CPU (h_cbit) = opval;
2018 written |= (1 << 3);
2019 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2020 }
2021 }
2022 {
2023 BI opval = LTSI (* FLD (i_Ri), 0);
2024 CPU (h_nbit) = opval;
2025 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2026 }
2027 {
2028 BI opval = EQSI (* FLD (i_Ri), 0);
2029 CPU (h_zbit) = opval;
2030 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2031 }
2032 }
2033
2034 abuf->written = written;
2035 return vpc;
2036 #undef FLD
2037 }
2038
2039 /* asr: asr $Rj,$Ri */
2040
2041 SEM_PC
2042 SEM_FN_NAME (fr30bf,asr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2043 {
2044 #define FLD(f) abuf->fields.fmt_lsl.f
2045 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2046 int UNUSED written = 0;
2047 IADDR UNUSED pc = abuf->addr;
2048 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2049
2050 {
2051 SI tmp_shift;
2052 tmp_shift = ANDSI (* FLD (i_Rj), 31);
2053 if (NESI (tmp_shift, 0)) {
2054 {
2055 {
2056 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
2057 CPU (h_cbit) = opval;
2058 written |= (1 << 3);
2059 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2060 }
2061 {
2062 SI opval = SRASI (* FLD (i_Ri), tmp_shift);
2063 * FLD (i_Ri) = opval;
2064 written |= (1 << 2);
2065 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2066 }
2067 }
2068 } else {
2069 {
2070 BI opval = 0;
2071 CPU (h_cbit) = opval;
2072 written |= (1 << 3);
2073 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2074 }
2075 }
2076 {
2077 BI opval = LTSI (* FLD (i_Ri), 0);
2078 CPU (h_nbit) = opval;
2079 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2080 }
2081 {
2082 BI opval = EQSI (* FLD (i_Ri), 0);
2083 CPU (h_zbit) = opval;
2084 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2085 }
2086 }
2087
2088 abuf->written = written;
2089 return vpc;
2090 #undef FLD
2091 }
2092
2093 /* asri: asr $u4,$Ri */
2094
2095 SEM_PC
2096 SEM_FN_NAME (fr30bf,asri) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2097 {
2098 #define FLD(f) abuf->fields.fmt_lsli.f
2099 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2100 int UNUSED written = 0;
2101 IADDR UNUSED pc = abuf->addr;
2102 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2103
2104 {
2105 SI tmp_shift;
2106 tmp_shift = FLD (f_u4);
2107 if (NESI (tmp_shift, 0)) {
2108 {
2109 {
2110 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
2111 CPU (h_cbit) = opval;
2112 written |= (1 << 3);
2113 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2114 }
2115 {
2116 SI opval = SRASI (* FLD (i_Ri), tmp_shift);
2117 * FLD (i_Ri) = opval;
2118 written |= (1 << 2);
2119 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2120 }
2121 }
2122 } else {
2123 {
2124 BI opval = 0;
2125 CPU (h_cbit) = opval;
2126 written |= (1 << 3);
2127 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2128 }
2129 }
2130 {
2131 BI opval = LTSI (* FLD (i_Ri), 0);
2132 CPU (h_nbit) = opval;
2133 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2134 }
2135 {
2136 BI opval = EQSI (* FLD (i_Ri), 0);
2137 CPU (h_zbit) = opval;
2138 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2139 }
2140 }
2141
2142 abuf->written = written;
2143 return vpc;
2144 #undef FLD
2145 }
2146
2147 /* asr2: asr2 $u4,$Ri */
2148
2149 SEM_PC
2150 SEM_FN_NAME (fr30bf,asr2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2151 {
2152 #define FLD(f) abuf->fields.fmt_lsli.f
2153 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2154 int UNUSED written = 0;
2155 IADDR UNUSED pc = abuf->addr;
2156 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2157
2158 {
2159 SI tmp_shift;
2160 tmp_shift = ADDSI (FLD (f_u4), 16);
2161 if (NESI (tmp_shift, 0)) {
2162 {
2163 {
2164 BI opval = NESI (ANDSI (* FLD (i_Ri), SLLSI (1, SUBSI (tmp_shift, 1))), 0);
2165 CPU (h_cbit) = opval;
2166 written |= (1 << 3);
2167 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2168 }
2169 {
2170 SI opval = SRASI (* FLD (i_Ri), tmp_shift);
2171 * FLD (i_Ri) = opval;
2172 written |= (1 << 2);
2173 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2174 }
2175 }
2176 } else {
2177 {
2178 BI opval = 0;
2179 CPU (h_cbit) = opval;
2180 written |= (1 << 3);
2181 TRACE_RESULT (current_cpu, abuf, "cbit", 'x', opval);
2182 }
2183 }
2184 {
2185 BI opval = LTSI (* FLD (i_Ri), 0);
2186 CPU (h_nbit) = opval;
2187 TRACE_RESULT (current_cpu, abuf, "nbit", 'x', opval);
2188 }
2189 {
2190 BI opval = EQSI (* FLD (i_Ri), 0);
2191 CPU (h_zbit) = opval;
2192 TRACE_RESULT (current_cpu, abuf, "zbit", 'x', opval);
2193 }
2194 }
2195
2196 abuf->written = written;
2197 return vpc;
2198 #undef FLD
2199 }
2200
2201 /* ldi8: ldi:8 $i8,$Ri */
2202
2203 SEM_PC
2204 SEM_FN_NAME (fr30bf,ldi8) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2205 {
2206 #define FLD(f) abuf->fields.fmt_ldi8.f
2207 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2208 int UNUSED written = 0;
2209 IADDR UNUSED pc = abuf->addr;
2210 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2211
2212 {
2213 SI opval = FLD (f_i8);
2214 * FLD (i_Ri) = opval;
2215 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2216 }
2217
2218 return vpc;
2219 #undef FLD
2220 }
2221
2222 /* ldi20: ldi:20 $i20,$Ri */
2223
2224 SEM_PC
2225 SEM_FN_NAME (fr30bf,ldi20) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2226 {
2227 #define FLD(f) abuf->fields.fmt_ldi20.f
2228 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2229 int UNUSED written = 0;
2230 IADDR UNUSED pc = abuf->addr;
2231 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2232
2233 {
2234 SI opval = FLD (f_i20);
2235 * FLD (i_Ri) = opval;
2236 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2237 }
2238
2239 return vpc;
2240 #undef FLD
2241 }
2242
2243 /* ldi32: ldi:32 $i32,$Ri */
2244
2245 SEM_PC
2246 SEM_FN_NAME (fr30bf,ldi32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2247 {
2248 #define FLD(f) abuf->fields.fmt_ldi32.f
2249 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2250 int UNUSED written = 0;
2251 IADDR UNUSED pc = abuf->addr;
2252 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 6);
2253
2254 {
2255 SI opval = FLD (f_i32);
2256 * FLD (i_Ri) = opval;
2257 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2258 }
2259
2260 return vpc;
2261 #undef FLD
2262 }
2263
2264 /* ld: ld @$Rj,$Ri */
2265
2266 SEM_PC
2267 SEM_FN_NAME (fr30bf,ld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2268 {
2269 #define FLD(f) abuf->fields.fmt_ld.f
2270 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2271 int UNUSED written = 0;
2272 IADDR UNUSED pc = abuf->addr;
2273 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2274
2275 {
2276 SI opval = GETMEMSI (current_cpu, pc, * FLD (i_Rj));
2277 * FLD (i_Ri) = opval;
2278 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2279 }
2280
2281 return vpc;
2282 #undef FLD
2283 }
2284
2285 /* lduh: lduh @$Rj,$Ri */
2286
2287 SEM_PC
2288 SEM_FN_NAME (fr30bf,lduh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2289 {
2290 #define FLD(f) abuf->fields.fmt_ld.f
2291 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2292 int UNUSED written = 0;
2293 IADDR UNUSED pc = abuf->addr;
2294 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2295
2296 {
2297 SI opval = GETMEMUHI (current_cpu, pc, * FLD (i_Rj));
2298 * FLD (i_Ri) = opval;
2299 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2300 }
2301
2302 return vpc;
2303 #undef FLD
2304 }
2305
2306 /* ldub: ldub @$Rj,$Ri */
2307
2308 SEM_PC
2309 SEM_FN_NAME (fr30bf,ldub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2310 {
2311 #define FLD(f) abuf->fields.fmt_ld.f
2312 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2313 int UNUSED written = 0;
2314 IADDR UNUSED pc = abuf->addr;
2315 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2316
2317 {
2318 SI opval = GETMEMUQI (current_cpu, pc, * FLD (i_Rj));
2319 * FLD (i_Ri) = opval;
2320 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2321 }
2322
2323 return vpc;
2324 #undef FLD
2325 }
2326
2327 /* ldr13: ld @($R13,$Rj),$Ri */
2328
2329 SEM_PC
2330 SEM_FN_NAME (fr30bf,ldr13) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2331 {
2332 #define FLD(f) abuf->fields.fmt_ldr13.f
2333 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2334 int UNUSED written = 0;
2335 IADDR UNUSED pc = abuf->addr;
2336 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2337
2338 {
2339 SI opval = GETMEMSI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])));
2340 * FLD (i_Ri) = opval;
2341 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2342 }
2343
2344 return vpc;
2345 #undef FLD
2346 }
2347
2348 /* ldr13uh: lduh @($R13,$Rj),$Ri */
2349
2350 SEM_PC
2351 SEM_FN_NAME (fr30bf,ldr13uh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2352 {
2353 #define FLD(f) abuf->fields.fmt_ldr13.f
2354 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2355 int UNUSED written = 0;
2356 IADDR UNUSED pc = abuf->addr;
2357 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2358
2359 {
2360 SI opval = GETMEMUHI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])));
2361 * FLD (i_Ri) = opval;
2362 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2363 }
2364
2365 return vpc;
2366 #undef FLD
2367 }
2368
2369 /* ldr13ub: ldub @($R13,$Rj),$Ri */
2370
2371 SEM_PC
2372 SEM_FN_NAME (fr30bf,ldr13ub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2373 {
2374 #define FLD(f) abuf->fields.fmt_ldr13.f
2375 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2376 int UNUSED written = 0;
2377 IADDR UNUSED pc = abuf->addr;
2378 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2379
2380 {
2381 SI opval = GETMEMUQI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])));
2382 * FLD (i_Ri) = opval;
2383 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2384 }
2385
2386 return vpc;
2387 #undef FLD
2388 }
2389
2390 /* ldr14: ld @($R14,$disp10),$Ri */
2391
2392 SEM_PC
2393 SEM_FN_NAME (fr30bf,ldr14) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2394 {
2395 #define FLD(f) abuf->fields.fmt_ldr14.f
2396 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2397 int UNUSED written = 0;
2398 IADDR UNUSED pc = abuf->addr;
2399 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2400
2401 {
2402 SI opval = GETMEMSI (current_cpu, pc, ADDSI (FLD (f_disp10), CPU (h_gr[((UINT) 14)])));
2403 * FLD (i_Ri) = opval;
2404 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2405 }
2406
2407 return vpc;
2408 #undef FLD
2409 }
2410
2411 /* ldr14uh: lduh @($R14,$disp9),$Ri */
2412
2413 SEM_PC
2414 SEM_FN_NAME (fr30bf,ldr14uh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2415 {
2416 #define FLD(f) abuf->fields.fmt_ldr14uh.f
2417 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2418 int UNUSED written = 0;
2419 IADDR UNUSED pc = abuf->addr;
2420 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2421
2422 {
2423 SI opval = GETMEMUHI (current_cpu, pc, ADDSI (FLD (f_disp9), CPU (h_gr[((UINT) 14)])));
2424 * FLD (i_Ri) = opval;
2425 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2426 }
2427
2428 return vpc;
2429 #undef FLD
2430 }
2431
2432 /* ldr14ub: ldub @($R14,$disp8),$Ri */
2433
2434 SEM_PC
2435 SEM_FN_NAME (fr30bf,ldr14ub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2436 {
2437 #define FLD(f) abuf->fields.fmt_ldr14ub.f
2438 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2439 int UNUSED written = 0;
2440 IADDR UNUSED pc = abuf->addr;
2441 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2442
2443 {
2444 SI opval = GETMEMUQI (current_cpu, pc, ADDSI (FLD (f_disp8), CPU (h_gr[((UINT) 14)])));
2445 * FLD (i_Ri) = opval;
2446 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2447 }
2448
2449 return vpc;
2450 #undef FLD
2451 }
2452
2453 /* ldr15: ld @($R15,$udisp6),$Ri */
2454
2455 SEM_PC
2456 SEM_FN_NAME (fr30bf,ldr15) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2457 {
2458 #define FLD(f) abuf->fields.fmt_ldr15.f
2459 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2460 int UNUSED written = 0;
2461 IADDR UNUSED pc = abuf->addr;
2462 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2463
2464 {
2465 SI opval = GETMEMSI (current_cpu, pc, ADDSI (FLD (f_udisp6), CPU (h_gr[((UINT) 15)])));
2466 * FLD (i_Ri) = opval;
2467 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2468 }
2469
2470 return vpc;
2471 #undef FLD
2472 }
2473
2474 /* ldr15gr: ld @$R15+,$Ri */
2475
2476 SEM_PC
2477 SEM_FN_NAME (fr30bf,ldr15gr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2478 {
2479 #define FLD(f) abuf->fields.fmt_ldr15gr.f
2480 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2481 int UNUSED written = 0;
2482 IADDR UNUSED pc = abuf->addr;
2483 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2484
2485 {
2486 {
2487 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
2488 * FLD (i_Ri) = opval;
2489 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2490 }
2491 if (NESI (FLD (f_Ri), 15)) {
2492 {
2493 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
2494 CPU (h_gr[((UINT) 15)]) = opval;
2495 written |= (1 << 4);
2496 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2497 }
2498 }
2499 }
2500
2501 abuf->written = written;
2502 return vpc;
2503 #undef FLD
2504 }
2505
2506 /* ldr15dr: ld @$R15+,$Rs2 */
2507
2508 SEM_PC
2509 SEM_FN_NAME (fr30bf,ldr15dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2510 {
2511 #define FLD(f) abuf->fields.fmt_ldr15dr.f
2512 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2513 int UNUSED written = 0;
2514 IADDR UNUSED pc = abuf->addr;
2515 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2516
2517 {
2518 SI tmp_tmp;
2519 tmp_tmp = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
2520 {
2521 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
2522 CPU (h_gr[((UINT) 15)]) = opval;
2523 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2524 }
2525 {
2526 SI opval = tmp_tmp;
2527 SET_H_DR (FLD (f_Rs2), opval);
2528 TRACE_RESULT (current_cpu, abuf, "Rs2", 'x', opval);
2529 }
2530 }
2531
2532 return vpc;
2533 #undef FLD
2534 }
2535
2536 /* ldr15ps: ld @$R15+,$ps */
2537
2538 SEM_PC
2539 SEM_FN_NAME (fr30bf,ldr15ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2540 {
2541 #define FLD(f) abuf->fields.fmt_ldr15ps.f
2542 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2543 int UNUSED written = 0;
2544 IADDR UNUSED pc = abuf->addr;
2545 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2546
2547 {
2548 {
2549 USI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
2550 SET_H_PS (opval);
2551 TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval);
2552 }
2553 {
2554 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
2555 CPU (h_gr[((UINT) 15)]) = opval;
2556 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2557 }
2558 }
2559
2560 return vpc;
2561 #undef FLD
2562 }
2563
2564 /* st: st $Ri,@$Rj */
2565
2566 SEM_PC
2567 SEM_FN_NAME (fr30bf,st) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2568 {
2569 #define FLD(f) abuf->fields.fmt_st.f
2570 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2571 int UNUSED written = 0;
2572 IADDR UNUSED pc = abuf->addr;
2573 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2574
2575 {
2576 SI opval = * FLD (i_Ri);
2577 SETMEMSI (current_cpu, pc, * FLD (i_Rj), opval);
2578 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2579 }
2580
2581 return vpc;
2582 #undef FLD
2583 }
2584
2585 /* sth: sth $Ri,@$Rj */
2586
2587 SEM_PC
2588 SEM_FN_NAME (fr30bf,sth) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2589 {
2590 #define FLD(f) abuf->fields.fmt_st.f
2591 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2592 int UNUSED written = 0;
2593 IADDR UNUSED pc = abuf->addr;
2594 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2595
2596 {
2597 HI opval = * FLD (i_Ri);
2598 SETMEMHI (current_cpu, pc, * FLD (i_Rj), opval);
2599 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2600 }
2601
2602 return vpc;
2603 #undef FLD
2604 }
2605
2606 /* stb: stb $Ri,@$Rj */
2607
2608 SEM_PC
2609 SEM_FN_NAME (fr30bf,stb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2610 {
2611 #define FLD(f) abuf->fields.fmt_st.f
2612 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2613 int UNUSED written = 0;
2614 IADDR UNUSED pc = abuf->addr;
2615 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2616
2617 {
2618 QI opval = * FLD (i_Ri);
2619 SETMEMQI (current_cpu, pc, * FLD (i_Rj), opval);
2620 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2621 }
2622
2623 return vpc;
2624 #undef FLD
2625 }
2626
2627 /* str13: st $Ri,@($R13,$Rj) */
2628
2629 SEM_PC
2630 SEM_FN_NAME (fr30bf,str13) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2631 {
2632 #define FLD(f) abuf->fields.fmt_str13.f
2633 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2634 int UNUSED written = 0;
2635 IADDR UNUSED pc = abuf->addr;
2636 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2637
2638 {
2639 SI opval = * FLD (i_Ri);
2640 SETMEMSI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval);
2641 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2642 }
2643
2644 return vpc;
2645 #undef FLD
2646 }
2647
2648 /* str13h: sth $Ri,@($R13,$Rj) */
2649
2650 SEM_PC
2651 SEM_FN_NAME (fr30bf,str13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2652 {
2653 #define FLD(f) abuf->fields.fmt_str13.f
2654 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2655 int UNUSED written = 0;
2656 IADDR UNUSED pc = abuf->addr;
2657 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2658
2659 {
2660 HI opval = * FLD (i_Ri);
2661 SETMEMHI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval);
2662 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2663 }
2664
2665 return vpc;
2666 #undef FLD
2667 }
2668
2669 /* str13b: stb $Ri,@($R13,$Rj) */
2670
2671 SEM_PC
2672 SEM_FN_NAME (fr30bf,str13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2673 {
2674 #define FLD(f) abuf->fields.fmt_str13.f
2675 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2676 int UNUSED written = 0;
2677 IADDR UNUSED pc = abuf->addr;
2678 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2679
2680 {
2681 QI opval = * FLD (i_Ri);
2682 SETMEMQI (current_cpu, pc, ADDSI (* FLD (i_Rj), CPU (h_gr[((UINT) 13)])), opval);
2683 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2684 }
2685
2686 return vpc;
2687 #undef FLD
2688 }
2689
2690 /* str14: st $Ri,@($R14,$disp10) */
2691
2692 SEM_PC
2693 SEM_FN_NAME (fr30bf,str14) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2694 {
2695 #define FLD(f) abuf->fields.fmt_str14.f
2696 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2697 int UNUSED written = 0;
2698 IADDR UNUSED pc = abuf->addr;
2699 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2700
2701 {
2702 SI opval = * FLD (i_Ri);
2703 SETMEMSI (current_cpu, pc, ADDSI (FLD (f_disp10), CPU (h_gr[((UINT) 14)])), opval);
2704 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2705 }
2706
2707 return vpc;
2708 #undef FLD
2709 }
2710
2711 /* str14h: sth $Ri,@($R14,$disp9) */
2712
2713 SEM_PC
2714 SEM_FN_NAME (fr30bf,str14h) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2715 {
2716 #define FLD(f) abuf->fields.fmt_str14h.f
2717 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2718 int UNUSED written = 0;
2719 IADDR UNUSED pc = abuf->addr;
2720 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2721
2722 {
2723 HI opval = * FLD (i_Ri);
2724 SETMEMHI (current_cpu, pc, ADDSI (FLD (f_disp9), CPU (h_gr[((UINT) 14)])), opval);
2725 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2726 }
2727
2728 return vpc;
2729 #undef FLD
2730 }
2731
2732 /* str14b: stb $Ri,@($R14,$disp8) */
2733
2734 SEM_PC
2735 SEM_FN_NAME (fr30bf,str14b) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2736 {
2737 #define FLD(f) abuf->fields.fmt_str14b.f
2738 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2739 int UNUSED written = 0;
2740 IADDR UNUSED pc = abuf->addr;
2741 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2742
2743 {
2744 QI opval = * FLD (i_Ri);
2745 SETMEMQI (current_cpu, pc, ADDSI (FLD (f_disp8), CPU (h_gr[((UINT) 14)])), opval);
2746 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2747 }
2748
2749 return vpc;
2750 #undef FLD
2751 }
2752
2753 /* str15: st $Ri,@($R15,$udisp6) */
2754
2755 SEM_PC
2756 SEM_FN_NAME (fr30bf,str15) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2757 {
2758 #define FLD(f) abuf->fields.fmt_str15.f
2759 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2760 int UNUSED written = 0;
2761 IADDR UNUSED pc = abuf->addr;
2762 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2763
2764 {
2765 SI opval = * FLD (i_Ri);
2766 SETMEMSI (current_cpu, pc, ADDSI (CPU (h_gr[((UINT) 15)]), FLD (f_udisp6)), opval);
2767 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2768 }
2769
2770 return vpc;
2771 #undef FLD
2772 }
2773
2774 /* str15gr: st $Ri,@-$R15 */
2775
2776 SEM_PC
2777 SEM_FN_NAME (fr30bf,str15gr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2778 {
2779 #define FLD(f) abuf->fields.fmt_str15gr.f
2780 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2781 int UNUSED written = 0;
2782 IADDR UNUSED pc = abuf->addr;
2783 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2784
2785 {
2786 SI tmp_tmp;
2787 tmp_tmp = * FLD (i_Ri);
2788 {
2789 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
2790 CPU (h_gr[((UINT) 15)]) = opval;
2791 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2792 }
2793 {
2794 SI opval = tmp_tmp;
2795 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
2796 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2797 }
2798 }
2799
2800 return vpc;
2801 #undef FLD
2802 }
2803
2804 /* str15dr: st $Rs2,@-$R15 */
2805
2806 SEM_PC
2807 SEM_FN_NAME (fr30bf,str15dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2808 {
2809 #define FLD(f) abuf->fields.fmt_str15dr.f
2810 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2811 int UNUSED written = 0;
2812 IADDR UNUSED pc = abuf->addr;
2813 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2814
2815 {
2816 SI tmp_tmp;
2817 tmp_tmp = GET_H_DR (FLD (f_Rs2));
2818 {
2819 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
2820 CPU (h_gr[((UINT) 15)]) = opval;
2821 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2822 }
2823 {
2824 SI opval = tmp_tmp;
2825 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
2826 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2827 }
2828 }
2829
2830 return vpc;
2831 #undef FLD
2832 }
2833
2834 /* str15ps: st $ps,@-$R15 */
2835
2836 SEM_PC
2837 SEM_FN_NAME (fr30bf,str15ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2838 {
2839 #define FLD(f) abuf->fields.fmt_str15ps.f
2840 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2841 int UNUSED written = 0;
2842 IADDR UNUSED pc = abuf->addr;
2843 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2844
2845 {
2846 {
2847 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
2848 CPU (h_gr[((UINT) 15)]) = opval;
2849 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
2850 }
2851 {
2852 SI opval = GET_H_PS ();
2853 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
2854 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
2855 }
2856 }
2857
2858 return vpc;
2859 #undef FLD
2860 }
2861
2862 /* mov: mov $Rj,$Ri */
2863
2864 SEM_PC
2865 SEM_FN_NAME (fr30bf,mov) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2866 {
2867 #define FLD(f) abuf->fields.fmt_mov.f
2868 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2869 int UNUSED written = 0;
2870 IADDR UNUSED pc = abuf->addr;
2871 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2872
2873 {
2874 SI opval = * FLD (i_Rj);
2875 * FLD (i_Ri) = opval;
2876 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2877 }
2878
2879 return vpc;
2880 #undef FLD
2881 }
2882
2883 /* movdr: mov $Rs1,$Ri */
2884
2885 SEM_PC
2886 SEM_FN_NAME (fr30bf,movdr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2887 {
2888 #define FLD(f) abuf->fields.fmt_movdr.f
2889 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2890 int UNUSED written = 0;
2891 IADDR UNUSED pc = abuf->addr;
2892 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2893
2894 {
2895 SI opval = GET_H_DR (FLD (f_Rs1));
2896 * FLD (i_Ri) = opval;
2897 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2898 }
2899
2900 return vpc;
2901 #undef FLD
2902 }
2903
2904 /* movps: mov $ps,$Ri */
2905
2906 SEM_PC
2907 SEM_FN_NAME (fr30bf,movps) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2908 {
2909 #define FLD(f) abuf->fields.fmt_movps.f
2910 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2911 int UNUSED written = 0;
2912 IADDR UNUSED pc = abuf->addr;
2913 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2914
2915 {
2916 SI opval = GET_H_PS ();
2917 * FLD (i_Ri) = opval;
2918 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
2919 }
2920
2921 return vpc;
2922 #undef FLD
2923 }
2924
2925 /* mov2dr: mov $Ri,$Rs1 */
2926
2927 SEM_PC
2928 SEM_FN_NAME (fr30bf,mov2dr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2929 {
2930 #define FLD(f) abuf->fields.fmt_mov2dr.f
2931 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2932 int UNUSED written = 0;
2933 IADDR UNUSED pc = abuf->addr;
2934 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2935
2936 {
2937 SI opval = * FLD (i_Ri);
2938 SET_H_DR (FLD (f_Rs1), opval);
2939 TRACE_RESULT (current_cpu, abuf, "Rs1", 'x', opval);
2940 }
2941
2942 return vpc;
2943 #undef FLD
2944 }
2945
2946 /* mov2ps: mov $Ri,$ps */
2947
2948 SEM_PC
2949 SEM_FN_NAME (fr30bf,mov2ps) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2950 {
2951 #define FLD(f) abuf->fields.fmt_mov2ps.f
2952 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2953 int UNUSED written = 0;
2954 IADDR UNUSED pc = abuf->addr;
2955 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2956
2957 {
2958 USI opval = * FLD (i_Ri);
2959 SET_H_PS (opval);
2960 TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval);
2961 }
2962
2963 return vpc;
2964 #undef FLD
2965 }
2966
2967 /* jmp: jmp @$Ri */
2968
2969 SEM_PC
2970 SEM_FN_NAME (fr30bf,jmp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2971 {
2972 #define FLD(f) abuf->fields.cti.fields.fmt_jmp.f
2973 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2974 int UNUSED written = 0;
2975 IADDR UNUSED pc = abuf->addr;
2976 SEM_BRANCH_INIT
2977 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
2978
2979 {
2980 USI opval = * FLD (i_Ri);
2981 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
2982 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
2983 }
2984
2985 SEM_BRANCH_FINI (vpc);
2986 return vpc;
2987 #undef FLD
2988 }
2989
2990 /* jmpd: jmp:d @$Ri */
2991
2992 SEM_PC
2993 SEM_FN_NAME (fr30bf,jmpd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2994 {
2995 #define FLD(f) abuf->fields.cti.fields.fmt_jmp.f
2996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2997 int UNUSED written = 0;
2998 IADDR UNUSED pc = abuf->addr;
2999 SEM_BRANCH_INIT
3000 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3001
3002 {
3003 {
3004 USI opval = * FLD (i_Ri);
3005 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3006 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3007 }
3008 }
3009
3010 SEM_BRANCH_FINI (vpc);
3011 return vpc;
3012 #undef FLD
3013 }
3014
3015 /* callr: call @$Ri */
3016
3017 SEM_PC
3018 SEM_FN_NAME (fr30bf,callr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3019 {
3020 #define FLD(f) abuf->fields.cti.fields.fmt_callr.f
3021 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3022 int UNUSED written = 0;
3023 IADDR UNUSED pc = abuf->addr;
3024 SEM_BRANCH_INIT
3025 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3026
3027 {
3028 {
3029 SI opval = ADDSI (pc, 2);
3030 SET_H_DR (((UINT) 1), opval);
3031 TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval);
3032 }
3033 {
3034 USI opval = * FLD (i_Ri);
3035 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3036 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3037 }
3038 }
3039
3040 SEM_BRANCH_FINI (vpc);
3041 return vpc;
3042 #undef FLD
3043 }
3044
3045 /* callrd: call:d @$Ri */
3046
3047 SEM_PC
3048 SEM_FN_NAME (fr30bf,callrd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3049 {
3050 #define FLD(f) abuf->fields.cti.fields.fmt_callr.f
3051 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3052 int UNUSED written = 0;
3053 IADDR UNUSED pc = abuf->addr;
3054 SEM_BRANCH_INIT
3055 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3056
3057 {
3058 {
3059 {
3060 SI opval = ADDSI (pc, 4);
3061 SET_H_DR (((UINT) 1), opval);
3062 TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval);
3063 }
3064 {
3065 USI opval = * FLD (i_Ri);
3066 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3067 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3068 }
3069 }
3070 }
3071
3072 SEM_BRANCH_FINI (vpc);
3073 return vpc;
3074 #undef FLD
3075 }
3076
3077 /* call: call $label12 */
3078
3079 SEM_PC
3080 SEM_FN_NAME (fr30bf,call) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3081 {
3082 #define FLD(f) abuf->fields.cti.fields.fmt_call.f
3083 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3084 int UNUSED written = 0;
3085 IADDR UNUSED pc = abuf->addr;
3086 SEM_BRANCH_INIT
3087 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3088
3089 {
3090 {
3091 SI opval = ADDSI (pc, 2);
3092 SET_H_DR (((UINT) 1), opval);
3093 TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval);
3094 }
3095 {
3096 USI opval = FLD (i_label12);
3097 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3098 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3099 }
3100 }
3101
3102 SEM_BRANCH_FINI (vpc);
3103 return vpc;
3104 #undef FLD
3105 }
3106
3107 /* calld: call:d $label12 */
3108
3109 SEM_PC
3110 SEM_FN_NAME (fr30bf,calld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3111 {
3112 #define FLD(f) abuf->fields.cti.fields.fmt_call.f
3113 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3114 int UNUSED written = 0;
3115 IADDR UNUSED pc = abuf->addr;
3116 SEM_BRANCH_INIT
3117 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3118
3119 {
3120 {
3121 {
3122 SI opval = ADDSI (pc, 4);
3123 SET_H_DR (((UINT) 1), opval);
3124 TRACE_RESULT (current_cpu, abuf, "dr-1", 'x', opval);
3125 }
3126 {
3127 USI opval = FLD (i_label12);
3128 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3129 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3130 }
3131 }
3132 }
3133
3134 SEM_BRANCH_FINI (vpc);
3135 return vpc;
3136 #undef FLD
3137 }
3138
3139 /* ret: ret */
3140
3141 SEM_PC
3142 SEM_FN_NAME (fr30bf,ret) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3143 {
3144 #define FLD(f) abuf->fields.cti.fields.fmt_ret.f
3145 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3146 int UNUSED written = 0;
3147 IADDR UNUSED pc = abuf->addr;
3148 SEM_BRANCH_INIT
3149 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3150
3151 {
3152 USI opval = GET_H_DR (((UINT) 1));
3153 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3154 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3155 }
3156
3157 SEM_BRANCH_FINI (vpc);
3158 return vpc;
3159 #undef FLD
3160 }
3161
3162 /* ret:d: ret:d */
3163
3164 SEM_PC
3165 SEM_FN_NAME (fr30bf,ret_d) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3166 {
3167 #define FLD(f) abuf->fields.cti.fields.fmt_ret.f
3168 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3169 int UNUSED written = 0;
3170 IADDR UNUSED pc = abuf->addr;
3171 SEM_BRANCH_INIT
3172 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3173
3174 {
3175 {
3176 USI opval = GET_H_DR (((UINT) 1));
3177 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3178 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3179 }
3180 }
3181
3182 SEM_BRANCH_FINI (vpc);
3183 return vpc;
3184 #undef FLD
3185 }
3186
3187 /* int: int $u8 */
3188
3189 SEM_PC
3190 SEM_FN_NAME (fr30bf,int) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3191 {
3192 #define FLD(f) abuf->fields.cti.fields.fmt_int.f
3193 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3194 int UNUSED written = 0;
3195 IADDR UNUSED pc = abuf->addr;
3196 SEM_BRANCH_INIT
3197 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3198
3199 {
3200 ; /*clobber*/
3201 ; /*clobber*/
3202 ; /*clobber*/
3203 {
3204 SI opval = fr30_int (current_cpu, pc, FLD (f_u8));
3205 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3206 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3207 }
3208 }
3209
3210 SEM_BRANCH_FINI (vpc);
3211 return vpc;
3212 #undef FLD
3213 }
3214
3215 /* inte: inte */
3216
3217 SEM_PC
3218 SEM_FN_NAME (fr30bf,inte) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3219 {
3220 #define FLD(f) abuf->fields.cti.fields.fmt_inte.f
3221 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3222 int UNUSED written = 0;
3223 IADDR UNUSED pc = abuf->addr;
3224 SEM_BRANCH_INIT
3225 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3226
3227 {
3228 ; /*clobber*/
3229 ; /*clobber*/
3230 ; /*clobber*/
3231 {
3232 SI opval = fr30_inte (current_cpu, pc);
3233 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3234 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3235 }
3236 }
3237
3238 SEM_BRANCH_FINI (vpc);
3239 return vpc;
3240 #undef FLD
3241 }
3242
3243 /* reti: reti */
3244
3245 SEM_PC
3246 SEM_FN_NAME (fr30bf,reti) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3247 {
3248 #define FLD(f) abuf->fields.cti.fields.fmt_reti.f
3249 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3250 int UNUSED written = 0;
3251 IADDR UNUSED pc = abuf->addr;
3252 SEM_BRANCH_INIT
3253 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3254
3255 if (EQBI (GET_H_SBIT (), 0)) {
3256 {
3257 {
3258 SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 2)));
3259 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3260 written |= (1 << 7);
3261 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3262 }
3263 {
3264 SI opval = ADDSI (GET_H_DR (((UINT) 2)), 4);
3265 SET_H_DR (((UINT) 2), opval);
3266 written |= (1 << 5);
3267 TRACE_RESULT (current_cpu, abuf, "dr-2", 'x', opval);
3268 }
3269 {
3270 SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 2)));
3271 SET_H_PS (opval);
3272 written |= (1 << 8);
3273 TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval);
3274 }
3275 {
3276 SI opval = ADDSI (GET_H_DR (((UINT) 2)), 4);
3277 SET_H_DR (((UINT) 2), opval);
3278 written |= (1 << 5);
3279 TRACE_RESULT (current_cpu, abuf, "dr-2", 'x', opval);
3280 }
3281 }
3282 } else {
3283 {
3284 {
3285 SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 3)));
3286 SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
3287 written |= (1 << 7);
3288 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3289 }
3290 {
3291 SI opval = ADDSI (GET_H_DR (((UINT) 3)), 4);
3292 SET_H_DR (((UINT) 3), opval);
3293 written |= (1 << 6);
3294 TRACE_RESULT (current_cpu, abuf, "dr-3", 'x', opval);
3295 }
3296 {
3297 SI opval = GETMEMSI (current_cpu, pc, GET_H_DR (((UINT) 3)));
3298 SET_H_PS (opval);
3299 written |= (1 << 8);
3300 TRACE_RESULT (current_cpu, abuf, "ps", 'x', opval);
3301 }
3302 {
3303 SI opval = ADDSI (GET_H_DR (((UINT) 3)), 4);
3304 SET_H_DR (((UINT) 3), opval);
3305 written |= (1 << 6);
3306 TRACE_RESULT (current_cpu, abuf, "dr-3", 'x', opval);
3307 }
3308 }
3309 }
3310
3311 abuf->written = written;
3312 SEM_BRANCH_FINI (vpc);
3313 return vpc;
3314 #undef FLD
3315 }
3316
3317 /* brad: bra:d $label9 */
3318
3319 SEM_PC
3320 SEM_FN_NAME (fr30bf,brad) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3321 {
3322 #define FLD(f) abuf->fields.cti.fields.fmt_brad.f
3323 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3324 int UNUSED written = 0;
3325 IADDR UNUSED pc = abuf->addr;
3326 SEM_BRANCH_INIT
3327 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3328
3329 {
3330 {
3331 USI opval = FLD (i_label9);
3332 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3333 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3334 }
3335 }
3336
3337 SEM_BRANCH_FINI (vpc);
3338 return vpc;
3339 #undef FLD
3340 }
3341
3342 /* bra: bra $label9 */
3343
3344 SEM_PC
3345 SEM_FN_NAME (fr30bf,bra) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3346 {
3347 #define FLD(f) abuf->fields.cti.fields.fmt_brad.f
3348 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3349 int UNUSED written = 0;
3350 IADDR UNUSED pc = abuf->addr;
3351 SEM_BRANCH_INIT
3352 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3353
3354 {
3355 USI opval = FLD (i_label9);
3356 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3357 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3358 }
3359
3360 SEM_BRANCH_FINI (vpc);
3361 return vpc;
3362 #undef FLD
3363 }
3364
3365 /* bnod: bno:d $label9 */
3366
3367 SEM_PC
3368 SEM_FN_NAME (fr30bf,bnod) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3369 {
3370 #define FLD(f) abuf->fields.fmt_bnod.f
3371 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3372 int UNUSED written = 0;
3373 IADDR UNUSED pc = abuf->addr;
3374 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3375
3376 {
3377 do { } while (0); /*nop*/
3378 }
3379
3380 return vpc;
3381 #undef FLD
3382 }
3383
3384 /* bno: bno $label9 */
3385
3386 SEM_PC
3387 SEM_FN_NAME (fr30bf,bno) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3388 {
3389 #define FLD(f) abuf->fields.fmt_bnod.f
3390 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3391 int UNUSED written = 0;
3392 IADDR UNUSED pc = abuf->addr;
3393 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3394
3395 do { } while (0); /*nop*/
3396
3397 return vpc;
3398 #undef FLD
3399 }
3400
3401 /* beqd: beq:d $label9 */
3402
3403 SEM_PC
3404 SEM_FN_NAME (fr30bf,beqd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3405 {
3406 #define FLD(f) abuf->fields.cti.fields.fmt_beqd.f
3407 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3408 int UNUSED written = 0;
3409 IADDR UNUSED pc = abuf->addr;
3410 SEM_BRANCH_INIT
3411 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3412
3413 {
3414 if (CPU (h_zbit)) {
3415 {
3416 USI opval = FLD (i_label9);
3417 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3418 written |= (1 << 2);
3419 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3420 }
3421 }
3422 }
3423
3424 abuf->written = written;
3425 SEM_BRANCH_FINI (vpc);
3426 return vpc;
3427 #undef FLD
3428 }
3429
3430 /* beq: beq $label9 */
3431
3432 SEM_PC
3433 SEM_FN_NAME (fr30bf,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3434 {
3435 #define FLD(f) abuf->fields.cti.fields.fmt_beqd.f
3436 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3437 int UNUSED written = 0;
3438 IADDR UNUSED pc = abuf->addr;
3439 SEM_BRANCH_INIT
3440 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3441
3442 if (CPU (h_zbit)) {
3443 {
3444 USI opval = FLD (i_label9);
3445 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3446 written |= (1 << 2);
3447 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3448 }
3449 }
3450
3451 abuf->written = written;
3452 SEM_BRANCH_FINI (vpc);
3453 return vpc;
3454 #undef FLD
3455 }
3456
3457 /* bned: bne:d $label9 */
3458
3459 SEM_PC
3460 SEM_FN_NAME (fr30bf,bned) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3461 {
3462 #define FLD(f) abuf->fields.cti.fields.fmt_beqd.f
3463 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3464 int UNUSED written = 0;
3465 IADDR UNUSED pc = abuf->addr;
3466 SEM_BRANCH_INIT
3467 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3468
3469 {
3470 if (NOTBI (CPU (h_zbit))) {
3471 {
3472 USI opval = FLD (i_label9);
3473 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3474 written |= (1 << 2);
3475 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3476 }
3477 }
3478 }
3479
3480 abuf->written = written;
3481 SEM_BRANCH_FINI (vpc);
3482 return vpc;
3483 #undef FLD
3484 }
3485
3486 /* bne: bne $label9 */
3487
3488 SEM_PC
3489 SEM_FN_NAME (fr30bf,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3490 {
3491 #define FLD(f) abuf->fields.cti.fields.fmt_beqd.f
3492 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3493 int UNUSED written = 0;
3494 IADDR UNUSED pc = abuf->addr;
3495 SEM_BRANCH_INIT
3496 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3497
3498 if (NOTBI (CPU (h_zbit))) {
3499 {
3500 USI opval = FLD (i_label9);
3501 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3502 written |= (1 << 2);
3503 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3504 }
3505 }
3506
3507 abuf->written = written;
3508 SEM_BRANCH_FINI (vpc);
3509 return vpc;
3510 #undef FLD
3511 }
3512
3513 /* bcd: bc:d $label9 */
3514
3515 SEM_PC
3516 SEM_FN_NAME (fr30bf,bcd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3517 {
3518 #define FLD(f) abuf->fields.cti.fields.fmt_bcd.f
3519 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3520 int UNUSED written = 0;
3521 IADDR UNUSED pc = abuf->addr;
3522 SEM_BRANCH_INIT
3523 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3524
3525 {
3526 if (CPU (h_cbit)) {
3527 {
3528 USI opval = FLD (i_label9);
3529 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3530 written |= (1 << 2);
3531 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3532 }
3533 }
3534 }
3535
3536 abuf->written = written;
3537 SEM_BRANCH_FINI (vpc);
3538 return vpc;
3539 #undef FLD
3540 }
3541
3542 /* bc: bc $label9 */
3543
3544 SEM_PC
3545 SEM_FN_NAME (fr30bf,bc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3546 {
3547 #define FLD(f) abuf->fields.cti.fields.fmt_bcd.f
3548 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3549 int UNUSED written = 0;
3550 IADDR UNUSED pc = abuf->addr;
3551 SEM_BRANCH_INIT
3552 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3553
3554 if (CPU (h_cbit)) {
3555 {
3556 USI opval = FLD (i_label9);
3557 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3558 written |= (1 << 2);
3559 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3560 }
3561 }
3562
3563 abuf->written = written;
3564 SEM_BRANCH_FINI (vpc);
3565 return vpc;
3566 #undef FLD
3567 }
3568
3569 /* bncd: bnc:d $label9 */
3570
3571 SEM_PC
3572 SEM_FN_NAME (fr30bf,bncd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3573 {
3574 #define FLD(f) abuf->fields.cti.fields.fmt_bcd.f
3575 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3576 int UNUSED written = 0;
3577 IADDR UNUSED pc = abuf->addr;
3578 SEM_BRANCH_INIT
3579 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3580
3581 {
3582 if (NOTBI (CPU (h_cbit))) {
3583 {
3584 USI opval = FLD (i_label9);
3585 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3586 written |= (1 << 2);
3587 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3588 }
3589 }
3590 }
3591
3592 abuf->written = written;
3593 SEM_BRANCH_FINI (vpc);
3594 return vpc;
3595 #undef FLD
3596 }
3597
3598 /* bnc: bnc $label9 */
3599
3600 SEM_PC
3601 SEM_FN_NAME (fr30bf,bnc) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3602 {
3603 #define FLD(f) abuf->fields.cti.fields.fmt_bcd.f
3604 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3605 int UNUSED written = 0;
3606 IADDR UNUSED pc = abuf->addr;
3607 SEM_BRANCH_INIT
3608 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3609
3610 if (NOTBI (CPU (h_cbit))) {
3611 {
3612 USI opval = FLD (i_label9);
3613 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3614 written |= (1 << 2);
3615 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3616 }
3617 }
3618
3619 abuf->written = written;
3620 SEM_BRANCH_FINI (vpc);
3621 return vpc;
3622 #undef FLD
3623 }
3624
3625 /* bnd: bn:d $label9 */
3626
3627 SEM_PC
3628 SEM_FN_NAME (fr30bf,bnd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3629 {
3630 #define FLD(f) abuf->fields.cti.fields.fmt_bnd.f
3631 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3632 int UNUSED written = 0;
3633 IADDR UNUSED pc = abuf->addr;
3634 SEM_BRANCH_INIT
3635 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3636
3637 {
3638 if (CPU (h_nbit)) {
3639 {
3640 USI opval = FLD (i_label9);
3641 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3642 written |= (1 << 2);
3643 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3644 }
3645 }
3646 }
3647
3648 abuf->written = written;
3649 SEM_BRANCH_FINI (vpc);
3650 return vpc;
3651 #undef FLD
3652 }
3653
3654 /* bn: bn $label9 */
3655
3656 SEM_PC
3657 SEM_FN_NAME (fr30bf,bn) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3658 {
3659 #define FLD(f) abuf->fields.cti.fields.fmt_bnd.f
3660 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3661 int UNUSED written = 0;
3662 IADDR UNUSED pc = abuf->addr;
3663 SEM_BRANCH_INIT
3664 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3665
3666 if (CPU (h_nbit)) {
3667 {
3668 USI opval = FLD (i_label9);
3669 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3670 written |= (1 << 2);
3671 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3672 }
3673 }
3674
3675 abuf->written = written;
3676 SEM_BRANCH_FINI (vpc);
3677 return vpc;
3678 #undef FLD
3679 }
3680
3681 /* bpd: bp:d $label9 */
3682
3683 SEM_PC
3684 SEM_FN_NAME (fr30bf,bpd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3685 {
3686 #define FLD(f) abuf->fields.cti.fields.fmt_bnd.f
3687 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3688 int UNUSED written = 0;
3689 IADDR UNUSED pc = abuf->addr;
3690 SEM_BRANCH_INIT
3691 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3692
3693 {
3694 if (NOTBI (CPU (h_nbit))) {
3695 {
3696 USI opval = FLD (i_label9);
3697 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3698 written |= (1 << 2);
3699 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3700 }
3701 }
3702 }
3703
3704 abuf->written = written;
3705 SEM_BRANCH_FINI (vpc);
3706 return vpc;
3707 #undef FLD
3708 }
3709
3710 /* bp: bp $label9 */
3711
3712 SEM_PC
3713 SEM_FN_NAME (fr30bf,bp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3714 {
3715 #define FLD(f) abuf->fields.cti.fields.fmt_bnd.f
3716 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3717 int UNUSED written = 0;
3718 IADDR UNUSED pc = abuf->addr;
3719 SEM_BRANCH_INIT
3720 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3721
3722 if (NOTBI (CPU (h_nbit))) {
3723 {
3724 USI opval = FLD (i_label9);
3725 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3726 written |= (1 << 2);
3727 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3728 }
3729 }
3730
3731 abuf->written = written;
3732 SEM_BRANCH_FINI (vpc);
3733 return vpc;
3734 #undef FLD
3735 }
3736
3737 /* bvd: bv:d $label9 */
3738
3739 SEM_PC
3740 SEM_FN_NAME (fr30bf,bvd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3741 {
3742 #define FLD(f) abuf->fields.cti.fields.fmt_bvd.f
3743 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3744 int UNUSED written = 0;
3745 IADDR UNUSED pc = abuf->addr;
3746 SEM_BRANCH_INIT
3747 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3748
3749 {
3750 if (CPU (h_vbit)) {
3751 {
3752 USI opval = FLD (i_label9);
3753 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3754 written |= (1 << 2);
3755 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3756 }
3757 }
3758 }
3759
3760 abuf->written = written;
3761 SEM_BRANCH_FINI (vpc);
3762 return vpc;
3763 #undef FLD
3764 }
3765
3766 /* bv: bv $label9 */
3767
3768 SEM_PC
3769 SEM_FN_NAME (fr30bf,bv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3770 {
3771 #define FLD(f) abuf->fields.cti.fields.fmt_bvd.f
3772 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3773 int UNUSED written = 0;
3774 IADDR UNUSED pc = abuf->addr;
3775 SEM_BRANCH_INIT
3776 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3777
3778 if (CPU (h_vbit)) {
3779 {
3780 USI opval = FLD (i_label9);
3781 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3782 written |= (1 << 2);
3783 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3784 }
3785 }
3786
3787 abuf->written = written;
3788 SEM_BRANCH_FINI (vpc);
3789 return vpc;
3790 #undef FLD
3791 }
3792
3793 /* bnvd: bnv:d $label9 */
3794
3795 SEM_PC
3796 SEM_FN_NAME (fr30bf,bnvd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3797 {
3798 #define FLD(f) abuf->fields.cti.fields.fmt_bvd.f
3799 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3800 int UNUSED written = 0;
3801 IADDR UNUSED pc = abuf->addr;
3802 SEM_BRANCH_INIT
3803 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3804
3805 {
3806 if (NOTBI (CPU (h_vbit))) {
3807 {
3808 USI opval = FLD (i_label9);
3809 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3810 written |= (1 << 2);
3811 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3812 }
3813 }
3814 }
3815
3816 abuf->written = written;
3817 SEM_BRANCH_FINI (vpc);
3818 return vpc;
3819 #undef FLD
3820 }
3821
3822 /* bnv: bnv $label9 */
3823
3824 SEM_PC
3825 SEM_FN_NAME (fr30bf,bnv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3826 {
3827 #define FLD(f) abuf->fields.cti.fields.fmt_bvd.f
3828 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3829 int UNUSED written = 0;
3830 IADDR UNUSED pc = abuf->addr;
3831 SEM_BRANCH_INIT
3832 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3833
3834 if (NOTBI (CPU (h_vbit))) {
3835 {
3836 USI opval = FLD (i_label9);
3837 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3838 written |= (1 << 2);
3839 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3840 }
3841 }
3842
3843 abuf->written = written;
3844 SEM_BRANCH_FINI (vpc);
3845 return vpc;
3846 #undef FLD
3847 }
3848
3849 /* bltd: blt:d $label9 */
3850
3851 SEM_PC
3852 SEM_FN_NAME (fr30bf,bltd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3853 {
3854 #define FLD(f) abuf->fields.cti.fields.fmt_bltd.f
3855 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3856 int UNUSED written = 0;
3857 IADDR UNUSED pc = abuf->addr;
3858 SEM_BRANCH_INIT
3859 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3860
3861 {
3862 if (XORBI (CPU (h_vbit), CPU (h_nbit))) {
3863 {
3864 USI opval = FLD (i_label9);
3865 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3866 written |= (1 << 3);
3867 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3868 }
3869 }
3870 }
3871
3872 abuf->written = written;
3873 SEM_BRANCH_FINI (vpc);
3874 return vpc;
3875 #undef FLD
3876 }
3877
3878 /* blt: blt $label9 */
3879
3880 SEM_PC
3881 SEM_FN_NAME (fr30bf,blt) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3882 {
3883 #define FLD(f) abuf->fields.cti.fields.fmt_bltd.f
3884 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3885 int UNUSED written = 0;
3886 IADDR UNUSED pc = abuf->addr;
3887 SEM_BRANCH_INIT
3888 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3889
3890 if (XORBI (CPU (h_vbit), CPU (h_nbit))) {
3891 {
3892 USI opval = FLD (i_label9);
3893 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3894 written |= (1 << 3);
3895 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3896 }
3897 }
3898
3899 abuf->written = written;
3900 SEM_BRANCH_FINI (vpc);
3901 return vpc;
3902 #undef FLD
3903 }
3904
3905 /* bged: bge:d $label9 */
3906
3907 SEM_PC
3908 SEM_FN_NAME (fr30bf,bged) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3909 {
3910 #define FLD(f) abuf->fields.cti.fields.fmt_bltd.f
3911 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3912 int UNUSED written = 0;
3913 IADDR UNUSED pc = abuf->addr;
3914 SEM_BRANCH_INIT
3915 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3916
3917 {
3918 if (NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)))) {
3919 {
3920 USI opval = FLD (i_label9);
3921 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3922 written |= (1 << 3);
3923 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3924 }
3925 }
3926 }
3927
3928 abuf->written = written;
3929 SEM_BRANCH_FINI (vpc);
3930 return vpc;
3931 #undef FLD
3932 }
3933
3934 /* bge: bge $label9 */
3935
3936 SEM_PC
3937 SEM_FN_NAME (fr30bf,bge) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3938 {
3939 #define FLD(f) abuf->fields.cti.fields.fmt_bltd.f
3940 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3941 int UNUSED written = 0;
3942 IADDR UNUSED pc = abuf->addr;
3943 SEM_BRANCH_INIT
3944 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3945
3946 if (NOTBI (XORBI (CPU (h_vbit), CPU (h_nbit)))) {
3947 {
3948 USI opval = FLD (i_label9);
3949 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3950 written |= (1 << 3);
3951 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3952 }
3953 }
3954
3955 abuf->written = written;
3956 SEM_BRANCH_FINI (vpc);
3957 return vpc;
3958 #undef FLD
3959 }
3960
3961 /* bled: ble:d $label9 */
3962
3963 SEM_PC
3964 SEM_FN_NAME (fr30bf,bled) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3965 {
3966 #define FLD(f) abuf->fields.cti.fields.fmt_bled.f
3967 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3968 int UNUSED written = 0;
3969 IADDR UNUSED pc = abuf->addr;
3970 SEM_BRANCH_INIT
3971 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
3972
3973 {
3974 if (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit))) {
3975 {
3976 USI opval = FLD (i_label9);
3977 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
3978 written |= (1 << 4);
3979 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3980 }
3981 }
3982 }
3983
3984 abuf->written = written;
3985 SEM_BRANCH_FINI (vpc);
3986 return vpc;
3987 #undef FLD
3988 }
3989
3990 /* ble: ble $label9 */
3991
3992 SEM_PC
3993 SEM_FN_NAME (fr30bf,ble) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3994 {
3995 #define FLD(f) abuf->fields.cti.fields.fmt_bled.f
3996 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3997 int UNUSED written = 0;
3998 IADDR UNUSED pc = abuf->addr;
3999 SEM_BRANCH_INIT
4000 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4001
4002 if (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit))) {
4003 {
4004 USI opval = FLD (i_label9);
4005 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4006 written |= (1 << 4);
4007 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4008 }
4009 }
4010
4011 abuf->written = written;
4012 SEM_BRANCH_FINI (vpc);
4013 return vpc;
4014 #undef FLD
4015 }
4016
4017 /* bgtd: bgt:d $label9 */
4018
4019 SEM_PC
4020 SEM_FN_NAME (fr30bf,bgtd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4021 {
4022 #define FLD(f) abuf->fields.cti.fields.fmt_bled.f
4023 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4024 int UNUSED written = 0;
4025 IADDR UNUSED pc = abuf->addr;
4026 SEM_BRANCH_INIT
4027 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4028
4029 {
4030 if (NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)))) {
4031 {
4032 USI opval = FLD (i_label9);
4033 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4034 written |= (1 << 4);
4035 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4036 }
4037 }
4038 }
4039
4040 abuf->written = written;
4041 SEM_BRANCH_FINI (vpc);
4042 return vpc;
4043 #undef FLD
4044 }
4045
4046 /* bgt: bgt $label9 */
4047
4048 SEM_PC
4049 SEM_FN_NAME (fr30bf,bgt) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4050 {
4051 #define FLD(f) abuf->fields.cti.fields.fmt_bled.f
4052 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4053 int UNUSED written = 0;
4054 IADDR UNUSED pc = abuf->addr;
4055 SEM_BRANCH_INIT
4056 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4057
4058 if (NOTBI (ORBI (XORBI (CPU (h_vbit), CPU (h_nbit)), CPU (h_zbit)))) {
4059 {
4060 USI opval = FLD (i_label9);
4061 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4062 written |= (1 << 4);
4063 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4064 }
4065 }
4066
4067 abuf->written = written;
4068 SEM_BRANCH_FINI (vpc);
4069 return vpc;
4070 #undef FLD
4071 }
4072
4073 /* blsd: bls:d $label9 */
4074
4075 SEM_PC
4076 SEM_FN_NAME (fr30bf,blsd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4077 {
4078 #define FLD(f) abuf->fields.cti.fields.fmt_blsd.f
4079 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4080 int UNUSED written = 0;
4081 IADDR UNUSED pc = abuf->addr;
4082 SEM_BRANCH_INIT
4083 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4084
4085 {
4086 if (ORBI (CPU (h_cbit), CPU (h_zbit))) {
4087 {
4088 USI opval = FLD (i_label9);
4089 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4090 written |= (1 << 3);
4091 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4092 }
4093 }
4094 }
4095
4096 abuf->written = written;
4097 SEM_BRANCH_FINI (vpc);
4098 return vpc;
4099 #undef FLD
4100 }
4101
4102 /* bls: bls $label9 */
4103
4104 SEM_PC
4105 SEM_FN_NAME (fr30bf,bls) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4106 {
4107 #define FLD(f) abuf->fields.cti.fields.fmt_blsd.f
4108 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4109 int UNUSED written = 0;
4110 IADDR UNUSED pc = abuf->addr;
4111 SEM_BRANCH_INIT
4112 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4113
4114 if (ORBI (CPU (h_cbit), CPU (h_zbit))) {
4115 {
4116 USI opval = FLD (i_label9);
4117 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4118 written |= (1 << 3);
4119 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4120 }
4121 }
4122
4123 abuf->written = written;
4124 SEM_BRANCH_FINI (vpc);
4125 return vpc;
4126 #undef FLD
4127 }
4128
4129 /* bhid: bhi:d $label9 */
4130
4131 SEM_PC
4132 SEM_FN_NAME (fr30bf,bhid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4133 {
4134 #define FLD(f) abuf->fields.cti.fields.fmt_blsd.f
4135 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4136 int UNUSED written = 0;
4137 IADDR UNUSED pc = abuf->addr;
4138 SEM_BRANCH_INIT
4139 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4140
4141 {
4142 if (NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)))) {
4143 {
4144 USI opval = FLD (i_label9);
4145 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4146 written |= (1 << 3);
4147 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4148 }
4149 }
4150 }
4151
4152 abuf->written = written;
4153 SEM_BRANCH_FINI (vpc);
4154 return vpc;
4155 #undef FLD
4156 }
4157
4158 /* bhi: bhi $label9 */
4159
4160 SEM_PC
4161 SEM_FN_NAME (fr30bf,bhi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4162 {
4163 #define FLD(f) abuf->fields.cti.fields.fmt_blsd.f
4164 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4165 int UNUSED written = 0;
4166 IADDR UNUSED pc = abuf->addr;
4167 SEM_BRANCH_INIT
4168 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4169
4170 if (NOTBI (ORBI (CPU (h_cbit), CPU (h_zbit)))) {
4171 {
4172 USI opval = FLD (i_label9);
4173 SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc, SEM_BRANCH_ADDR_CACHE (sem_arg));
4174 written |= (1 << 3);
4175 TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
4176 }
4177 }
4178
4179 abuf->written = written;
4180 SEM_BRANCH_FINI (vpc);
4181 return vpc;
4182 #undef FLD
4183 }
4184
4185 /* dmovr13: dmov $R13,@$dir10 */
4186
4187 SEM_PC
4188 SEM_FN_NAME (fr30bf,dmovr13) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4189 {
4190 #define FLD(f) abuf->fields.fmt_dmovr13.f
4191 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4192 int UNUSED written = 0;
4193 IADDR UNUSED pc = abuf->addr;
4194 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4195
4196 {
4197 SI opval = CPU (h_gr[((UINT) 13)]);
4198 SETMEMSI (current_cpu, pc, FLD (f_dir10), opval);
4199 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4200 }
4201
4202 return vpc;
4203 #undef FLD
4204 }
4205
4206 /* dmovr13h: dmovh $R13,@$dir9 */
4207
4208 SEM_PC
4209 SEM_FN_NAME (fr30bf,dmovr13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4210 {
4211 #define FLD(f) abuf->fields.fmt_dmovr13h.f
4212 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4213 int UNUSED written = 0;
4214 IADDR UNUSED pc = abuf->addr;
4215 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4216
4217 {
4218 HI opval = CPU (h_gr[((UINT) 13)]);
4219 SETMEMHI (current_cpu, pc, FLD (f_dir9), opval);
4220 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4221 }
4222
4223 return vpc;
4224 #undef FLD
4225 }
4226
4227 /* dmovr13b: dmovb $R13,@$dir8 */
4228
4229 SEM_PC
4230 SEM_FN_NAME (fr30bf,dmovr13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4231 {
4232 #define FLD(f) abuf->fields.fmt_dmovr13b.f
4233 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4234 int UNUSED written = 0;
4235 IADDR UNUSED pc = abuf->addr;
4236 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4237
4238 {
4239 QI opval = CPU (h_gr[((UINT) 13)]);
4240 SETMEMQI (current_cpu, pc, FLD (f_dir8), opval);
4241 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4242 }
4243
4244 return vpc;
4245 #undef FLD
4246 }
4247
4248 /* dmovr13pi: dmov @$R13+,@$dir10 */
4249
4250 SEM_PC
4251 SEM_FN_NAME (fr30bf,dmovr13pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4252 {
4253 #define FLD(f) abuf->fields.fmt_dmovr13pi.f
4254 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4255 int UNUSED written = 0;
4256 IADDR UNUSED pc = abuf->addr;
4257 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4258
4259 {
4260 {
4261 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 13)]));
4262 SETMEMSI (current_cpu, pc, FLD (f_dir10), opval);
4263 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4264 }
4265 {
4266 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 4);
4267 CPU (h_gr[((UINT) 13)]) = opval;
4268 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4269 }
4270 }
4271
4272 return vpc;
4273 #undef FLD
4274 }
4275
4276 /* dmovr13pih: dmovh @$R13+,@$dir9 */
4277
4278 SEM_PC
4279 SEM_FN_NAME (fr30bf,dmovr13pih) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4280 {
4281 #define FLD(f) abuf->fields.fmt_dmovr13pih.f
4282 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4283 int UNUSED written = 0;
4284 IADDR UNUSED pc = abuf->addr;
4285 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4286
4287 {
4288 {
4289 HI opval = GETMEMHI (current_cpu, pc, CPU (h_gr[((UINT) 13)]));
4290 SETMEMHI (current_cpu, pc, FLD (f_dir9), opval);
4291 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4292 }
4293 {
4294 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 2);
4295 CPU (h_gr[((UINT) 13)]) = opval;
4296 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4297 }
4298 }
4299
4300 return vpc;
4301 #undef FLD
4302 }
4303
4304 /* dmovr13pib: dmovb @$R13+,@$dir8 */
4305
4306 SEM_PC
4307 SEM_FN_NAME (fr30bf,dmovr13pib) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4308 {
4309 #define FLD(f) abuf->fields.fmt_dmovr13pib.f
4310 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4311 int UNUSED written = 0;
4312 IADDR UNUSED pc = abuf->addr;
4313 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4314
4315 {
4316 {
4317 QI opval = GETMEMQI (current_cpu, pc, CPU (h_gr[((UINT) 13)]));
4318 SETMEMQI (current_cpu, pc, FLD (f_dir8), opval);
4319 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4320 }
4321 {
4322 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 1);
4323 CPU (h_gr[((UINT) 13)]) = opval;
4324 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4325 }
4326 }
4327
4328 return vpc;
4329 #undef FLD
4330 }
4331
4332 /* dmovr15pi: dmov @$R15+,@$dir10 */
4333
4334 SEM_PC
4335 SEM_FN_NAME (fr30bf,dmovr15pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4336 {
4337 #define FLD(f) abuf->fields.fmt_dmovr15pi.f
4338 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4339 int UNUSED written = 0;
4340 IADDR UNUSED pc = abuf->addr;
4341 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4342
4343 {
4344 {
4345 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4346 SETMEMSI (current_cpu, pc, FLD (f_dir10), opval);
4347 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4348 }
4349 {
4350 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4351 CPU (h_gr[((UINT) 15)]) = opval;
4352 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4353 }
4354 }
4355
4356 return vpc;
4357 #undef FLD
4358 }
4359
4360 /* dmov2r13: dmov @$dir10,$R13 */
4361
4362 SEM_PC
4363 SEM_FN_NAME (fr30bf,dmov2r13) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4364 {
4365 #define FLD(f) abuf->fields.fmt_dmov2r13.f
4366 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4367 int UNUSED written = 0;
4368 IADDR UNUSED pc = abuf->addr;
4369 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4370
4371 {
4372 SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10));
4373 CPU (h_gr[((UINT) 13)]) = opval;
4374 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4375 }
4376
4377 return vpc;
4378 #undef FLD
4379 }
4380
4381 /* dmov2r13h: dmovh @$dir9,$R13 */
4382
4383 SEM_PC
4384 SEM_FN_NAME (fr30bf,dmov2r13h) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4385 {
4386 #define FLD(f) abuf->fields.fmt_dmov2r13h.f
4387 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4388 int UNUSED written = 0;
4389 IADDR UNUSED pc = abuf->addr;
4390 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4391
4392 {
4393 SI opval = GETMEMHI (current_cpu, pc, FLD (f_dir9));
4394 CPU (h_gr[((UINT) 13)]) = opval;
4395 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4396 }
4397
4398 return vpc;
4399 #undef FLD
4400 }
4401
4402 /* dmov2r13b: dmovb @$dir8,$R13 */
4403
4404 SEM_PC
4405 SEM_FN_NAME (fr30bf,dmov2r13b) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4406 {
4407 #define FLD(f) abuf->fields.fmt_dmov2r13b.f
4408 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4409 int UNUSED written = 0;
4410 IADDR UNUSED pc = abuf->addr;
4411 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4412
4413 {
4414 SI opval = GETMEMQI (current_cpu, pc, FLD (f_dir8));
4415 CPU (h_gr[((UINT) 13)]) = opval;
4416 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4417 }
4418
4419 return vpc;
4420 #undef FLD
4421 }
4422
4423 /* dmov2r13pi: dmov @$dir10,@$R13+ */
4424
4425 SEM_PC
4426 SEM_FN_NAME (fr30bf,dmov2r13pi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4427 {
4428 #define FLD(f) abuf->fields.fmt_dmov2r13pi.f
4429 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4430 int UNUSED written = 0;
4431 IADDR UNUSED pc = abuf->addr;
4432 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4433
4434 {
4435 {
4436 SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10));
4437 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval);
4438 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4439 }
4440 {
4441 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 4);
4442 CPU (h_gr[((UINT) 13)]) = opval;
4443 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4444 }
4445 }
4446
4447 return vpc;
4448 #undef FLD
4449 }
4450
4451 /* dmov2r13pih: dmovh @$dir9,@$R13+ */
4452
4453 SEM_PC
4454 SEM_FN_NAME (fr30bf,dmov2r13pih) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4455 {
4456 #define FLD(f) abuf->fields.fmt_dmov2r13pih.f
4457 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4458 int UNUSED written = 0;
4459 IADDR UNUSED pc = abuf->addr;
4460 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4461
4462 {
4463 {
4464 HI opval = GETMEMHI (current_cpu, pc, FLD (f_dir9));
4465 SETMEMHI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval);
4466 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4467 }
4468 {
4469 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 2);
4470 CPU (h_gr[((UINT) 13)]) = opval;
4471 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4472 }
4473 }
4474
4475 return vpc;
4476 #undef FLD
4477 }
4478
4479 /* dmov2r13pib: dmovb @$dir8,@$R13+ */
4480
4481 SEM_PC
4482 SEM_FN_NAME (fr30bf,dmov2r13pib) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4483 {
4484 #define FLD(f) abuf->fields.fmt_dmov2r13pib.f
4485 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4486 int UNUSED written = 0;
4487 IADDR UNUSED pc = abuf->addr;
4488 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4489
4490 {
4491 {
4492 QI opval = GETMEMQI (current_cpu, pc, FLD (f_dir8));
4493 SETMEMQI (current_cpu, pc, CPU (h_gr[((UINT) 13)]), opval);
4494 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4495 }
4496 {
4497 SI opval = ADDSI (CPU (h_gr[((UINT) 13)]), 1);
4498 CPU (h_gr[((UINT) 13)]) = opval;
4499 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
4500 }
4501 }
4502
4503 return vpc;
4504 #undef FLD
4505 }
4506
4507 /* dmov2r15pd: dmov @$dir10,@-$R15 */
4508
4509 SEM_PC
4510 SEM_FN_NAME (fr30bf,dmov2r15pd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4511 {
4512 #define FLD(f) abuf->fields.fmt_dmov2r15pd.f
4513 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4514 int UNUSED written = 0;
4515 IADDR UNUSED pc = abuf->addr;
4516 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4517
4518 {
4519 {
4520 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
4521 CPU (h_gr[((UINT) 15)]) = opval;
4522 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4523 }
4524 {
4525 SI opval = GETMEMSI (current_cpu, pc, FLD (f_dir10));
4526 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
4527 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
4528 }
4529 }
4530
4531 return vpc;
4532 #undef FLD
4533 }
4534
4535 /* ldres: ldres @$Ri+,$u4 */
4536
4537 SEM_PC
4538 SEM_FN_NAME (fr30bf,ldres) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4539 {
4540 #define FLD(f) abuf->fields.fmt_ldres.f
4541 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4542 int UNUSED written = 0;
4543 IADDR UNUSED pc = abuf->addr;
4544 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4545
4546 {
4547 SI opval = ADDSI (* FLD (i_Ri), 4);
4548 * FLD (i_Ri) = opval;
4549 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4550 }
4551
4552 return vpc;
4553 #undef FLD
4554 }
4555
4556 /* stres: stres $u4,@$Ri+ */
4557
4558 SEM_PC
4559 SEM_FN_NAME (fr30bf,stres) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4560 {
4561 #define FLD(f) abuf->fields.fmt_ldres.f
4562 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4563 int UNUSED written = 0;
4564 IADDR UNUSED pc = abuf->addr;
4565 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4566
4567 {
4568 SI opval = ADDSI (* FLD (i_Ri), 4);
4569 * FLD (i_Ri) = opval;
4570 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4571 }
4572
4573 return vpc;
4574 #undef FLD
4575 }
4576
4577 /* copop: copop $u4c,$ccc,$CRj,$CRi */
4578
4579 SEM_PC
4580 SEM_FN_NAME (fr30bf,copop) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4581 {
4582 #define FLD(f) abuf->fields.fmt_copop.f
4583 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4584 int UNUSED written = 0;
4585 IADDR UNUSED pc = abuf->addr;
4586 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4587
4588 do { } while (0); /*nop*/
4589
4590 return vpc;
4591 #undef FLD
4592 }
4593
4594 /* copld: copld $u4c,$ccc,$Rjc,$CRi */
4595
4596 SEM_PC
4597 SEM_FN_NAME (fr30bf,copld) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4598 {
4599 #define FLD(f) abuf->fields.fmt_copop.f
4600 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4601 int UNUSED written = 0;
4602 IADDR UNUSED pc = abuf->addr;
4603 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4604
4605 do { } while (0); /*nop*/
4606
4607 return vpc;
4608 #undef FLD
4609 }
4610
4611 /* copst: copst $u4c,$ccc,$CRj,$Ric */
4612
4613 SEM_PC
4614 SEM_FN_NAME (fr30bf,copst) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4615 {
4616 #define FLD(f) abuf->fields.fmt_copop.f
4617 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4618 int UNUSED written = 0;
4619 IADDR UNUSED pc = abuf->addr;
4620 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4621
4622 do { } while (0); /*nop*/
4623
4624 return vpc;
4625 #undef FLD
4626 }
4627
4628 /* copsv: copsv $u4c,$ccc,$CRj,$Ric */
4629
4630 SEM_PC
4631 SEM_FN_NAME (fr30bf,copsv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4632 {
4633 #define FLD(f) abuf->fields.fmt_copop.f
4634 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4635 int UNUSED written = 0;
4636 IADDR UNUSED pc = abuf->addr;
4637 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
4638
4639 do { } while (0); /*nop*/
4640
4641 return vpc;
4642 #undef FLD
4643 }
4644
4645 /* nop: nop */
4646
4647 SEM_PC
4648 SEM_FN_NAME (fr30bf,nop) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4649 {
4650 #define FLD(f) abuf->fields.fmt_bnod.f
4651 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4652 int UNUSED written = 0;
4653 IADDR UNUSED pc = abuf->addr;
4654 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4655
4656 do { } while (0); /*nop*/
4657
4658 return vpc;
4659 #undef FLD
4660 }
4661
4662 /* andccr: andccr $u8 */
4663
4664 SEM_PC
4665 SEM_FN_NAME (fr30bf,andccr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4666 {
4667 #define FLD(f) abuf->fields.fmt_andccr.f
4668 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4669 int UNUSED written = 0;
4670 IADDR UNUSED pc = abuf->addr;
4671 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4672
4673 {
4674 UQI opval = ANDQI (GET_H_CCR (), FLD (f_u8));
4675 SET_H_CCR (opval);
4676 TRACE_RESULT (current_cpu, abuf, "ccr", 'x', opval);
4677 }
4678
4679 return vpc;
4680 #undef FLD
4681 }
4682
4683 /* orccr: orccr $u8 */
4684
4685 SEM_PC
4686 SEM_FN_NAME (fr30bf,orccr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4687 {
4688 #define FLD(f) abuf->fields.fmt_andccr.f
4689 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4690 int UNUSED written = 0;
4691 IADDR UNUSED pc = abuf->addr;
4692 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4693
4694 {
4695 UQI opval = ORQI (GET_H_CCR (), FLD (f_u8));
4696 SET_H_CCR (opval);
4697 TRACE_RESULT (current_cpu, abuf, "ccr", 'x', opval);
4698 }
4699
4700 return vpc;
4701 #undef FLD
4702 }
4703
4704 /* stilm: stilm $u8 */
4705
4706 SEM_PC
4707 SEM_FN_NAME (fr30bf,stilm) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4708 {
4709 #define FLD(f) abuf->fields.fmt_stilm.f
4710 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4711 int UNUSED written = 0;
4712 IADDR UNUSED pc = abuf->addr;
4713 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4714
4715 {
4716 UQI opval = ANDSI (FLD (f_u8), 31);
4717 SET_H_ILM (opval);
4718 TRACE_RESULT (current_cpu, abuf, "ilm", 'x', opval);
4719 }
4720
4721 return vpc;
4722 #undef FLD
4723 }
4724
4725 /* addsp: addsp $s10 */
4726
4727 SEM_PC
4728 SEM_FN_NAME (fr30bf,addsp) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4729 {
4730 #define FLD(f) abuf->fields.fmt_addsp.f
4731 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4732 int UNUSED written = 0;
4733 IADDR UNUSED pc = abuf->addr;
4734 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4735
4736 {
4737 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), FLD (f_s10));
4738 CPU (h_gr[((UINT) 15)]) = opval;
4739 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4740 }
4741
4742 return vpc;
4743 #undef FLD
4744 }
4745
4746 /* extsb: extsb $Ri */
4747
4748 SEM_PC
4749 SEM_FN_NAME (fr30bf,extsb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4750 {
4751 #define FLD(f) abuf->fields.fmt_extsb.f
4752 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4753 int UNUSED written = 0;
4754 IADDR UNUSED pc = abuf->addr;
4755 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4756
4757 {
4758 SI opval = EXTQISI (ANDQI (* FLD (i_Ri), 255));
4759 * FLD (i_Ri) = opval;
4760 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4761 }
4762
4763 return vpc;
4764 #undef FLD
4765 }
4766
4767 /* extub: extub $Ri */
4768
4769 SEM_PC
4770 SEM_FN_NAME (fr30bf,extub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4771 {
4772 #define FLD(f) abuf->fields.fmt_extub.f
4773 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4774 int UNUSED written = 0;
4775 IADDR UNUSED pc = abuf->addr;
4776 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4777
4778 {
4779 SI opval = ZEXTQISI (ANDQI (* FLD (i_Ri), 255));
4780 * FLD (i_Ri) = opval;
4781 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4782 }
4783
4784 return vpc;
4785 #undef FLD
4786 }
4787
4788 /* extsh: extsh $Ri */
4789
4790 SEM_PC
4791 SEM_FN_NAME (fr30bf,extsh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4792 {
4793 #define FLD(f) abuf->fields.fmt_extsh.f
4794 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4795 int UNUSED written = 0;
4796 IADDR UNUSED pc = abuf->addr;
4797 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4798
4799 {
4800 SI opval = EXTHISI (ANDHI (* FLD (i_Ri), 65535));
4801 * FLD (i_Ri) = opval;
4802 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4803 }
4804
4805 return vpc;
4806 #undef FLD
4807 }
4808
4809 /* extuh: extuh $Ri */
4810
4811 SEM_PC
4812 SEM_FN_NAME (fr30bf,extuh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4813 {
4814 #define FLD(f) abuf->fields.fmt_extuh.f
4815 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4816 int UNUSED written = 0;
4817 IADDR UNUSED pc = abuf->addr;
4818 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4819
4820 {
4821 SI opval = ZEXTHISI (ANDHI (* FLD (i_Ri), 65535));
4822 * FLD (i_Ri) = opval;
4823 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
4824 }
4825
4826 return vpc;
4827 #undef FLD
4828 }
4829
4830 /* ldm0: ldm0 ($reglist_low_ld) */
4831
4832 SEM_PC
4833 SEM_FN_NAME (fr30bf,ldm0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4834 {
4835 #define FLD(f) abuf->fields.fmt_ldm0.f
4836 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4837 int UNUSED written = 0;
4838 IADDR UNUSED pc = abuf->addr;
4839 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4840
4841 {
4842 if (ANDSI (FLD (f_reglist_low_ld), 1)) {
4843 {
4844 {
4845 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4846 CPU (h_gr[((UINT) 0)]) = opval;
4847 written |= (1 << 3);
4848 TRACE_RESULT (current_cpu, abuf, "gr-0", 'x', opval);
4849 }
4850 {
4851 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4852 CPU (h_gr[((UINT) 15)]) = opval;
4853 written |= (1 << 5);
4854 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4855 }
4856 }
4857 }
4858 if (ANDSI (FLD (f_reglist_low_ld), 2)) {
4859 {
4860 {
4861 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4862 CPU (h_gr[((UINT) 1)]) = opval;
4863 written |= (1 << 4);
4864 TRACE_RESULT (current_cpu, abuf, "gr-1", 'x', opval);
4865 }
4866 {
4867 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4868 CPU (h_gr[((UINT) 15)]) = opval;
4869 written |= (1 << 5);
4870 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4871 }
4872 }
4873 }
4874 if (ANDSI (FLD (f_reglist_low_ld), 4)) {
4875 {
4876 {
4877 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4878 CPU (h_gr[((UINT) 2)]) = opval;
4879 written |= (1 << 6);
4880 TRACE_RESULT (current_cpu, abuf, "gr-2", 'x', opval);
4881 }
4882 {
4883 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4884 CPU (h_gr[((UINT) 15)]) = opval;
4885 written |= (1 << 5);
4886 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4887 }
4888 }
4889 }
4890 if (ANDSI (FLD (f_reglist_low_ld), 8)) {
4891 {
4892 {
4893 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4894 CPU (h_gr[((UINT) 3)]) = opval;
4895 written |= (1 << 7);
4896 TRACE_RESULT (current_cpu, abuf, "gr-3", 'x', opval);
4897 }
4898 {
4899 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4900 CPU (h_gr[((UINT) 15)]) = opval;
4901 written |= (1 << 5);
4902 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4903 }
4904 }
4905 }
4906 if (ANDSI (FLD (f_reglist_low_ld), 16)) {
4907 {
4908 {
4909 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4910 CPU (h_gr[((UINT) 4)]) = opval;
4911 written |= (1 << 8);
4912 TRACE_RESULT (current_cpu, abuf, "gr-4", 'x', opval);
4913 }
4914 {
4915 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4916 CPU (h_gr[((UINT) 15)]) = opval;
4917 written |= (1 << 5);
4918 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4919 }
4920 }
4921 }
4922 if (ANDSI (FLD (f_reglist_low_ld), 32)) {
4923 {
4924 {
4925 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4926 CPU (h_gr[((UINT) 5)]) = opval;
4927 written |= (1 << 9);
4928 TRACE_RESULT (current_cpu, abuf, "gr-5", 'x', opval);
4929 }
4930 {
4931 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4932 CPU (h_gr[((UINT) 15)]) = opval;
4933 written |= (1 << 5);
4934 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4935 }
4936 }
4937 }
4938 if (ANDSI (FLD (f_reglist_low_ld), 64)) {
4939 {
4940 {
4941 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4942 CPU (h_gr[((UINT) 6)]) = opval;
4943 written |= (1 << 10);
4944 TRACE_RESULT (current_cpu, abuf, "gr-6", 'x', opval);
4945 }
4946 {
4947 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4948 CPU (h_gr[((UINT) 15)]) = opval;
4949 written |= (1 << 5);
4950 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4951 }
4952 }
4953 }
4954 if (ANDSI (FLD (f_reglist_low_ld), 128)) {
4955 {
4956 {
4957 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4958 CPU (h_gr[((UINT) 7)]) = opval;
4959 written |= (1 << 11);
4960 TRACE_RESULT (current_cpu, abuf, "gr-7", 'x', opval);
4961 }
4962 {
4963 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4964 CPU (h_gr[((UINT) 15)]) = opval;
4965 written |= (1 << 5);
4966 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
4967 }
4968 }
4969 }
4970 }
4971
4972 abuf->written = written;
4973 return vpc;
4974 #undef FLD
4975 }
4976
4977 /* ldm1: ldm1 ($reglist_hi_ld) */
4978
4979 SEM_PC
4980 SEM_FN_NAME (fr30bf,ldm1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
4981 {
4982 #define FLD(f) abuf->fields.fmt_ldm1.f
4983 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
4984 int UNUSED written = 0;
4985 IADDR UNUSED pc = abuf->addr;
4986 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
4987
4988 {
4989 if (ANDSI (FLD (f_reglist_hi_ld), 1)) {
4990 {
4991 {
4992 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
4993 CPU (h_gr[((UINT) 8)]) = opval;
4994 written |= (1 << 9);
4995 TRACE_RESULT (current_cpu, abuf, "gr-8", 'x', opval);
4996 }
4997 {
4998 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
4999 CPU (h_gr[((UINT) 15)]) = opval;
5000 written |= (1 << 8);
5001 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5002 }
5003 }
5004 }
5005 if (ANDSI (FLD (f_reglist_hi_ld), 2)) {
5006 {
5007 {
5008 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5009 CPU (h_gr[((UINT) 9)]) = opval;
5010 written |= (1 << 10);
5011 TRACE_RESULT (current_cpu, abuf, "gr-9", 'x', opval);
5012 }
5013 {
5014 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5015 CPU (h_gr[((UINT) 15)]) = opval;
5016 written |= (1 << 8);
5017 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5018 }
5019 }
5020 }
5021 if (ANDSI (FLD (f_reglist_hi_ld), 4)) {
5022 {
5023 {
5024 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5025 CPU (h_gr[((UINT) 10)]) = opval;
5026 written |= (1 << 3);
5027 TRACE_RESULT (current_cpu, abuf, "gr-10", 'x', opval);
5028 }
5029 {
5030 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5031 CPU (h_gr[((UINT) 15)]) = opval;
5032 written |= (1 << 8);
5033 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5034 }
5035 }
5036 }
5037 if (ANDSI (FLD (f_reglist_hi_ld), 8)) {
5038 {
5039 {
5040 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5041 CPU (h_gr[((UINT) 11)]) = opval;
5042 written |= (1 << 4);
5043 TRACE_RESULT (current_cpu, abuf, "gr-11", 'x', opval);
5044 }
5045 {
5046 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5047 CPU (h_gr[((UINT) 15)]) = opval;
5048 written |= (1 << 8);
5049 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5050 }
5051 }
5052 }
5053 if (ANDSI (FLD (f_reglist_hi_ld), 16)) {
5054 {
5055 {
5056 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5057 CPU (h_gr[((UINT) 12)]) = opval;
5058 written |= (1 << 5);
5059 TRACE_RESULT (current_cpu, abuf, "gr-12", 'x', opval);
5060 }
5061 {
5062 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5063 CPU (h_gr[((UINT) 15)]) = opval;
5064 written |= (1 << 8);
5065 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5066 }
5067 }
5068 }
5069 if (ANDSI (FLD (f_reglist_hi_ld), 32)) {
5070 {
5071 {
5072 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5073 CPU (h_gr[((UINT) 13)]) = opval;
5074 written |= (1 << 6);
5075 TRACE_RESULT (current_cpu, abuf, "gr-13", 'x', opval);
5076 }
5077 {
5078 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5079 CPU (h_gr[((UINT) 15)]) = opval;
5080 written |= (1 << 8);
5081 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5082 }
5083 }
5084 }
5085 if (ANDSI (FLD (f_reglist_hi_ld), 64)) {
5086 {
5087 {
5088 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5089 CPU (h_gr[((UINT) 14)]) = opval;
5090 written |= (1 << 7);
5091 TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval);
5092 }
5093 {
5094 SI opval = ADDSI (CPU (h_gr[((UINT) 15)]), 4);
5095 CPU (h_gr[((UINT) 15)]) = opval;
5096 written |= (1 << 8);
5097 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5098 }
5099 }
5100 }
5101 if (ANDSI (FLD (f_reglist_hi_ld), 128)) {
5102 {
5103 SI opval = GETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]));
5104 CPU (h_gr[((UINT) 15)]) = opval;
5105 written |= (1 << 8);
5106 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5107 }
5108 }
5109 }
5110
5111 abuf->written = written;
5112 return vpc;
5113 #undef FLD
5114 }
5115
5116 /* stm0: stm0 ($reglist_low_st) */
5117
5118 SEM_PC
5119 SEM_FN_NAME (fr30bf,stm0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5120 {
5121 #define FLD(f) abuf->fields.fmt_stm0.f
5122 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5123 int UNUSED written = 0;
5124 IADDR UNUSED pc = abuf->addr;
5125 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5126
5127 {
5128 if (ANDSI (FLD (f_reglist_low_st), 1)) {
5129 {
5130 {
5131 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5132 CPU (h_gr[((UINT) 15)]) = opval;
5133 written |= (1 << 10);
5134 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5135 }
5136 {
5137 SI opval = CPU (h_gr[((UINT) 7)]);
5138 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5139 written |= (1 << 11);
5140 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5141 }
5142 }
5143 }
5144 if (ANDSI (FLD (f_reglist_low_st), 2)) {
5145 {
5146 {
5147 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5148 CPU (h_gr[((UINT) 15)]) = opval;
5149 written |= (1 << 10);
5150 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5151 }
5152 {
5153 SI opval = CPU (h_gr[((UINT) 6)]);
5154 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5155 written |= (1 << 11);
5156 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5157 }
5158 }
5159 }
5160 if (ANDSI (FLD (f_reglist_low_st), 4)) {
5161 {
5162 {
5163 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5164 CPU (h_gr[((UINT) 15)]) = opval;
5165 written |= (1 << 10);
5166 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5167 }
5168 {
5169 SI opval = CPU (h_gr[((UINT) 5)]);
5170 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5171 written |= (1 << 11);
5172 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5173 }
5174 }
5175 }
5176 if (ANDSI (FLD (f_reglist_low_st), 8)) {
5177 {
5178 {
5179 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5180 CPU (h_gr[((UINT) 15)]) = opval;
5181 written |= (1 << 10);
5182 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5183 }
5184 {
5185 SI opval = CPU (h_gr[((UINT) 4)]);
5186 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5187 written |= (1 << 11);
5188 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5189 }
5190 }
5191 }
5192 if (ANDSI (FLD (f_reglist_low_st), 16)) {
5193 {
5194 {
5195 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5196 CPU (h_gr[((UINT) 15)]) = opval;
5197 written |= (1 << 10);
5198 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5199 }
5200 {
5201 SI opval = CPU (h_gr[((UINT) 3)]);
5202 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5203 written |= (1 << 11);
5204 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5205 }
5206 }
5207 }
5208 if (ANDSI (FLD (f_reglist_low_st), 32)) {
5209 {
5210 {
5211 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5212 CPU (h_gr[((UINT) 15)]) = opval;
5213 written |= (1 << 10);
5214 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5215 }
5216 {
5217 SI opval = CPU (h_gr[((UINT) 2)]);
5218 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5219 written |= (1 << 11);
5220 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5221 }
5222 }
5223 }
5224 if (ANDSI (FLD (f_reglist_low_st), 64)) {
5225 {
5226 {
5227 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5228 CPU (h_gr[((UINT) 15)]) = opval;
5229 written |= (1 << 10);
5230 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5231 }
5232 {
5233 SI opval = CPU (h_gr[((UINT) 1)]);
5234 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5235 written |= (1 << 11);
5236 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5237 }
5238 }
5239 }
5240 if (ANDSI (FLD (f_reglist_low_st), 128)) {
5241 {
5242 {
5243 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5244 CPU (h_gr[((UINT) 15)]) = opval;
5245 written |= (1 << 10);
5246 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5247 }
5248 {
5249 SI opval = CPU (h_gr[((UINT) 0)]);
5250 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5251 written |= (1 << 11);
5252 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5253 }
5254 }
5255 }
5256 }
5257
5258 abuf->written = written;
5259 return vpc;
5260 #undef FLD
5261 }
5262
5263 /* stm1: stm1 ($reglist_hi_st) */
5264
5265 SEM_PC
5266 SEM_FN_NAME (fr30bf,stm1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5267 {
5268 #define FLD(f) abuf->fields.fmt_stm1.f
5269 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5270 int UNUSED written = 0;
5271 IADDR UNUSED pc = abuf->addr;
5272 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5273
5274 {
5275 if (ANDSI (FLD (f_reglist_hi_st), 1)) {
5276 {
5277 SI tmp_save_r15;
5278 tmp_save_r15 = CPU (h_gr[((UINT) 15)]);
5279 {
5280 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5281 CPU (h_gr[((UINT) 15)]) = opval;
5282 written |= (1 << 9);
5283 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5284 }
5285 {
5286 SI opval = tmp_save_r15;
5287 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5288 written |= (1 << 10);
5289 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5290 }
5291 }
5292 }
5293 if (ANDSI (FLD (f_reglist_hi_st), 2)) {
5294 {
5295 {
5296 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5297 CPU (h_gr[((UINT) 15)]) = opval;
5298 written |= (1 << 9);
5299 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5300 }
5301 {
5302 SI opval = CPU (h_gr[((UINT) 14)]);
5303 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5304 written |= (1 << 10);
5305 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5306 }
5307 }
5308 }
5309 if (ANDSI (FLD (f_reglist_hi_st), 4)) {
5310 {
5311 {
5312 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5313 CPU (h_gr[((UINT) 15)]) = opval;
5314 written |= (1 << 9);
5315 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5316 }
5317 {
5318 SI opval = CPU (h_gr[((UINT) 13)]);
5319 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5320 written |= (1 << 10);
5321 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5322 }
5323 }
5324 }
5325 if (ANDSI (FLD (f_reglist_hi_st), 8)) {
5326 {
5327 {
5328 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5329 CPU (h_gr[((UINT) 15)]) = opval;
5330 written |= (1 << 9);
5331 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5332 }
5333 {
5334 SI opval = CPU (h_gr[((UINT) 12)]);
5335 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5336 written |= (1 << 10);
5337 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5338 }
5339 }
5340 }
5341 if (ANDSI (FLD (f_reglist_hi_st), 16)) {
5342 {
5343 {
5344 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5345 CPU (h_gr[((UINT) 15)]) = opval;
5346 written |= (1 << 9);
5347 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5348 }
5349 {
5350 SI opval = CPU (h_gr[((UINT) 11)]);
5351 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5352 written |= (1 << 10);
5353 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5354 }
5355 }
5356 }
5357 if (ANDSI (FLD (f_reglist_hi_st), 32)) {
5358 {
5359 {
5360 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5361 CPU (h_gr[((UINT) 15)]) = opval;
5362 written |= (1 << 9);
5363 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5364 }
5365 {
5366 SI opval = CPU (h_gr[((UINT) 10)]);
5367 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5368 written |= (1 << 10);
5369 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5370 }
5371 }
5372 }
5373 if (ANDSI (FLD (f_reglist_hi_st), 64)) {
5374 {
5375 {
5376 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5377 CPU (h_gr[((UINT) 15)]) = opval;
5378 written |= (1 << 9);
5379 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5380 }
5381 {
5382 SI opval = CPU (h_gr[((UINT) 9)]);
5383 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5384 written |= (1 << 10);
5385 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5386 }
5387 }
5388 }
5389 if (ANDSI (FLD (f_reglist_hi_st), 128)) {
5390 {
5391 {
5392 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5393 CPU (h_gr[((UINT) 15)]) = opval;
5394 written |= (1 << 9);
5395 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5396 }
5397 {
5398 SI opval = CPU (h_gr[((UINT) 8)]);
5399 SETMEMSI (current_cpu, pc, CPU (h_gr[((UINT) 15)]), opval);
5400 written |= (1 << 10);
5401 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5402 }
5403 }
5404 }
5405 }
5406
5407 abuf->written = written;
5408 return vpc;
5409 #undef FLD
5410 }
5411
5412 /* enter: enter $u10 */
5413
5414 SEM_PC
5415 SEM_FN_NAME (fr30bf,enter) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5416 {
5417 #define FLD(f) abuf->fields.fmt_enter.f
5418 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5419 int UNUSED written = 0;
5420 IADDR UNUSED pc = abuf->addr;
5421 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5422
5423 {
5424 SI tmp_tmp;
5425 tmp_tmp = SUBSI (CPU (h_gr[((UINT) 15)]), 4);
5426 {
5427 SI opval = CPU (h_gr[((UINT) 14)]);
5428 SETMEMSI (current_cpu, pc, tmp_tmp, opval);
5429 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5430 }
5431 {
5432 SI opval = tmp_tmp;
5433 CPU (h_gr[((UINT) 14)]) = opval;
5434 TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval);
5435 }
5436 {
5437 SI opval = SUBSI (CPU (h_gr[((UINT) 15)]), FLD (f_u10));
5438 CPU (h_gr[((UINT) 15)]) = opval;
5439 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5440 }
5441 }
5442
5443 return vpc;
5444 #undef FLD
5445 }
5446
5447 /* leave: leave */
5448
5449 SEM_PC
5450 SEM_FN_NAME (fr30bf,leave) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5451 {
5452 #define FLD(f) abuf->fields.fmt_leave.f
5453 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5454 int UNUSED written = 0;
5455 IADDR UNUSED pc = abuf->addr;
5456 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5457
5458 {
5459 {
5460 SI opval = ADDSI (CPU (h_gr[((UINT) 14)]), 4);
5461 CPU (h_gr[((UINT) 15)]) = opval;
5462 TRACE_RESULT (current_cpu, abuf, "gr-15", 'x', opval);
5463 }
5464 {
5465 SI opval = GETMEMSI (current_cpu, pc, SUBSI (CPU (h_gr[((UINT) 15)]), 4));
5466 CPU (h_gr[((UINT) 14)]) = opval;
5467 TRACE_RESULT (current_cpu, abuf, "gr-14", 'x', opval);
5468 }
5469 }
5470
5471 return vpc;
5472 #undef FLD
5473 }
5474
5475 /* xchb: xchb @$Rj,$Ri */
5476
5477 SEM_PC
5478 SEM_FN_NAME (fr30bf,xchb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
5479 {
5480 #define FLD(f) abuf->fields.fmt_xchb.f
5481 ARGBUF *abuf = SEM_ARGBUF (sem_arg);
5482 int UNUSED written = 0;
5483 IADDR UNUSED pc = abuf->addr;
5484 SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 2);
5485
5486 {
5487 SI tmp_tmp;
5488 tmp_tmp = * FLD (i_Ri);
5489 {
5490 SI opval = GETMEMUQI (current_cpu, pc, * FLD (i_Rj));
5491 * FLD (i_Ri) = opval;
5492 TRACE_RESULT (current_cpu, abuf, "Ri", 'x', opval);
5493 }
5494 {
5495 UQI opval = tmp_tmp;
5496 SETMEMUQI (current_cpu, pc, * FLD (i_Rj), opval);
5497 TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
5498 }
5499 }
5500
5501 return vpc;
5502 #undef FLD
5503 }
5504