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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [cris/] [modelv32.c] - Blame information for rev 856

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

Line No. Rev Author Line
1 227 jeremybenn
/* Simulator model support for crisv32f.
2
 
3
THIS FILE IS MACHINE GENERATED WITH CGEN.
4
 
5
Copyright 1996-2010 Free Software Foundation, Inc.
6
 
7
This file is part of the GNU simulators.
8
 
9
   This file is free software; you can redistribute it and/or modify
10
   it under the terms of the GNU General Public License as published by
11
   the Free Software Foundation; either version 3, or (at your option)
12
   any later version.
13
 
14
   It is distributed in the hope that it will be useful, but WITHOUT
15
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17
   License for more details.
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
   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22
 
23
*/
24
 
25
#define WANT_CPU crisv32f
26
#define WANT_CPU_CRISV32F
27
 
28
#include "sim-main.h"
29
 
30
/* The profiling data is recorded here, but is accessed via the profiling
31
   mechanism.  After all, this is information for profiling.  */
32
 
33
#if WITH_PROFILE_MODEL_P
34
 
35
/* Model handlers for each insn.  */
36
 
37
static int
38
model_crisv32_move_b_r (SIM_CPU *current_cpu, void *sem_arg)
39
{
40
#define FLD(f) abuf->fields.sfmt_addc_m.f
41
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
42
  const IDESC * UNUSED idesc = abuf->idesc;
43
  int cycles = 0;
44
  {
45
    int referenced = 0;
46
    int UNUSED insn_referenced = abuf->written;
47
    INT in_Rd = -1;
48
    INT in_Rs = -1;
49
    INT out_Rd = -1;
50
    in_Rs = FLD (in_Rs);
51
    referenced |= 1 << 1;
52
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
53
  }
54
  return cycles;
55
#undef FLD
56
}
57
 
58
static int
59
model_crisv32_move_w_r (SIM_CPU *current_cpu, void *sem_arg)
60
{
61
#define FLD(f) abuf->fields.sfmt_addc_m.f
62
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
63
  const IDESC * UNUSED idesc = abuf->idesc;
64
  int cycles = 0;
65
  {
66
    int referenced = 0;
67
    int UNUSED insn_referenced = abuf->written;
68
    INT in_Rd = -1;
69
    INT in_Rs = -1;
70
    INT out_Rd = -1;
71
    in_Rs = FLD (in_Rs);
72
    referenced |= 1 << 1;
73
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
74
  }
75
  return cycles;
76
#undef FLD
77
}
78
 
79
static int
80
model_crisv32_move_d_r (SIM_CPU *current_cpu, void *sem_arg)
81
{
82
#define FLD(f) abuf->fields.sfmt_addc_m.f
83
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
84
  const IDESC * UNUSED idesc = abuf->idesc;
85
  int cycles = 0;
86
  {
87
    int referenced = 0;
88
    int UNUSED insn_referenced = abuf->written;
89
    INT in_Rd = -1;
90
    INT in_Rs = -1;
91
    INT out_Rd = -1;
92
    in_Rs = FLD (in_Rs);
93
    referenced |= 1 << 1;
94
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
95
  }
96
  return cycles;
97
#undef FLD
98
}
99
 
100
static int
101
model_crisv32_moveq (SIM_CPU *current_cpu, void *sem_arg)
102
{
103
#define FLD(f) abuf->fields.sfmt_moveq.f
104
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
105
  const IDESC * UNUSED idesc = abuf->idesc;
106
  int cycles = 0;
107
  {
108
    int referenced = 0;
109
    int UNUSED insn_referenced = abuf->written;
110
    INT in_Rd = -1;
111
    INT in_Rs = -1;
112
    INT out_Rd = -1;
113
    out_Rd = FLD (out_Rd);
114
    referenced |= 1 << 2;
115
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
116
  }
117
  return cycles;
118
#undef FLD
119
}
120
 
121
static int
122
model_crisv32_movs_b_r (SIM_CPU *current_cpu, void *sem_arg)
123
{
124
#define FLD(f) abuf->fields.sfmt_muls_b.f
125
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
126
  const IDESC * UNUSED idesc = abuf->idesc;
127
  int cycles = 0;
128
  {
129
    int referenced = 0;
130
    int UNUSED insn_referenced = abuf->written;
131
    INT in_Rd = -1;
132
    INT in_Rs = -1;
133
    INT out_Rd = -1;
134
    in_Rs = FLD (in_Rs);
135
    out_Rd = FLD (out_Rd);
136
    referenced |= 1 << 1;
137
    referenced |= 1 << 2;
138
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
139
  }
140
  return cycles;
141
#undef FLD
142
}
143
 
144
static int
145
model_crisv32_movs_w_r (SIM_CPU *current_cpu, void *sem_arg)
146
{
147
#define FLD(f) abuf->fields.sfmt_muls_b.f
148
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
149
  const IDESC * UNUSED idesc = abuf->idesc;
150
  int cycles = 0;
151
  {
152
    int referenced = 0;
153
    int UNUSED insn_referenced = abuf->written;
154
    INT in_Rd = -1;
155
    INT in_Rs = -1;
156
    INT out_Rd = -1;
157
    in_Rs = FLD (in_Rs);
158
    out_Rd = FLD (out_Rd);
159
    referenced |= 1 << 1;
160
    referenced |= 1 << 2;
161
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
162
  }
163
  return cycles;
164
#undef FLD
165
}
166
 
167
static int
168
model_crisv32_movu_b_r (SIM_CPU *current_cpu, void *sem_arg)
169
{
170
#define FLD(f) abuf->fields.sfmt_muls_b.f
171
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
172
  const IDESC * UNUSED idesc = abuf->idesc;
173
  int cycles = 0;
174
  {
175
    int referenced = 0;
176
    int UNUSED insn_referenced = abuf->written;
177
    INT in_Rd = -1;
178
    INT in_Rs = -1;
179
    INT out_Rd = -1;
180
    in_Rs = FLD (in_Rs);
181
    out_Rd = FLD (out_Rd);
182
    referenced |= 1 << 1;
183
    referenced |= 1 << 2;
184
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
185
  }
186
  return cycles;
187
#undef FLD
188
}
189
 
190
static int
191
model_crisv32_movu_w_r (SIM_CPU *current_cpu, void *sem_arg)
192
{
193
#define FLD(f) abuf->fields.sfmt_muls_b.f
194
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
195
  const IDESC * UNUSED idesc = abuf->idesc;
196
  int cycles = 0;
197
  {
198
    int referenced = 0;
199
    int UNUSED insn_referenced = abuf->written;
200
    INT in_Rd = -1;
201
    INT in_Rs = -1;
202
    INT out_Rd = -1;
203
    in_Rs = FLD (in_Rs);
204
    out_Rd = FLD (out_Rd);
205
    referenced |= 1 << 1;
206
    referenced |= 1 << 2;
207
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
208
  }
209
  return cycles;
210
#undef FLD
211
}
212
 
213
static int
214
model_crisv32_movecbr (SIM_CPU *current_cpu, void *sem_arg)
215
{
216
#define FLD(f) abuf->fields.sfmt_addcbr.f
217
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
218
  const IDESC * UNUSED idesc = abuf->idesc;
219
  int cycles = 0;
220
  {
221
    int referenced = 0;
222
    int UNUSED insn_referenced = abuf->written;
223
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
224
  }
225
  {
226
    int referenced = 0;
227
    int UNUSED insn_referenced = abuf->written;
228
    INT in_Rd = -1;
229
    INT in_Rs = -1;
230
    INT out_Rd = -1;
231
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
232
  }
233
  return cycles;
234
#undef FLD
235
}
236
 
237
static int
238
model_crisv32_movecwr (SIM_CPU *current_cpu, void *sem_arg)
239
{
240
#define FLD(f) abuf->fields.sfmt_addcwr.f
241
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
242
  const IDESC * UNUSED idesc = abuf->idesc;
243
  int cycles = 0;
244
  {
245
    int referenced = 0;
246
    int UNUSED insn_referenced = abuf->written;
247
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
248
  }
249
  {
250
    int referenced = 0;
251
    int UNUSED insn_referenced = abuf->written;
252
    INT in_Rd = -1;
253
    INT in_Rs = -1;
254
    INT out_Rd = -1;
255
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
256
  }
257
  return cycles;
258
#undef FLD
259
}
260
 
261
static int
262
model_crisv32_movecdr (SIM_CPU *current_cpu, void *sem_arg)
263
{
264
#define FLD(f) abuf->fields.sfmt_bound_cd.f
265
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
266
  const IDESC * UNUSED idesc = abuf->idesc;
267
  int cycles = 0;
268
  {
269
    int referenced = 0;
270
    int UNUSED insn_referenced = abuf->written;
271
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
272
  }
273
  {
274
    int referenced = 0;
275
    int UNUSED insn_referenced = abuf->written;
276
    INT in_Rd = -1;
277
    INT in_Rs = -1;
278
    INT out_Rd = -1;
279
    out_Rd = FLD (out_Rd);
280
    referenced |= 1 << 2;
281
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
282
  }
283
  return cycles;
284
#undef FLD
285
}
286
 
287
static int
288
model_crisv32_movscbr (SIM_CPU *current_cpu, void *sem_arg)
289
{
290
#define FLD(f) abuf->fields.sfmt_bound_cb.f
291
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
292
  const IDESC * UNUSED idesc = abuf->idesc;
293
  int cycles = 0;
294
  {
295
    int referenced = 0;
296
    int UNUSED insn_referenced = abuf->written;
297
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
298
  }
299
  {
300
    int referenced = 0;
301
    int UNUSED insn_referenced = abuf->written;
302
    INT in_Rd = -1;
303
    INT in_Rs = -1;
304
    INT out_Rd = -1;
305
    out_Rd = FLD (out_Rd);
306
    referenced |= 1 << 2;
307
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
308
  }
309
  return cycles;
310
#undef FLD
311
}
312
 
313
static int
314
model_crisv32_movscwr (SIM_CPU *current_cpu, void *sem_arg)
315
{
316
#define FLD(f) abuf->fields.sfmt_bound_cw.f
317
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
318
  const IDESC * UNUSED idesc = abuf->idesc;
319
  int cycles = 0;
320
  {
321
    int referenced = 0;
322
    int UNUSED insn_referenced = abuf->written;
323
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
324
  }
325
  {
326
    int referenced = 0;
327
    int UNUSED insn_referenced = abuf->written;
328
    INT in_Rd = -1;
329
    INT in_Rs = -1;
330
    INT out_Rd = -1;
331
    out_Rd = FLD (out_Rd);
332
    referenced |= 1 << 2;
333
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
334
  }
335
  return cycles;
336
#undef FLD
337
}
338
 
339
static int
340
model_crisv32_movucbr (SIM_CPU *current_cpu, void *sem_arg)
341
{
342
#define FLD(f) abuf->fields.sfmt_bound_cb.f
343
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
344
  const IDESC * UNUSED idesc = abuf->idesc;
345
  int cycles = 0;
346
  {
347
    int referenced = 0;
348
    int UNUSED insn_referenced = abuf->written;
349
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
350
  }
351
  {
352
    int referenced = 0;
353
    int UNUSED insn_referenced = abuf->written;
354
    INT in_Rd = -1;
355
    INT in_Rs = -1;
356
    INT out_Rd = -1;
357
    out_Rd = FLD (out_Rd);
358
    referenced |= 1 << 2;
359
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
360
  }
361
  return cycles;
362
#undef FLD
363
}
364
 
365
static int
366
model_crisv32_movucwr (SIM_CPU *current_cpu, void *sem_arg)
367
{
368
#define FLD(f) abuf->fields.sfmt_bound_cw.f
369
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
370
  const IDESC * UNUSED idesc = abuf->idesc;
371
  int cycles = 0;
372
  {
373
    int referenced = 0;
374
    int UNUSED insn_referenced = abuf->written;
375
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
376
  }
377
  {
378
    int referenced = 0;
379
    int UNUSED insn_referenced = abuf->written;
380
    INT in_Rd = -1;
381
    INT in_Rs = -1;
382
    INT out_Rd = -1;
383
    out_Rd = FLD (out_Rd);
384
    referenced |= 1 << 2;
385
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
386
  }
387
  return cycles;
388
#undef FLD
389
}
390
 
391
static int
392
model_crisv32_addq (SIM_CPU *current_cpu, void *sem_arg)
393
{
394
#define FLD(f) abuf->fields.sfmt_addq.f
395
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
396
  const IDESC * UNUSED idesc = abuf->idesc;
397
  int cycles = 0;
398
  {
399
    int referenced = 0;
400
    int UNUSED insn_referenced = abuf->written;
401
    INT in_Rd = -1;
402
    INT in_Rs = -1;
403
    INT out_Rd = -1;
404
    in_Rd = FLD (in_Rd);
405
    referenced |= 1 << 0;
406
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
407
  }
408
  return cycles;
409
#undef FLD
410
}
411
 
412
static int
413
model_crisv32_subq (SIM_CPU *current_cpu, void *sem_arg)
414
{
415
#define FLD(f) abuf->fields.sfmt_addq.f
416
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
417
  const IDESC * UNUSED idesc = abuf->idesc;
418
  int cycles = 0;
419
  {
420
    int referenced = 0;
421
    int UNUSED insn_referenced = abuf->written;
422
    INT in_Rd = -1;
423
    INT in_Rs = -1;
424
    INT out_Rd = -1;
425
    in_Rd = FLD (in_Rd);
426
    referenced |= 1 << 0;
427
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
428
  }
429
  return cycles;
430
#undef FLD
431
}
432
 
433
static int
434
model_crisv32_cmp_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
435
{
436
#define FLD(f) abuf->fields.sfmt_muls_b.f
437
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
438
  const IDESC * UNUSED idesc = abuf->idesc;
439
  int cycles = 0;
440
  {
441
    int referenced = 0;
442
    int UNUSED insn_referenced = abuf->written;
443
    INT in_Rd = -1;
444
    INT in_Rs = -1;
445
    INT out_Rd = -1;
446
    in_Rd = FLD (in_Rd);
447
    in_Rs = FLD (in_Rs);
448
    referenced |= 1 << 0;
449
    referenced |= 1 << 1;
450
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
451
  }
452
  return cycles;
453
#undef FLD
454
}
455
 
456
static int
457
model_crisv32_cmp_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
458
{
459
#define FLD(f) abuf->fields.sfmt_muls_b.f
460
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
461
  const IDESC * UNUSED idesc = abuf->idesc;
462
  int cycles = 0;
463
  {
464
    int referenced = 0;
465
    int UNUSED insn_referenced = abuf->written;
466
    INT in_Rd = -1;
467
    INT in_Rs = -1;
468
    INT out_Rd = -1;
469
    in_Rd = FLD (in_Rd);
470
    in_Rs = FLD (in_Rs);
471
    referenced |= 1 << 0;
472
    referenced |= 1 << 1;
473
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
474
  }
475
  return cycles;
476
#undef FLD
477
}
478
 
479
static int
480
model_crisv32_cmp_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
481
{
482
#define FLD(f) abuf->fields.sfmt_muls_b.f
483
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
484
  const IDESC * UNUSED idesc = abuf->idesc;
485
  int cycles = 0;
486
  {
487
    int referenced = 0;
488
    int UNUSED insn_referenced = abuf->written;
489
    INT in_Rd = -1;
490
    INT in_Rs = -1;
491
    INT out_Rd = -1;
492
    in_Rd = FLD (in_Rd);
493
    in_Rs = FLD (in_Rs);
494
    referenced |= 1 << 0;
495
    referenced |= 1 << 1;
496
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
497
  }
498
  return cycles;
499
#undef FLD
500
}
501
 
502
static int
503
model_crisv32_cmp_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
504
{
505
#define FLD(f) abuf->fields.sfmt_addc_m.f
506
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
507
  const IDESC * UNUSED idesc = abuf->idesc;
508
  int cycles = 0;
509
  {
510
    int referenced = 0;
511
    int UNUSED insn_referenced = abuf->written;
512
    INT in_Rs = -1;
513
    in_Rs = FLD (in_Rs);
514
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
515
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
516
  }
517
  {
518
    int referenced = 0;
519
    int UNUSED insn_referenced = abuf->written;
520
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
521
  }
522
  {
523
    int referenced = 0;
524
    int UNUSED insn_referenced = abuf->written;
525
    INT in_Rd = -1;
526
    INT in_Rs = -1;
527
    INT out_Rd = -1;
528
    in_Rd = FLD (in_Rd);
529
    in_Rs = FLD (in_Rs);
530
    referenced |= 1 << 0;
531
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
532
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
533
  }
534
  return cycles;
535
#undef FLD
536
}
537
 
538
static int
539
model_crisv32_cmp_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
540
{
541
#define FLD(f) abuf->fields.sfmt_addc_m.f
542
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
543
  const IDESC * UNUSED idesc = abuf->idesc;
544
  int cycles = 0;
545
  {
546
    int referenced = 0;
547
    int UNUSED insn_referenced = abuf->written;
548
    INT in_Rs = -1;
549
    in_Rs = FLD (in_Rs);
550
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
551
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
552
  }
553
  {
554
    int referenced = 0;
555
    int UNUSED insn_referenced = abuf->written;
556
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
557
  }
558
  {
559
    int referenced = 0;
560
    int UNUSED insn_referenced = abuf->written;
561
    INT in_Rd = -1;
562
    INT in_Rs = -1;
563
    INT out_Rd = -1;
564
    in_Rd = FLD (in_Rd);
565
    in_Rs = FLD (in_Rs);
566
    referenced |= 1 << 0;
567
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
568
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
569
  }
570
  return cycles;
571
#undef FLD
572
}
573
 
574
static int
575
model_crisv32_cmp_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
576
{
577
#define FLD(f) abuf->fields.sfmt_addc_m.f
578
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
579
  const IDESC * UNUSED idesc = abuf->idesc;
580
  int cycles = 0;
581
  {
582
    int referenced = 0;
583
    int UNUSED insn_referenced = abuf->written;
584
    INT in_Rs = -1;
585
    in_Rs = FLD (in_Rs);
586
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
587
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
588
  }
589
  {
590
    int referenced = 0;
591
    int UNUSED insn_referenced = abuf->written;
592
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
593
  }
594
  {
595
    int referenced = 0;
596
    int UNUSED insn_referenced = abuf->written;
597
    INT in_Rd = -1;
598
    INT in_Rs = -1;
599
    INT out_Rd = -1;
600
    in_Rd = FLD (in_Rd);
601
    in_Rs = FLD (in_Rs);
602
    referenced |= 1 << 0;
603
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
604
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
605
  }
606
  return cycles;
607
#undef FLD
608
}
609
 
610
static int
611
model_crisv32_cmpcbr (SIM_CPU *current_cpu, void *sem_arg)
612
{
613
#define FLD(f) abuf->fields.sfmt_bound_cb.f
614
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
615
  const IDESC * UNUSED idesc = abuf->idesc;
616
  int cycles = 0;
617
  {
618
    int referenced = 0;
619
    int UNUSED insn_referenced = abuf->written;
620
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
621
  }
622
  {
623
    int referenced = 0;
624
    int UNUSED insn_referenced = abuf->written;
625
    INT in_Rd = -1;
626
    INT in_Rs = -1;
627
    INT out_Rd = -1;
628
    in_Rd = FLD (in_Rd);
629
    referenced |= 1 << 0;
630
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
631
  }
632
  return cycles;
633
#undef FLD
634
}
635
 
636
static int
637
model_crisv32_cmpcwr (SIM_CPU *current_cpu, void *sem_arg)
638
{
639
#define FLD(f) abuf->fields.sfmt_bound_cw.f
640
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
641
  const IDESC * UNUSED idesc = abuf->idesc;
642
  int cycles = 0;
643
  {
644
    int referenced = 0;
645
    int UNUSED insn_referenced = abuf->written;
646
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
647
  }
648
  {
649
    int referenced = 0;
650
    int UNUSED insn_referenced = abuf->written;
651
    INT in_Rd = -1;
652
    INT in_Rs = -1;
653
    INT out_Rd = -1;
654
    in_Rd = FLD (in_Rd);
655
    referenced |= 1 << 0;
656
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
657
  }
658
  return cycles;
659
#undef FLD
660
}
661
 
662
static int
663
model_crisv32_cmpcdr (SIM_CPU *current_cpu, void *sem_arg)
664
{
665
#define FLD(f) abuf->fields.sfmt_bound_cd.f
666
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
667
  const IDESC * UNUSED idesc = abuf->idesc;
668
  int cycles = 0;
669
  {
670
    int referenced = 0;
671
    int UNUSED insn_referenced = abuf->written;
672
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
673
  }
674
  {
675
    int referenced = 0;
676
    int UNUSED insn_referenced = abuf->written;
677
    INT in_Rd = -1;
678
    INT in_Rs = -1;
679
    INT out_Rd = -1;
680
    in_Rd = FLD (in_Rd);
681
    referenced |= 1 << 0;
682
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
683
  }
684
  return cycles;
685
#undef FLD
686
}
687
 
688
static int
689
model_crisv32_cmpq (SIM_CPU *current_cpu, void *sem_arg)
690
{
691
#define FLD(f) abuf->fields.sfmt_andq.f
692
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
693
  const IDESC * UNUSED idesc = abuf->idesc;
694
  int cycles = 0;
695
  {
696
    int referenced = 0;
697
    int UNUSED insn_referenced = abuf->written;
698
    INT in_Rd = -1;
699
    INT in_Rs = -1;
700
    INT out_Rd = -1;
701
    in_Rd = FLD (in_Rd);
702
    referenced |= 1 << 0;
703
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
704
  }
705
  return cycles;
706
#undef FLD
707
}
708
 
709
static int
710
model_crisv32_cmps_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
711
{
712
#define FLD(f) abuf->fields.sfmt_addc_m.f
713
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
714
  const IDESC * UNUSED idesc = abuf->idesc;
715
  int cycles = 0;
716
  {
717
    int referenced = 0;
718
    int UNUSED insn_referenced = abuf->written;
719
    INT in_Rs = -1;
720
    in_Rs = FLD (in_Rs);
721
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
722
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
723
  }
724
  {
725
    int referenced = 0;
726
    int UNUSED insn_referenced = abuf->written;
727
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
728
  }
729
  {
730
    int referenced = 0;
731
    int UNUSED insn_referenced = abuf->written;
732
    INT in_Rd = -1;
733
    INT in_Rs = -1;
734
    INT out_Rd = -1;
735
    in_Rd = FLD (in_Rd);
736
    in_Rs = FLD (in_Rs);
737
    referenced |= 1 << 0;
738
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
739
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
740
  }
741
  return cycles;
742
#undef FLD
743
}
744
 
745
static int
746
model_crisv32_cmps_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
747
{
748
#define FLD(f) abuf->fields.sfmt_addc_m.f
749
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
750
  const IDESC * UNUSED idesc = abuf->idesc;
751
  int cycles = 0;
752
  {
753
    int referenced = 0;
754
    int UNUSED insn_referenced = abuf->written;
755
    INT in_Rs = -1;
756
    in_Rs = FLD (in_Rs);
757
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
758
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
759
  }
760
  {
761
    int referenced = 0;
762
    int UNUSED insn_referenced = abuf->written;
763
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
764
  }
765
  {
766
    int referenced = 0;
767
    int UNUSED insn_referenced = abuf->written;
768
    INT in_Rd = -1;
769
    INT in_Rs = -1;
770
    INT out_Rd = -1;
771
    in_Rd = FLD (in_Rd);
772
    in_Rs = FLD (in_Rs);
773
    referenced |= 1 << 0;
774
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
775
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
776
  }
777
  return cycles;
778
#undef FLD
779
}
780
 
781
static int
782
model_crisv32_cmpscbr (SIM_CPU *current_cpu, void *sem_arg)
783
{
784
#define FLD(f) abuf->fields.sfmt_bound_cb.f
785
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
786
  const IDESC * UNUSED idesc = abuf->idesc;
787
  int cycles = 0;
788
  {
789
    int referenced = 0;
790
    int UNUSED insn_referenced = abuf->written;
791
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
792
  }
793
  {
794
    int referenced = 0;
795
    int UNUSED insn_referenced = abuf->written;
796
    INT in_Rd = -1;
797
    INT in_Rs = -1;
798
    INT out_Rd = -1;
799
    in_Rd = FLD (in_Rd);
800
    referenced |= 1 << 0;
801
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
802
  }
803
  return cycles;
804
#undef FLD
805
}
806
 
807
static int
808
model_crisv32_cmpscwr (SIM_CPU *current_cpu, void *sem_arg)
809
{
810
#define FLD(f) abuf->fields.sfmt_bound_cw.f
811
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
812
  const IDESC * UNUSED idesc = abuf->idesc;
813
  int cycles = 0;
814
  {
815
    int referenced = 0;
816
    int UNUSED insn_referenced = abuf->written;
817
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
818
  }
819
  {
820
    int referenced = 0;
821
    int UNUSED insn_referenced = abuf->written;
822
    INT in_Rd = -1;
823
    INT in_Rs = -1;
824
    INT out_Rd = -1;
825
    in_Rd = FLD (in_Rd);
826
    referenced |= 1 << 0;
827
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
828
  }
829
  return cycles;
830
#undef FLD
831
}
832
 
