OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [sim/] [fr30/] [sem.c] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.