833
static int
834
model_crisv32_cmpu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
835
{
836
#define FLD(f) abuf->fields.sfmt_addc_m.f
837
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
838
  const IDESC * UNUSED idesc = abuf->idesc;
839
  int cycles = 0;
840
  {
841
    int referenced = 0;
842
    int UNUSED insn_referenced = abuf->written;
843
    INT in_Rs = -1;
844
    in_Rs = FLD (in_Rs);
845
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
846
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
847
  }
848
  {
849
    int referenced = 0;
850
    int UNUSED insn_referenced = abuf->written;
851
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
852
  }
853
  {
854
    int referenced = 0;
855
    int UNUSED insn_referenced = abuf->written;
856
    INT in_Rd = -1;
857
    INT in_Rs = -1;
858
    INT out_Rd = -1;
859
    in_Rd = FLD (in_Rd);
860
    in_Rs = FLD (in_Rs);
861
    referenced |= 1 << 0;
862
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
863
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
864
  }
865
  return cycles;
866
#undef FLD
867
}
868
 
869
static int
870
model_crisv32_cmpu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
871
{
872
#define FLD(f) abuf->fields.sfmt_addc_m.f
873
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
874
  const IDESC * UNUSED idesc = abuf->idesc;
875
  int cycles = 0;
876
  {
877
    int referenced = 0;
878
    int UNUSED insn_referenced = abuf->written;
879
    INT in_Rs = -1;
880
    in_Rs = FLD (in_Rs);
881
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
882
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
883
  }
884
  {
885
    int referenced = 0;
886
    int UNUSED insn_referenced = abuf->written;
887
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
888
  }
889
  {
890
    int referenced = 0;
891
    int UNUSED insn_referenced = abuf->written;
892
    INT in_Rd = -1;
893
    INT in_Rs = -1;
894
    INT out_Rd = -1;
895
    in_Rd = FLD (in_Rd);
896
    in_Rs = FLD (in_Rs);
897
    referenced |= 1 << 0;
898
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
899
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
900
  }
901
  return cycles;
902
#undef FLD
903
}
904
 
905
static int
906
model_crisv32_cmpucbr (SIM_CPU *current_cpu, void *sem_arg)
907
{
908
#define FLD(f) abuf->fields.sfmt_bound_cb.f
909
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
910
  const IDESC * UNUSED idesc = abuf->idesc;
911
  int cycles = 0;
912
  {
913
    int referenced = 0;
914
    int UNUSED insn_referenced = abuf->written;
915
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
916
  }
917
  {
918
    int referenced = 0;
919
    int UNUSED insn_referenced = abuf->written;
920
    INT in_Rd = -1;
921
    INT in_Rs = -1;
922
    INT out_Rd = -1;
923
    in_Rd = FLD (in_Rd);
924
    referenced |= 1 << 0;
925
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
926
  }
927
  return cycles;
928
#undef FLD
929
}
930
 
931
static int
932
model_crisv32_cmpucwr (SIM_CPU *current_cpu, void *sem_arg)
933
{
934
#define FLD(f) abuf->fields.sfmt_bound_cw.f
935
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
936
  const IDESC * UNUSED idesc = abuf->idesc;
937
  int cycles = 0;
938
  {
939
    int referenced = 0;
940
    int UNUSED insn_referenced = abuf->written;
941
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
942
  }
943
  {
944
    int referenced = 0;
945
    int UNUSED insn_referenced = abuf->written;
946
    INT in_Rd = -1;
947
    INT in_Rs = -1;
948
    INT out_Rd = -1;
949
    in_Rd = FLD (in_Rd);
950
    referenced |= 1 << 0;
951
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
952
  }
953
  return cycles;
954
#undef FLD
955
}
956
 
957
static int
958
model_crisv32_move_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
959
{
960
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
961
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
962
  const IDESC * UNUSED idesc = abuf->idesc;
963
  int cycles = 0;
964
  {
965
    int referenced = 0;
966
    int UNUSED insn_referenced = abuf->written;
967
    INT in_Rs = -1;
968
    in_Rs = FLD (in_Rs);
969
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
970
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
971
  }
972
  {
973
    int referenced = 0;
974
    int UNUSED insn_referenced = abuf->written;
975
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
976
  }
977
  {
978
    int referenced = 0;
979
    int UNUSED insn_referenced = abuf->written;
980
    INT in_Rd = -1;
981
    INT in_Rs = -1;
982
    INT out_Rd = -1;
983
    in_Rs = FLD (in_Rs);
984
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
985
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
986
  }
987
  return cycles;
988
#undef FLD
989
}
990
 
991
static int
992
model_crisv32_move_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
993
{
994
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
995
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
996
  const IDESC * UNUSED idesc = abuf->idesc;
997
  int cycles = 0;
998
  {
999
    int referenced = 0;
1000
    int UNUSED insn_referenced = abuf->written;
1001
    INT in_Rs = -1;
1002
    in_Rs = FLD (in_Rs);
1003
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1004
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1005
  }
1006
  {
1007
    int referenced = 0;
1008
    int UNUSED insn_referenced = abuf->written;
1009
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1010
  }
1011
  {
1012
    int referenced = 0;
1013
    int UNUSED insn_referenced = abuf->written;
1014
    INT in_Rd = -1;
1015
    INT in_Rs = -1;
1016
    INT out_Rd = -1;
1017
    in_Rs = FLD (in_Rs);
1018
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1019
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1020
  }
1021
  return cycles;
1022
#undef FLD
1023
}
1024
 
1025
static int
1026
model_crisv32_move_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1027
{
1028
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1029
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1030
  const IDESC * UNUSED idesc = abuf->idesc;
1031
  int cycles = 0;
1032
  {
1033
    int referenced = 0;
1034
    int UNUSED insn_referenced = abuf->written;
1035
    INT in_Rs = -1;
1036
    in_Rs = FLD (in_Rs);
1037
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1038
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1039
  }
1040
  {
1041
    int referenced = 0;
1042
    int UNUSED insn_referenced = abuf->written;
1043
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1044
  }
1045
  {
1046
    int referenced = 0;
1047
    int UNUSED insn_referenced = abuf->written;
1048
    INT in_Rd = -1;
1049
    INT in_Rs = -1;
1050
    INT out_Rd = -1;
1051
    in_Rs = FLD (in_Rs);
1052
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1053
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1054
  }
1055
  return cycles;
1056
#undef FLD
1057
}
1058
 
1059
static int
1060
model_crisv32_movs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1061
{
1062
#define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1063
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1064
  const IDESC * UNUSED idesc = abuf->idesc;
1065
  int cycles = 0;
1066
  {
1067
    int referenced = 0;
1068
    int UNUSED insn_referenced = abuf->written;
1069
    INT in_Rs = -1;
1070
    in_Rs = FLD (in_Rs);
1071
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1072
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1073
  }
1074
  {
1075
    int referenced = 0;
1076
    int UNUSED insn_referenced = abuf->written;
1077
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1078
  }
1079
  {
1080
    int referenced = 0;
1081
    int UNUSED insn_referenced = abuf->written;
1082
    INT in_Rd = -1;
1083
    INT in_Rs = -1;
1084
    INT out_Rd = -1;
1085
    in_Rs = FLD (in_Rs);
1086
    out_Rd = FLD (out_Rd);
1087
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1088
    if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1089
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1090
  }
1091
  return cycles;
1092
#undef FLD
1093
}
1094
 
1095
static int
1096
model_crisv32_movs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1097
{
1098
#define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1099
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1100
  const IDESC * UNUSED idesc = abuf->idesc;
1101
  int cycles = 0;
1102
  {
1103
    int referenced = 0;
1104
    int UNUSED insn_referenced = abuf->written;
1105
    INT in_Rs = -1;
1106
    in_Rs = FLD (in_Rs);
1107
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1108
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1109
  }
1110
  {
1111
    int referenced = 0;
1112
    int UNUSED insn_referenced = abuf->written;
1113
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1114
  }
1115
  {
1116
    int referenced = 0;
1117
    int UNUSED insn_referenced = abuf->written;
1118
    INT in_Rd = -1;
1119
    INT in_Rs = -1;
1120
    INT out_Rd = -1;
1121
    in_Rs = FLD (in_Rs);
1122
    out_Rd = FLD (out_Rd);
1123
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1124
    if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1125
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1126
  }
1127
  return cycles;
1128
#undef FLD
1129
}
1130
 
1131
static int
1132
model_crisv32_movu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1133
{
1134
#define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1135
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1136
  const IDESC * UNUSED idesc = abuf->idesc;
1137
  int cycles = 0;
1138
  {
1139
    int referenced = 0;
1140
    int UNUSED insn_referenced = abuf->written;
1141
    INT in_Rs = -1;
1142
    in_Rs = FLD (in_Rs);
1143
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1144
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1145
  }
1146
  {
1147
    int referenced = 0;
1148
    int UNUSED insn_referenced = abuf->written;
1149
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1150
  }
1151
  {
1152
    int referenced = 0;
1153
    int UNUSED insn_referenced = abuf->written;
1154
    INT in_Rd = -1;
1155
    INT in_Rs = -1;
1156
    INT out_Rd = -1;
1157
    in_Rs = FLD (in_Rs);
1158
    out_Rd = FLD (out_Rd);
1159
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1160
    if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1161
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1162
  }
1163
  return cycles;
1164
#undef FLD
1165
}
1166
 
1167
static int
1168
model_crisv32_movu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1169
{
1170
#define FLD(f) abuf->fields.sfmt_movs_m_b_m.f
1171
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1172
  const IDESC * UNUSED idesc = abuf->idesc;
1173
  int cycles = 0;
1174
  {
1175
    int referenced = 0;
1176
    int UNUSED insn_referenced = abuf->written;
1177
    INT in_Rs = -1;
1178
    in_Rs = FLD (in_Rs);
1179
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1180
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1181
  }
1182
  {
1183
    int referenced = 0;
1184
    int UNUSED insn_referenced = abuf->written;
1185
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1186
  }
1187
  {
1188
    int referenced = 0;
1189
    int UNUSED insn_referenced = abuf->written;
1190
    INT in_Rd = -1;
1191
    INT in_Rs = -1;
1192
    INT out_Rd = -1;
1193
    in_Rs = FLD (in_Rs);
1194
    out_Rd = FLD (out_Rd);
1195
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
1196
    if (insn_referenced & (1 << 7)) referenced |= 1 << 2;
1197
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1198
  }
1199
  return cycles;
1200
#undef FLD
1201
}
1202
 
1203
static int
1204
model_crisv32_move_r_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1205
{
1206
#define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1207
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1208
  const IDESC * UNUSED idesc = abuf->idesc;
1209
  int cycles = 0;
1210
  {
1211
    int referenced = 0;
1212
    int UNUSED insn_referenced = abuf->written;
1213
    INT in_Rs = -1;
1214
    INT out_Pd = -1;
1215
    in_Rs = FLD (in_Rs);
1216
    out_Pd = FLD (out_Pd);
1217
    referenced |= 1 << 0;
1218
    if (insn_referenced & (1 << 2)) referenced |= 1 << 1;
1219
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 0, referenced, in_Rs, out_Pd);
1220
  }
1221
  return cycles;
1222
#undef FLD
1223
}
1224
 
1225
static int
1226
model_crisv32_move_spr_rv32 (SIM_CPU *current_cpu, void *sem_arg)
1227
{
1228
#define FLD(f) abuf->fields.sfmt_mcp.f
1229
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1230
  const IDESC * UNUSED idesc = abuf->idesc;
1231
  int cycles = 0;
1232
  {
1233
    int referenced = 0;
1234
    int UNUSED insn_referenced = abuf->written;
1235
    INT in_Rd = -1;
1236
    INT in_Rs = -1;
1237
    INT out_Rd = -1;
1238
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1239
  }
1240
  return cycles;
1241
#undef FLD
1242
}
1243
 
1244
static int
1245
model_crisv32_move_m_sprv32 (SIM_CPU *current_cpu, void *sem_arg)
1246
{
1247
#define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
1248
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1249
  const IDESC * UNUSED idesc = abuf->idesc;
1250
  int cycles = 0;
1251
  {
1252
    int referenced = 0;
1253
    int UNUSED insn_referenced = abuf->written;
1254
    INT in_Rs = -1;
1255
    in_Rs = FLD (in_Rs);
1256
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1257
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1258
  }
1259
  {
1260
    int referenced = 0;
1261
    int UNUSED insn_referenced = abuf->written;
1262
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1263
  }
1264
  {
1265
    int referenced = 0;
1266
    int UNUSED insn_referenced = abuf->written;
1267
    INT in_Rs = -1;
1268
    INT out_Pd = -1;
1269
    in_Rs = FLD (in_Rs);
1270
    out_Pd = FLD (out_Pd);
1271
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
1272
    referenced |= 1 << 1;
1273
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 2, referenced, in_Rs, out_Pd);
1274
  }
1275
  return cycles;
1276
#undef FLD
1277
}
1278
 
1279
static int
1280
model_crisv32_move_c_sprv32_p2 (SIM_CPU *current_cpu, void *sem_arg)
1281
{
1282
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1283
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1284
  const IDESC * UNUSED idesc = abuf->idesc;
1285
  int cycles = 0;
1286
  {
1287
    int referenced = 0;
1288
    int UNUSED insn_referenced = abuf->written;
1289
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1290
  }
1291
  {
1292
    int referenced = 0;
1293
    int UNUSED insn_referenced = abuf->written;
1294
    INT in_Rs = -1;
1295
    INT out_Pd = -1;
1296
    out_Pd = FLD (out_Pd);
1297
    referenced |= 1 << 1;
1298
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1299
  }
1300
  return cycles;
1301
#undef FLD
1302
}
1303
 
1304
static int
1305
model_crisv32_move_c_sprv32_p3 (SIM_CPU *current_cpu, void *sem_arg)
1306
{
1307
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1308
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1309
  const IDESC * UNUSED idesc = abuf->idesc;
1310
  int cycles = 0;
1311
  {
1312
    int referenced = 0;
1313
    int UNUSED insn_referenced = abuf->written;
1314
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1315
  }
1316
  {
1317
    int referenced = 0;
1318
    int UNUSED insn_referenced = abuf->written;
1319
    INT in_Rs = -1;
1320
    INT out_Pd = -1;
1321
    out_Pd = FLD (out_Pd);
1322
    referenced |= 1 << 1;
1323
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1324
  }
1325
  return cycles;
1326
#undef FLD
1327
}
1328
 
1329
static int
1330
model_crisv32_move_c_sprv32_p5 (SIM_CPU *current_cpu, void *sem_arg)
1331
{
1332
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1333
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1334
  const IDESC * UNUSED idesc = abuf->idesc;
1335
  int cycles = 0;
1336
  {
1337
    int referenced = 0;
1338
    int UNUSED insn_referenced = abuf->written;
1339
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1340
  }
1341
  {
1342
    int referenced = 0;
1343
    int UNUSED insn_referenced = abuf->written;
1344
    INT in_Rs = -1;
1345
    INT out_Pd = -1;
1346
    out_Pd = FLD (out_Pd);
1347
    referenced |= 1 << 1;
1348
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1349
  }
1350
  return cycles;
1351
#undef FLD
1352
}
1353
 
1354
static int
1355
model_crisv32_move_c_sprv32_p6 (SIM_CPU *current_cpu, void *sem_arg)
1356
{
1357
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1358
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1359
  const IDESC * UNUSED idesc = abuf->idesc;
1360
  int cycles = 0;
1361
  {
1362
    int referenced = 0;
1363
    int UNUSED insn_referenced = abuf->written;
1364
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1365
  }
1366
  {
1367
    int referenced = 0;
1368
    int UNUSED insn_referenced = abuf->written;
1369
    INT in_Rs = -1;
1370
    INT out_Pd = -1;
1371
    out_Pd = FLD (out_Pd);
1372
    referenced |= 1 << 1;
1373
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1374
  }
1375
  return cycles;
1376
#undef FLD
1377
}
1378
 
1379
static int
1380
model_crisv32_move_c_sprv32_p7 (SIM_CPU *current_cpu, void *sem_arg)
1381
{
1382
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1383
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1384
  const IDESC * UNUSED idesc = abuf->idesc;
1385
  int cycles = 0;
1386
  {
1387
    int referenced = 0;
1388
    int UNUSED insn_referenced = abuf->written;
1389
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1390
  }
1391
  {
1392
    int referenced = 0;
1393
    int UNUSED insn_referenced = abuf->written;
1394
    INT in_Rs = -1;
1395
    INT out_Pd = -1;
1396
    out_Pd = FLD (out_Pd);
1397
    referenced |= 1 << 1;
1398
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1399
  }
1400
  return cycles;
1401
#undef FLD
1402
}
1403
 
1404
static int
1405
model_crisv32_move_c_sprv32_p9 (SIM_CPU *current_cpu, void *sem_arg)
1406
{
1407
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1408
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1409
  const IDESC * UNUSED idesc = abuf->idesc;
1410
  int cycles = 0;
1411
  {
1412
    int referenced = 0;
1413
    int UNUSED insn_referenced = abuf->written;
1414
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1415
  }
1416
  {
1417
    int referenced = 0;
1418
    int UNUSED insn_referenced = abuf->written;
1419
    INT in_Rs = -1;
1420
    INT out_Pd = -1;
1421
    out_Pd = FLD (out_Pd);
1422
    referenced |= 1 << 1;
1423
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1424
  }
1425
  return cycles;
1426
#undef FLD
1427
}
1428
 
1429
static int
1430
model_crisv32_move_c_sprv32_p10 (SIM_CPU *current_cpu, void *sem_arg)
1431
{
1432
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1433
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1434
  const IDESC * UNUSED idesc = abuf->idesc;
1435
  int cycles = 0;
1436
  {
1437
    int referenced = 0;
1438
    int UNUSED insn_referenced = abuf->written;
1439
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1440
  }
1441
  {
1442
    int referenced = 0;
1443
    int UNUSED insn_referenced = abuf->written;
1444
    INT in_Rs = -1;
1445
    INT out_Pd = -1;
1446
    out_Pd = FLD (out_Pd);
1447
    referenced |= 1 << 1;
1448
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1449
  }
1450
  return cycles;
1451
#undef FLD
1452
}
1453
 
1454
static int
1455
model_crisv32_move_c_sprv32_p11 (SIM_CPU *current_cpu, void *sem_arg)
1456
{
1457
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1458
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1459
  const IDESC * UNUSED idesc = abuf->idesc;
1460
  int cycles = 0;
1461
  {
1462
    int referenced = 0;
1463
    int UNUSED insn_referenced = abuf->written;
1464
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1465
  }
1466
  {
1467
    int referenced = 0;
1468
    int UNUSED insn_referenced = abuf->written;
1469
    INT in_Rs = -1;
1470
    INT out_Pd = -1;
1471
    out_Pd = FLD (out_Pd);
1472
    referenced |= 1 << 1;
1473
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1474
  }
1475
  return cycles;
1476
#undef FLD
1477
}
1478
 
1479
static int
1480
model_crisv32_move_c_sprv32_p12 (SIM_CPU *current_cpu, void *sem_arg)
1481
{
1482
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1483
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1484
  const IDESC * UNUSED idesc = abuf->idesc;
1485
  int cycles = 0;
1486
  {
1487
    int referenced = 0;
1488
    int UNUSED insn_referenced = abuf->written;
1489
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1490
  }
1491
  {
1492
    int referenced = 0;
1493
    int UNUSED insn_referenced = abuf->written;
1494
    INT in_Rs = -1;
1495
    INT out_Pd = -1;
1496
    out_Pd = FLD (out_Pd);
1497
    referenced |= 1 << 1;
1498
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1499
  }
1500
  return cycles;
1501
#undef FLD
1502
}
1503
 
1504
static int
1505
model_crisv32_move_c_sprv32_p13 (SIM_CPU *current_cpu, void *sem_arg)
1506
{
1507
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1508
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1509
  const IDESC * UNUSED idesc = abuf->idesc;
1510
  int cycles = 0;
1511
  {
1512
    int referenced = 0;
1513
    int UNUSED insn_referenced = abuf->written;
1514
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1515
  }
1516
  {
1517
    int referenced = 0;
1518
    int UNUSED insn_referenced = abuf->written;
1519
    INT in_Rs = -1;
1520
    INT out_Pd = -1;
1521
    out_Pd = FLD (out_Pd);
1522
    referenced |= 1 << 1;
1523
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1524
  }
1525
  return cycles;
1526
#undef FLD
1527
}
1528
 
1529
static int
1530
model_crisv32_move_c_sprv32_p14 (SIM_CPU *current_cpu, void *sem_arg)
1531
{
1532
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1533
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1534
  const IDESC * UNUSED idesc = abuf->idesc;
1535
  int cycles = 0;
1536
  {
1537
    int referenced = 0;
1538
    int UNUSED insn_referenced = abuf->written;
1539
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1540
  }
1541
  {
1542
    int referenced = 0;
1543
    int UNUSED insn_referenced = abuf->written;
1544
    INT in_Rs = -1;
1545
    INT out_Pd = -1;
1546
    out_Pd = FLD (out_Pd);
1547
    referenced |= 1 << 1;
1548
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1549
  }
1550
  return cycles;
1551
#undef FLD
1552
}
1553
 
1554
static int
1555
model_crisv32_move_c_sprv32_p15 (SIM_CPU *current_cpu, void *sem_arg)
1556
{
1557
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
1558
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1559
  const IDESC * UNUSED idesc = abuf->idesc;
1560
  int cycles = 0;
1561
  {
1562
    int referenced = 0;
1563
    int UNUSED insn_referenced = abuf->written;
1564
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1565
  }
1566
  {
1567
    int referenced = 0;
1568
    int UNUSED insn_referenced = abuf->written;
1569
    INT in_Rs = -1;
1570
    INT out_Pd = -1;
1571
    out_Pd = FLD (out_Pd);
1572
    referenced |= 1 << 1;
1573
    cycles += crisv32f_model_crisv32_u_exec_to_sr (current_cpu, idesc, 1, referenced, in_Rs, out_Pd);
1574
  }
1575
  return cycles;
1576
#undef FLD
1577
}
1578
 
1579
static int
1580
model_crisv32_move_spr_mv32 (SIM_CPU *current_cpu, void *sem_arg)
1581
{
1582
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1583
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1584
  const IDESC * UNUSED idesc = abuf->idesc;
1585
  int cycles = 0;
1586
  {
1587
    int referenced = 0;
1588
    int UNUSED insn_referenced = abuf->written;
1589
    INT in_Rs = -1;
1590
    in_Rs = FLD (in_Rs);
1591
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1592
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1593
  }
1594
  {
1595
    int referenced = 0;
1596
    int UNUSED insn_referenced = abuf->written;
1597
    INT in_Rd = -1;
1598
    INT in_Rs = -1;
1599
    INT out_Rd = -1;
1600
    in_Rs = FLD (in_Rs);
1601
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1602
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1603
  }
1604
  {
1605
    int referenced = 0;
1606
    int UNUSED insn_referenced = abuf->written;
1607
    cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
1608
  }
1609
  return cycles;
1610
#undef FLD
1611
}
1612
 
1613
static int
1614
model_crisv32_move_ss_r (SIM_CPU *current_cpu, void *sem_arg)
1615
{
1616
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
1617
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1618
  const IDESC * UNUSED idesc = abuf->idesc;
1619
  int cycles = 0;
1620
  {
1621
    int referenced = 0;
1622
    int UNUSED insn_referenced = abuf->written;
1623
    INT in_Rd = -1;
1624
    INT in_Rs = -1;
1625
    INT out_Rd = -1;
1626
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1627
  }
1628
  return cycles;
1629
#undef FLD
1630
}
1631
 
1632
static int
1633
model_crisv32_move_r_ss (SIM_CPU *current_cpu, void *sem_arg)
1634
{
1635
#define FLD(f) abuf->fields.sfmt_mcp.f
1636
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1637
  const IDESC * UNUSED idesc = abuf->idesc;
1638
  int cycles = 0;
1639
  {
1640
    int referenced = 0;
1641
    int UNUSED insn_referenced = abuf->written;
1642
    INT in_Rd = -1;
1643
    INT in_Rs = -1;
1644
    INT out_Rd = -1;
1645
    in_Rs = FLD (in_Rs);
1646
    referenced |= 1 << 1;
1647
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1648
  }
1649
  return cycles;
1650
#undef FLD
1651
}
1652
 
1653
static int
1654
model_crisv32_movem_r_m_v32 (SIM_CPU *current_cpu, void *sem_arg)
1655
{
1656
#define FLD(f) abuf->fields.sfmt_movem_r_m_v32.f
1657
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1658
  const IDESC * UNUSED idesc = abuf->idesc;
1659
  int cycles = 0;
1660
  {
1661
    int referenced = 0;
1662
    int UNUSED insn_referenced = abuf->written;
1663
    INT in_Rs = -1;
1664
    in_Rs = FLD (in_Rs);
1665
    referenced |= 1 << 0;
1666
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1667
  }
1668
  {
1669
    int referenced = 0;
1670
    int UNUSED insn_referenced = abuf->written;
1671
    INT in_Rs = -1;
1672
    INT in_Rd = -1;
1673
    in_Rs = FLD (in_Rs);
1674
    in_Rd = FLD (in_Rd);
1675
    referenced |= 1 << 0;
1676
    referenced |= 1 << 1;
1677
    cycles += crisv32f_model_crisv32_u_movem_rtom (current_cpu, idesc, 1, referenced, in_Rs, in_Rd);
1678
  }
1679
  {
1680
    int referenced = 0;
1681
    int UNUSED insn_referenced = abuf->written;
1682
    INT in_Rs = -1;
1683
    INT out_Rd = -1;
1684
    in_Rs = FLD (in_Rs);
1685
    referenced |= 1 << 0;
1686
    cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 2, referenced, in_Rs, out_Rd);
1687
  }
1688
  {
1689
    int referenced = 0;
1690
    int UNUSED insn_referenced = abuf->written;
1691
    cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 3, referenced);
1692
  }
1693
  return cycles;
1694
#undef FLD
1695
}
1696
 
1697
static int
1698
model_crisv32_movem_m_r_v32 (SIM_CPU *current_cpu, void *sem_arg)
1699
{
1700
#define FLD(f) abuf->fields.sfmt_movem_m_r_v32.f
1701
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1702
  const IDESC * UNUSED idesc = abuf->idesc;
1703
  int cycles = 0;
1704
  {
1705
    int referenced = 0;
1706
    int UNUSED insn_referenced = abuf->written;
1707
    INT in_Rs = -1;
1708
    in_Rs = FLD (in_Rs);
1709
    referenced |= 1 << 0;
1710
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1711
  }
1712
  {
1713
    int referenced = 0;
1714
    int UNUSED insn_referenced = abuf->written;
1715
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1716
  }
1717
  {
1718
    int referenced = 0;
1719
    int UNUSED insn_referenced = abuf->written;
1720
    INT in_Rs = -1;
1721
    INT in_Rd = -1;
1722
    in_Rs = FLD (in_Rs);
1723
    in_Rd = FLD (in_Rd);
1724
    referenced |= 1 << 0;
1725
    referenced |= 1 << 1;
1726
    cycles += crisv32f_model_crisv32_u_movem_mtor (current_cpu, idesc, 2, referenced, in_Rs, in_Rd);
1727
  }
1728
  {
1729
    int referenced = 0;
1730
    int UNUSED insn_referenced = abuf->written;
1731
    INT in_Rs = -1;
1732
    INT out_Rd = -1;
1733
    in_Rs = FLD (in_Rs);
1734
    referenced |= 1 << 0;
1735
    cycles += crisv32f_model_crisv32_u_exec_movem (current_cpu, idesc, 3, referenced, in_Rs, out_Rd);
1736
  }
1737
  return cycles;
1738
#undef FLD
1739
}
1740
 
1741
static int
1742
model_crisv32_add_b_r (SIM_CPU *current_cpu, void *sem_arg)
1743
{
1744
#define FLD(f) abuf->fields.sfmt_addc_m.f
1745
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1746
  const IDESC * UNUSED idesc = abuf->idesc;
1747
  int cycles = 0;
1748
  {
1749
    int referenced = 0;
1750
    int UNUSED insn_referenced = abuf->written;
1751
    INT in_Rd = -1;
1752
    INT in_Rs = -1;
1753
    INT out_Rd = -1;
1754
    in_Rd = FLD (in_Rd);
1755
    in_Rs = FLD (in_Rs);
1756
    referenced |= 1 << 0;
1757
    referenced |= 1 << 1;
1758
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1759
  }
1760
  return cycles;
1761
#undef FLD
1762
}
1763
 
1764
static int
1765
model_crisv32_add_w_r (SIM_CPU *current_cpu, void *sem_arg)
1766
{
1767
#define FLD(f) abuf->fields.sfmt_addc_m.f
1768
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1769
  const IDESC * UNUSED idesc = abuf->idesc;
1770
  int cycles = 0;
1771
  {
1772
    int referenced = 0;
1773
    int UNUSED insn_referenced = abuf->written;
1774
    INT in_Rd = -1;
1775
    INT in_Rs = -1;
1776
    INT out_Rd = -1;
1777
    in_Rd = FLD (in_Rd);
1778
    in_Rs = FLD (in_Rs);
1779
    referenced |= 1 << 0;
1780
    referenced |= 1 << 1;
1781
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1782
  }
1783
  return cycles;
1784
#undef FLD
1785
}
1786
 
1787
static int
1788
model_crisv32_add_d_r (SIM_CPU *current_cpu, void *sem_arg)
1789
{
1790
#define FLD(f) abuf->fields.sfmt_addc_m.f
1791
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1792
  const IDESC * UNUSED idesc = abuf->idesc;
1793
  int cycles = 0;
1794
  {
1795
    int referenced = 0;
1796
    int UNUSED insn_referenced = abuf->written;
1797
    INT in_Rd = -1;
1798
    INT in_Rs = -1;
1799
    INT out_Rd = -1;
1800
    in_Rd = FLD (in_Rd);
1801
    in_Rs = FLD (in_Rs);
1802
    referenced |= 1 << 0;
1803
    referenced |= 1 << 1;
1804
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
1805
  }
1806
  return cycles;
1807
#undef FLD
1808
}
1809
 
1810
static int
1811
model_crisv32_add_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
1812
{
1813
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1814
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1815
  const IDESC * UNUSED idesc = abuf->idesc;
1816
  int cycles = 0;
1817
  {
1818
    int referenced = 0;
1819
    int UNUSED insn_referenced = abuf->written;
1820
    INT in_Rs = -1;
1821
    in_Rs = FLD (in_Rs);
1822
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1823
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1824
  }
1825
  {
1826
    int referenced = 0;
1827
    int UNUSED insn_referenced = abuf->written;
1828
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1829
  }
1830
  {
1831
    int referenced = 0;
1832
    int UNUSED insn_referenced = abuf->written;
1833
    INT in_Rd = -1;
1834
    INT in_Rs = -1;
1835
    INT out_Rd = -1;
1836
    in_Rd = FLD (in_Rd);
1837
    in_Rs = FLD (in_Rs);
1838
    referenced |= 1 << 0;
1839
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1840
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1841
  }
1842
  return cycles;
1843
#undef FLD
1844
}
1845
 
1846
static int
1847
model_crisv32_add_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
1848
{
1849
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1850
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1851
  const IDESC * UNUSED idesc = abuf->idesc;
1852
  int cycles = 0;
1853
  {
1854
    int referenced = 0;
1855
    int UNUSED insn_referenced = abuf->written;
1856
    INT in_Rs = -1;
1857
    in_Rs = FLD (in_Rs);
1858
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1859
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1860
  }
1861
  {
1862
    int referenced = 0;
1863
    int UNUSED insn_referenced = abuf->written;
1864
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1865
  }
1866
  {
1867
    int referenced = 0;
1868
    int UNUSED insn_referenced = abuf->written;
1869
    INT in_Rd = -1;
1870
    INT in_Rs = -1;
1871
    INT out_Rd = -1;
1872
    in_Rd = FLD (in_Rd);
1873
    in_Rs = FLD (in_Rs);
1874
    referenced |= 1 << 0;
1875
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1876
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1877
  }
1878
  return cycles;
1879
#undef FLD
1880
}
1881
 
1882
static int
1883
model_crisv32_add_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
1884
{
1885
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
1886
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1887
  const IDESC * UNUSED idesc = abuf->idesc;
1888
  int cycles = 0;
1889
  {
1890
    int referenced = 0;
1891
    int UNUSED insn_referenced = abuf->written;
1892
    INT in_Rs = -1;
1893
    in_Rs = FLD (in_Rs);
1894
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
1895
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
1896
  }
1897
  {
1898
    int referenced = 0;
1899
    int UNUSED insn_referenced = abuf->written;
1900
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
1901
  }
1902
  {
1903
    int referenced = 0;
1904
    int UNUSED insn_referenced = abuf->written;
1905
    INT in_Rd = -1;
1906
    INT in_Rs = -1;
1907
    INT out_Rd = -1;
1908
    in_Rd = FLD (in_Rd);
1909
    in_Rs = FLD (in_Rs);
1910
    referenced |= 1 << 0;
1911
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
1912
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
1913
  }
1914
  return cycles;
1915
#undef FLD
1916
}
1917
 
1918
static int
1919
model_crisv32_addcbr (SIM_CPU *current_cpu, void *sem_arg)
1920
{
1921
#define FLD(f) abuf->fields.sfmt_addcbr.f
1922
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1923
  const IDESC * UNUSED idesc = abuf->idesc;
1924
  int cycles = 0;
1925
  {
1926
    int referenced = 0;
1927
    int UNUSED insn_referenced = abuf->written;
1928
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1929
  }
1930
  {
1931
    int referenced = 0;
1932
    int UNUSED insn_referenced = abuf->written;
1933
    INT in_Rd = -1;
1934
    INT in_Rs = -1;
1935
    INT out_Rd = -1;
1936
    in_Rd = FLD (in_Rd);
1937
    referenced |= 1 << 0;
1938
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1939
  }
1940
  return cycles;
1941
#undef FLD
1942
}
1943
 
1944
static int
1945
model_crisv32_addcwr (SIM_CPU *current_cpu, void *sem_arg)
1946
{
1947
#define FLD(f) abuf->fields.sfmt_addcwr.f
1948
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1949
  const IDESC * UNUSED idesc = abuf->idesc;
1950
  int cycles = 0;
1951
  {
1952
    int referenced = 0;
1953
    int UNUSED insn_referenced = abuf->written;
1954
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
1955
  }
1956
  {
1957
    int referenced = 0;
1958
    int UNUSED insn_referenced = abuf->written;
1959
    INT in_Rd = -1;
1960
    INT in_Rs = -1;
1961
    INT out_Rd = -1;
1962
    in_Rd = FLD (in_Rd);
1963
    referenced |= 1 << 0;
1964
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1965
  }
1966
  return cycles;
1967
#undef FLD
1968
}
1969
 
1970
static int
1971
model_crisv32_addcdr (SIM_CPU *current_cpu, void *sem_arg)
1972
{
1973
#define FLD(f) abuf->fields.sfmt_addcdr.f
1974
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
1975
  const IDESC * UNUSED idesc = abuf->idesc;
1976
  int cycles = 0;
1977
  {
1978
    int referenced = 0;
1979
    int UNUSED insn_referenced = abuf->written;
1980
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
1981
  }
1982
  {
1983
    int referenced = 0;
1984
    int UNUSED insn_referenced = abuf->written;
1985
    INT in_Rd = -1;
1986
    INT in_Rs = -1;
1987
    INT out_Rd = -1;
1988
    in_Rd = FLD (in_Rd);
1989
    referenced |= 1 << 0;
1990
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
1991
  }
1992
  return cycles;
1993
#undef FLD
1994
}
1995
 
1996
static int
1997
model_crisv32_adds_b_r (SIM_CPU *current_cpu, void *sem_arg)
1998
{
1999
#define FLD(f) abuf->fields.sfmt_addc_m.f
2000
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2001
  const IDESC * UNUSED idesc = abuf->idesc;
2002
  int cycles = 0;
2003
  {
2004
    int referenced = 0;
2005
    int UNUSED insn_referenced = abuf->written;
2006
    INT in_Rd = -1;
2007
    INT in_Rs = -1;
2008
    INT out_Rd = -1;
2009
    in_Rd = FLD (in_Rd);
2010
    in_Rs = FLD (in_Rs);
2011
    referenced |= 1 << 0;
2012
    referenced |= 1 << 1;
2013
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2014
  }
2015
  return cycles;
2016
#undef FLD
2017
}
2018
 
2019
static int
2020
model_crisv32_adds_w_r (SIM_CPU *current_cpu, void *sem_arg)
2021
{
2022
#define FLD(f) abuf->fields.sfmt_addc_m.f
2023
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2024
  const IDESC * UNUSED idesc = abuf->idesc;
2025
  int cycles = 0;
2026
  {
2027
    int referenced = 0;
2028
    int UNUSED insn_referenced = abuf->written;
2029
    INT in_Rd = -1;
2030
    INT in_Rs = -1;
2031
    INT out_Rd = -1;
2032
    in_Rd = FLD (in_Rd);
2033
    in_Rs = FLD (in_Rs);
2034
    referenced |= 1 << 0;
2035
    referenced |= 1 << 1;
2036
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2037
  }
2038
  return cycles;
2039
#undef FLD
2040
}
2041
 
2042
static int
2043
model_crisv32_adds_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2044
{
2045
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2046
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2047
  const IDESC * UNUSED idesc = abuf->idesc;
2048
  int cycles = 0;
2049
  {
2050
    int referenced = 0;
2051
    int UNUSED insn_referenced = abuf->written;
2052
    INT in_Rs = -1;
2053
    in_Rs = FLD (in_Rs);
2054
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2055
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2056
  }
2057
  {
2058
    int referenced = 0;
2059
    int UNUSED insn_referenced = abuf->written;
2060
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2061
  }
2062
  {
2063
    int referenced = 0;
2064
    int UNUSED insn_referenced = abuf->written;
2065
    INT in_Rd = -1;
2066
    INT in_Rs = -1;
2067
    INT out_Rd = -1;
2068
    in_Rd = FLD (in_Rd);
2069
    in_Rs = FLD (in_Rs);
2070
    referenced |= 1 << 0;
2071
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2072
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2073
  }
2074
  return cycles;
2075
#undef FLD
2076
}
2077
 
2078
static int
2079
model_crisv32_adds_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2080
{
2081
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2082
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2083
  const IDESC * UNUSED idesc = abuf->idesc;
2084
  int cycles = 0;
2085
  {
2086
    int referenced = 0;
2087
    int UNUSED insn_referenced = abuf->written;
2088
    INT in_Rs = -1;
2089
    in_Rs = FLD (in_Rs);
2090
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2091
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2092
  }
2093
  {
2094
    int referenced = 0;
2095
    int UNUSED insn_referenced = abuf->written;
2096
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2097
  }
2098
  {
2099
    int referenced = 0;
2100
    int UNUSED insn_referenced = abuf->written;
2101
    INT in_Rd = -1;
2102
    INT in_Rs = -1;
2103
    INT out_Rd = -1;
2104
    in_Rd = FLD (in_Rd);
2105
    in_Rs = FLD (in_Rs);
2106
    referenced |= 1 << 0;
2107
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2108
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2109
  }
2110
  return cycles;
2111
#undef FLD
2112
}
2113
 
2114
static int
2115
model_crisv32_addscbr (SIM_CPU *current_cpu, void *sem_arg)
2116
{
2117
#define FLD(f) abuf->fields.sfmt_addcbr.f
2118
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2119
  const IDESC * UNUSED idesc = abuf->idesc;
2120
  int cycles = 0;
2121
  {
2122
    int referenced = 0;
2123
    int UNUSED insn_referenced = abuf->written;
2124
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2125
  }
2126
  {
2127
    int referenced = 0;
2128
    int UNUSED insn_referenced = abuf->written;
2129
    INT in_Rd = -1;
2130
    INT in_Rs = -1;
2131
    INT out_Rd = -1;
2132
    in_Rd = FLD (in_Rd);
2133
    referenced |= 1 << 0;
2134
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2135
  }
2136
  return cycles;
2137
#undef FLD
2138
}
2139
 
2140
static int
2141
model_crisv32_addscwr (SIM_CPU *current_cpu, void *sem_arg)
2142
{
2143
#define FLD(f) abuf->fields.sfmt_addcwr.f
2144
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2145
  const IDESC * UNUSED idesc = abuf->idesc;
2146
  int cycles = 0;
2147
  {
2148
    int referenced = 0;
2149
    int UNUSED insn_referenced = abuf->written;
2150
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2151
  }
2152
  {
2153
    int referenced = 0;
2154
    int UNUSED insn_referenced = abuf->written;
2155
    INT in_Rd = -1;
2156
    INT in_Rs = -1;
2157
    INT out_Rd = -1;
2158
    in_Rd = FLD (in_Rd);
2159
    referenced |= 1 << 0;
2160
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2161
  }
2162
  return cycles;
2163
#undef FLD
2164
}
2165
 
2166
static int
2167
model_crisv32_addu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2168
{
2169
#define FLD(f) abuf->fields.sfmt_addc_m.f
2170
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2171
  const IDESC * UNUSED idesc = abuf->idesc;
2172
  int cycles = 0;
2173
  {
2174
    int referenced = 0;
2175
    int UNUSED insn_referenced = abuf->written;
2176
    INT in_Rd = -1;
2177
    INT in_Rs = -1;
2178
    INT out_Rd = -1;
2179
    in_Rd = FLD (in_Rd);
2180
    in_Rs = FLD (in_Rs);
2181
    referenced |= 1 << 0;
2182
    referenced |= 1 << 1;
2183
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2184
  }
2185
  return cycles;
2186
#undef FLD
2187
}
2188
 
2189
static int
2190
model_crisv32_addu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2191
{
2192
#define FLD(f) abuf->fields.sfmt_addc_m.f
2193
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2194
  const IDESC * UNUSED idesc = abuf->idesc;
2195
  int cycles = 0;
2196
  {
2197
    int referenced = 0;
2198
    int UNUSED insn_referenced = abuf->written;
2199
    INT in_Rd = -1;
2200
    INT in_Rs = -1;
2201
    INT out_Rd = -1;
2202
    in_Rd = FLD (in_Rd);
2203
    in_Rs = FLD (in_Rs);
2204
    referenced |= 1 << 0;
2205
    referenced |= 1 << 1;
2206
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2207
  }
2208
  return cycles;
2209
#undef FLD
2210
}
2211
 
2212
static int
2213
model_crisv32_addu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2214
{
2215
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2216
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2217
  const IDESC * UNUSED idesc = abuf->idesc;
2218
  int cycles = 0;
2219
  {
2220
    int referenced = 0;
2221
    int UNUSED insn_referenced = abuf->written;
2222
    INT in_Rs = -1;
2223
    in_Rs = FLD (in_Rs);
2224
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2225
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2226
  }
2227
  {
2228
    int referenced = 0;
2229
    int UNUSED insn_referenced = abuf->written;
2230
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2231
  }
2232
  {
2233
    int referenced = 0;
2234
    int UNUSED insn_referenced = abuf->written;
2235
    INT in_Rd = -1;
2236
    INT in_Rs = -1;
2237
    INT out_Rd = -1;
2238
    in_Rd = FLD (in_Rd);
2239
    in_Rs = FLD (in_Rs);
2240
    referenced |= 1 << 0;
2241
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2242
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2243
  }
2244
  return cycles;
2245
#undef FLD
2246
}
2247
 
2248
static int
2249
model_crisv32_addu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2250
{
2251
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2252
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2253
  const IDESC * UNUSED idesc = abuf->idesc;
2254
  int cycles = 0;
2255
  {
2256
    int referenced = 0;
2257
    int UNUSED insn_referenced = abuf->written;
2258
    INT in_Rs = -1;
2259
    in_Rs = FLD (in_Rs);
2260
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2261
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2262
  }
2263
  {
2264
    int referenced = 0;
2265
    int UNUSED insn_referenced = abuf->written;
2266
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2267
  }
2268
  {
2269
    int referenced = 0;
2270
    int UNUSED insn_referenced = abuf->written;
2271
    INT in_Rd = -1;
2272
    INT in_Rs = -1;
2273
    INT out_Rd = -1;
2274
    in_Rd = FLD (in_Rd);
2275
    in_Rs = FLD (in_Rs);
2276
    referenced |= 1 << 0;
2277
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2278
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2279
  }
2280
  return cycles;
2281
#undef FLD
2282
}
2283
 
2284
static int
2285
model_crisv32_adducbr (SIM_CPU *current_cpu, void *sem_arg)
2286
{
2287
#define FLD(f) abuf->fields.sfmt_addcbr.f
2288
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2289
  const IDESC * UNUSED idesc = abuf->idesc;
2290
  int cycles = 0;
2291
  {
2292
    int referenced = 0;
2293
    int UNUSED insn_referenced = abuf->written;
2294
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2295
  }
2296
  {
2297
    int referenced = 0;
2298
    int UNUSED insn_referenced = abuf->written;
2299
    INT in_Rd = -1;
2300
    INT in_Rs = -1;
2301
    INT out_Rd = -1;
2302
    in_Rd = FLD (in_Rd);
2303
    referenced |= 1 << 0;
2304
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2305
  }
2306
  return cycles;
2307
#undef FLD
2308
}
2309
 
2310
static int
2311
model_crisv32_adducwr (SIM_CPU *current_cpu, void *sem_arg)
2312
{
2313
#define FLD(f) abuf->fields.sfmt_addcwr.f
2314
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2315
  const IDESC * UNUSED idesc = abuf->idesc;
2316
  int cycles = 0;
2317
  {
2318
    int referenced = 0;
2319
    int UNUSED insn_referenced = abuf->written;
2320
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2321
  }
2322
  {
2323
    int referenced = 0;
2324
    int UNUSED insn_referenced = abuf->written;
2325
    INT in_Rd = -1;
2326
    INT in_Rs = -1;
2327
    INT out_Rd = -1;
2328
    in_Rd = FLD (in_Rd);
2329
    referenced |= 1 << 0;
2330
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2331
  }
2332
  return cycles;
2333
#undef FLD
2334
}
2335
 
2336
static int
2337
model_crisv32_sub_b_r (SIM_CPU *current_cpu, void *sem_arg)
2338
{
2339
#define FLD(f) abuf->fields.sfmt_addc_m.f
2340
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2341
  const IDESC * UNUSED idesc = abuf->idesc;
2342
  int cycles = 0;
2343
  {
2344
    int referenced = 0;
2345
    int UNUSED insn_referenced = abuf->written;
2346
    INT in_Rd = -1;
2347
    INT in_Rs = -1;
2348
    INT out_Rd = -1;
2349
    in_Rd = FLD (in_Rd);
2350
    in_Rs = FLD (in_Rs);
2351
    referenced |= 1 << 0;
2352
    referenced |= 1 << 1;
2353
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2354
  }
2355
  return cycles;
2356
#undef FLD
2357
}
2358
 
2359
static int
2360
model_crisv32_sub_w_r (SIM_CPU *current_cpu, void *sem_arg)
2361
{
2362
#define FLD(f) abuf->fields.sfmt_addc_m.f
2363
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2364
  const IDESC * UNUSED idesc = abuf->idesc;
2365
  int cycles = 0;
2366
  {
2367
    int referenced = 0;
2368
    int UNUSED insn_referenced = abuf->written;
2369
    INT in_Rd = -1;
2370
    INT in_Rs = -1;
2371
    INT out_Rd = -1;
2372
    in_Rd = FLD (in_Rd);
2373
    in_Rs = FLD (in_Rs);
2374
    referenced |= 1 << 0;
2375
    referenced |= 1 << 1;
2376
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2377
  }
2378
  return cycles;
2379
#undef FLD
2380
}
2381
 
2382
static int
2383
model_crisv32_sub_d_r (SIM_CPU *current_cpu, void *sem_arg)
2384
{
2385
#define FLD(f) abuf->fields.sfmt_addc_m.f
2386
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2387
  const IDESC * UNUSED idesc = abuf->idesc;
2388
  int cycles = 0;
2389
  {
2390
    int referenced = 0;
2391
    int UNUSED insn_referenced = abuf->written;
2392
    INT in_Rd = -1;
2393
    INT in_Rs = -1;
2394
    INT out_Rd = -1;
2395
    in_Rd = FLD (in_Rd);
2396
    in_Rs = FLD (in_Rs);
2397
    referenced |= 1 << 0;
2398
    referenced |= 1 << 1;
2399
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2400
  }
2401
  return cycles;
2402
#undef FLD
2403
}
2404
 
2405
static int
2406
model_crisv32_sub_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2407
{
2408
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2409
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2410
  const IDESC * UNUSED idesc = abuf->idesc;
2411
  int cycles = 0;
2412
  {
2413
    int referenced = 0;
2414
    int UNUSED insn_referenced = abuf->written;
2415
    INT in_Rs = -1;
2416
    in_Rs = FLD (in_Rs);
2417
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2418
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2419
  }
2420
  {
2421
    int referenced = 0;
2422
    int UNUSED insn_referenced = abuf->written;
2423
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2424
  }
2425
  {
2426
    int referenced = 0;
2427
    int UNUSED insn_referenced = abuf->written;
2428
    INT in_Rd = -1;
2429
    INT in_Rs = -1;
2430
    INT out_Rd = -1;
2431
    in_Rd = FLD (in_Rd);
2432
    in_Rs = FLD (in_Rs);
2433
    referenced |= 1 << 0;
2434
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2435
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2436
  }
2437
  return cycles;
2438
#undef FLD
2439
}
2440
 
2441
static int
2442
model_crisv32_sub_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2443
{
2444
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2445
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2446
  const IDESC * UNUSED idesc = abuf->idesc;
2447
  int cycles = 0;
2448
  {
2449
    int referenced = 0;
2450
    int UNUSED insn_referenced = abuf->written;
2451
    INT in_Rs = -1;
2452
    in_Rs = FLD (in_Rs);
2453
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2454
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2455
  }
2456
  {
2457
    int referenced = 0;
2458
    int UNUSED insn_referenced = abuf->written;
2459
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2460
  }
2461
  {
2462
    int referenced = 0;
2463
    int UNUSED insn_referenced = abuf->written;
2464
    INT in_Rd = -1;
2465
    INT in_Rs = -1;
2466
    INT out_Rd = -1;
2467
    in_Rd = FLD (in_Rd);
2468
    in_Rs = FLD (in_Rs);
2469
    referenced |= 1 << 0;
2470
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2471
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2472
  }
2473
  return cycles;
2474
#undef FLD
2475
}
2476
 
2477
static int
2478
model_crisv32_sub_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
2479
{
2480
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2481
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2482
  const IDESC * UNUSED idesc = abuf->idesc;
2483
  int cycles = 0;
2484
  {
2485
    int referenced = 0;
2486
    int UNUSED insn_referenced = abuf->written;
2487
    INT in_Rs = -1;
2488
    in_Rs = FLD (in_Rs);
2489
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2490
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2491
  }
2492
  {
2493
    int referenced = 0;
2494
    int UNUSED insn_referenced = abuf->written;
2495
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2496
  }
2497
  {
2498
    int referenced = 0;
2499
    int UNUSED insn_referenced = abuf->written;
2500
    INT in_Rd = -1;
2501
    INT in_Rs = -1;
2502
    INT out_Rd = -1;
2503
    in_Rd = FLD (in_Rd);
2504
    in_Rs = FLD (in_Rs);
2505
    referenced |= 1 << 0;
2506
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2507
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2508
  }
2509
  return cycles;
2510
#undef FLD
2511
}
2512
 
2513
static int
2514
model_crisv32_subcbr (SIM_CPU *current_cpu, void *sem_arg)
2515
{
2516
#define FLD(f) abuf->fields.sfmt_addcbr.f
2517
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2518
  const IDESC * UNUSED idesc = abuf->idesc;
2519
  int cycles = 0;
2520
  {
2521
    int referenced = 0;
2522
    int UNUSED insn_referenced = abuf->written;
2523
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2524
  }
2525
  {
2526
    int referenced = 0;
2527
    int UNUSED insn_referenced = abuf->written;
2528
    INT in_Rd = -1;
2529
    INT in_Rs = -1;
2530
    INT out_Rd = -1;
2531
    in_Rd = FLD (in_Rd);
2532
    referenced |= 1 << 0;
2533
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2534
  }
2535
  return cycles;
2536
#undef FLD
2537
}
2538
 
2539
static int
2540
model_crisv32_subcwr (SIM_CPU *current_cpu, void *sem_arg)
2541
{
2542
#define FLD(f) abuf->fields.sfmt_addcwr.f
2543
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2544
  const IDESC * UNUSED idesc = abuf->idesc;
2545
  int cycles = 0;
2546
  {
2547
    int referenced = 0;
2548
    int UNUSED insn_referenced = abuf->written;
2549
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2550
  }
2551
  {
2552
    int referenced = 0;
2553
    int UNUSED insn_referenced = abuf->written;
2554
    INT in_Rd = -1;
2555
    INT in_Rs = -1;
2556
    INT out_Rd = -1;
2557
    in_Rd = FLD (in_Rd);
2558
    referenced |= 1 << 0;
2559
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2560
  }
2561
  return cycles;
2562
#undef FLD
2563
}
2564
 
2565
static int
2566
model_crisv32_subcdr (SIM_CPU *current_cpu, void *sem_arg)
2567
{
2568
#define FLD(f) abuf->fields.sfmt_addcdr.f
2569
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2570
  const IDESC * UNUSED idesc = abuf->idesc;
2571
  int cycles = 0;
2572
  {
2573
    int referenced = 0;
2574
    int UNUSED insn_referenced = abuf->written;
2575
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
2576
  }
2577
  {
2578
    int referenced = 0;
2579
    int UNUSED insn_referenced = abuf->written;
2580
    INT in_Rd = -1;
2581
    INT in_Rs = -1;
2582
    INT out_Rd = -1;
2583
    in_Rd = FLD (in_Rd);
2584
    referenced |= 1 << 0;
2585
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2586
  }
2587
  return cycles;
2588
#undef FLD
2589
}
2590
 
2591
static int
2592
model_crisv32_subs_b_r (SIM_CPU *current_cpu, void *sem_arg)
2593
{
2594
#define FLD(f) abuf->fields.sfmt_addc_m.f
2595
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2596
  const IDESC * UNUSED idesc = abuf->idesc;
2597
  int cycles = 0;
2598
  {
2599
    int referenced = 0;
2600
    int UNUSED insn_referenced = abuf->written;
2601
    INT in_Rd = -1;
2602
    INT in_Rs = -1;
2603
    INT out_Rd = -1;
2604
    in_Rd = FLD (in_Rd);
2605
    in_Rs = FLD (in_Rs);
2606
    referenced |= 1 << 0;
2607
    referenced |= 1 << 1;
2608
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2609
  }
2610
  return cycles;
2611
#undef FLD
2612
}
2613
 
2614
static int
2615
model_crisv32_subs_w_r (SIM_CPU *current_cpu, void *sem_arg)
2616
{
2617
#define FLD(f) abuf->fields.sfmt_addc_m.f
2618
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2619
  const IDESC * UNUSED idesc = abuf->idesc;
2620
  int cycles = 0;
2621
  {
2622
    int referenced = 0;
2623
    int UNUSED insn_referenced = abuf->written;
2624
    INT in_Rd = -1;
2625
    INT in_Rs = -1;
2626
    INT out_Rd = -1;
2627
    in_Rd = FLD (in_Rd);
2628
    in_Rs = FLD (in_Rs);
2629
    referenced |= 1 << 0;
2630
    referenced |= 1 << 1;
2631
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2632
  }
2633
  return cycles;
2634
#undef FLD
2635
}
2636
 
2637
static int
2638
model_crisv32_subs_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2639
{
2640
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2641
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2642
  const IDESC * UNUSED idesc = abuf->idesc;
2643
  int cycles = 0;
2644
  {
2645
    int referenced = 0;
2646
    int UNUSED insn_referenced = abuf->written;
2647
    INT in_Rs = -1;
2648
    in_Rs = FLD (in_Rs);
2649
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2650
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2651
  }
2652
  {
2653
    int referenced = 0;
2654
    int UNUSED insn_referenced = abuf->written;
2655
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2656
  }
2657
  {
2658
    int referenced = 0;
2659
    int UNUSED insn_referenced = abuf->written;
2660
    INT in_Rd = -1;
2661
    INT in_Rs = -1;
2662
    INT out_Rd = -1;
2663
    in_Rd = FLD (in_Rd);
2664
    in_Rs = FLD (in_Rs);
2665
    referenced |= 1 << 0;
2666
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2667
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2668
  }
2669
  return cycles;
2670
#undef FLD
2671
}
2672
 
2673
static int
2674
model_crisv32_subs_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2675
{
2676
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2677
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2678
  const IDESC * UNUSED idesc = abuf->idesc;
2679
  int cycles = 0;
2680
  {
2681
    int referenced = 0;
2682
    int UNUSED insn_referenced = abuf->written;
2683
    INT in_Rs = -1;
2684
    in_Rs = FLD (in_Rs);
2685
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2686
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2687
  }
2688
  {
2689
    int referenced = 0;
2690
    int UNUSED insn_referenced = abuf->written;
2691
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2692
  }
2693
  {
2694
    int referenced = 0;
2695
    int UNUSED insn_referenced = abuf->written;
2696
    INT in_Rd = -1;
2697
    INT in_Rs = -1;
2698
    INT out_Rd = -1;
2699
    in_Rd = FLD (in_Rd);
2700
    in_Rs = FLD (in_Rs);
2701
    referenced |= 1 << 0;
2702
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2703
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2704
  }
2705
  return cycles;
2706
#undef FLD
2707
}
2708
 
2709
static int
2710
model_crisv32_subscbr (SIM_CPU *current_cpu, void *sem_arg)
2711
{
2712
#define FLD(f) abuf->fields.sfmt_addcbr.f
2713
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2714
  const IDESC * UNUSED idesc = abuf->idesc;
2715
  int cycles = 0;
2716
  {
2717
    int referenced = 0;
2718
    int UNUSED insn_referenced = abuf->written;
2719
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2720
  }
2721
  {
2722
    int referenced = 0;
2723
    int UNUSED insn_referenced = abuf->written;
2724
    INT in_Rd = -1;
2725
    INT in_Rs = -1;
2726
    INT out_Rd = -1;
2727
    in_Rd = FLD (in_Rd);
2728
    referenced |= 1 << 0;
2729
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2730
  }
2731
  return cycles;
2732
#undef FLD
2733
}
2734
 
2735
static int
2736
model_crisv32_subscwr (SIM_CPU *current_cpu, void *sem_arg)
2737
{
2738
#define FLD(f) abuf->fields.sfmt_addcwr.f
2739
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2740
  const IDESC * UNUSED idesc = abuf->idesc;
2741
  int cycles = 0;
2742
  {
2743
    int referenced = 0;
2744
    int UNUSED insn_referenced = abuf->written;
2745
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2746
  }
2747
  {
2748
    int referenced = 0;
2749
    int UNUSED insn_referenced = abuf->written;
2750
    INT in_Rd = -1;
2751
    INT in_Rs = -1;
2752
    INT out_Rd = -1;
2753
    in_Rd = FLD (in_Rd);
2754
    referenced |= 1 << 0;
2755
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2756
  }
2757
  return cycles;
2758
#undef FLD
2759
}
2760
 
2761
static int
2762
model_crisv32_subu_b_r (SIM_CPU *current_cpu, void *sem_arg)
2763
{
2764
#define FLD(f) abuf->fields.sfmt_addc_m.f
2765
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2766
  const IDESC * UNUSED idesc = abuf->idesc;
2767
  int cycles = 0;
2768
  {
2769
    int referenced = 0;
2770
    int UNUSED insn_referenced = abuf->written;
2771
    INT in_Rd = -1;
2772
    INT in_Rs = -1;
2773
    INT out_Rd = -1;
2774
    in_Rd = FLD (in_Rd);
2775
    in_Rs = FLD (in_Rs);
2776
    referenced |= 1 << 0;
2777
    referenced |= 1 << 1;
2778
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2779
  }
2780
  return cycles;
2781
#undef FLD
2782
}
2783
 
2784
static int
2785
model_crisv32_subu_w_r (SIM_CPU *current_cpu, void *sem_arg)
2786
{
2787
#define FLD(f) abuf->fields.sfmt_addc_m.f
2788
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2789
  const IDESC * UNUSED idesc = abuf->idesc;
2790
  int cycles = 0;
2791
  {
2792
    int referenced = 0;
2793
    int UNUSED insn_referenced = abuf->written;
2794
    INT in_Rd = -1;
2795
    INT in_Rs = -1;
2796
    INT out_Rd = -1;
2797
    in_Rd = FLD (in_Rd);
2798
    in_Rs = FLD (in_Rs);
2799
    referenced |= 1 << 0;
2800
    referenced |= 1 << 1;
2801
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2802
  }
2803
  return cycles;
2804
#undef FLD
2805
}
2806
 
2807
static int
2808
model_crisv32_subu_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
2809
{
2810
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2811
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2812
  const IDESC * UNUSED idesc = abuf->idesc;
2813
  int cycles = 0;
2814
  {
2815
    int referenced = 0;
2816
    int UNUSED insn_referenced = abuf->written;
2817
    INT in_Rs = -1;
2818
    in_Rs = FLD (in_Rs);
2819
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2820
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2821
  }
2822
  {
2823
    int referenced = 0;
2824
    int UNUSED insn_referenced = abuf->written;
2825
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2826
  }
2827
  {
2828
    int referenced = 0;
2829
    int UNUSED insn_referenced = abuf->written;
2830
    INT in_Rd = -1;
2831
    INT in_Rs = -1;
2832
    INT out_Rd = -1;
2833
    in_Rd = FLD (in_Rd);
2834
    in_Rs = FLD (in_Rs);
2835
    referenced |= 1 << 0;
2836
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2837
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2838
  }
2839
  return cycles;
2840
#undef FLD
2841
}
2842
 
2843
static int
2844
model_crisv32_subu_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
2845
{
2846
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
2847
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2848
  const IDESC * UNUSED idesc = abuf->idesc;
2849
  int cycles = 0;
2850
  {
2851
    int referenced = 0;
2852
    int UNUSED insn_referenced = abuf->written;
2853
    INT in_Rs = -1;
2854
    in_Rs = FLD (in_Rs);
2855
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2856
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2857
  }
2858
  {
2859
    int referenced = 0;
2860
    int UNUSED insn_referenced = abuf->written;
2861
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2862
  }
2863
  {
2864
    int referenced = 0;
2865
    int UNUSED insn_referenced = abuf->written;
2866
    INT in_Rd = -1;
2867
    INT in_Rs = -1;
2868
    INT out_Rd = -1;
2869
    in_Rd = FLD (in_Rd);
2870
    in_Rs = FLD (in_Rs);
2871
    referenced |= 1 << 0;
2872
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2873
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2874
  }
2875
  return cycles;
2876
#undef FLD
2877
}
2878
 
2879
static int
2880
model_crisv32_subucbr (SIM_CPU *current_cpu, void *sem_arg)
2881
{
2882
#define FLD(f) abuf->fields.sfmt_addcbr.f
2883
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2884
  const IDESC * UNUSED idesc = abuf->idesc;
2885
  int cycles = 0;
2886
  {
2887
    int referenced = 0;
2888
    int UNUSED insn_referenced = abuf->written;
2889
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2890
  }
2891
  {
2892
    int referenced = 0;
2893
    int UNUSED insn_referenced = abuf->written;
2894
    INT in_Rd = -1;
2895
    INT in_Rs = -1;
2896
    INT out_Rd = -1;
2897
    in_Rd = FLD (in_Rd);
2898
    referenced |= 1 << 0;
2899
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2900
  }
2901
  return cycles;
2902
#undef FLD
2903
}
2904
 
2905
static int
2906
model_crisv32_subucwr (SIM_CPU *current_cpu, void *sem_arg)
2907
{
2908
#define FLD(f) abuf->fields.sfmt_addcwr.f
2909
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2910
  const IDESC * UNUSED idesc = abuf->idesc;
2911
  int cycles = 0;
2912
  {
2913
    int referenced = 0;
2914
    int UNUSED insn_referenced = abuf->written;
2915
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
2916
  }
2917
  {
2918
    int referenced = 0;
2919
    int UNUSED insn_referenced = abuf->written;
2920
    INT in_Rd = -1;
2921
    INT in_Rs = -1;
2922
    INT out_Rd = -1;
2923
    in_Rd = FLD (in_Rd);
2924
    referenced |= 1 << 0;
2925
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
2926
  }
2927
  return cycles;
2928
#undef FLD
2929
}
2930
 
2931
static int
2932
model_crisv32_addc_r (SIM_CPU *current_cpu, void *sem_arg)
2933
{
2934
#define FLD(f) abuf->fields.sfmt_addc_m.f
2935
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2936
  const IDESC * UNUSED idesc = abuf->idesc;
2937
  int cycles = 0;
2938
  {
2939
    int referenced = 0;
2940
    int UNUSED insn_referenced = abuf->written;
2941
    INT in_Rd = -1;
2942
    INT in_Rs = -1;
2943
    INT out_Rd = -1;
2944
    in_Rd = FLD (in_Rd);
2945
    in_Rs = FLD (in_Rs);
2946
    referenced |= 1 << 0;
2947
    referenced |= 1 << 1;
2948
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
2949
  }
2950
  return cycles;
2951
#undef FLD
2952
}
2953
 
2954
static int
2955
model_crisv32_addc_m (SIM_CPU *current_cpu, void *sem_arg)
2956
{
2957
#define FLD(f) abuf->fields.sfmt_addc_m.f
2958
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2959
  const IDESC * UNUSED idesc = abuf->idesc;
2960
  int cycles = 0;
2961
  {
2962
    int referenced = 0;
2963
    int UNUSED insn_referenced = abuf->written;
2964
    INT in_Rs = -1;
2965
    in_Rs = FLD (in_Rs);
2966
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
2967
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
2968
  }
2969
  {
2970
    int referenced = 0;
2971
    int UNUSED insn_referenced = abuf->written;
2972
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
2973
  }
2974
  {
2975
    int referenced = 0;
2976
    int UNUSED insn_referenced = abuf->written;
2977
    INT in_Rd = -1;
2978
    INT in_Rs = -1;
2979
    INT out_Rd = -1;
2980
    in_Rd = FLD (in_Rd);
2981
    in_Rs = FLD (in_Rs);
2982
    referenced |= 1 << 0;
2983
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
2984
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
2985
  }
2986
  return cycles;
2987
#undef FLD
2988
}
2989
 
2990
static int
2991
model_crisv32_addc_c (SIM_CPU *current_cpu, void *sem_arg)
2992
{
2993
#define FLD(f) abuf->fields.sfmt_addcdr.f
2994
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
2995
  const IDESC * UNUSED idesc = abuf->idesc;
2996
  int cycles = 0;
2997
  {
2998
    int referenced = 0;
2999
    int UNUSED insn_referenced = abuf->written;
3000
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3001
  }
3002
  {
3003
    int referenced = 0;
3004
    int UNUSED insn_referenced = abuf->written;
3005
    INT in_Rd = -1;
3006
    INT in_Rs = -1;
3007
    INT out_Rd = -1;
3008
    in_Rd = FLD (in_Rd);
3009
    referenced |= 1 << 0;
3010
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3011
  }
3012
  return cycles;
3013
#undef FLD
3014
}
3015
 
3016
static int
3017
model_crisv32_lapc_d (SIM_CPU *current_cpu, void *sem_arg)
3018
{
3019
#define FLD(f) abuf->fields.sfmt_lapc_d.f
3020
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3021
  const IDESC * UNUSED idesc = abuf->idesc;
3022
  int cycles = 0;
3023
  {
3024
    int referenced = 0;
3025
    int UNUSED insn_referenced = abuf->written;
3026
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3027
  }
3028
  {
3029
    int referenced = 0;
3030
    int UNUSED insn_referenced = abuf->written;
3031
    INT in_Rd = -1;
3032
    INT in_Rs = -1;
3033
    INT out_Rd = -1;
3034
    out_Rd = FLD (out_Rd);
3035
    referenced |= 1 << 2;
3036
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3037
  }
3038
  return cycles;
3039
#undef FLD
3040
}
3041
 
3042
static int
3043
model_crisv32_lapcq (SIM_CPU *current_cpu, void *sem_arg)
3044
{
3045
#define FLD(f) abuf->fields.sfmt_lapcq.f
3046
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3047
  const IDESC * UNUSED idesc = abuf->idesc;
3048
  int cycles = 0;
3049
  {
3050
    int referenced = 0;
3051
    int UNUSED insn_referenced = abuf->written;
3052
    INT in_Rd = -1;
3053
    INT in_Rs = -1;
3054
    INT out_Rd = -1;
3055
    out_Rd = FLD (out_Rd);
3056
    referenced |= 1 << 2;
3057
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3058
  }
3059
  return cycles;
3060
#undef FLD
3061
}
3062
 
3063
static int
3064
model_crisv32_addi_b_r (SIM_CPU *current_cpu, void *sem_arg)
3065
{
3066
#define FLD(f) abuf->fields.sfmt_addc_m.f
3067
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3068
  const IDESC * UNUSED idesc = abuf->idesc;
3069
  int cycles = 0;
3070
  {
3071
    int referenced = 0;
3072
    int UNUSED insn_referenced = abuf->written;
3073
    INT in_Rd = -1;
3074
    INT in_Rs = -1;
3075
    INT out_Rd = -1;
3076
    in_Rd = FLD (in_Rd);
3077
    in_Rs = FLD (in_Rs);
3078
    referenced |= 1 << 0;
3079
    referenced |= 1 << 1;
3080
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3081
  }
3082
  return cycles;
3083
#undef FLD
3084
}
3085
 
3086
static int
3087
model_crisv32_addi_w_r (SIM_CPU *current_cpu, void *sem_arg)
3088
{
3089
#define FLD(f) abuf->fields.sfmt_addc_m.f
3090
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3091
  const IDESC * UNUSED idesc = abuf->idesc;
3092
  int cycles = 0;
3093
  {
3094
    int referenced = 0;
3095
    int UNUSED insn_referenced = abuf->written;
3096
    INT in_Rd = -1;
3097
    INT in_Rs = -1;
3098
    INT out_Rd = -1;
3099
    in_Rd = FLD (in_Rd);
3100
    in_Rs = FLD (in_Rs);
3101
    referenced |= 1 << 0;
3102
    referenced |= 1 << 1;
3103
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3104
  }
3105
  return cycles;
3106
#undef FLD
3107
}
3108
 
3109
static int
3110
model_crisv32_addi_d_r (SIM_CPU *current_cpu, void *sem_arg)
3111
{
3112
#define FLD(f) abuf->fields.sfmt_addc_m.f
3113
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3114
  const IDESC * UNUSED idesc = abuf->idesc;
3115
  int cycles = 0;
3116
  {
3117
    int referenced = 0;
3118
    int UNUSED insn_referenced = abuf->written;
3119
    INT in_Rd = -1;
3120
    INT in_Rs = -1;
3121
    INT out_Rd = -1;
3122
    in_Rd = FLD (in_Rd);
3123
    in_Rs = FLD (in_Rs);
3124
    referenced |= 1 << 0;
3125
    referenced |= 1 << 1;
3126
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3127
  }
3128
  return cycles;
3129
#undef FLD
3130
}
3131
 
3132
static int
3133
model_crisv32_neg_b_r (SIM_CPU *current_cpu, void *sem_arg)
3134
{
3135
#define FLD(f) abuf->fields.sfmt_addc_m.f
3136
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3137
  const IDESC * UNUSED idesc = abuf->idesc;
3138
  int cycles = 0;
3139
  {
3140
    int referenced = 0;
3141
    int UNUSED insn_referenced = abuf->written;
3142
    INT in_Rd = -1;
3143
    INT in_Rs = -1;
3144
    INT out_Rd = -1;
3145
    in_Rs = FLD (in_Rs);
3146
    referenced |= 1 << 1;
3147
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3148
  }
3149
  return cycles;
3150
#undef FLD
3151
}
3152
 
3153
static int
3154
model_crisv32_neg_w_r (SIM_CPU *current_cpu, void *sem_arg)
3155
{
3156
#define FLD(f) abuf->fields.sfmt_addc_m.f
3157
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3158
  const IDESC * UNUSED idesc = abuf->idesc;
3159
  int cycles = 0;
3160
  {
3161
    int referenced = 0;
3162
    int UNUSED insn_referenced = abuf->written;
3163
    INT in_Rd = -1;
3164
    INT in_Rs = -1;
3165
    INT out_Rd = -1;
3166
    in_Rs = FLD (in_Rs);
3167
    referenced |= 1 << 1;
3168
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3169
  }
3170
  return cycles;
3171
#undef FLD
3172
}
3173
 
3174
static int
3175
model_crisv32_neg_d_r (SIM_CPU *current_cpu, void *sem_arg)
3176
{
3177
#define FLD(f) abuf->fields.sfmt_addc_m.f
3178
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3179
  const IDESC * UNUSED idesc = abuf->idesc;
3180
  int cycles = 0;
3181
  {
3182
    int referenced = 0;
3183
    int UNUSED insn_referenced = abuf->written;
3184
    INT in_Rd = -1;
3185
    INT in_Rs = -1;
3186
    INT out_Rd = -1;
3187
    in_Rs = FLD (in_Rs);
3188
    referenced |= 1 << 1;
3189
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3190
  }
3191
  return cycles;
3192
#undef FLD
3193
}
3194
 
3195
static int
3196
model_crisv32_test_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3197
{
3198
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3199
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3200
  const IDESC * UNUSED idesc = abuf->idesc;
3201
  int cycles = 0;
3202
  {
3203
    int referenced = 0;
3204
    int UNUSED insn_referenced = abuf->written;
3205
    INT in_Rs = -1;
3206
    in_Rs = FLD (in_Rs);
3207
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3208
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3209
  }
3210
  {
3211
    int referenced = 0;
3212
    int UNUSED insn_referenced = abuf->written;
3213
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3214
  }
3215
  {
3216
    int referenced = 0;
3217
    int UNUSED insn_referenced = abuf->written;
3218
    INT in_Rd = -1;
3219
    INT in_Rs = -1;
3220
    INT out_Rd = -1;
3221
    in_Rs = FLD (in_Rs);
3222
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3223
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3224
  }
3225
  return cycles;
3226
#undef FLD
3227
}
3228
 
3229
static int
3230
model_crisv32_test_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3231
{
3232
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3233
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3234
  const IDESC * UNUSED idesc = abuf->idesc;
3235
  int cycles = 0;
3236
  {
3237
    int referenced = 0;
3238
    int UNUSED insn_referenced = abuf->written;
3239
    INT in_Rs = -1;
3240
    in_Rs = FLD (in_Rs);
3241
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3242
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3243
  }
3244
  {
3245
    int referenced = 0;
3246
    int UNUSED insn_referenced = abuf->written;
3247
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3248
  }
3249
  {
3250
    int referenced = 0;
3251
    int UNUSED insn_referenced = abuf->written;
3252
    INT in_Rd = -1;
3253
    INT in_Rs = -1;
3254
    INT out_Rd = -1;
3255
    in_Rs = FLD (in_Rs);
3256
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3257
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3258
  }
3259
  return cycles;
3260
#undef FLD
3261
}
3262
 
3263
static int
3264
model_crisv32_test_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3265
{
3266
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
3267
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3268
  const IDESC * UNUSED idesc = abuf->idesc;
3269
  int cycles = 0;
3270
  {
3271
    int referenced = 0;
3272
    int UNUSED insn_referenced = abuf->written;
3273
    INT in_Rs = -1;
3274
    in_Rs = FLD (in_Rs);
3275
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
3276
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3277
  }
3278
  {
3279
    int referenced = 0;
3280
    int UNUSED insn_referenced = abuf->written;
3281
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3282
  }
3283
  {
3284
    int referenced = 0;
3285
    int UNUSED insn_referenced = abuf->written;
3286
    INT in_Rd = -1;
3287
    INT in_Rs = -1;
3288
    INT out_Rd = -1;
3289
    in_Rs = FLD (in_Rs);
3290
    if (insn_referenced & (1 << 0)) referenced |= 1 << 1;
3291
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3292
  }
3293
  return cycles;
3294
#undef FLD
3295
}
3296
 
3297
static int
3298
model_crisv32_move_r_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3299
{
3300
#define FLD(f) abuf->fields.sfmt_addc_m.f
3301
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3302
  const IDESC * UNUSED idesc = abuf->idesc;
3303
  int cycles = 0;
3304
  {
3305
    int referenced = 0;
3306
    int UNUSED insn_referenced = abuf->written;
3307
    INT in_Rs = -1;
3308
    in_Rs = FLD (in_Rs);
3309
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3310
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3311
  }
3312
  {
3313
    int referenced = 0;
3314
    int UNUSED insn_referenced = abuf->written;
3315
    INT in_Rd = -1;
3316
    INT in_Rs = -1;
3317
    INT out_Rd = -1;
3318
    in_Rd = FLD (in_Rd);
3319
    in_Rs = FLD (in_Rs);
3320
    referenced |= 1 << 0;
3321
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3322
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3323
  }
3324
  {
3325
    int referenced = 0;
3326
    int UNUSED insn_referenced = abuf->written;
3327
    cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3328
  }
3329
  return cycles;
3330
#undef FLD
3331
}
3332
 
3333
static int
3334
model_crisv32_move_r_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3335
{
3336
#define FLD(f) abuf->fields.sfmt_addc_m.f
3337
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3338
  const IDESC * UNUSED idesc = abuf->idesc;
3339
  int cycles = 0;
3340
  {
3341
    int referenced = 0;
3342
    int UNUSED insn_referenced = abuf->written;
3343
    INT in_Rs = -1;
3344
    in_Rs = FLD (in_Rs);
3345
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3346
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3347
  }
3348
  {
3349
    int referenced = 0;
3350
    int UNUSED insn_referenced = abuf->written;
3351
    INT in_Rd = -1;
3352
    INT in_Rs = -1;
3353
    INT out_Rd = -1;
3354
    in_Rd = FLD (in_Rd);
3355
    in_Rs = FLD (in_Rs);
3356
    referenced |= 1 << 0;
3357
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3358
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3359
  }
3360
  {
3361
    int referenced = 0;
3362
    int UNUSED insn_referenced = abuf->written;
3363
    cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3364
  }
3365
  return cycles;
3366
#undef FLD
3367
}
3368
 
3369
static int
3370
model_crisv32_move_r_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3371
{
3372
#define FLD(f) abuf->fields.sfmt_addc_m.f
3373
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3374
  const IDESC * UNUSED idesc = abuf->idesc;
3375
  int cycles = 0;
3376
  {
3377
    int referenced = 0;
3378
    int UNUSED insn_referenced = abuf->written;
3379
    INT in_Rs = -1;
3380
    in_Rs = FLD (in_Rs);
3381
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3382
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3383
  }
3384
  {
3385
    int referenced = 0;
3386
    int UNUSED insn_referenced = abuf->written;
3387
    INT in_Rd = -1;
3388
    INT in_Rs = -1;
3389
    INT out_Rd = -1;
3390
    in_Rd = FLD (in_Rd);
3391
    in_Rs = FLD (in_Rs);
3392
    referenced |= 1 << 0;
3393
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3394
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3395
  }
3396
  {
3397
    int referenced = 0;
3398
    int UNUSED insn_referenced = abuf->written;
3399
    cycles += crisv32f_model_crisv32_u_mem_w (current_cpu, idesc, 2, referenced);
3400
  }
3401
  return cycles;
3402
#undef FLD
3403
}
3404
 
3405
static int
3406
model_crisv32_muls_b (SIM_CPU *current_cpu, void *sem_arg)
3407
{
3408
#define FLD(f) abuf->fields.sfmt_muls_b.f
3409
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3410
  const IDESC * UNUSED idesc = abuf->idesc;
3411
  int cycles = 0;
3412
  {
3413
    int referenced = 0;
3414
    int UNUSED insn_referenced = abuf->written;
3415
    INT in_Rs = -1;
3416
    INT in_Rd = -1;
3417
    in_Rs = FLD (in_Rs);
3418
    in_Rd = FLD (in_Rd);
3419
    referenced |= 1 << 0;
3420
    referenced |= 1 << 1;
3421
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3422
  }
3423
  {
3424
    int referenced = 0;
3425
    int UNUSED insn_referenced = abuf->written;
3426
    INT in_Rd = -1;
3427
    INT in_Rs = -1;
3428
    INT out_Rd = -1;
3429
    in_Rd = FLD (in_Rd);
3430
    in_Rs = FLD (in_Rs);
3431
    out_Rd = FLD (out_Rd);
3432
    referenced |= 1 << 0;
3433
    referenced |= 1 << 1;
3434
    referenced |= 1 << 2;
3435
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3436
  }
3437
  return cycles;
3438
#undef FLD
3439
}
3440
 
3441
static int
3442
model_crisv32_muls_w (SIM_CPU *current_cpu, void *sem_arg)
3443
{
3444
#define FLD(f) abuf->fields.sfmt_muls_b.f
3445
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3446
  const IDESC * UNUSED idesc = abuf->idesc;
3447
  int cycles = 0;
3448
  {
3449
    int referenced = 0;
3450
    int UNUSED insn_referenced = abuf->written;
3451
    INT in_Rs = -1;
3452
    INT in_Rd = -1;
3453
    in_Rs = FLD (in_Rs);
3454
    in_Rd = FLD (in_Rd);
3455
    referenced |= 1 << 0;
3456
    referenced |= 1 << 1;
3457
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3458
  }
3459
  {
3460
    int referenced = 0;
3461
    int UNUSED insn_referenced = abuf->written;
3462
    INT in_Rd = -1;
3463
    INT in_Rs = -1;
3464
    INT out_Rd = -1;
3465
    in_Rd = FLD (in_Rd);
3466
    in_Rs = FLD (in_Rs);
3467
    out_Rd = FLD (out_Rd);
3468
    referenced |= 1 << 0;
3469
    referenced |= 1 << 1;
3470
    referenced |= 1 << 2;
3471
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3472
  }
3473
  return cycles;
3474
#undef FLD
3475
}
3476
 
3477
static int
3478
model_crisv32_muls_d (SIM_CPU *current_cpu, void *sem_arg)
3479
{
3480
#define FLD(f) abuf->fields.sfmt_muls_b.f
3481
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3482
  const IDESC * UNUSED idesc = abuf->idesc;
3483
  int cycles = 0;
3484
  {
3485
    int referenced = 0;
3486
    int UNUSED insn_referenced = abuf->written;
3487
    INT in_Rs = -1;
3488
    INT in_Rd = -1;
3489
    in_Rs = FLD (in_Rs);
3490
    in_Rd = FLD (in_Rd);
3491
    referenced |= 1 << 0;
3492
    referenced |= 1 << 1;
3493
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3494
  }
3495
  {
3496
    int referenced = 0;
3497
    int UNUSED insn_referenced = abuf->written;
3498
    INT in_Rd = -1;
3499
    INT in_Rs = -1;
3500
    INT out_Rd = -1;
3501
    in_Rd = FLD (in_Rd);
3502
    in_Rs = FLD (in_Rs);
3503
    out_Rd = FLD (out_Rd);
3504
    referenced |= 1 << 0;
3505
    referenced |= 1 << 1;
3506
    referenced |= 1 << 2;
3507
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3508
  }
3509
  return cycles;
3510
#undef FLD
3511
}
3512
 
3513
static int
3514
model_crisv32_mulu_b (SIM_CPU *current_cpu, void *sem_arg)
3515
{
3516
#define FLD(f) abuf->fields.sfmt_muls_b.f
3517
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3518
  const IDESC * UNUSED idesc = abuf->idesc;
3519
  int cycles = 0;
3520
  {
3521
    int referenced = 0;
3522
    int UNUSED insn_referenced = abuf->written;
3523
    INT in_Rs = -1;
3524
    INT in_Rd = -1;
3525
    in_Rs = FLD (in_Rs);
3526
    in_Rd = FLD (in_Rd);
3527
    referenced |= 1 << 0;
3528
    referenced |= 1 << 1;
3529
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3530
  }
3531
  {
3532
    int referenced = 0;
3533
    int UNUSED insn_referenced = abuf->written;
3534
    INT in_Rd = -1;
3535
    INT in_Rs = -1;
3536
    INT out_Rd = -1;
3537
    in_Rd = FLD (in_Rd);
3538
    in_Rs = FLD (in_Rs);
3539
    out_Rd = FLD (out_Rd);
3540
    referenced |= 1 << 0;
3541
    referenced |= 1 << 1;
3542
    referenced |= 1 << 2;
3543
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3544
  }
3545
  return cycles;
3546
#undef FLD
3547
}
3548
 
3549
static int
3550
model_crisv32_mulu_w (SIM_CPU *current_cpu, void *sem_arg)
3551
{
3552
#define FLD(f) abuf->fields.sfmt_muls_b.f
3553
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3554
  const IDESC * UNUSED idesc = abuf->idesc;
3555
  int cycles = 0;
3556
  {
3557
    int referenced = 0;
3558
    int UNUSED insn_referenced = abuf->written;
3559
    INT in_Rs = -1;
3560
    INT in_Rd = -1;
3561
    in_Rs = FLD (in_Rs);
3562
    in_Rd = FLD (in_Rd);
3563
    referenced |= 1 << 0;
3564
    referenced |= 1 << 1;
3565
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3566
  }
3567
  {
3568
    int referenced = 0;
3569
    int UNUSED insn_referenced = abuf->written;
3570
    INT in_Rd = -1;
3571
    INT in_Rs = -1;
3572
    INT out_Rd = -1;
3573
    in_Rd = FLD (in_Rd);
3574
    in_Rs = FLD (in_Rs);
3575
    out_Rd = FLD (out_Rd);
3576
    referenced |= 1 << 0;
3577
    referenced |= 1 << 1;
3578
    referenced |= 1 << 2;
3579
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3580
  }
3581
  return cycles;
3582
#undef FLD
3583
}
3584
 
3585
static int
3586
model_crisv32_mulu_d (SIM_CPU *current_cpu, void *sem_arg)
3587
{
3588
#define FLD(f) abuf->fields.sfmt_muls_b.f
3589
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3590
  const IDESC * UNUSED idesc = abuf->idesc;
3591
  int cycles = 0;
3592
  {
3593
    int referenced = 0;
3594
    int UNUSED insn_referenced = abuf->written;
3595
    INT in_Rs = -1;
3596
    INT in_Rd = -1;
3597
    in_Rs = FLD (in_Rs);
3598
    in_Rd = FLD (in_Rd);
3599
    referenced |= 1 << 0;
3600
    referenced |= 1 << 1;
3601
    cycles += crisv32f_model_crisv32_u_multiply (current_cpu, idesc, 0, referenced, in_Rs, in_Rd);
3602
  }
3603
  {
3604
    int referenced = 0;
3605
    int UNUSED insn_referenced = abuf->written;
3606
    INT in_Rd = -1;
3607
    INT in_Rs = -1;
3608
    INT out_Rd = -1;
3609
    in_Rd = FLD (in_Rd);
3610
    in_Rs = FLD (in_Rs);
3611
    out_Rd = FLD (out_Rd);
3612
    referenced |= 1 << 0;
3613
    referenced |= 1 << 1;
3614
    referenced |= 1 << 2;
3615
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3616
  }
3617
  return cycles;
3618
#undef FLD
3619
}
3620
 
3621
static int
3622
model_crisv32_mcp (SIM_CPU *current_cpu, void *sem_arg)
3623
{
3624
#define FLD(f) abuf->fields.sfmt_mcp.f
3625
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3626
  const IDESC * UNUSED idesc = abuf->idesc;
3627
  int cycles = 0;
3628
  {
3629
    int referenced = 0;
3630
    int UNUSED insn_referenced = abuf->written;
3631
    INT in_Rd = -1;
3632
    INT in_Rs = -1;
3633
    INT out_Rd = -1;
3634
    in_Rs = FLD (in_Rs);
3635
    referenced |= 1 << 1;
3636
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3637
  }
3638
  return cycles;
3639
#undef FLD
3640
}
3641
 
3642
static int
3643
model_crisv32_dstep (SIM_CPU *current_cpu, void *sem_arg)
3644
{
3645
#define FLD(f) abuf->fields.sfmt_muls_b.f
3646
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3647
  const IDESC * UNUSED idesc = abuf->idesc;
3648
  int cycles = 0;
3649
  {
3650
    int referenced = 0;
3651
    int UNUSED insn_referenced = abuf->written;
3652
    INT in_Rd = -1;
3653
    INT in_Rs = -1;
3654
    INT out_Rd = -1;
3655
    in_Rd = FLD (in_Rd);
3656
    in_Rs = FLD (in_Rs);
3657
    out_Rd = FLD (out_Rd);
3658
    referenced |= 1 << 0;
3659
    referenced |= 1 << 1;
3660
    referenced |= 1 << 2;
3661
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3662
  }
3663
  return cycles;
3664
#undef FLD
3665
}
3666
 
3667
static int
3668
model_crisv32_abs (SIM_CPU *current_cpu, void *sem_arg)
3669
{
3670
#define FLD(f) abuf->fields.sfmt_muls_b.f
3671
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3672
  const IDESC * UNUSED idesc = abuf->idesc;
3673
  int cycles = 0;
3674
  {
3675
    int referenced = 0;
3676
    int UNUSED insn_referenced = abuf->written;
3677
    INT in_Rd = -1;
3678
    INT in_Rs = -1;
3679
    INT out_Rd = -1;
3680
    in_Rs = FLD (in_Rs);
3681
    out_Rd = FLD (out_Rd);
3682
    referenced |= 1 << 1;
3683
    referenced |= 1 << 2;
3684
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3685
  }
3686
  return cycles;
3687
#undef FLD
3688
}
3689
 
3690
static int
3691
model_crisv32_and_b_r (SIM_CPU *current_cpu, void *sem_arg)
3692
{
3693
#define FLD(f) abuf->fields.sfmt_addc_m.f
3694
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3695
  const IDESC * UNUSED idesc = abuf->idesc;
3696
  int cycles = 0;
3697
  {
3698
    int referenced = 0;
3699
    int UNUSED insn_referenced = abuf->written;
3700
    INT in_Rd = -1;
3701
    INT in_Rs = -1;
3702
    INT out_Rd = -1;
3703
    in_Rd = FLD (in_Rd);
3704
    in_Rs = FLD (in_Rs);
3705
    referenced |= 1 << 0;
3706
    referenced |= 1 << 1;
3707
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3708
  }
3709
  return cycles;
3710
#undef FLD
3711
}
3712
 
3713
static int
3714
model_crisv32_and_w_r (SIM_CPU *current_cpu, void *sem_arg)
3715
{
3716
#define FLD(f) abuf->fields.sfmt_addc_m.f
3717
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3718
  const IDESC * UNUSED idesc = abuf->idesc;
3719
  int cycles = 0;
3720
  {
3721
    int referenced = 0;
3722
    int UNUSED insn_referenced = abuf->written;
3723
    INT in_Rd = -1;
3724
    INT in_Rs = -1;
3725
    INT out_Rd = -1;
3726
    in_Rd = FLD (in_Rd);
3727
    in_Rs = FLD (in_Rs);
3728
    referenced |= 1 << 0;
3729
    referenced |= 1 << 1;
3730
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3731
  }
3732
  return cycles;
3733
#undef FLD
3734
}
3735
 
3736
static int
3737
model_crisv32_and_d_r (SIM_CPU *current_cpu, void *sem_arg)
3738
{
3739
#define FLD(f) abuf->fields.sfmt_addc_m.f
3740
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3741
  const IDESC * UNUSED idesc = abuf->idesc;
3742
  int cycles = 0;
3743
  {
3744
    int referenced = 0;
3745
    int UNUSED insn_referenced = abuf->written;
3746
    INT in_Rd = -1;
3747
    INT in_Rs = -1;
3748
    INT out_Rd = -1;
3749
    in_Rd = FLD (in_Rd);
3750
    in_Rs = FLD (in_Rs);
3751
    referenced |= 1 << 0;
3752
    referenced |= 1 << 1;
3753
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3754
  }
3755
  return cycles;
3756
#undef FLD
3757
}
3758
 
3759
static int
3760
model_crisv32_and_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
3761
{
3762
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3763
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3764
  const IDESC * UNUSED idesc = abuf->idesc;
3765
  int cycles = 0;
3766
  {
3767
    int referenced = 0;
3768
    int UNUSED insn_referenced = abuf->written;
3769
    INT in_Rs = -1;
3770
    in_Rs = FLD (in_Rs);
3771
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3772
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3773
  }
3774
  {
3775
    int referenced = 0;
3776
    int UNUSED insn_referenced = abuf->written;
3777
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3778
  }
3779
  {
3780
    int referenced = 0;
3781
    int UNUSED insn_referenced = abuf->written;
3782
    INT in_Rd = -1;
3783
    INT in_Rs = -1;
3784
    INT out_Rd = -1;
3785
    in_Rd = FLD (in_Rd);
3786
    in_Rs = FLD (in_Rs);
3787
    referenced |= 1 << 0;
3788
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3789
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3790
  }
3791
  return cycles;
3792
#undef FLD
3793
}
3794
 
3795
static int
3796
model_crisv32_and_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
3797
{
3798
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3799
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3800
  const IDESC * UNUSED idesc = abuf->idesc;
3801
  int cycles = 0;
3802
  {
3803
    int referenced = 0;
3804
    int UNUSED insn_referenced = abuf->written;
3805
    INT in_Rs = -1;
3806
    in_Rs = FLD (in_Rs);
3807
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3808
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3809
  }
3810
  {
3811
    int referenced = 0;
3812
    int UNUSED insn_referenced = abuf->written;
3813
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3814
  }
3815
  {
3816
    int referenced = 0;
3817
    int UNUSED insn_referenced = abuf->written;
3818
    INT in_Rd = -1;
3819
    INT in_Rs = -1;
3820
    INT out_Rd = -1;
3821
    in_Rd = FLD (in_Rd);
3822
    in_Rs = FLD (in_Rs);
3823
    referenced |= 1 << 0;
3824
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3825
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3826
  }
3827
  return cycles;
3828
#undef FLD
3829
}
3830
 
3831
static int
3832
model_crisv32_and_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
3833
{
3834
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
3835
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3836
  const IDESC * UNUSED idesc = abuf->idesc;
3837
  int cycles = 0;
3838
  {
3839
    int referenced = 0;
3840
    int UNUSED insn_referenced = abuf->written;
3841
    INT in_Rs = -1;
3842
    in_Rs = FLD (in_Rs);
3843
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
3844
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
3845
  }
3846
  {
3847
    int referenced = 0;
3848
    int UNUSED insn_referenced = abuf->written;
3849
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
3850
  }
3851
  {
3852
    int referenced = 0;
3853
    int UNUSED insn_referenced = abuf->written;
3854
    INT in_Rd = -1;
3855
    INT in_Rs = -1;
3856
    INT out_Rd = -1;
3857
    in_Rd = FLD (in_Rd);
3858
    in_Rs = FLD (in_Rs);
3859
    referenced |= 1 << 0;
3860
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
3861
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
3862
  }
3863
  return cycles;
3864
#undef FLD
3865
}
3866
 
3867
static int
3868
model_crisv32_andcbr (SIM_CPU *current_cpu, void *sem_arg)
3869
{
3870
#define FLD(f) abuf->fields.sfmt_addcbr.f
3871
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3872
  const IDESC * UNUSED idesc = abuf->idesc;
3873
  int cycles = 0;
3874
  {
3875
    int referenced = 0;
3876
    int UNUSED insn_referenced = abuf->written;
3877
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3878
  }
3879
  {
3880
    int referenced = 0;
3881
    int UNUSED insn_referenced = abuf->written;
3882
    INT in_Rd = -1;
3883
    INT in_Rs = -1;
3884
    INT out_Rd = -1;
3885
    in_Rd = FLD (in_Rd);
3886
    referenced |= 1 << 0;
3887
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3888
  }
3889
  return cycles;
3890
#undef FLD
3891
}
3892
 
3893
static int
3894
model_crisv32_andcwr (SIM_CPU *current_cpu, void *sem_arg)
3895
{
3896
#define FLD(f) abuf->fields.sfmt_addcwr.f
3897
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3898
  const IDESC * UNUSED idesc = abuf->idesc;
3899
  int cycles = 0;
3900
  {
3901
    int referenced = 0;
3902
    int UNUSED insn_referenced = abuf->written;
3903
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
3904
  }
3905
  {
3906
    int referenced = 0;
3907
    int UNUSED insn_referenced = abuf->written;
3908
    INT in_Rd = -1;
3909
    INT in_Rs = -1;
3910
    INT out_Rd = -1;
3911
    in_Rd = FLD (in_Rd);
3912
    referenced |= 1 << 0;
3913
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3914
  }
3915
  return cycles;
3916
#undef FLD
3917
}
3918
 
3919
static int
3920
model_crisv32_andcdr (SIM_CPU *current_cpu, void *sem_arg)
3921
{
3922
#define FLD(f) abuf->fields.sfmt_addcdr.f
3923
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3924
  const IDESC * UNUSED idesc = abuf->idesc;
3925
  int cycles = 0;
3926
  {
3927
    int referenced = 0;
3928
    int UNUSED insn_referenced = abuf->written;
3929
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
3930
  }
3931
  {
3932
    int referenced = 0;
3933
    int UNUSED insn_referenced = abuf->written;
3934
    INT in_Rd = -1;
3935
    INT in_Rs = -1;
3936
    INT out_Rd = -1;
3937
    in_Rd = FLD (in_Rd);
3938
    referenced |= 1 << 0;
3939
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
3940
  }
3941
  return cycles;
3942
#undef FLD
3943
}
3944
 
3945
static int
3946
model_crisv32_andq (SIM_CPU *current_cpu, void *sem_arg)
3947
{
3948
#define FLD(f) abuf->fields.sfmt_andq.f
3949
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3950
  const IDESC * UNUSED idesc = abuf->idesc;
3951
  int cycles = 0;
3952
  {
3953
    int referenced = 0;
3954
    int UNUSED insn_referenced = abuf->written;
3955
    INT in_Rd = -1;
3956
    INT in_Rs = -1;
3957
    INT out_Rd = -1;
3958
    in_Rd = FLD (in_Rd);
3959
    referenced |= 1 << 0;
3960
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3961
  }
3962
  return cycles;
3963
#undef FLD
3964
}
3965
 
3966
static int
3967
model_crisv32_orr_b_r (SIM_CPU *current_cpu, void *sem_arg)
3968
{
3969
#define FLD(f) abuf->fields.sfmt_addc_m.f
3970
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3971
  const IDESC * UNUSED idesc = abuf->idesc;
3972
  int cycles = 0;
3973
  {
3974
    int referenced = 0;
3975
    int UNUSED insn_referenced = abuf->written;
3976
    INT in_Rd = -1;
3977
    INT in_Rs = -1;
3978
    INT out_Rd = -1;
3979
    in_Rd = FLD (in_Rd);
3980
    in_Rs = FLD (in_Rs);
3981
    referenced |= 1 << 0;
3982
    referenced |= 1 << 1;
3983
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
3984
  }
3985
  return cycles;
3986
#undef FLD
3987
}
3988
 
3989
static int
3990
model_crisv32_orr_w_r (SIM_CPU *current_cpu, void *sem_arg)
3991
{
3992
#define FLD(f) abuf->fields.sfmt_addc_m.f
3993
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
3994
  const IDESC * UNUSED idesc = abuf->idesc;
3995
  int cycles = 0;
3996
  {
3997
    int referenced = 0;
3998
    int UNUSED insn_referenced = abuf->written;
3999
    INT in_Rd = -1;
4000
    INT in_Rs = -1;
4001
    INT out_Rd = -1;
4002
    in_Rd = FLD (in_Rd);
4003
    in_Rs = FLD (in_Rs);
4004
    referenced |= 1 << 0;
4005
    referenced |= 1 << 1;
4006
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4007
  }
4008
  return cycles;
4009
#undef FLD
4010
}
4011
 
4012
static int
4013
model_crisv32_orr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4014
{
4015
#define FLD(f) abuf->fields.sfmt_addc_m.f
4016
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4017
  const IDESC * UNUSED idesc = abuf->idesc;
4018
  int cycles = 0;
4019
  {
4020
    int referenced = 0;
4021
    int UNUSED insn_referenced = abuf->written;
4022
    INT in_Rd = -1;
4023
    INT in_Rs = -1;
4024
    INT out_Rd = -1;
4025
    in_Rd = FLD (in_Rd);
4026
    in_Rs = FLD (in_Rs);
4027
    referenced |= 1 << 0;
4028
    referenced |= 1 << 1;
4029
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4030
  }
4031
  return cycles;
4032
#undef FLD
4033
}
4034
 
4035
static int
4036
model_crisv32_or_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
4037
{
4038
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4039
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4040
  const IDESC * UNUSED idesc = abuf->idesc;
4041
  int cycles = 0;
4042
  {
4043
    int referenced = 0;
4044
    int UNUSED insn_referenced = abuf->written;
4045
    INT in_Rs = -1;
4046
    in_Rs = FLD (in_Rs);
4047
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4048
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4049
  }
4050
  {
4051
    int referenced = 0;
4052
    int UNUSED insn_referenced = abuf->written;
4053
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4054
  }
4055
  {
4056
    int referenced = 0;
4057
    int UNUSED insn_referenced = abuf->written;
4058
    INT in_Rd = -1;
4059
    INT in_Rs = -1;
4060
    INT out_Rd = -1;
4061
    in_Rd = FLD (in_Rd);
4062
    in_Rs = FLD (in_Rs);
4063
    referenced |= 1 << 0;
4064
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4065
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4066
  }
4067
  return cycles;
4068
#undef FLD
4069
}
4070
 
4071
static int
4072
model_crisv32_or_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
4073
{
4074
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4075
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4076
  const IDESC * UNUSED idesc = abuf->idesc;
4077
  int cycles = 0;
4078
  {
4079
    int referenced = 0;
4080
    int UNUSED insn_referenced = abuf->written;
4081
    INT in_Rs = -1;
4082
    in_Rs = FLD (in_Rs);
4083
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4084
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4085
  }
4086
  {
4087
    int referenced = 0;
4088
    int UNUSED insn_referenced = abuf->written;
4089
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4090
  }
4091
  {
4092
    int referenced = 0;
4093
    int UNUSED insn_referenced = abuf->written;
4094
    INT in_Rd = -1;
4095
    INT in_Rs = -1;
4096
    INT out_Rd = -1;
4097
    in_Rd = FLD (in_Rd);
4098
    in_Rs = FLD (in_Rs);
4099
    referenced |= 1 << 0;
4100
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4101
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4102
  }
4103
  return cycles;
4104
#undef FLD
4105
}
4106
 
4107
static int
4108
model_crisv32_or_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
4109
{
4110
#define FLD(f) abuf->fields.sfmt_add_m_b_m.f
4111
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4112
  const IDESC * UNUSED idesc = abuf->idesc;
4113
  int cycles = 0;
4114
  {
4115
    int referenced = 0;
4116
    int UNUSED insn_referenced = abuf->written;
4117
    INT in_Rs = -1;
4118
    in_Rs = FLD (in_Rs);
4119
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
4120
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
4121
  }
4122
  {
4123
    int referenced = 0;
4124
    int UNUSED insn_referenced = abuf->written;
4125
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
4126
  }
4127
  {
4128
    int referenced = 0;
4129
    int UNUSED insn_referenced = abuf->written;
4130
    INT in_Rd = -1;
4131
    INT in_Rs = -1;
4132
    INT out_Rd = -1;
4133
    in_Rd = FLD (in_Rd);
4134
    in_Rs = FLD (in_Rs);
4135
    referenced |= 1 << 0;
4136
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
4137
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4138
  }
4139
  return cycles;
4140
#undef FLD
4141
}
4142
 
4143
static int
4144
model_crisv32_orcbr (SIM_CPU *current_cpu, void *sem_arg)
4145
{
4146
#define FLD(f) abuf->fields.sfmt_addcbr.f
4147
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4148
  const IDESC * UNUSED idesc = abuf->idesc;
4149
  int cycles = 0;
4150
  {
4151
    int referenced = 0;
4152
    int UNUSED insn_referenced = abuf->written;
4153
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4154
  }
4155
  {
4156
    int referenced = 0;
4157
    int UNUSED insn_referenced = abuf->written;
4158
    INT in_Rd = -1;
4159
    INT in_Rs = -1;
4160
    INT out_Rd = -1;
4161
    in_Rd = FLD (in_Rd);
4162
    referenced |= 1 << 0;
4163
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4164
  }
4165
  return cycles;
4166
#undef FLD
4167
}
4168
 
4169
static int
4170
model_crisv32_orcwr (SIM_CPU *current_cpu, void *sem_arg)
4171
{
4172
#define FLD(f) abuf->fields.sfmt_addcwr.f
4173
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4174
  const IDESC * UNUSED idesc = abuf->idesc;
4175
  int cycles = 0;
4176
  {
4177
    int referenced = 0;
4178
    int UNUSED insn_referenced = abuf->written;
4179
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4180
  }
4181
  {
4182
    int referenced = 0;
4183
    int UNUSED insn_referenced = abuf->written;
4184
    INT in_Rd = -1;
4185
    INT in_Rs = -1;
4186
    INT out_Rd = -1;
4187
    in_Rd = FLD (in_Rd);
4188
    referenced |= 1 << 0;
4189
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4190
  }
4191
  return cycles;
4192
#undef FLD
4193
}
4194
 
4195
static int
4196
model_crisv32_orcdr (SIM_CPU *current_cpu, void *sem_arg)
4197
{
4198
#define FLD(f) abuf->fields.sfmt_addcdr.f
4199
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4200
  const IDESC * UNUSED idesc = abuf->idesc;
4201
  int cycles = 0;
4202
  {
4203
    int referenced = 0;
4204
    int UNUSED insn_referenced = abuf->written;
4205
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4206
  }
4207
  {
4208
    int referenced = 0;
4209
    int UNUSED insn_referenced = abuf->written;
4210
    INT in_Rd = -1;
4211
    INT in_Rs = -1;
4212
    INT out_Rd = -1;
4213
    in_Rd = FLD (in_Rd);
4214
    referenced |= 1 << 0;
4215
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4216
  }
4217
  return cycles;
4218
#undef FLD
4219
}
4220
 
4221
static int
4222
model_crisv32_orq (SIM_CPU *current_cpu, void *sem_arg)
4223
{
4224
#define FLD(f) abuf->fields.sfmt_andq.f
4225
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4226
  const IDESC * UNUSED idesc = abuf->idesc;
4227
  int cycles = 0;
4228
  {
4229
    int referenced = 0;
4230
    int UNUSED insn_referenced = abuf->written;
4231
    INT in_Rd = -1;
4232
    INT in_Rs = -1;
4233
    INT out_Rd = -1;
4234
    in_Rd = FLD (in_Rd);
4235
    referenced |= 1 << 0;
4236
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4237
  }
4238
  return cycles;
4239
#undef FLD
4240
}
4241
 
4242
static int
4243
model_crisv32_xor (SIM_CPU *current_cpu, void *sem_arg)
4244
{
4245
#define FLD(f) abuf->fields.sfmt_muls_b.f
4246
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4247
  const IDESC * UNUSED idesc = abuf->idesc;
4248
  int cycles = 0;
4249
  {
4250
    int referenced = 0;
4251
    int UNUSED insn_referenced = abuf->written;
4252
    INT in_Rd = -1;
4253
    INT in_Rs = -1;
4254
    INT out_Rd = -1;
4255
    in_Rd = FLD (in_Rd);
4256
    in_Rs = FLD (in_Rs);
4257
    out_Rd = FLD (out_Rd);
4258
    referenced |= 1 << 0;
4259
    referenced |= 1 << 1;
4260
    referenced |= 1 << 2;
4261
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4262
  }
4263
  return cycles;
4264
#undef FLD
4265
}
4266
 
4267
static int
4268
model_crisv32_swap (SIM_CPU *current_cpu, void *sem_arg)
4269
{
4270
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
4271
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4272
  const IDESC * UNUSED idesc = abuf->idesc;
4273
  int cycles = 0;
4274
  {
4275
    int referenced = 0;
4276
    int UNUSED insn_referenced = abuf->written;
4277
    INT in_Rd = -1;
4278
    INT in_Rs = -1;
4279
    INT out_Rd = -1;
4280
    in_Rs = FLD (in_Rs);
4281
    referenced |= 1 << 1;
4282
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4283
  }
4284
  return cycles;
4285
#undef FLD
4286
}
4287
 
4288
static int
4289
model_crisv32_asrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4290
{
4291
#define FLD(f) abuf->fields.sfmt_addc_m.f
4292
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4293
  const IDESC * UNUSED idesc = abuf->idesc;
4294
  int cycles = 0;
4295
  {
4296
    int referenced = 0;
4297
    int UNUSED insn_referenced = abuf->written;
4298
    INT in_Rd = -1;
4299
    INT in_Rs = -1;
4300
    INT out_Rd = -1;
4301
    in_Rd = FLD (in_Rd);
4302
    in_Rs = FLD (in_Rs);
4303
    referenced |= 1 << 0;
4304
    referenced |= 1 << 1;
4305
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4306
  }
4307
  return cycles;
4308
#undef FLD
4309
}
4310
 
4311
static int
4312
model_crisv32_asrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4313
{
4314
#define FLD(f) abuf->fields.sfmt_addc_m.f
4315
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4316
  const IDESC * UNUSED idesc = abuf->idesc;
4317
  int cycles = 0;
4318
  {
4319
    int referenced = 0;
4320
    int UNUSED insn_referenced = abuf->written;
4321
    INT in_Rd = -1;
4322
    INT in_Rs = -1;
4323
    INT out_Rd = -1;
4324
    in_Rd = FLD (in_Rd);
4325
    in_Rs = FLD (in_Rs);
4326
    referenced |= 1 << 0;
4327
    referenced |= 1 << 1;
4328
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4329
  }
4330
  return cycles;
4331
#undef FLD
4332
}
4333
 
4334
static int
4335
model_crisv32_asrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4336
{
4337
#define FLD(f) abuf->fields.sfmt_addc_m.f
4338
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4339
  const IDESC * UNUSED idesc = abuf->idesc;
4340
  int cycles = 0;
4341
  {
4342
    int referenced = 0;
4343
    int UNUSED insn_referenced = abuf->written;
4344
    INT in_Rd = -1;
4345
    INT in_Rs = -1;
4346
    INT out_Rd = -1;
4347
    in_Rd = FLD (in_Rd);
4348
    in_Rs = FLD (in_Rs);
4349
    referenced |= 1 << 0;
4350
    referenced |= 1 << 1;
4351
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4352
  }
4353
  return cycles;
4354
#undef FLD
4355
}
4356
 
4357
static int
4358
model_crisv32_asrq (SIM_CPU *current_cpu, void *sem_arg)
4359
{
4360
#define FLD(f) abuf->fields.sfmt_asrq.f
4361
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4362
  const IDESC * UNUSED idesc = abuf->idesc;
4363
  int cycles = 0;
4364
  {
4365
    int referenced = 0;
4366
    int UNUSED insn_referenced = abuf->written;
4367
    INT in_Rd = -1;
4368
    INT in_Rs = -1;
4369
    INT out_Rd = -1;
4370
    in_Rd = FLD (in_Rd);
4371
    out_Rd = FLD (out_Rd);
4372
    referenced |= 1 << 0;
4373
    referenced |= 1 << 2;
4374
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4375
  }
4376
  return cycles;
4377
#undef FLD
4378
}
4379
 
4380
static int
4381
model_crisv32_lsrr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4382
{
4383
#define FLD(f) abuf->fields.sfmt_addc_m.f
4384
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4385
  const IDESC * UNUSED idesc = abuf->idesc;
4386
  int cycles = 0;
4387
  {
4388
    int referenced = 0;
4389
    int UNUSED insn_referenced = abuf->written;
4390
    INT in_Rd = -1;
4391
    INT in_Rs = -1;
4392
    INT out_Rd = -1;
4393
    in_Rd = FLD (in_Rd);
4394
    in_Rs = FLD (in_Rs);
4395
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4396
    referenced |= 1 << 1;
4397
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4398
  }
4399
  return cycles;
4400
#undef FLD
4401
}
4402
 
4403
static int
4404
model_crisv32_lsrr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4405
{
4406
#define FLD(f) abuf->fields.sfmt_addc_m.f
4407
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4408
  const IDESC * UNUSED idesc = abuf->idesc;
4409
  int cycles = 0;
4410
  {
4411
    int referenced = 0;
4412
    int UNUSED insn_referenced = abuf->written;
4413
    INT in_Rd = -1;
4414
    INT in_Rs = -1;
4415
    INT out_Rd = -1;
4416
    in_Rd = FLD (in_Rd);
4417
    in_Rs = FLD (in_Rs);
4418
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4419
    referenced |= 1 << 1;
4420
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4421
  }
4422
  return cycles;
4423
#undef FLD
4424
}
4425
 
4426
static int
4427
model_crisv32_lsrr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4428
{
4429
#define FLD(f) abuf->fields.sfmt_addc_m.f
4430
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4431
  const IDESC * UNUSED idesc = abuf->idesc;
4432
  int cycles = 0;
4433
  {
4434
    int referenced = 0;
4435
    int UNUSED insn_referenced = abuf->written;
4436
    INT in_Rd = -1;
4437
    INT in_Rs = -1;
4438
    INT out_Rd = -1;
4439
    in_Rd = FLD (in_Rd);
4440
    in_Rs = FLD (in_Rs);
4441
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4442
    referenced |= 1 << 1;
4443
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4444
  }
4445
  return cycles;
4446
#undef FLD
4447
}
4448
 
4449
static int
4450
model_crisv32_lsrq (SIM_CPU *current_cpu, void *sem_arg)
4451
{
4452
#define FLD(f) abuf->fields.sfmt_asrq.f
4453
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4454
  const IDESC * UNUSED idesc = abuf->idesc;
4455
  int cycles = 0;
4456
  {
4457
    int referenced = 0;
4458
    int UNUSED insn_referenced = abuf->written;
4459
    INT in_Rd = -1;
4460
    INT in_Rs = -1;
4461
    INT out_Rd = -1;
4462
    in_Rd = FLD (in_Rd);
4463
    out_Rd = FLD (out_Rd);
4464
    referenced |= 1 << 0;
4465
    referenced |= 1 << 2;
4466
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4467
  }
4468
  return cycles;
4469
#undef FLD
4470
}
4471
 
4472
static int
4473
model_crisv32_lslr_b_r (SIM_CPU *current_cpu, void *sem_arg)
4474
{
4475
#define FLD(f) abuf->fields.sfmt_addc_m.f
4476
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4477
  const IDESC * UNUSED idesc = abuf->idesc;
4478
  int cycles = 0;
4479
  {
4480
    int referenced = 0;
4481
    int UNUSED insn_referenced = abuf->written;
4482
    INT in_Rd = -1;
4483
    INT in_Rs = -1;
4484
    INT out_Rd = -1;
4485
    in_Rd = FLD (in_Rd);
4486
    in_Rs = FLD (in_Rs);
4487
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4488
    referenced |= 1 << 1;
4489
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4490
  }
4491
  return cycles;
4492
#undef FLD
4493
}
4494
 
4495
static int
4496
model_crisv32_lslr_w_r (SIM_CPU *current_cpu, void *sem_arg)
4497
{
4498
#define FLD(f) abuf->fields.sfmt_addc_m.f
4499
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4500
  const IDESC * UNUSED idesc = abuf->idesc;
4501
  int cycles = 0;
4502
  {
4503
    int referenced = 0;
4504
    int UNUSED insn_referenced = abuf->written;
4505
    INT in_Rd = -1;
4506
    INT in_Rs = -1;
4507
    INT out_Rd = -1;
4508
    in_Rd = FLD (in_Rd);
4509
    in_Rs = FLD (in_Rs);
4510
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4511
    referenced |= 1 << 1;
4512
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4513
  }
4514
  return cycles;
4515
#undef FLD
4516
}
4517
 
4518
static int
4519
model_crisv32_lslr_d_r (SIM_CPU *current_cpu, void *sem_arg)
4520
{
4521
#define FLD(f) abuf->fields.sfmt_addc_m.f
4522
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4523
  const IDESC * UNUSED idesc = abuf->idesc;
4524
  int cycles = 0;
4525
  {
4526
    int referenced = 0;
4527
    int UNUSED insn_referenced = abuf->written;
4528
    INT in_Rd = -1;
4529
    INT in_Rs = -1;
4530
    INT out_Rd = -1;
4531
    in_Rd = FLD (in_Rd);
4532
    in_Rs = FLD (in_Rs);
4533
    if (insn_referenced & (1 << 0)) referenced |= 1 << 0;
4534
    referenced |= 1 << 1;
4535
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4536
  }
4537
  return cycles;
4538
#undef FLD
4539
}
4540
 
4541
static int
4542
model_crisv32_lslq (SIM_CPU *current_cpu, void *sem_arg)
4543
{
4544
#define FLD(f) abuf->fields.sfmt_asrq.f
4545
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4546
  const IDESC * UNUSED idesc = abuf->idesc;
4547
  int cycles = 0;
4548
  {
4549
    int referenced = 0;
4550
    int UNUSED insn_referenced = abuf->written;
4551
    INT in_Rd = -1;
4552
    INT in_Rs = -1;
4553
    INT out_Rd = -1;
4554
    in_Rd = FLD (in_Rd);
4555
    out_Rd = FLD (out_Rd);
4556
    referenced |= 1 << 0;
4557
    referenced |= 1 << 2;
4558
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4559
  }
4560
  return cycles;
4561
#undef FLD
4562
}
4563
 
4564
static int
4565
model_crisv32_btst (SIM_CPU *current_cpu, void *sem_arg)
4566
{
4567
#define FLD(f) abuf->fields.sfmt_muls_b.f
4568
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4569
  const IDESC * UNUSED idesc = abuf->idesc;
4570
  int cycles = 0;
4571
  {
4572
    int referenced = 0;
4573
    int UNUSED insn_referenced = abuf->written;
4574
    INT in_Rd = -1;
4575
    INT in_Rs = -1;
4576
    INT out_Rd = -1;
4577
    in_Rd = FLD (in_Rd);
4578
    in_Rs = FLD (in_Rs);
4579
    referenced |= 1 << 0;
4580
    referenced |= 1 << 1;
4581
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4582
  }
4583
  return cycles;
4584
#undef FLD
4585
}
4586
 
4587
static int
4588
model_crisv32_btstq (SIM_CPU *current_cpu, void *sem_arg)
4589
{
4590
#define FLD(f) abuf->fields.sfmt_asrq.f
4591
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4592
  const IDESC * UNUSED idesc = abuf->idesc;
4593
  int cycles = 0;
4594
  {
4595
    int referenced = 0;
4596
    int UNUSED insn_referenced = abuf->written;
4597
    INT in_Rd = -1;
4598
    INT in_Rs = -1;
4599
    INT out_Rd = -1;
4600
    in_Rd = FLD (in_Rd);
4601
    referenced |= 1 << 0;
4602
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4603
  }
4604
  return cycles;
4605
#undef FLD
4606
}
4607
 
4608
static int
4609
model_crisv32_setf (SIM_CPU *current_cpu, void *sem_arg)
4610
{
4611
#define FLD(f) abuf->fields.sfmt_setf.f
4612
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4613
  const IDESC * UNUSED idesc = abuf->idesc;
4614
  int cycles = 0;
4615
  {
4616
    int referenced = 0;
4617
    int UNUSED insn_referenced = abuf->written;
4618
    INT in_Rd = -1;
4619
    INT in_Rs = -1;
4620
    INT out_Rd = -1;
4621
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4622
  }
4623
  return cycles;
4624
#undef FLD
4625
}
4626
 
4627
static int
4628
model_crisv32_clearf (SIM_CPU *current_cpu, void *sem_arg)
4629
{
4630
#define FLD(f) abuf->fields.sfmt_setf.f
4631
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4632
  const IDESC * UNUSED idesc = abuf->idesc;
4633
  int cycles = 0;
4634
  {
4635
    int referenced = 0;
4636
    int UNUSED insn_referenced = abuf->written;
4637
    INT in_Rd = -1;
4638
    INT in_Rs = -1;
4639
    INT out_Rd = -1;
4640
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4641
  }
4642
  return cycles;
4643
#undef FLD
4644
}
4645
 
4646
static int
4647
model_crisv32_rfe (SIM_CPU *current_cpu, void *sem_arg)
4648
{
4649
#define FLD(f) abuf->fields.sfmt_rfe.f
4650
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4651
  const IDESC * UNUSED idesc = abuf->idesc;
4652
  int cycles = 0;
4653
  {
4654
    int referenced = 0;
4655
    int UNUSED insn_referenced = abuf->written;
4656
    INT in_Rd = -1;
4657
    INT in_Rs = -1;
4658
    INT out_Rd = -1;
4659
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4660
  }
4661
  return cycles;
4662
#undef FLD
4663
}
4664
 
4665
static int
4666
model_crisv32_sfe (SIM_CPU *current_cpu, void *sem_arg)
4667
{
4668
#define FLD(f) abuf->fields.sfmt_rfe.f
4669
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4670
  const IDESC * UNUSED idesc = abuf->idesc;
4671
  int cycles = 0;
4672
  {
4673
    int referenced = 0;
4674
    int UNUSED insn_referenced = abuf->written;
4675
    INT in_Rd = -1;
4676
    INT in_Rs = -1;
4677
    INT out_Rd = -1;
4678
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4679
  }
4680
  return cycles;
4681
#undef FLD
4682
}
4683
 
4684
static int
4685
model_crisv32_rfg (SIM_CPU *current_cpu, void *sem_arg)
4686
{
4687
#define FLD(f) abuf->fields.sfmt_empty.f
4688
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4689
  const IDESC * UNUSED idesc = abuf->idesc;
4690
  int cycles = 0;
4691
  {
4692
    int referenced = 0;
4693
    int UNUSED insn_referenced = abuf->written;
4694
    INT in_Rd = -1;
4695
    INT in_Rs = -1;
4696
    INT out_Rd = -1;
4697
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4698
  }
4699
  return cycles;
4700
#undef FLD
4701
}
4702
 
4703
static int
4704
model_crisv32_rfn (SIM_CPU *current_cpu, void *sem_arg)
4705
{
4706
#define FLD(f) abuf->fields.sfmt_rfe.f
4707
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4708
  const IDESC * UNUSED idesc = abuf->idesc;
4709
  int cycles = 0;
4710
  {
4711
    int referenced = 0;
4712
    int UNUSED insn_referenced = abuf->written;
4713
    INT in_Rd = -1;
4714
    INT in_Rs = -1;
4715
    INT out_Rd = -1;
4716
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4717
  }
4718
  return cycles;
4719
#undef FLD
4720
}
4721
 
4722
static int
4723
model_crisv32_halt (SIM_CPU *current_cpu, void *sem_arg)
4724
{
4725
#define FLD(f) abuf->fields.sfmt_empty.f
4726
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4727
  const IDESC * UNUSED idesc = abuf->idesc;
4728
  int cycles = 0;
4729
  {
4730
    int referenced = 0;
4731
    int UNUSED insn_referenced = abuf->written;
4732
    INT in_Rd = -1;
4733
    INT in_Rs = -1;
4734
    INT out_Rd = -1;
4735
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
4736
  }
4737
  return cycles;
4738
#undef FLD
4739
}
4740
 
4741
static int
4742
model_crisv32_bcc_b (SIM_CPU *current_cpu, void *sem_arg)
4743
{
4744
#define FLD(f) abuf->fields.sfmt_bcc_b.f
4745
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4746
  const IDESC * UNUSED idesc = abuf->idesc;
4747
  int cycles = 0;
4748
  {
4749
    int referenced = 0;
4750
    int UNUSED insn_referenced = abuf->written;
4751
    cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 0, referenced);
4752
  }
4753
  {
4754
    int referenced = 0;
4755
    int UNUSED insn_referenced = abuf->written;
4756
    INT in_Rd = -1;
4757
    INT in_Rs = -1;
4758
    INT out_Rd = -1;
4759
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4760
  }
4761
  return cycles;
4762
#undef FLD
4763
}
4764
 
4765
static int
4766
model_crisv32_ba_b (SIM_CPU *current_cpu, void *sem_arg)
4767
{
4768
#define FLD(f) abuf->fields.sfmt_bcc_b.f
4769
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4770
  const IDESC * UNUSED idesc = abuf->idesc;
4771
  int cycles = 0;
4772
  {
4773
    int referenced = 0;
4774
    int UNUSED insn_referenced = abuf->written;
4775
    INT out_Pd = -1;
4776
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 0, referenced, out_Pd);
4777
  }
4778
  {
4779
    int referenced = 0;
4780
    int UNUSED insn_referenced = abuf->written;
4781
    INT in_Rd = -1;
4782
    INT in_Rs = -1;
4783
    INT out_Rd = -1;
4784
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4785
  }
4786
  return cycles;
4787
#undef FLD
4788
}
4789
 
4790
static int
4791
model_crisv32_bcc_w (SIM_CPU *current_cpu, void *sem_arg)
4792
{
4793
#define FLD(f) abuf->fields.sfmt_bcc_w.f
4794
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4795
  const IDESC * UNUSED idesc = abuf->idesc;
4796
  int cycles = 0;
4797
  {
4798
    int referenced = 0;
4799
    int UNUSED insn_referenced = abuf->written;
4800
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4801
  }
4802
  {
4803
    int referenced = 0;
4804
    int UNUSED insn_referenced = abuf->written;
4805
    cycles += crisv32f_model_crisv32_u_branch (current_cpu, idesc, 1, referenced);
4806
  }
4807
  {
4808
    int referenced = 0;
4809
    int UNUSED insn_referenced = abuf->written;
4810
    INT in_Rd = -1;
4811
    INT in_Rs = -1;
4812
    INT out_Rd = -1;
4813
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4814
  }
4815
  return cycles;
4816
#undef FLD
4817
}
4818
 
4819
static int
4820
model_crisv32_ba_w (SIM_CPU *current_cpu, void *sem_arg)
4821
{
4822
#define FLD(f) abuf->fields.sfmt_bcc_w.f
4823
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4824
  const IDESC * UNUSED idesc = abuf->idesc;
4825
  int cycles = 0;
4826
  {
4827
    int referenced = 0;
4828
    int UNUSED insn_referenced = abuf->written;
4829
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
4830
  }
4831
  {
4832
    int referenced = 0;
4833
    int UNUSED insn_referenced = abuf->written;
4834
    INT out_Pd = -1;
4835
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4836
  }
4837
  {
4838
    int referenced = 0;
4839
    int UNUSED insn_referenced = abuf->written;
4840
    INT in_Rd = -1;
4841
    INT in_Rs = -1;
4842
    INT out_Rd = -1;
4843
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4844
  }
4845
  return cycles;
4846
#undef FLD
4847
}
4848
 
4849
static int
4850
model_crisv32_jas_r (SIM_CPU *current_cpu, void *sem_arg)
4851
{
4852
#define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4853
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4854
  const IDESC * UNUSED idesc = abuf->idesc;
4855
  int cycles = 0;
4856
  {
4857
    int referenced = 0;
4858
    int UNUSED insn_referenced = abuf->written;
4859
    INT in_Rs = -1;
4860
    in_Rs = FLD (in_Rs);
4861
    referenced |= 1 << 0;
4862
    cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4863
  }
4864
  {
4865
    int referenced = 0;
4866
    int UNUSED insn_referenced = abuf->written;
4867
    INT out_Pd = -1;
4868
    out_Pd = FLD (out_Pd);
4869
    referenced |= 1 << 0;
4870
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4871
  }
4872
  {
4873
    int referenced = 0;
4874
    int UNUSED insn_referenced = abuf->written;
4875
    INT in_Rd = -1;
4876
    INT in_Rs = -1;
4877
    INT out_Rd = -1;
4878
    in_Rs = FLD (in_Rs);
4879
    referenced |= 1 << 1;
4880
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4881
  }
4882
  return cycles;
4883
#undef FLD
4884
}
4885
 
4886
static int
4887
model_crisv32_jas_c (SIM_CPU *current_cpu, void *sem_arg)
4888
{
4889
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
4890
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4891
  const IDESC * UNUSED idesc = abuf->idesc;
4892
  int cycles = 0;
4893
  {
4894
    int referenced = 0;
4895
    int UNUSED insn_referenced = abuf->written;
4896
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4897
  }
4898
  {
4899
    int referenced = 0;
4900
    int UNUSED insn_referenced = abuf->written;
4901
    INT out_Pd = -1;
4902
    out_Pd = FLD (out_Pd);
4903
    referenced |= 1 << 0;
4904
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4905
  }
4906
  {
4907
    int referenced = 0;
4908
    int UNUSED insn_referenced = abuf->written;
4909
    INT in_Rd = -1;
4910
    INT in_Rs = -1;
4911
    INT out_Rd = -1;
4912
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4913
  }
4914
  return cycles;
4915
#undef FLD
4916
}
4917
 
4918
static int
4919
model_crisv32_jump_p (SIM_CPU *current_cpu, void *sem_arg)
4920
{
4921
#define FLD(f) abuf->fields.sfmt_mcp.f
4922
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4923
  const IDESC * UNUSED idesc = abuf->idesc;
4924
  int cycles = 0;
4925
  {
4926
    int referenced = 0;
4927
    int UNUSED insn_referenced = abuf->written;
4928
    INT in_Ps = -1;
4929
    in_Ps = FLD (in_Ps);
4930
    referenced |= 1 << 0;
4931
    cycles += crisv32f_model_crisv32_u_jump_sr (current_cpu, idesc, 0, referenced, in_Ps);
4932
  }
4933
  {
4934
    int referenced = 0;
4935
    int UNUSED insn_referenced = abuf->written;
4936
    INT in_Rd = -1;
4937
    INT in_Rs = -1;
4938
    INT out_Rd = -1;
4939
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
4940
  }
4941
  return cycles;
4942
#undef FLD
4943
}
4944
 
4945
static int
4946
model_crisv32_bas_c (SIM_CPU *current_cpu, void *sem_arg)
4947
{
4948
#define FLD(f) abuf->fields.sfmt_bas_c.f
4949
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4950
  const IDESC * UNUSED idesc = abuf->idesc;
4951
  int cycles = 0;
4952
  {
4953
    int referenced = 0;
4954
    int UNUSED insn_referenced = abuf->written;
4955
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
4956
  }
4957
  {
4958
    int referenced = 0;
4959
    int UNUSED insn_referenced = abuf->written;
4960
    INT out_Pd = -1;
4961
    out_Pd = FLD (out_Pd);
4962
    referenced |= 1 << 0;
4963
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 1, referenced, out_Pd);
4964
  }
4965
  {
4966
    int referenced = 0;
4967
    int UNUSED insn_referenced = abuf->written;
4968
    INT in_Rd = -1;
4969
    INT in_Rs = -1;
4970
    INT out_Rd = -1;
4971
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
4972
  }
4973
  return cycles;
4974
#undef FLD
4975
}
4976
 
4977
static int
4978
model_crisv32_jasc_r (SIM_CPU *current_cpu, void *sem_arg)
4979
{
4980
#define FLD(f) abuf->fields.sfmt_move_m_sprv32.f
4981
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
4982
  const IDESC * UNUSED idesc = abuf->idesc;
4983
  int cycles = 0;
4984
  {
4985
    int referenced = 0;
4986
    int UNUSED insn_referenced = abuf->written;
4987
    INT in_Rs = -1;
4988
    in_Rs = FLD (in_Rs);
4989
    referenced |= 1 << 0;
4990
    cycles += crisv32f_model_crisv32_u_jump_r (current_cpu, idesc, 0, referenced, in_Rs);
4991
  }
4992
  {
4993
    int referenced = 0;
4994
    int UNUSED insn_referenced = abuf->written;
4995
    cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
4996
  }
4997
  {
4998
    int referenced = 0;
4999
    int UNUSED insn_referenced = abuf->written;
5000
    INT out_Pd = -1;
5001
    out_Pd = FLD (out_Pd);
5002
    referenced |= 1 << 0;
5003
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5004
  }
5005
  {
5006
    int referenced = 0;
5007
    int UNUSED insn_referenced = abuf->written;
5008
    INT in_Rd = -1;
5009
    INT in_Rs = -1;
5010
    INT out_Rd = -1;
5011
    in_Rs = FLD (in_Rs);
5012
    referenced |= 1 << 1;
5013
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5014
  }
5015
  return cycles;
5016
#undef FLD
5017
}
5018
 
5019
static int
5020
model_crisv32_jasc_c (SIM_CPU *current_cpu, void *sem_arg)
5021
{
5022
#define FLD(f) abuf->fields.sfmt_move_c_sprv32_p2.f
5023
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5024
  const IDESC * UNUSED idesc = abuf->idesc;
5025
  int cycles = 0;
5026
  {
5027
    int referenced = 0;
5028
    int UNUSED insn_referenced = abuf->written;
5029
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5030
  }
5031
  {
5032
    int referenced = 0;
5033
    int UNUSED insn_referenced = abuf->written;
5034
    cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5035
  }
5036
  {
5037
    int referenced = 0;
5038
    int UNUSED insn_referenced = abuf->written;
5039
    INT out_Pd = -1;
5040
    out_Pd = FLD (out_Pd);
5041
    referenced |= 1 << 0;
5042
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5043
  }
5044
  {
5045
    int referenced = 0;
5046
    int UNUSED insn_referenced = abuf->written;
5047
    INT in_Rd = -1;
5048
    INT in_Rs = -1;
5049
    INT out_Rd = -1;
5050
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5051
  }
5052
  return cycles;
5053
#undef FLD
5054
}
5055
 
5056
static int
5057
model_crisv32_basc_c (SIM_CPU *current_cpu, void *sem_arg)
5058
{
5059
#define FLD(f) abuf->fields.sfmt_bas_c.f
5060
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5061
  const IDESC * UNUSED idesc = abuf->idesc;
5062
  int cycles = 0;
5063
  {
5064
    int referenced = 0;
5065
    int UNUSED insn_referenced = abuf->written;
5066
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5067
  }
5068
  {
5069
    int referenced = 0;
5070
    int UNUSED insn_referenced = abuf->written;
5071
    cycles += crisv32f_model_crisv32_u_skip4 (current_cpu, idesc, 1, referenced);
5072
  }
5073
  {
5074
    int referenced = 0;
5075
    int UNUSED insn_referenced = abuf->written;
5076
    INT out_Pd = -1;
5077
    out_Pd = FLD (out_Pd);
5078
    referenced |= 1 << 0;
5079
    cycles += crisv32f_model_crisv32_u_jump (current_cpu, idesc, 2, referenced, out_Pd);
5080
  }
5081
  {
5082
    int referenced = 0;
5083
    int UNUSED insn_referenced = abuf->written;
5084
    INT in_Rd = -1;
5085
    INT in_Rs = -1;
5086
    INT out_Rd = -1;
5087
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 3, referenced, in_Rd, in_Rs, out_Rd);
5088
  }
5089
  return cycles;
5090
#undef FLD
5091
}
5092
 
5093
static int
5094
model_crisv32_break (SIM_CPU *current_cpu, void *sem_arg)
5095
{
5096
#define FLD(f) abuf->fields.sfmt_break.f
5097
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5098
  const IDESC * UNUSED idesc = abuf->idesc;
5099
  int cycles = 0;
5100
  {
5101
    int referenced = 0;
5102
    int UNUSED insn_referenced = abuf->written;
5103
    INT in_Rd = -1;
5104
    INT in_Rs = -1;
5105
    INT out_Rd = -1;
5106
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5107
  }
5108
  return cycles;
5109
#undef FLD
5110
}
5111
 
5112
static int
5113
model_crisv32_bound_r_b_r (SIM_CPU *current_cpu, void *sem_arg)
5114
{
5115
#define FLD(f) abuf->fields.sfmt_muls_b.f
5116
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5117
  const IDESC * UNUSED idesc = abuf->idesc;
5118
  int cycles = 0;
5119
  {
5120
    int referenced = 0;
5121
    int UNUSED insn_referenced = abuf->written;
5122
    INT in_Rd = -1;
5123
    INT in_Rs = -1;
5124
    INT out_Rd = -1;
5125
    in_Rd = FLD (in_Rd);
5126
    in_Rs = FLD (in_Rs);
5127
    out_Rd = FLD (out_Rd);
5128
    referenced |= 1 << 0;
5129
    referenced |= 1 << 1;
5130
    referenced |= 1 << 2;
5131
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5132
  }
5133
  return cycles;
5134
#undef FLD
5135
}
5136
 
5137
static int
5138
model_crisv32_bound_r_w_r (SIM_CPU *current_cpu, void *sem_arg)
5139
{
5140
#define FLD(f) abuf->fields.sfmt_muls_b.f
5141
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5142
  const IDESC * UNUSED idesc = abuf->idesc;
5143
  int cycles = 0;
5144
  {
5145
    int referenced = 0;
5146
    int UNUSED insn_referenced = abuf->written;
5147
    INT in_Rd = -1;
5148
    INT in_Rs = -1;
5149
    INT out_Rd = -1;
5150
    in_Rd = FLD (in_Rd);
5151
    in_Rs = FLD (in_Rs);
5152
    out_Rd = FLD (out_Rd);
5153
    referenced |= 1 << 0;
5154
    referenced |= 1 << 1;
5155
    referenced |= 1 << 2;
5156
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5157
  }
5158
  return cycles;
5159
#undef FLD
5160
}
5161
 
5162
static int
5163
model_crisv32_bound_r_d_r (SIM_CPU *current_cpu, void *sem_arg)
5164
{
5165
#define FLD(f) abuf->fields.sfmt_muls_b.f
5166
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5167
  const IDESC * UNUSED idesc = abuf->idesc;
5168
  int cycles = 0;
5169
  {
5170
    int referenced = 0;
5171
    int UNUSED insn_referenced = abuf->written;
5172
    INT in_Rd = -1;
5173
    INT in_Rs = -1;
5174
    INT out_Rd = -1;
5175
    in_Rd = FLD (in_Rd);
5176
    in_Rs = FLD (in_Rs);
5177
    out_Rd = FLD (out_Rd);
5178
    referenced |= 1 << 0;
5179
    referenced |= 1 << 1;
5180
    referenced |= 1 << 2;
5181
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5182
  }
5183
  return cycles;
5184
#undef FLD
5185
}
5186
 
5187
static int
5188
model_crisv32_bound_cb (SIM_CPU *current_cpu, void *sem_arg)
5189
{
5190
#define FLD(f) abuf->fields.sfmt_bound_cb.f
5191
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5192
  const IDESC * UNUSED idesc = abuf->idesc;
5193
  int cycles = 0;
5194
  {
5195
    int referenced = 0;
5196
    int UNUSED insn_referenced = abuf->written;
5197
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5198
  }
5199
  {
5200
    int referenced = 0;
5201
    int UNUSED insn_referenced = abuf->written;
5202
    INT in_Rd = -1;
5203
    INT in_Rs = -1;
5204
    INT out_Rd = -1;
5205
    in_Rd = FLD (in_Rd);
5206
    out_Rd = FLD (out_Rd);
5207
    referenced |= 1 << 0;
5208
    referenced |= 1 << 2;
5209
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5210
  }
5211
  return cycles;
5212
#undef FLD
5213
}
5214
 
5215
static int
5216
model_crisv32_bound_cw (SIM_CPU *current_cpu, void *sem_arg)
5217
{
5218
#define FLD(f) abuf->fields.sfmt_bound_cw.f
5219
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5220
  const IDESC * UNUSED idesc = abuf->idesc;
5221
  int cycles = 0;
5222
  {
5223
    int referenced = 0;
5224
    int UNUSED insn_referenced = abuf->written;
5225
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5226
  }
5227
  {
5228
    int referenced = 0;
5229
    int UNUSED insn_referenced = abuf->written;
5230
    INT in_Rd = -1;
5231
    INT in_Rs = -1;
5232
    INT out_Rd = -1;
5233
    in_Rd = FLD (in_Rd);
5234
    out_Rd = FLD (out_Rd);
5235
    referenced |= 1 << 0;
5236
    referenced |= 1 << 2;
5237
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5238
  }
5239
  return cycles;
5240
#undef FLD
5241
}
5242
 
5243
static int
5244
model_crisv32_bound_cd (SIM_CPU *current_cpu, void *sem_arg)
5245
{
5246
#define FLD(f) abuf->fields.sfmt_bound_cd.f
5247
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5248
  const IDESC * UNUSED idesc = abuf->idesc;
5249
  int cycles = 0;
5250
  {
5251
    int referenced = 0;
5252
    int UNUSED insn_referenced = abuf->written;
5253
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5254
  }
5255
  {
5256
    int referenced = 0;
5257
    int UNUSED insn_referenced = abuf->written;
5258
    INT in_Rd = -1;
5259
    INT in_Rs = -1;
5260
    INT out_Rd = -1;
5261
    in_Rd = FLD (in_Rd);
5262
    out_Rd = FLD (out_Rd);
5263
    referenced |= 1 << 0;
5264
    referenced |= 1 << 2;
5265
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5266
  }
5267
  return cycles;
5268
#undef FLD
5269
}
5270
 
5271
static int
5272
model_crisv32_scc (SIM_CPU *current_cpu, void *sem_arg)
5273
{
5274
#define FLD(f) abuf->fields.sfmt_move_spr_mv32.f
5275
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5276
  const IDESC * UNUSED idesc = abuf->idesc;
5277
  int cycles = 0;
5278
  {
5279
    int referenced = 0;
5280
    int UNUSED insn_referenced = abuf->written;
5281
    INT in_Rd = -1;
5282
    INT in_Rs = -1;
5283
    INT out_Rd = -1;
5284
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5285
  }
5286
  return cycles;
5287
#undef FLD
5288
}
5289
 
5290
static int
5291
model_crisv32_lz (SIM_CPU *current_cpu, void *sem_arg)
5292
{
5293
#define FLD(f) abuf->fields.sfmt_muls_b.f
5294
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5295
  const IDESC * UNUSED idesc = abuf->idesc;
5296
  int cycles = 0;
5297
  {
5298
    int referenced = 0;
5299
    int UNUSED insn_referenced = abuf->written;
5300
    INT in_Rd = -1;
5301
    INT in_Rs = -1;
5302
    INT out_Rd = -1;
5303
    in_Rs = FLD (in_Rs);
5304
    out_Rd = FLD (out_Rd);
5305
    referenced |= 1 << 1;
5306
    referenced |= 1 << 2;
5307
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5308
  }
5309
  return cycles;
5310
#undef FLD
5311
}
5312
 
5313
static int
5314
model_crisv32_addoq (SIM_CPU *current_cpu, void *sem_arg)
5315
{
5316
#define FLD(f) abuf->fields.sfmt_addoq.f
5317
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5318
  const IDESC * UNUSED idesc = abuf->idesc;
5319
  int cycles = 0;
5320
  {
5321
    int referenced = 0;
5322
    int UNUSED insn_referenced = abuf->written;
5323
    INT in_Rd = -1;
5324
    INT in_Rs = -1;
5325
    INT out_Rd = -1;
5326
    in_Rd = FLD (in_Rd);
5327
    referenced |= 1 << 0;
5328
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5329
  }
5330
  return cycles;
5331
#undef FLD
5332
}
5333
 
5334
static int
5335
model_crisv32_addo_m_b_m (SIM_CPU *current_cpu, void *sem_arg)
5336
{
5337
#define FLD(f) abuf->fields.sfmt_addc_m.f
5338
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5339
  const IDESC * UNUSED idesc = abuf->idesc;
5340
  int cycles = 0;
5341
  {
5342
    int referenced = 0;
5343
    int UNUSED insn_referenced = abuf->written;
5344
    INT in_Rs = -1;
5345
    in_Rs = FLD (in_Rs);
5346
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5347
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5348
  }
5349
  {
5350
    int referenced = 0;
5351
    int UNUSED insn_referenced = abuf->written;
5352
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5353
  }
5354
  {
5355
    int referenced = 0;
5356
    int UNUSED insn_referenced = abuf->written;
5357
    INT in_Rd = -1;
5358
    INT in_Rs = -1;
5359
    INT out_Rd = -1;
5360
    in_Rd = FLD (in_Rd);
5361
    in_Rs = FLD (in_Rs);
5362
    referenced |= 1 << 0;
5363
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5364
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5365
  }
5366
  return cycles;
5367
#undef FLD
5368
}
5369
 
5370
static int
5371
model_crisv32_addo_m_w_m (SIM_CPU *current_cpu, void *sem_arg)
5372
{
5373
#define FLD(f) abuf->fields.sfmt_addc_m.f
5374
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5375
  const IDESC * UNUSED idesc = abuf->idesc;
5376
  int cycles = 0;
5377
  {
5378
    int referenced = 0;
5379
    int UNUSED insn_referenced = abuf->written;
5380
    INT in_Rs = -1;
5381
    in_Rs = FLD (in_Rs);
5382
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5383
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5384
  }
5385
  {
5386
    int referenced = 0;
5387
    int UNUSED insn_referenced = abuf->written;
5388
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5389
  }
5390
  {
5391
    int referenced = 0;
5392
    int UNUSED insn_referenced = abuf->written;
5393
    INT in_Rd = -1;
5394
    INT in_Rs = -1;
5395
    INT out_Rd = -1;
5396
    in_Rd = FLD (in_Rd);
5397
    in_Rs = FLD (in_Rs);
5398
    referenced |= 1 << 0;
5399
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5400
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5401
  }
5402
  return cycles;
5403
#undef FLD
5404
}
5405
 
5406
static int
5407
model_crisv32_addo_m_d_m (SIM_CPU *current_cpu, void *sem_arg)
5408
{
5409
#define FLD(f) abuf->fields.sfmt_addc_m.f
5410
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5411
  const IDESC * UNUSED idesc = abuf->idesc;
5412
  int cycles = 0;
5413
  {
5414
    int referenced = 0;
5415
    int UNUSED insn_referenced = abuf->written;
5416
    INT in_Rs = -1;
5417
    in_Rs = FLD (in_Rs);
5418
    if (insn_referenced & (1 << 1)) referenced |= 1 << 0;
5419
    cycles += crisv32f_model_crisv32_u_mem (current_cpu, idesc, 0, referenced, in_Rs);
5420
  }
5421
  {
5422
    int referenced = 0;
5423
    int UNUSED insn_referenced = abuf->written;
5424
    cycles += crisv32f_model_crisv32_u_mem_r (current_cpu, idesc, 1, referenced);
5425
  }
5426
  {
5427
    int referenced = 0;
5428
    int UNUSED insn_referenced = abuf->written;
5429
    INT in_Rd = -1;
5430
    INT in_Rs = -1;
5431
    INT out_Rd = -1;
5432
    in_Rd = FLD (in_Rd);
5433
    in_Rs = FLD (in_Rs);
5434
    referenced |= 1 << 0;
5435
    if (insn_referenced & (1 << 1)) referenced |= 1 << 1;
5436
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 2, referenced, in_Rd, in_Rs, out_Rd);
5437
  }
5438
  return cycles;
5439
#undef FLD
5440
}
5441
 
5442
static int
5443
model_crisv32_addo_cb (SIM_CPU *current_cpu, void *sem_arg)
5444
{
5445
#define FLD(f) abuf->fields.sfmt_bound_cb.f
5446
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5447
  const IDESC * UNUSED idesc = abuf->idesc;
5448
  int cycles = 0;
5449
  {
5450
    int referenced = 0;
5451
    int UNUSED insn_referenced = abuf->written;
5452
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5453
  }
5454
  {
5455
    int referenced = 0;
5456
    int UNUSED insn_referenced = abuf->written;
5457
    INT in_Rd = -1;
5458
    INT in_Rs = -1;
5459
    INT out_Rd = -1;
5460
    in_Rd = FLD (in_Rd);
5461
    referenced |= 1 << 0;
5462
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5463
  }
5464
  return cycles;
5465
#undef FLD
5466
}
5467
 
5468
static int
5469
model_crisv32_addo_cw (SIM_CPU *current_cpu, void *sem_arg)
5470
{
5471
#define FLD(f) abuf->fields.sfmt_bound_cw.f
5472
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5473
  const IDESC * UNUSED idesc = abuf->idesc;
5474
  int cycles = 0;
5475
  {
5476
    int referenced = 0;
5477
    int UNUSED insn_referenced = abuf->written;
5478
    cycles += crisv32f_model_crisv32_u_const16 (current_cpu, idesc, 0, referenced);
5479
  }
5480
  {
5481
    int referenced = 0;
5482
    int UNUSED insn_referenced = abuf->written;
5483
    INT in_Rd = -1;
5484
    INT in_Rs = -1;
5485
    INT out_Rd = -1;
5486
    in_Rd = FLD (in_Rd);
5487
    referenced |= 1 << 0;
5488
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5489
  }
5490
  return cycles;
5491
#undef FLD
5492
}
5493
 
5494
static int
5495
model_crisv32_addo_cd (SIM_CPU *current_cpu, void *sem_arg)
5496
{
5497
#define FLD(f) abuf->fields.sfmt_bound_cd.f
5498
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5499
  const IDESC * UNUSED idesc = abuf->idesc;
5500
  int cycles = 0;
5501
  {
5502
    int referenced = 0;
5503
    int UNUSED insn_referenced = abuf->written;
5504
    cycles += crisv32f_model_crisv32_u_const32 (current_cpu, idesc, 0, referenced);
5505
  }
5506
  {
5507
    int referenced = 0;
5508
    int UNUSED insn_referenced = abuf->written;
5509
    INT in_Rd = -1;
5510
    INT in_Rs = -1;
5511
    INT out_Rd = -1;
5512
    in_Rd = FLD (in_Rd);
5513
    referenced |= 1 << 0;
5514
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 1, referenced, in_Rd, in_Rs, out_Rd);
5515
  }
5516
  return cycles;
5517
#undef FLD
5518
}
5519
 
5520
static int
5521
model_crisv32_addi_acr_b_r (SIM_CPU *current_cpu, void *sem_arg)
5522
{
5523
#define FLD(f) abuf->fields.sfmt_muls_b.f
5524
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5525
  const IDESC * UNUSED idesc = abuf->idesc;
5526
  int cycles = 0;
5527
  {
5528
    int referenced = 0;
5529
    int UNUSED insn_referenced = abuf->written;
5530
    INT in_Rd = -1;
5531
    INT in_Rs = -1;
5532
    INT out_Rd = -1;
5533
    in_Rd = FLD (in_Rd);
5534
    in_Rs = FLD (in_Rs);
5535
    referenced |= 1 << 0;
5536
    referenced |= 1 << 1;
5537
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5538
  }
5539
  return cycles;
5540
#undef FLD
5541
}
5542
 
5543
static int
5544
model_crisv32_addi_acr_w_r (SIM_CPU *current_cpu, void *sem_arg)
5545
{
5546
#define FLD(f) abuf->fields.sfmt_muls_b.f
5547
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5548
  const IDESC * UNUSED idesc = abuf->idesc;
5549
  int cycles = 0;
5550
  {
5551
    int referenced = 0;
5552
    int UNUSED insn_referenced = abuf->written;
5553
    INT in_Rd = -1;
5554
    INT in_Rs = -1;
5555
    INT out_Rd = -1;
5556
    in_Rd = FLD (in_Rd);
5557
    in_Rs = FLD (in_Rs);
5558
    referenced |= 1 << 0;
5559
    referenced |= 1 << 1;
5560
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5561
  }
5562
  return cycles;
5563
#undef FLD
5564
}
5565
 
5566
static int
5567
model_crisv32_addi_acr_d_r (SIM_CPU *current_cpu, void *sem_arg)
5568
{
5569
#define FLD(f) abuf->fields.sfmt_muls_b.f
5570
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5571
  const IDESC * UNUSED idesc = abuf->idesc;
5572
  int cycles = 0;
5573
  {
5574
    int referenced = 0;
5575
    int UNUSED insn_referenced = abuf->written;
5576
    INT in_Rd = -1;
5577
    INT in_Rs = -1;
5578
    INT out_Rd = -1;
5579
    in_Rd = FLD (in_Rd);
5580
    in_Rs = FLD (in_Rs);
5581
    referenced |= 1 << 0;
5582
    referenced |= 1 << 1;
5583
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5584
  }
5585
  return cycles;
5586
#undef FLD
5587
}
5588
 
5589
static int
5590
model_crisv32_fidxi (SIM_CPU *current_cpu, void *sem_arg)
5591
{
5592
#define FLD(f) abuf->fields.sfmt_mcp.f
5593
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5594
  const IDESC * UNUSED idesc = abuf->idesc;
5595
  int cycles = 0;
5596
  {
5597
    int referenced = 0;
5598
    int UNUSED insn_referenced = abuf->written;
5599
    INT in_Rd = -1;
5600
    INT in_Rs = -1;
5601
    INT out_Rd = -1;
5602
    in_Rs = FLD (in_Rs);
5603
    referenced |= 1 << 1;
5604
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5605
  }
5606
  return cycles;
5607
#undef FLD
5608
}
5609
 
5610
static int
5611
model_crisv32_ftagi (SIM_CPU *current_cpu, void *sem_arg)
5612
{
5613
#define FLD(f) abuf->fields.sfmt_mcp.f
5614
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5615
  const IDESC * UNUSED idesc = abuf->idesc;
5616
  int cycles = 0;
5617
  {
5618
    int referenced = 0;
5619
    int UNUSED insn_referenced = abuf->written;
5620
    INT in_Rd = -1;
5621
    INT in_Rs = -1;
5622
    INT out_Rd = -1;
5623
    in_Rs = FLD (in_Rs);
5624
    referenced |= 1 << 1;
5625
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5626
  }
5627
  return cycles;
5628
#undef FLD
5629
}
5630
 
5631
static int
5632
model_crisv32_fidxd (SIM_CPU *current_cpu, void *sem_arg)
5633
{
5634
#define FLD(f) abuf->fields.sfmt_mcp.f
5635
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5636
  const IDESC * UNUSED idesc = abuf->idesc;
5637
  int cycles = 0;
5638
  {
5639
    int referenced = 0;
5640
    int UNUSED insn_referenced = abuf->written;
5641
    INT in_Rd = -1;
5642
    INT in_Rs = -1;
5643
    INT out_Rd = -1;
5644
    in_Rs = FLD (in_Rs);
5645
    referenced |= 1 << 1;
5646
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5647
  }
5648
  return cycles;
5649
#undef FLD
5650
}
5651
 
5652
static int
5653
model_crisv32_ftagd (SIM_CPU *current_cpu, void *sem_arg)
5654
{
5655
#define FLD(f) abuf->fields.sfmt_mcp.f
5656
  const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
5657
  const IDESC * UNUSED idesc = abuf->idesc;
5658
  int cycles = 0;
5659
  {
5660
    int referenced = 0;
5661
    int UNUSED insn_referenced = abuf->written;
5662
    INT in_Rd = -1;
5663
    INT in_Rs = -1;
5664
    INT out_Rd = -1;
5665
    in_Rs = FLD (in_Rs);
5666
    referenced |= 1 << 1;
5667
    cycles += crisv32f_model_crisv32_u_exec (current_cpu, idesc, 0, referenced, in_Rd, in_Rs, out_Rd);
5668
  }
5669
  return cycles;
5670
#undef FLD
5671
}
5672
 
5673
/* We assume UNIT_NONE == 0 because the tables don't always terminate
5674
   entries with it.  */
5675
 
5676
/* Model timing data for `crisv32'.  */
5677
 
5678
static const INSN_TIMING crisv32_timing[] = {
5679
  { CRISV32F_INSN_X_INVALID, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5680
  { CRISV32F_INSN_X_AFTER, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5681
  { CRISV32F_INSN_X_BEFORE, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5682
  { CRISV32F_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5683
  { CRISV32F_INSN_X_CHAIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5684
  { CRISV32F_INSN_X_BEGIN, 0, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5685
  { CRISV32F_INSN_MOVE_B_R, model_crisv32_move_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5686
  { CRISV32F_INSN_MOVE_W_R, model_crisv32_move_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5687
  { CRISV32F_INSN_MOVE_D_R, model_crisv32_move_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5688
  { CRISV32F_INSN_MOVEQ, model_crisv32_moveq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5689
  { CRISV32F_INSN_MOVS_B_R, model_crisv32_movs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5690
  { CRISV32F_INSN_MOVS_W_R, model_crisv32_movs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5691
  { CRISV32F_INSN_MOVU_B_R, model_crisv32_movu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5692
  { CRISV32F_INSN_MOVU_W_R, model_crisv32_movu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5693
  { CRISV32F_INSN_MOVECBR, model_crisv32_movecbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5694
  { CRISV32F_INSN_MOVECWR, model_crisv32_movecwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5695
  { CRISV32F_INSN_MOVECDR, model_crisv32_movecdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5696
  { CRISV32F_INSN_MOVSCBR, model_crisv32_movscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5697
  { CRISV32F_INSN_MOVSCWR, model_crisv32_movscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5698
  { CRISV32F_INSN_MOVUCBR, model_crisv32_movucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5699
  { CRISV32F_INSN_MOVUCWR, model_crisv32_movucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5700
  { CRISV32F_INSN_ADDQ, model_crisv32_addq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5701
  { CRISV32F_INSN_SUBQ, model_crisv32_subq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5702
  { CRISV32F_INSN_CMP_R_B_R, model_crisv32_cmp_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5703
  { CRISV32F_INSN_CMP_R_W_R, model_crisv32_cmp_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5704
  { CRISV32F_INSN_CMP_R_D_R, model_crisv32_cmp_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5705
  { CRISV32F_INSN_CMP_M_B_M, model_crisv32_cmp_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5706
  { CRISV32F_INSN_CMP_M_W_M, model_crisv32_cmp_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5707
  { CRISV32F_INSN_CMP_M_D_M, model_crisv32_cmp_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5708
  { CRISV32F_INSN_CMPCBR, model_crisv32_cmpcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5709
  { CRISV32F_INSN_CMPCWR, model_crisv32_cmpcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5710
  { CRISV32F_INSN_CMPCDR, model_crisv32_cmpcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5711
  { CRISV32F_INSN_CMPQ, model_crisv32_cmpq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5712
  { CRISV32F_INSN_CMPS_M_B_M, model_crisv32_cmps_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5713
  { CRISV32F_INSN_CMPS_M_W_M, model_crisv32_cmps_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5714
  { CRISV32F_INSN_CMPSCBR, model_crisv32_cmpscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5715
  { CRISV32F_INSN_CMPSCWR, model_crisv32_cmpscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5716
  { CRISV32F_INSN_CMPU_M_B_M, model_crisv32_cmpu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5717
  { CRISV32F_INSN_CMPU_M_W_M, model_crisv32_cmpu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5718
  { CRISV32F_INSN_CMPUCBR, model_crisv32_cmpucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5719
  { CRISV32F_INSN_CMPUCWR, model_crisv32_cmpucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5720
  { CRISV32F_INSN_MOVE_M_B_M, model_crisv32_move_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5721
  { CRISV32F_INSN_MOVE_M_W_M, model_crisv32_move_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5722
  { CRISV32F_INSN_MOVE_M_D_M, model_crisv32_move_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5723
  { CRISV32F_INSN_MOVS_M_B_M, model_crisv32_movs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5724
  { CRISV32F_INSN_MOVS_M_W_M, model_crisv32_movs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5725
  { CRISV32F_INSN_MOVU_M_B_M, model_crisv32_movu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5726
  { CRISV32F_INSN_MOVU_M_W_M, model_crisv32_movu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5727
  { CRISV32F_INSN_MOVE_R_SPRV32, model_crisv32_move_r_sprv32, { { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5728
  { CRISV32F_INSN_MOVE_SPR_RV32, model_crisv32_move_spr_rv32, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5729
  { CRISV32F_INSN_MOVE_M_SPRV32, model_crisv32_move_m_sprv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5730
  { CRISV32F_INSN_MOVE_C_SPRV32_P2, model_crisv32_move_c_sprv32_p2, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5731
  { CRISV32F_INSN_MOVE_C_SPRV32_P3, model_crisv32_move_c_sprv32_p3, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5732
  { CRISV32F_INSN_MOVE_C_SPRV32_P5, model_crisv32_move_c_sprv32_p5, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5733
  { CRISV32F_INSN_MOVE_C_SPRV32_P6, model_crisv32_move_c_sprv32_p6, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5734
  { CRISV32F_INSN_MOVE_C_SPRV32_P7, model_crisv32_move_c_sprv32_p7, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5735
  { CRISV32F_INSN_MOVE_C_SPRV32_P9, model_crisv32_move_c_sprv32_p9, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5736
  { CRISV32F_INSN_MOVE_C_SPRV32_P10, model_crisv32_move_c_sprv32_p10, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5737
  { CRISV32F_INSN_MOVE_C_SPRV32_P11, model_crisv32_move_c_sprv32_p11, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5738
  { CRISV32F_INSN_MOVE_C_SPRV32_P12, model_crisv32_move_c_sprv32_p12, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5739
  { CRISV32F_INSN_MOVE_C_SPRV32_P13, model_crisv32_move_c_sprv32_p13, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5740
  { CRISV32F_INSN_MOVE_C_SPRV32_P14, model_crisv32_move_c_sprv32_p14, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5741
  { CRISV32F_INSN_MOVE_C_SPRV32_P15, model_crisv32_move_c_sprv32_p15, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_TO_SR, 1, 1 } } },
5742
  { CRISV32F_INSN_MOVE_SPR_MV32, model_crisv32_move_spr_mv32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5743
  { CRISV32F_INSN_MOVE_SS_R, model_crisv32_move_ss_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5744
  { CRISV32F_INSN_MOVE_R_SS, model_crisv32_move_r_ss, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5745
  { CRISV32F_INSN_MOVEM_R_M_V32, model_crisv32_movem_r_m_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_RTOM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5746
  { CRISV32F_INSN_MOVEM_M_R_V32, model_crisv32_movem_m_r_v32, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_MOVEM_MTOR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC_MOVEM, 1, 1 } } },
5747
  { CRISV32F_INSN_ADD_B_R, model_crisv32_add_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5748
  { CRISV32F_INSN_ADD_W_R, model_crisv32_add_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5749
  { CRISV32F_INSN_ADD_D_R, model_crisv32_add_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5750
  { CRISV32F_INSN_ADD_M_B_M, model_crisv32_add_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5751
  { CRISV32F_INSN_ADD_M_W_M, model_crisv32_add_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5752
  { CRISV32F_INSN_ADD_M_D_M, model_crisv32_add_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5753
  { CRISV32F_INSN_ADDCBR, model_crisv32_addcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5754
  { CRISV32F_INSN_ADDCWR, model_crisv32_addcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5755
  { CRISV32F_INSN_ADDCDR, model_crisv32_addcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5756
  { CRISV32F_INSN_ADDS_B_R, model_crisv32_adds_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5757
  { CRISV32F_INSN_ADDS_W_R, model_crisv32_adds_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5758
  { CRISV32F_INSN_ADDS_M_B_M, model_crisv32_adds_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5759
  { CRISV32F_INSN_ADDS_M_W_M, model_crisv32_adds_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5760
  { CRISV32F_INSN_ADDSCBR, model_crisv32_addscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5761
  { CRISV32F_INSN_ADDSCWR, model_crisv32_addscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5762
  { CRISV32F_INSN_ADDU_B_R, model_crisv32_addu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5763
  { CRISV32F_INSN_ADDU_W_R, model_crisv32_addu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5764
  { CRISV32F_INSN_ADDU_M_B_M, model_crisv32_addu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5765
  { CRISV32F_INSN_ADDU_M_W_M, model_crisv32_addu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5766
  { CRISV32F_INSN_ADDUCBR, model_crisv32_adducbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5767
  { CRISV32F_INSN_ADDUCWR, model_crisv32_adducwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5768
  { CRISV32F_INSN_SUB_B_R, model_crisv32_sub_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5769
  { CRISV32F_INSN_SUB_W_R, model_crisv32_sub_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5770
  { CRISV32F_INSN_SUB_D_R, model_crisv32_sub_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5771
  { CRISV32F_INSN_SUB_M_B_M, model_crisv32_sub_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5772
  { CRISV32F_INSN_SUB_M_W_M, model_crisv32_sub_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5773
  { CRISV32F_INSN_SUB_M_D_M, model_crisv32_sub_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5774
  { CRISV32F_INSN_SUBCBR, model_crisv32_subcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5775
  { CRISV32F_INSN_SUBCWR, model_crisv32_subcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5776
  { CRISV32F_INSN_SUBCDR, model_crisv32_subcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5777
  { CRISV32F_INSN_SUBS_B_R, model_crisv32_subs_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5778
  { CRISV32F_INSN_SUBS_W_R, model_crisv32_subs_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5779
  { CRISV32F_INSN_SUBS_M_B_M, model_crisv32_subs_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5780
  { CRISV32F_INSN_SUBS_M_W_M, model_crisv32_subs_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5781
  { CRISV32F_INSN_SUBSCBR, model_crisv32_subscbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5782
  { CRISV32F_INSN_SUBSCWR, model_crisv32_subscwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5783
  { CRISV32F_INSN_SUBU_B_R, model_crisv32_subu_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5784
  { CRISV32F_INSN_SUBU_W_R, model_crisv32_subu_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5785
  { CRISV32F_INSN_SUBU_M_B_M, model_crisv32_subu_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5786
  { CRISV32F_INSN_SUBU_M_W_M, model_crisv32_subu_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5787
  { CRISV32F_INSN_SUBUCBR, model_crisv32_subucbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5788
  { CRISV32F_INSN_SUBUCWR, model_crisv32_subucwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5789
  { CRISV32F_INSN_ADDC_R, model_crisv32_addc_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5790
  { CRISV32F_INSN_ADDC_M, model_crisv32_addc_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5791
  { CRISV32F_INSN_ADDC_C, model_crisv32_addc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5792
  { CRISV32F_INSN_LAPC_D, model_crisv32_lapc_d, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5793
  { CRISV32F_INSN_LAPCQ, model_crisv32_lapcq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5794
  { CRISV32F_INSN_ADDI_B_R, model_crisv32_addi_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5795
  { CRISV32F_INSN_ADDI_W_R, model_crisv32_addi_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5796
  { CRISV32F_INSN_ADDI_D_R, model_crisv32_addi_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5797
  { CRISV32F_INSN_NEG_B_R, model_crisv32_neg_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5798
  { CRISV32F_INSN_NEG_W_R, model_crisv32_neg_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5799
  { CRISV32F_INSN_NEG_D_R, model_crisv32_neg_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5800
  { CRISV32F_INSN_TEST_M_B_M, model_crisv32_test_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5801
  { CRISV32F_INSN_TEST_M_W_M, model_crisv32_test_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5802
  { CRISV32F_INSN_TEST_M_D_M, model_crisv32_test_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5803
  { CRISV32F_INSN_MOVE_R_M_B_M, model_crisv32_move_r_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5804
  { CRISV32F_INSN_MOVE_R_M_W_M, model_crisv32_move_r_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5805
  { CRISV32F_INSN_MOVE_R_M_D_M, model_crisv32_move_r_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_W, 1, 1 } } },
5806
  { CRISV32F_INSN_MULS_B, model_crisv32_muls_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5807
  { CRISV32F_INSN_MULS_W, model_crisv32_muls_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5808
  { CRISV32F_INSN_MULS_D, model_crisv32_muls_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5809
  { CRISV32F_INSN_MULU_B, model_crisv32_mulu_b, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5810
  { CRISV32F_INSN_MULU_W, model_crisv32_mulu_w, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5811
  { CRISV32F_INSN_MULU_D, model_crisv32_mulu_d, { { (int) UNIT_CRISV32_U_MULTIPLY, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5812
  { CRISV32F_INSN_MCP, model_crisv32_mcp, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5813
  { CRISV32F_INSN_DSTEP, model_crisv32_dstep, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5814
  { CRISV32F_INSN_ABS, model_crisv32_abs, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5815
  { CRISV32F_INSN_AND_B_R, model_crisv32_and_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5816
  { CRISV32F_INSN_AND_W_R, model_crisv32_and_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5817
  { CRISV32F_INSN_AND_D_R, model_crisv32_and_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5818
  { CRISV32F_INSN_AND_M_B_M, model_crisv32_and_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5819
  { CRISV32F_INSN_AND_M_W_M, model_crisv32_and_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5820
  { CRISV32F_INSN_AND_M_D_M, model_crisv32_and_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5821
  { CRISV32F_INSN_ANDCBR, model_crisv32_andcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5822
  { CRISV32F_INSN_ANDCWR, model_crisv32_andcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5823
  { CRISV32F_INSN_ANDCDR, model_crisv32_andcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5824
  { CRISV32F_INSN_ANDQ, model_crisv32_andq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5825
  { CRISV32F_INSN_ORR_B_R, model_crisv32_orr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5826
  { CRISV32F_INSN_ORR_W_R, model_crisv32_orr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5827
  { CRISV32F_INSN_ORR_D_R, model_crisv32_orr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5828
  { CRISV32F_INSN_OR_M_B_M, model_crisv32_or_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5829
  { CRISV32F_INSN_OR_M_W_M, model_crisv32_or_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5830
  { CRISV32F_INSN_OR_M_D_M, model_crisv32_or_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5831
  { CRISV32F_INSN_ORCBR, model_crisv32_orcbr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5832
  { CRISV32F_INSN_ORCWR, model_crisv32_orcwr, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5833
  { CRISV32F_INSN_ORCDR, model_crisv32_orcdr, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5834
  { CRISV32F_INSN_ORQ, model_crisv32_orq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5835
  { CRISV32F_INSN_XOR, model_crisv32_xor, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5836
  { CRISV32F_INSN_SWAP, model_crisv32_swap, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5837
  { CRISV32F_INSN_ASRR_B_R, model_crisv32_asrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5838
  { CRISV32F_INSN_ASRR_W_R, model_crisv32_asrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5839
  { CRISV32F_INSN_ASRR_D_R, model_crisv32_asrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5840
  { CRISV32F_INSN_ASRQ, model_crisv32_asrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5841
  { CRISV32F_INSN_LSRR_B_R, model_crisv32_lsrr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5842
  { CRISV32F_INSN_LSRR_W_R, model_crisv32_lsrr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5843
  { CRISV32F_INSN_LSRR_D_R, model_crisv32_lsrr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5844
  { CRISV32F_INSN_LSRQ, model_crisv32_lsrq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5845
  { CRISV32F_INSN_LSLR_B_R, model_crisv32_lslr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5846
  { CRISV32F_INSN_LSLR_W_R, model_crisv32_lslr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5847
  { CRISV32F_INSN_LSLR_D_R, model_crisv32_lslr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5848
  { CRISV32F_INSN_LSLQ, model_crisv32_lslq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5849
  { CRISV32F_INSN_BTST, model_crisv32_btst, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5850
  { CRISV32F_INSN_BTSTQ, model_crisv32_btstq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5851
  { CRISV32F_INSN_SETF, model_crisv32_setf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5852
  { CRISV32F_INSN_CLEARF, model_crisv32_clearf, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5853
  { CRISV32F_INSN_RFE, model_crisv32_rfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5854
  { CRISV32F_INSN_SFE, model_crisv32_sfe, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5855
  { CRISV32F_INSN_RFG, model_crisv32_rfg, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5856
  { CRISV32F_INSN_RFN, model_crisv32_rfn, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5857
  { CRISV32F_INSN_HALT, model_crisv32_halt, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5858
  { CRISV32F_INSN_BCC_B, model_crisv32_bcc_b, { { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5859
  { CRISV32F_INSN_BA_B, model_crisv32_ba_b, { { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5860
  { CRISV32F_INSN_BCC_W, model_crisv32_bcc_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_BRANCH, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5861
  { CRISV32F_INSN_BA_W, model_crisv32_ba_w, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5862
  { CRISV32F_INSN_JAS_R, model_crisv32_jas_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5863
  { CRISV32F_INSN_JAS_C, model_crisv32_jas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5864
  { CRISV32F_INSN_JUMP_P, model_crisv32_jump_p, { { (int) UNIT_CRISV32_U_JUMP_SR, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5865
  { CRISV32F_INSN_BAS_C, model_crisv32_bas_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5866
  { CRISV32F_INSN_JASC_R, model_crisv32_jasc_r, { { (int) UNIT_CRISV32_U_JUMP_R, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5867
  { CRISV32F_INSN_JASC_C, model_crisv32_jasc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5868
  { CRISV32F_INSN_BASC_C, model_crisv32_basc_c, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_SKIP4, 1, 1 }, { (int) UNIT_CRISV32_U_JUMP, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5869
  { CRISV32F_INSN_BREAK, model_crisv32_break, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5870
  { CRISV32F_INSN_BOUND_R_B_R, model_crisv32_bound_r_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5871
  { CRISV32F_INSN_BOUND_R_W_R, model_crisv32_bound_r_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5872
  { CRISV32F_INSN_BOUND_R_D_R, model_crisv32_bound_r_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5873
  { CRISV32F_INSN_BOUND_CB, model_crisv32_bound_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5874
  { CRISV32F_INSN_BOUND_CW, model_crisv32_bound_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5875
  { CRISV32F_INSN_BOUND_CD, model_crisv32_bound_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5876
  { CRISV32F_INSN_SCC, model_crisv32_scc, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5877
  { CRISV32F_INSN_LZ, model_crisv32_lz, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5878
  { CRISV32F_INSN_ADDOQ, model_crisv32_addoq, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5879
  { CRISV32F_INSN_ADDO_M_B_M, model_crisv32_addo_m_b_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5880
  { CRISV32F_INSN_ADDO_M_W_M, model_crisv32_addo_m_w_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5881
  { CRISV32F_INSN_ADDO_M_D_M, model_crisv32_addo_m_d_m, { { (int) UNIT_CRISV32_U_MEM, 1, 1 }, { (int) UNIT_CRISV32_U_MEM_R, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5882
  { CRISV32F_INSN_ADDO_CB, model_crisv32_addo_cb, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5883
  { CRISV32F_INSN_ADDO_CW, model_crisv32_addo_cw, { { (int) UNIT_CRISV32_U_CONST16, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5884
  { CRISV32F_INSN_ADDO_CD, model_crisv32_addo_cd, { { (int) UNIT_CRISV32_U_CONST32, 1, 1 }, { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5885
  { CRISV32F_INSN_ADDI_ACR_B_R, model_crisv32_addi_acr_b_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5886
  { CRISV32F_INSN_ADDI_ACR_W_R, model_crisv32_addi_acr_w_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5887
  { CRISV32F_INSN_ADDI_ACR_D_R, model_crisv32_addi_acr_d_r, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5888
  { CRISV32F_INSN_FIDXI, model_crisv32_fidxi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5889
  { CRISV32F_INSN_FTAGI, model_crisv32_ftagi, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5890
  { CRISV32F_INSN_FIDXD, model_crisv32_fidxd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5891
  { CRISV32F_INSN_FTAGD, model_crisv32_ftagd, { { (int) UNIT_CRISV32_U_EXEC, 1, 1 } } },
5892
};
5893
 
5894
#endif /* WITH_PROFILE_MODEL_P */
5895
 
5896
static void
5897
crisv32_model_init (SIM_CPU *cpu)
5898
{
5899
  CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_CRISV32_DATA));
5900
}
5901
 
5902
#if WITH_PROFILE_MODEL_P
5903
#define TIMING_DATA(td) td
5904
#else
5905
#define TIMING_DATA(td) 0
5906
#endif
5907
 
5908
static const MODEL crisv32_models[] =
5909
{
5910
  { "crisv32", & crisv32_mach, MODEL_CRISV32, TIMING_DATA (& crisv32_timing[0]), crisv32_model_init },
5911
  { 0 }
5912
};
5913
 
5914
/* The properties of this cpu's implementation.  */
5915
 
5916
static const MACH_IMP_PROPERTIES crisv32f_imp_properties =
5917
{
5918
  sizeof (SIM_CPU),
5919
#if WITH_SCACHE
5920
  sizeof (SCACHE)
5921
#else
5922
 
5923
#endif
5924
};
5925
 
5926
 
5927
static void
5928
crisv32f_prepare_run (SIM_CPU *cpu)
5929
{
5930
  if (CPU_IDESC (cpu) == NULL)
5931
    crisv32f_init_idesc_table (cpu);
5932
}
5933
 
5934
static const CGEN_INSN *
5935
crisv32f_get_idata (SIM_CPU *cpu, int inum)
5936
{
5937
  return CPU_IDESC (cpu) [inum].idata;
5938
}
5939
 
5940
static void
5941
crisv32_init_cpu (SIM_CPU *cpu)
5942
{
5943
  CPU_REG_FETCH (cpu) = crisv32f_fetch_register;
5944
  CPU_REG_STORE (cpu) = crisv32f_store_register;
5945
  CPU_PC_FETCH (cpu) = crisv32f_h_pc_get;
5946
  CPU_PC_STORE (cpu) = crisv32f_h_pc_set;
5947
  CPU_GET_IDATA (cpu) = crisv32f_get_idata;
5948
  CPU_MAX_INSNS (cpu) = CRISV32F_INSN__MAX;
5949
  CPU_INSN_NAME (cpu) = cgen_insn_name;
5950
  CPU_FULL_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5951
#if WITH_FAST
5952
  CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_fast;
5953
#else
5954
  CPU_FAST_ENGINE_FN (cpu) = crisv32f_engine_run_full;
5955
#endif
5956
}
5957
 
5958
const MACH crisv32_mach =
5959
{
5960
  "crisv32", "crisv32", MACH_CRISV32,
5961
  32, 32, & crisv32_models[0], & crisv32f_imp_properties,
5962
  crisv32_init_cpu,
5963
  crisv32f_prepare_run
5964
};
5965
 

powered by: WebSVN 2.1.0

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