OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [iq2000/] [sem.c] - Blame information for rev 613

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

Line No. Rev Author Line
1 227 jeremybenn
/* Simulator instruction semantics for iq2000bf.
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 iq2000bf
26
#define WANT_CPU_IQ2000BF
27
 
28
#include "sim-main.h"
29
#include "cgen-mem.h"
30
#include "cgen-ops.h"
31
 
32
#undef GET_ATTR
33
#define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
34
 
35
/* This is used so that we can compile two copies of the semantic code,
36
   one with full feature support and one without that runs fast(er).
37
   FAST_P, when desired, is defined on the command line, -DFAST_P=1.  */
38
#if FAST_P
39
#define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
40
#undef TRACE_RESULT
41
#define TRACE_RESULT(cpu, abuf, name, type, val)
42
#else
43
#define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
44
#endif
45
 
46
/* x-invalid: --invalid-- */
47
 
48
static SEM_PC
49
SEM_FN_NAME (iq2000bf,x_invalid) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
50
{
51
#define FLD(f) abuf->fields.sfmt_empty.f
52
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
53
  int UNUSED written = 0;
54
  IADDR UNUSED pc = abuf->addr;
55
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
56
 
57
  {
58
    /* Update the recorded pc in the cpu state struct.
59
       Only necessary for WITH_SCACHE case, but to avoid the
60
       conditional compilation ....  */
61
    SET_H_PC (pc);
62
    /* Virtual insns have zero size.  Overwrite vpc with address of next insn
63
       using the default-insn-bitsize spec.  When executing insns in parallel
64
       we may want to queue the fault and continue execution.  */
65
    vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
66
    vpc = sim_engine_invalid_insn (current_cpu, pc, vpc);
67
  }
68
 
69
  return vpc;
70
#undef FLD
71
}
72
 
73
/* x-after: --after-- */
74
 
75
static SEM_PC
76
SEM_FN_NAME (iq2000bf,x_after) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
77
{
78
#define FLD(f) abuf->fields.sfmt_empty.f
79
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
80
  int UNUSED written = 0;
81
  IADDR UNUSED pc = abuf->addr;
82
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
83
 
84
  {
85
#if WITH_SCACHE_PBB_IQ2000BF
86
    iq2000bf_pbb_after (current_cpu, sem_arg);
87
#endif
88
  }
89
 
90
  return vpc;
91
#undef FLD
92
}
93
 
94
/* x-before: --before-- */
95
 
96
static SEM_PC
97
SEM_FN_NAME (iq2000bf,x_before) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
98
{
99
#define FLD(f) abuf->fields.sfmt_empty.f
100
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
101
  int UNUSED written = 0;
102
  IADDR UNUSED pc = abuf->addr;
103
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
104
 
105
  {
106
#if WITH_SCACHE_PBB_IQ2000BF
107
    iq2000bf_pbb_before (current_cpu, sem_arg);
108
#endif
109
  }
110
 
111
  return vpc;
112
#undef FLD
113
}
114
 
115
/* x-cti-chain: --cti-chain-- */
116
 
117
static SEM_PC
118
SEM_FN_NAME (iq2000bf,x_cti_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
119
{
120
#define FLD(f) abuf->fields.sfmt_empty.f
121
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
122
  int UNUSED written = 0;
123
  IADDR UNUSED pc = abuf->addr;
124
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
125
 
126
  {
127
#if WITH_SCACHE_PBB_IQ2000BF
128
#ifdef DEFINE_SWITCH
129
    vpc = iq2000bf_pbb_cti_chain (current_cpu, sem_arg,
130
                               pbb_br_type, pbb_br_npc);
131
    BREAK (sem);
132
#else
133
    /* FIXME: Allow provision of explicit ifmt spec in insn spec.  */
134
    vpc = iq2000bf_pbb_cti_chain (current_cpu, sem_arg,
135
                               CPU_PBB_BR_TYPE (current_cpu),
136
                               CPU_PBB_BR_NPC (current_cpu));
137
#endif
138
#endif
139
  }
140
 
141
  return vpc;
142
#undef FLD
143
}
144
 
145
/* x-chain: --chain-- */
146
 
147
static SEM_PC
148
SEM_FN_NAME (iq2000bf,x_chain) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
149
{
150
#define FLD(f) abuf->fields.sfmt_empty.f
151
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
152
  int UNUSED written = 0;
153
  IADDR UNUSED pc = abuf->addr;
154
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
155
 
156
  {
157
#if WITH_SCACHE_PBB_IQ2000BF
158
    vpc = iq2000bf_pbb_chain (current_cpu, sem_arg);
159
#ifdef DEFINE_SWITCH
160
    BREAK (sem);
161
#endif
162
#endif
163
  }
164
 
165
  return vpc;
166
#undef FLD
167
}
168
 
169
/* x-begin: --begin-- */
170
 
171
static SEM_PC
172
SEM_FN_NAME (iq2000bf,x_begin) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
173
{
174
#define FLD(f) abuf->fields.sfmt_empty.f
175
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
176
  int UNUSED written = 0;
177
  IADDR UNUSED pc = abuf->addr;
178
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 0);
179
 
180
  {
181
#if WITH_SCACHE_PBB_IQ2000BF
182
#if defined DEFINE_SWITCH || defined FAST_P
183
    /* In the switch case FAST_P is a constant, allowing several optimizations
184
       in any called inline functions.  */
185
    vpc = iq2000bf_pbb_begin (current_cpu, FAST_P);
186
#else
187
#if 0 /* cgen engine can't handle dynamic fast/full switching yet.  */
188
    vpc = iq2000bf_pbb_begin (current_cpu, STATE_RUN_FAST_P (CPU_STATE (current_cpu)));
189
#else
190
    vpc = iq2000bf_pbb_begin (current_cpu, 0);
191
#endif
192
#endif
193
#endif
194
  }
195
 
196
  return vpc;
197
#undef FLD
198
}
199
 
200
/* add: add $rd,$rs,$rt */
201
 
202
static SEM_PC
203
SEM_FN_NAME (iq2000bf,add) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
204
{
205
#define FLD(f) abuf->fields.sfmt_mrgb.f
206
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
207
  int UNUSED written = 0;
208
  IADDR UNUSED pc = abuf->addr;
209
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
210
 
211
  {
212
    SI opval = ADDSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
213
    SET_H_GR (FLD (f_rd), opval);
214
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
215
  }
216
 
217
  return vpc;
218
#undef FLD
219
}
220
 
221
/* addi: addi $rt,$rs,$lo16 */
222
 
223
static SEM_PC
224
SEM_FN_NAME (iq2000bf,addi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
225
{
226
#define FLD(f) abuf->fields.sfmt_addi.f
227
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
228
  int UNUSED written = 0;
229
  IADDR UNUSED pc = abuf->addr;
230
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
231
 
232
  {
233
    SI opval = ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))));
234
    SET_H_GR (FLD (f_rt), opval);
235
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
236
  }
237
 
238
  return vpc;
239
#undef FLD
240
}
241
 
242
/* addiu: addiu $rt,$rs,$lo16 */
243
 
244
static SEM_PC
245
SEM_FN_NAME (iq2000bf,addiu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
246
{
247
#define FLD(f) abuf->fields.sfmt_addi.f
248
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
249
  int UNUSED written = 0;
250
  IADDR UNUSED pc = abuf->addr;
251
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
252
 
253
  {
254
    SI opval = ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))));
255
    SET_H_GR (FLD (f_rt), opval);
256
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
257
  }
258
 
259
  return vpc;
260
#undef FLD
261
}
262
 
263
/* addu: addu $rd,$rs,$rt */
264
 
265
static SEM_PC
266
SEM_FN_NAME (iq2000bf,addu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
267
{
268
#define FLD(f) abuf->fields.sfmt_mrgb.f
269
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
270
  int UNUSED written = 0;
271
  IADDR UNUSED pc = abuf->addr;
272
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
273
 
274
  {
275
    SI opval = ADDSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
276
    SET_H_GR (FLD (f_rd), opval);
277
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
278
  }
279
 
280
  return vpc;
281
#undef FLD
282
}
283
 
284
/* ado16: ado16 $rd,$rs,$rt */
285
 
286
static SEM_PC
287
SEM_FN_NAME (iq2000bf,ado16) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
288
{
289
#define FLD(f) abuf->fields.sfmt_mrgb.f
290
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
291
  int UNUSED written = 0;
292
  IADDR UNUSED pc = abuf->addr;
293
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
294
 
295
{
296
  HI tmp_high;
297
  HI tmp_low;
298
  tmp_low = ADDHI (ANDHI (GET_H_GR (FLD (f_rs)), 65535), ANDHI (GET_H_GR (FLD (f_rt)), 65535));
299
  tmp_high = ADDHI (SRLSI (GET_H_GR (FLD (f_rs)), 16), SRLSI (GET_H_GR (FLD (f_rt)), 16));
300
  {
301
    SI opval = ORSI (SLLSI (tmp_high, 16), tmp_low);
302
    SET_H_GR (FLD (f_rd), opval);
303
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
304
  }
305
}
306
 
307
  return vpc;
308
#undef FLD
309
}
310
 
311
/* and: and $rd,$rs,$rt */
312
 
313
static SEM_PC
314
SEM_FN_NAME (iq2000bf,and) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
315
{
316
#define FLD(f) abuf->fields.sfmt_mrgb.f
317
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
318
  int UNUSED written = 0;
319
  IADDR UNUSED pc = abuf->addr;
320
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
321
 
322
  {
323
    SI opval = ANDSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
324
    SET_H_GR (FLD (f_rd), opval);
325
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
326
  }
327
 
328
  return vpc;
329
#undef FLD
330
}
331
 
332
/* andi: andi $rt,$rs,$lo16 */
333
 
334
static SEM_PC
335
SEM_FN_NAME (iq2000bf,andi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
336
{
337
#define FLD(f) abuf->fields.sfmt_addi.f
338
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
339
  int UNUSED written = 0;
340
  IADDR UNUSED pc = abuf->addr;
341
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
342
 
343
  {
344
    SI opval = ANDSI (GET_H_GR (FLD (f_rs)), ZEXTSISI (FLD (f_imm)));
345
    SET_H_GR (FLD (f_rt), opval);
346
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
347
  }
348
 
349
  return vpc;
350
#undef FLD
351
}
352
 
353
/* andoi: andoi $rt,$rs,$lo16 */
354
 
355
static SEM_PC
356
SEM_FN_NAME (iq2000bf,andoi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
357
{
358
#define FLD(f) abuf->fields.sfmt_addi.f
359
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
360
  int UNUSED written = 0;
361
  IADDR UNUSED pc = abuf->addr;
362
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
363
 
364
  {
365
    SI opval = ANDSI (GET_H_GR (FLD (f_rs)), ORSI (0xffff0000, EXTHISI (TRUNCSIHI (FLD (f_imm)))));
366
    SET_H_GR (FLD (f_rt), opval);
367
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
368
  }
369
 
370
  return vpc;
371
#undef FLD
372
}
373
 
374
/* nor: nor $rd,$rs,$rt */
375
 
376
static SEM_PC
377
SEM_FN_NAME (iq2000bf,nor) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
378
{
379
#define FLD(f) abuf->fields.sfmt_mrgb.f
380
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
381
  int UNUSED written = 0;
382
  IADDR UNUSED pc = abuf->addr;
383
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
384
 
385
  {
386
    SI opval = INVSI (ORSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt))));
387
    SET_H_GR (FLD (f_rd), opval);
388
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
389
  }
390
 
391
  return vpc;
392
#undef FLD
393
}
394
 
395
/* or: or $rd,$rs,$rt */
396
 
397
static SEM_PC
398
SEM_FN_NAME (iq2000bf,or) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
399
{
400
#define FLD(f) abuf->fields.sfmt_mrgb.f
401
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
402
  int UNUSED written = 0;
403
  IADDR UNUSED pc = abuf->addr;
404
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
405
 
406
  {
407
    SI opval = ORSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
408
    SET_H_GR (FLD (f_rd), opval);
409
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
410
  }
411
 
412
  return vpc;
413
#undef FLD
414
}
415
 
416
/* ori: ori $rt,$rs,$lo16 */
417
 
418
static SEM_PC
419
SEM_FN_NAME (iq2000bf,ori) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
420
{
421
#define FLD(f) abuf->fields.sfmt_addi.f
422
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
423
  int UNUSED written = 0;
424
  IADDR UNUSED pc = abuf->addr;
425
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
426
 
427
  {
428
    SI opval = ORSI (GET_H_GR (FLD (f_rs)), ZEXTSISI (FLD (f_imm)));
429
    SET_H_GR (FLD (f_rt), opval);
430
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
431
  }
432
 
433
  return vpc;
434
#undef FLD
435
}
436
 
437
/* ram: ram $rd,$rt,$shamt,$maskl,$maskr */
438
 
439
static SEM_PC
440
SEM_FN_NAME (iq2000bf,ram) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
441
{
442
#define FLD(f) abuf->fields.sfmt_ram.f
443
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
444
  int UNUSED written = 0;
445
  IADDR UNUSED pc = abuf->addr;
446
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
447
 
448
{
449
  {
450
    SI opval = RORSI (GET_H_GR (FLD (f_rt)), FLD (f_shamt));
451
    SET_H_GR (FLD (f_rd), opval);
452
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
453
  }
454
  {
455
    SI opval = ANDSI (GET_H_GR (FLD (f_rd)), SRLSI (0xffffffff, FLD (f_maskl)));
456
    SET_H_GR (FLD (f_rd), opval);
457
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
458
  }
459
  {
460
    SI opval = ANDSI (GET_H_GR (FLD (f_rd)), SLLSI (0xffffffff, FLD (f_rs)));
461
    SET_H_GR (FLD (f_rd), opval);
462
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
463
  }
464
}
465
 
466
  return vpc;
467
#undef FLD
468
}
469
 
470
/* sll: sll $rd,$rt,$shamt */
471
 
472
static SEM_PC
473
SEM_FN_NAME (iq2000bf,sll) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
474
{
475
#define FLD(f) abuf->fields.sfmt_ram.f
476
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
477
  int UNUSED written = 0;
478
  IADDR UNUSED pc = abuf->addr;
479
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
480
 
481
  {
482
    SI opval = SLLSI (GET_H_GR (FLD (f_rt)), FLD (f_shamt));
483
    SET_H_GR (FLD (f_rd), opval);
484
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
485
  }
486
 
487
  return vpc;
488
#undef FLD
489
}
490
 
491
/* sllv: sllv $rd,$rt,$rs */
492
 
493
static SEM_PC
494
SEM_FN_NAME (iq2000bf,sllv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
495
{
496
#define FLD(f) abuf->fields.sfmt_mrgb.f
497
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
498
  int UNUSED written = 0;
499
  IADDR UNUSED pc = abuf->addr;
500
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
501
 
502
  {
503
    SI opval = SLLSI (GET_H_GR (FLD (f_rt)), ANDSI (GET_H_GR (FLD (f_rs)), 31));
504
    SET_H_GR (FLD (f_rd), opval);
505
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
506
  }
507
 
508
  return vpc;
509
#undef FLD
510
}
511
 
512
/* slmv: slmv $rd,$rt,$rs,$shamt */
513
 
514
static SEM_PC
515
SEM_FN_NAME (iq2000bf,slmv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
516
{
517
#define FLD(f) abuf->fields.sfmt_ram.f
518
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
519
  int UNUSED written = 0;
520
  IADDR UNUSED pc = abuf->addr;
521
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
522
 
523
  {
524
    SI opval = ANDSI (SLLSI (GET_H_GR (FLD (f_rt)), FLD (f_shamt)), SRLSI (0xffffffff, GET_H_GR (FLD (f_rs))));
525
    SET_H_GR (FLD (f_rd), opval);
526
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
527
  }
528
 
529
  return vpc;
530
#undef FLD
531
}
532
 
533
/* slt: slt $rd,$rs,$rt */
534
 
535
static SEM_PC
536
SEM_FN_NAME (iq2000bf,slt) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
537
{
538
#define FLD(f) abuf->fields.sfmt_mrgb.f
539
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
540
  int UNUSED written = 0;
541
  IADDR UNUSED pc = abuf->addr;
542
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
543
 
544
if (LTSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
545
  {
546
    SI opval = 1;
547
    SET_H_GR (FLD (f_rd), opval);
548
    written |= (1 << 2);
549
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
550
  }
551
} else {
552
  {
553
    SI opval = 0;
554
    SET_H_GR (FLD (f_rd), opval);
555
    written |= (1 << 2);
556
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
557
  }
558
}
559
 
560
  abuf->written = written;
561
  return vpc;
562
#undef FLD
563
}
564
 
565
/* slti: slti $rt,$rs,$imm */
566
 
567
static SEM_PC
568
SEM_FN_NAME (iq2000bf,slti) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
569
{
570
#define FLD(f) abuf->fields.sfmt_addi.f
571
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
572
  int UNUSED written = 0;
573
  IADDR UNUSED pc = abuf->addr;
574
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
575
 
576
if (LTSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))) {
577
  {
578
    SI opval = 1;
579
    SET_H_GR (FLD (f_rt), opval);
580
    written |= (1 << 2);
581
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
582
  }
583
} else {
584
  {
585
    SI opval = 0;
586
    SET_H_GR (FLD (f_rt), opval);
587
    written |= (1 << 2);
588
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
589
  }
590
}
591
 
592
  abuf->written = written;
593
  return vpc;
594
#undef FLD
595
}
596
 
597
/* sltiu: sltiu $rt,$rs,$imm */
598
 
599
static SEM_PC
600
SEM_FN_NAME (iq2000bf,sltiu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
601
{
602
#define FLD(f) abuf->fields.sfmt_addi.f
603
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
604
  int UNUSED written = 0;
605
  IADDR UNUSED pc = abuf->addr;
606
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
607
 
608
if (LTUSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))) {
609
  {
610
    SI opval = 1;
611
    SET_H_GR (FLD (f_rt), opval);
612
    written |= (1 << 2);
613
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
614
  }
615
} else {
616
  {
617
    SI opval = 0;
618
    SET_H_GR (FLD (f_rt), opval);
619
    written |= (1 << 2);
620
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
621
  }
622
}
623
 
624
  abuf->written = written;
625
  return vpc;
626
#undef FLD
627
}
628
 
629
/* sltu: sltu $rd,$rs,$rt */
630
 
631
static SEM_PC
632
SEM_FN_NAME (iq2000bf,sltu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
633
{
634
#define FLD(f) abuf->fields.sfmt_mrgb.f
635
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
636
  int UNUSED written = 0;
637
  IADDR UNUSED pc = abuf->addr;
638
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
639
 
640
if (LTUSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
641
  {
642
    SI opval = 1;
643
    SET_H_GR (FLD (f_rd), opval);
644
    written |= (1 << 2);
645
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
646
  }
647
} else {
648
  {
649
    SI opval = 0;
650
    SET_H_GR (FLD (f_rd), opval);
651
    written |= (1 << 2);
652
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
653
  }
654
}
655
 
656
  abuf->written = written;
657
  return vpc;
658
#undef FLD
659
}
660
 
661
/* sra: sra $rd,$rt,$shamt */
662
 
663
static SEM_PC
664
SEM_FN_NAME (iq2000bf,sra) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
665
{
666
#define FLD(f) abuf->fields.sfmt_ram.f
667
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
668
  int UNUSED written = 0;
669
  IADDR UNUSED pc = abuf->addr;
670
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
671
 
672
  {
673
    SI opval = SRASI (GET_H_GR (FLD (f_rt)), FLD (f_shamt));
674
    SET_H_GR (FLD (f_rd), opval);
675
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
676
  }
677
 
678
  return vpc;
679
#undef FLD
680
}
681
 
682
/* srav: srav $rd,$rt,$rs */
683
 
684
static SEM_PC
685
SEM_FN_NAME (iq2000bf,srav) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
686
{
687
#define FLD(f) abuf->fields.sfmt_mrgb.f
688
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
689
  int UNUSED written = 0;
690
  IADDR UNUSED pc = abuf->addr;
691
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
692
 
693
  {
694
    SI opval = SRASI (GET_H_GR (FLD (f_rt)), ANDSI (GET_H_GR (FLD (f_rs)), 31));
695
    SET_H_GR (FLD (f_rd), opval);
696
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
697
  }
698
 
699
  return vpc;
700
#undef FLD
701
}
702
 
703
/* srl: srl $rd,$rt,$shamt */
704
 
705
static SEM_PC
706
SEM_FN_NAME (iq2000bf,srl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
707
{
708
#define FLD(f) abuf->fields.sfmt_ram.f
709
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
710
  int UNUSED written = 0;
711
  IADDR UNUSED pc = abuf->addr;
712
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
713
 
714
  {
715
    SI opval = SRLSI (GET_H_GR (FLD (f_rt)), FLD (f_shamt));
716
    SET_H_GR (FLD (f_rd), opval);
717
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
718
  }
719
 
720
  return vpc;
721
#undef FLD
722
}
723
 
724
/* srlv: srlv $rd,$rt,$rs */
725
 
726
static SEM_PC
727
SEM_FN_NAME (iq2000bf,srlv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
728
{
729
#define FLD(f) abuf->fields.sfmt_mrgb.f
730
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
731
  int UNUSED written = 0;
732
  IADDR UNUSED pc = abuf->addr;
733
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
734
 
735
  {
736
    SI opval = SRLSI (GET_H_GR (FLD (f_rt)), ANDSI (GET_H_GR (FLD (f_rs)), 31));
737
    SET_H_GR (FLD (f_rd), opval);
738
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
739
  }
740
 
741
  return vpc;
742
#undef FLD
743
}
744
 
745
/* srmv: srmv $rd,$rt,$rs,$shamt */
746
 
747
static SEM_PC
748
SEM_FN_NAME (iq2000bf,srmv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
749
{
750
#define FLD(f) abuf->fields.sfmt_ram.f
751
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
752
  int UNUSED written = 0;
753
  IADDR UNUSED pc = abuf->addr;
754
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
755
 
756
  {
757
    SI opval = ANDSI (SRLSI (GET_H_GR (FLD (f_rt)), FLD (f_shamt)), SLLSI (0xffffffff, GET_H_GR (FLD (f_rs))));
758
    SET_H_GR (FLD (f_rd), opval);
759
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
760
  }
761
 
762
  return vpc;
763
#undef FLD
764
}
765
 
766
/* sub: sub $rd,$rs,$rt */
767
 
768
static SEM_PC
769
SEM_FN_NAME (iq2000bf,sub) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
770
{
771
#define FLD(f) abuf->fields.sfmt_mrgb.f
772
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
773
  int UNUSED written = 0;
774
  IADDR UNUSED pc = abuf->addr;
775
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
776
 
777
  {
778
    SI opval = SUBSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
779
    SET_H_GR (FLD (f_rd), opval);
780
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
781
  }
782
 
783
  return vpc;
784
#undef FLD
785
}
786
 
787
/* subu: subu $rd,$rs,$rt */
788
 
789
static SEM_PC
790
SEM_FN_NAME (iq2000bf,subu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
791
{
792
#define FLD(f) abuf->fields.sfmt_mrgb.f
793
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
794
  int UNUSED written = 0;
795
  IADDR UNUSED pc = abuf->addr;
796
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
797
 
798
  {
799
    SI opval = SUBSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
800
    SET_H_GR (FLD (f_rd), opval);
801
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
802
  }
803
 
804
  return vpc;
805
#undef FLD
806
}
807
 
808
/* xor: xor $rd,$rs,$rt */
809
 
810
static SEM_PC
811
SEM_FN_NAME (iq2000bf,xor) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
812
{
813
#define FLD(f) abuf->fields.sfmt_mrgb.f
814
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
815
  int UNUSED written = 0;
816
  IADDR UNUSED pc = abuf->addr;
817
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
818
 
819
  {
820
    SI opval = XORSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)));
821
    SET_H_GR (FLD (f_rd), opval);
822
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
823
  }
824
 
825
  return vpc;
826
#undef FLD
827
}
828
 
829
/* xori: xori $rt,$rs,$lo16 */
830
 
831
static SEM_PC
832
SEM_FN_NAME (iq2000bf,xori) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
833
{
834
#define FLD(f) abuf->fields.sfmt_addi.f
835
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
836
  int UNUSED written = 0;
837
  IADDR UNUSED pc = abuf->addr;
838
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
839
 
840
  {
841
    SI opval = XORSI (GET_H_GR (FLD (f_rs)), ZEXTSISI (FLD (f_imm)));
842
    SET_H_GR (FLD (f_rt), opval);
843
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
844
  }
845
 
846
  return vpc;
847
#undef FLD
848
}
849
 
850
/* bbi: bbi $rs($bitnum),$offset */
851
 
852
static SEM_PC
853
SEM_FN_NAME (iq2000bf,bbi) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
854
{
855
#define FLD(f) abuf->fields.sfmt_bbi.f
856
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
857
  int UNUSED written = 0;
858
  IADDR UNUSED pc = abuf->addr;
859
  SEM_BRANCH_INIT
860
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
861
 
862
if (ANDSI (GET_H_GR (FLD (f_rs)), SLLSI (1, FLD (f_rt)))) {
863
{
864
  {
865
    USI opval = FLD (i_offset);
866
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
867
    written |= (1 << 3);
868
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
869
  }
870
}
871
}
872
 
873
  abuf->written = written;
874
  SEM_BRANCH_FINI (vpc);
875
  return vpc;
876
#undef FLD
877
}
878
 
879
/* bbin: bbin $rs($bitnum),$offset */
880
 
881
static SEM_PC
882
SEM_FN_NAME (iq2000bf,bbin) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
883
{
884
#define FLD(f) abuf->fields.sfmt_bbi.f
885
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
886
  int UNUSED written = 0;
887
  IADDR UNUSED pc = abuf->addr;
888
  SEM_BRANCH_INIT
889
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
890
 
891
if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs)), SLLSI (1, FLD (f_rt))))) {
892
{
893
  {
894
    USI opval = FLD (i_offset);
895
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
896
    written |= (1 << 3);
897
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
898
  }
899
}
900
}
901
 
902
  abuf->written = written;
903
  SEM_BRANCH_FINI (vpc);
904
  return vpc;
905
#undef FLD
906
}
907
 
908
/* bbv: bbv $rs,$rt,$offset */
909
 
910
static SEM_PC
911
SEM_FN_NAME (iq2000bf,bbv) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
912
{
913
#define FLD(f) abuf->fields.sfmt_bbi.f
914
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
915
  int UNUSED written = 0;
916
  IADDR UNUSED pc = abuf->addr;
917
  SEM_BRANCH_INIT
918
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
919
 
920
if (ANDSI (GET_H_GR (FLD (f_rs)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt)), 31)))) {
921
{
922
  {
923
    USI opval = FLD (i_offset);
924
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
925
    written |= (1 << 3);
926
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
927
  }
928
}
929
}
930
 
931
  abuf->written = written;
932
  SEM_BRANCH_FINI (vpc);
933
  return vpc;
934
#undef FLD
935
}
936
 
937
/* bbvn: bbvn $rs,$rt,$offset */
938
 
939
static SEM_PC
940
SEM_FN_NAME (iq2000bf,bbvn) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
941
{
942
#define FLD(f) abuf->fields.sfmt_bbi.f
943
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
944
  int UNUSED written = 0;
945
  IADDR UNUSED pc = abuf->addr;
946
  SEM_BRANCH_INIT
947
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
948
 
949
if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt)), 31))))) {
950
{
951
  {
952
    USI opval = FLD (i_offset);
953
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
954
    written |= (1 << 3);
955
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
956
  }
957
}
958
}
959
 
960
  abuf->written = written;
961
  SEM_BRANCH_FINI (vpc);
962
  return vpc;
963
#undef FLD
964
}
965
 
966
/* beq: beq $rs,$rt,$offset */
967
 
968
static SEM_PC
969
SEM_FN_NAME (iq2000bf,beq) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
970
{
971
#define FLD(f) abuf->fields.sfmt_bbi.f
972
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
973
  int UNUSED written = 0;
974
  IADDR UNUSED pc = abuf->addr;
975
  SEM_BRANCH_INIT
976
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
977
 
978
if (EQSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
979
{
980
  {
981
    USI opval = FLD (i_offset);
982
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
983
    written |= (1 << 3);
984
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
985
  }
986
}
987
}
988
 
989
  abuf->written = written;
990
  SEM_BRANCH_FINI (vpc);
991
  return vpc;
992
#undef FLD
993
}
994
 
995
/* beql: beql $rs,$rt,$offset */
996
 
997
static SEM_PC
998
SEM_FN_NAME (iq2000bf,beql) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
999
{
1000
#define FLD(f) abuf->fields.sfmt_bbi.f
1001
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1002
  int UNUSED written = 0;
1003
  IADDR UNUSED pc = abuf->addr;
1004
  SEM_BRANCH_INIT
1005
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1006
 
1007
if (EQSI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
1008
{
1009
  {
1010
    USI opval = FLD (i_offset);
1011
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1012
    written |= (1 << 3);
1013
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1014
  }
1015
}
1016
} else {
1017
if (1)
1018
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1019
}
1020
 
1021
  abuf->written = written;
1022
  SEM_BRANCH_FINI (vpc);
1023
  return vpc;
1024
#undef FLD
1025
}
1026
 
1027
/* bgez: bgez $rs,$offset */
1028
 
1029
static SEM_PC
1030
SEM_FN_NAME (iq2000bf,bgez) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1031
{
1032
#define FLD(f) abuf->fields.sfmt_bbi.f
1033
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1034
  int UNUSED written = 0;
1035
  IADDR UNUSED pc = abuf->addr;
1036
  SEM_BRANCH_INIT
1037
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1038
 
1039
if (GESI (GET_H_GR (FLD (f_rs)), 0)) {
1040
{
1041
  {
1042
    USI opval = FLD (i_offset);
1043
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1044
    written |= (1 << 2);
1045
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1046
  }
1047
}
1048
}
1049
 
1050
  abuf->written = written;
1051
  SEM_BRANCH_FINI (vpc);
1052
  return vpc;
1053
#undef FLD
1054
}
1055
 
1056
/* bgezal: bgezal $rs,$offset */
1057
 
1058
static SEM_PC
1059
SEM_FN_NAME (iq2000bf,bgezal) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1060
{
1061
#define FLD(f) abuf->fields.sfmt_bbi.f
1062
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1063
  int UNUSED written = 0;
1064
  IADDR UNUSED pc = abuf->addr;
1065
  SEM_BRANCH_INIT
1066
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1067
 
1068
if (GESI (GET_H_GR (FLD (f_rs)), 0)) {
1069
{
1070
  {
1071
    SI opval = ADDSI (pc, 8);
1072
    SET_H_GR (((UINT) 31), opval);
1073
    written |= (1 << 3);
1074
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1075
  }
1076
{
1077
  {
1078
    USI opval = FLD (i_offset);
1079
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1080
    written |= (1 << 4);
1081
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1082
  }
1083
}
1084
}
1085
}
1086
 
1087
  abuf->written = written;
1088
  SEM_BRANCH_FINI (vpc);
1089
  return vpc;
1090
#undef FLD
1091
}
1092
 
1093
/* bgezall: bgezall $rs,$offset */
1094
 
1095
static SEM_PC
1096
SEM_FN_NAME (iq2000bf,bgezall) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1097
{
1098
#define FLD(f) abuf->fields.sfmt_bbi.f
1099
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1100
  int UNUSED written = 0;
1101
  IADDR UNUSED pc = abuf->addr;
1102
  SEM_BRANCH_INIT
1103
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1104
 
1105
if (GESI (GET_H_GR (FLD (f_rs)), 0)) {
1106
{
1107
  {
1108
    SI opval = ADDSI (pc, 8);
1109
    SET_H_GR (((UINT) 31), opval);
1110
    written |= (1 << 3);
1111
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1112
  }
1113
{
1114
  {
1115
    USI opval = FLD (i_offset);
1116
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1117
    written |= (1 << 4);
1118
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1119
  }
1120
}
1121
}
1122
} else {
1123
if (1)
1124
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1125
}
1126
 
1127
  abuf->written = written;
1128
  SEM_BRANCH_FINI (vpc);
1129
  return vpc;
1130
#undef FLD
1131
}
1132
 
1133
/* bgezl: bgezl $rs,$offset */
1134
 
1135
static SEM_PC
1136
SEM_FN_NAME (iq2000bf,bgezl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1137
{
1138
#define FLD(f) abuf->fields.sfmt_bbi.f
1139
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1140
  int UNUSED written = 0;
1141
  IADDR UNUSED pc = abuf->addr;
1142
  SEM_BRANCH_INIT
1143
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1144
 
1145
if (GESI (GET_H_GR (FLD (f_rs)), 0)) {
1146
{
1147
  {
1148
    USI opval = FLD (i_offset);
1149
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1150
    written |= (1 << 2);
1151
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1152
  }
1153
}
1154
} else {
1155
if (1)
1156
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1157
}
1158
 
1159
  abuf->written = written;
1160
  SEM_BRANCH_FINI (vpc);
1161
  return vpc;
1162
#undef FLD
1163
}
1164
 
1165
/* bltz: bltz $rs,$offset */
1166
 
1167
static SEM_PC
1168
SEM_FN_NAME (iq2000bf,bltz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1169
{
1170
#define FLD(f) abuf->fields.sfmt_bbi.f
1171
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1172
  int UNUSED written = 0;
1173
  IADDR UNUSED pc = abuf->addr;
1174
  SEM_BRANCH_INIT
1175
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1176
 
1177
if (LTSI (GET_H_GR (FLD (f_rs)), 0)) {
1178
{
1179
  {
1180
    USI opval = FLD (i_offset);
1181
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1182
    written |= (1 << 2);
1183
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1184
  }
1185
}
1186
}
1187
 
1188
  abuf->written = written;
1189
  SEM_BRANCH_FINI (vpc);
1190
  return vpc;
1191
#undef FLD
1192
}
1193
 
1194
/* bltzl: bltzl $rs,$offset */
1195
 
1196
static SEM_PC
1197
SEM_FN_NAME (iq2000bf,bltzl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1198
{
1199
#define FLD(f) abuf->fields.sfmt_bbi.f
1200
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1201
  int UNUSED written = 0;
1202
  IADDR UNUSED pc = abuf->addr;
1203
  SEM_BRANCH_INIT
1204
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1205
 
1206
if (LTSI (GET_H_GR (FLD (f_rs)), 0)) {
1207
{
1208
  {
1209
    USI opval = FLD (i_offset);
1210
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1211
    written |= (1 << 2);
1212
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1213
  }
1214
}
1215
} else {
1216
if (1)
1217
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1218
}
1219
 
1220
  abuf->written = written;
1221
  SEM_BRANCH_FINI (vpc);
1222
  return vpc;
1223
#undef FLD
1224
}
1225
 
1226
/* bltzal: bltzal $rs,$offset */
1227
 
1228
static SEM_PC
1229
SEM_FN_NAME (iq2000bf,bltzal) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1230
{
1231
#define FLD(f) abuf->fields.sfmt_bbi.f
1232
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1233
  int UNUSED written = 0;
1234
  IADDR UNUSED pc = abuf->addr;
1235
  SEM_BRANCH_INIT
1236
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1237
 
1238
if (LTSI (GET_H_GR (FLD (f_rs)), 0)) {
1239
{
1240
  {
1241
    SI opval = ADDSI (pc, 8);
1242
    SET_H_GR (((UINT) 31), opval);
1243
    written |= (1 << 3);
1244
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1245
  }
1246
{
1247
  {
1248
    USI opval = FLD (i_offset);
1249
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1250
    written |= (1 << 4);
1251
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1252
  }
1253
}
1254
}
1255
}
1256
 
1257
  abuf->written = written;
1258
  SEM_BRANCH_FINI (vpc);
1259
  return vpc;
1260
#undef FLD
1261
}
1262
 
1263
/* bltzall: bltzall $rs,$offset */
1264
 
1265
static SEM_PC
1266
SEM_FN_NAME (iq2000bf,bltzall) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1267
{
1268
#define FLD(f) abuf->fields.sfmt_bbi.f
1269
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1270
  int UNUSED written = 0;
1271
  IADDR UNUSED pc = abuf->addr;
1272
  SEM_BRANCH_INIT
1273
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1274
 
1275
if (LTSI (GET_H_GR (FLD (f_rs)), 0)) {
1276
{
1277
  {
1278
    SI opval = ADDSI (pc, 8);
1279
    SET_H_GR (((UINT) 31), opval);
1280
    written |= (1 << 3);
1281
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1282
  }
1283
{
1284
  {
1285
    USI opval = FLD (i_offset);
1286
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1287
    written |= (1 << 4);
1288
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1289
  }
1290
}
1291
}
1292
} else {
1293
if (1)
1294
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1295
}
1296
 
1297
  abuf->written = written;
1298
  SEM_BRANCH_FINI (vpc);
1299
  return vpc;
1300
#undef FLD
1301
}
1302
 
1303
/* bmb0: bmb0 $rs,$rt,$offset */
1304
 
1305
static SEM_PC
1306
SEM_FN_NAME (iq2000bf,bmb0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1307
{
1308
#define FLD(f) abuf->fields.sfmt_bbi.f
1309
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1310
  int UNUSED written = 0;
1311
  IADDR UNUSED pc = abuf->addr;
1312
  SEM_BRANCH_INIT
1313
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1314
 
1315
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 255), ANDSI (GET_H_GR (FLD (f_rt)), 255))) {
1316
{
1317
  {
1318
    USI opval = FLD (i_offset);
1319
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1320
    written |= (1 << 3);
1321
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1322
  }
1323
}
1324
}
1325
 
1326
  abuf->written = written;
1327
  SEM_BRANCH_FINI (vpc);
1328
  return vpc;
1329
#undef FLD
1330
}
1331
 
1332
/* bmb1: bmb1 $rs,$rt,$offset */
1333
 
1334
static SEM_PC
1335
SEM_FN_NAME (iq2000bf,bmb1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1336
{
1337
#define FLD(f) abuf->fields.sfmt_bbi.f
1338
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1339
  int UNUSED written = 0;
1340
  IADDR UNUSED pc = abuf->addr;
1341
  SEM_BRANCH_INIT
1342
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1343
 
1344
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 65280), ANDSI (GET_H_GR (FLD (f_rt)), 65280))) {
1345
{
1346
  {
1347
    USI opval = FLD (i_offset);
1348
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1349
    written |= (1 << 3);
1350
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1351
  }
1352
}
1353
}
1354
 
1355
  abuf->written = written;
1356
  SEM_BRANCH_FINI (vpc);
1357
  return vpc;
1358
#undef FLD
1359
}
1360
 
1361
/* bmb2: bmb2 $rs,$rt,$offset */
1362
 
1363
static SEM_PC
1364
SEM_FN_NAME (iq2000bf,bmb2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1365
{
1366
#define FLD(f) abuf->fields.sfmt_bbi.f
1367
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1368
  int UNUSED written = 0;
1369
  IADDR UNUSED pc = abuf->addr;
1370
  SEM_BRANCH_INIT
1371
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1372
 
1373
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 16711680), ANDSI (GET_H_GR (FLD (f_rt)), 16711680))) {
1374
{
1375
  {
1376
    USI opval = FLD (i_offset);
1377
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1378
    written |= (1 << 3);
1379
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1380
  }
1381
}
1382
}
1383
 
1384
  abuf->written = written;
1385
  SEM_BRANCH_FINI (vpc);
1386
  return vpc;
1387
#undef FLD
1388
}
1389
 
1390
/* bmb3: bmb3 $rs,$rt,$offset */
1391
 
1392
static SEM_PC
1393
SEM_FN_NAME (iq2000bf,bmb3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1394
{
1395
#define FLD(f) abuf->fields.sfmt_bbi.f
1396
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1397
  int UNUSED written = 0;
1398
  IADDR UNUSED pc = abuf->addr;
1399
  SEM_BRANCH_INIT
1400
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1401
 
1402
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt)), 0xff000000))) {
1403
{
1404
  {
1405
    USI opval = FLD (i_offset);
1406
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1407
    written |= (1 << 3);
1408
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1409
  }
1410
}
1411
}
1412
 
1413
  abuf->written = written;
1414
  SEM_BRANCH_FINI (vpc);
1415
  return vpc;
1416
#undef FLD
1417
}
1418
 
1419
/* bne: bne $rs,$rt,$offset */
1420
 
1421
static SEM_PC
1422
SEM_FN_NAME (iq2000bf,bne) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1423
{
1424
#define FLD(f) abuf->fields.sfmt_bbi.f
1425
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1426
  int UNUSED written = 0;
1427
  IADDR UNUSED pc = abuf->addr;
1428
  SEM_BRANCH_INIT
1429
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1430
 
1431
if (NESI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
1432
{
1433
  {
1434
    USI opval = FLD (i_offset);
1435
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1436
    written |= (1 << 3);
1437
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1438
  }
1439
}
1440
}
1441
 
1442
  abuf->written = written;
1443
  SEM_BRANCH_FINI (vpc);
1444
  return vpc;
1445
#undef FLD
1446
}
1447
 
1448
/* bnel: bnel $rs,$rt,$offset */
1449
 
1450
static SEM_PC
1451
SEM_FN_NAME (iq2000bf,bnel) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1452
{
1453
#define FLD(f) abuf->fields.sfmt_bbi.f
1454
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1455
  int UNUSED written = 0;
1456
  IADDR UNUSED pc = abuf->addr;
1457
  SEM_BRANCH_INIT
1458
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1459
 
1460
if (NESI (GET_H_GR (FLD (f_rs)), GET_H_GR (FLD (f_rt)))) {
1461
{
1462
  {
1463
    USI opval = FLD (i_offset);
1464
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1465
    written |= (1 << 3);
1466
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1467
  }
1468
}
1469
} else {
1470
if (1)
1471
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1472
}
1473
 
1474
  abuf->written = written;
1475
  SEM_BRANCH_FINI (vpc);
1476
  return vpc;
1477
#undef FLD
1478
}
1479
 
1480
/* jalr: jalr $rd,$rs */
1481
 
1482
static SEM_PC
1483
SEM_FN_NAME (iq2000bf,jalr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1484
{
1485
#define FLD(f) abuf->fields.sfmt_mrgb.f
1486
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1487
  int UNUSED written = 0;
1488
  IADDR UNUSED pc = abuf->addr;
1489
  SEM_BRANCH_INIT
1490
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1491
 
1492
{
1493
{
1494
  {
1495
    SI opval = ADDSI (pc, 8);
1496
    SET_H_GR (FLD (f_rd), opval);
1497
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1498
  }
1499
  {
1500
    USI opval = GET_H_GR (FLD (f_rs));
1501
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1502
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1503
  }
1504
}
1505
}
1506
 
1507
  SEM_BRANCH_FINI (vpc);
1508
  return vpc;
1509
#undef FLD
1510
}
1511
 
1512
/* jr: jr $rs */
1513
 
1514
static SEM_PC
1515
SEM_FN_NAME (iq2000bf,jr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1516
{
1517
#define FLD(f) abuf->fields.sfmt_bbi.f
1518
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1519
  int UNUSED written = 0;
1520
  IADDR UNUSED pc = abuf->addr;
1521
  SEM_BRANCH_INIT
1522
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1523
 
1524
{
1525
  {
1526
    USI opval = GET_H_GR (FLD (f_rs));
1527
    SEM_BRANCH_VIA_ADDR (current_cpu, sem_arg, opval, vpc);
1528
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1529
  }
1530
}
1531
 
1532
  SEM_BRANCH_FINI (vpc);
1533
  return vpc;
1534
#undef FLD
1535
}
1536
 
1537
/* lb: lb $rt,$lo16($base) */
1538
 
1539
static SEM_PC
1540
SEM_FN_NAME (iq2000bf,lb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1541
{
1542
#define FLD(f) abuf->fields.sfmt_addi.f
1543
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1544
  int UNUSED written = 0;
1545
  IADDR UNUSED pc = abuf->addr;
1546
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1547
 
1548
  {
1549
    SI opval = EXTQISI (GETMEMQI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))));
1550
    SET_H_GR (FLD (f_rt), opval);
1551
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1552
  }
1553
 
1554
  return vpc;
1555
#undef FLD
1556
}
1557
 
1558
/* lbu: lbu $rt,$lo16($base) */
1559
 
1560
static SEM_PC
1561
SEM_FN_NAME (iq2000bf,lbu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1562
{
1563
#define FLD(f) abuf->fields.sfmt_addi.f
1564
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1565
  int UNUSED written = 0;
1566
  IADDR UNUSED pc = abuf->addr;
1567
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1568
 
1569
  {
1570
    SI opval = ZEXTQISI (GETMEMQI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))));
1571
    SET_H_GR (FLD (f_rt), opval);
1572
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1573
  }
1574
 
1575
  return vpc;
1576
#undef FLD
1577
}
1578
 
1579
/* lh: lh $rt,$lo16($base) */
1580
 
1581
static SEM_PC
1582
SEM_FN_NAME (iq2000bf,lh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1583
{
1584
#define FLD(f) abuf->fields.sfmt_addi.f
1585
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1586
  int UNUSED written = 0;
1587
  IADDR UNUSED pc = abuf->addr;
1588
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1589
 
1590
  {
1591
    SI opval = EXTHISI (GETMEMHI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))));
1592
    SET_H_GR (FLD (f_rt), opval);
1593
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1594
  }
1595
 
1596
  return vpc;
1597
#undef FLD
1598
}
1599
 
1600
/* lhu: lhu $rt,$lo16($base) */
1601
 
1602
static SEM_PC
1603
SEM_FN_NAME (iq2000bf,lhu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1604
{
1605
#define FLD(f) abuf->fields.sfmt_addi.f
1606
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1607
  int UNUSED written = 0;
1608
  IADDR UNUSED pc = abuf->addr;
1609
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1610
 
1611
  {
1612
    SI opval = ZEXTHISI (GETMEMHI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm))))));
1613
    SET_H_GR (FLD (f_rt), opval);
1614
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1615
  }
1616
 
1617
  return vpc;
1618
#undef FLD
1619
}
1620
 
1621
/* lui: lui $rt,$hi16 */
1622
 
1623
static SEM_PC
1624
SEM_FN_NAME (iq2000bf,lui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1625
{
1626
#define FLD(f) abuf->fields.sfmt_addi.f
1627
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1628
  int UNUSED written = 0;
1629
  IADDR UNUSED pc = abuf->addr;
1630
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1631
 
1632
  {
1633
    SI opval = SLLSI (FLD (f_imm), 16);
1634
    SET_H_GR (FLD (f_rt), opval);
1635
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1636
  }
1637
 
1638
  return vpc;
1639
#undef FLD
1640
}
1641
 
1642
/* lw: lw $rt,$lo16($base) */
1643
 
1644
static SEM_PC
1645
SEM_FN_NAME (iq2000bf,lw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1646
{
1647
#define FLD(f) abuf->fields.sfmt_addi.f
1648
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1649
  int UNUSED written = 0;
1650
  IADDR UNUSED pc = abuf->addr;
1651
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1652
 
1653
  {
1654
    SI opval = GETMEMSI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm)))));
1655
    SET_H_GR (FLD (f_rt), opval);
1656
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1657
  }
1658
 
1659
  return vpc;
1660
#undef FLD
1661
}
1662
 
1663
/* sb: sb $rt,$lo16($base) */
1664
 
1665
static SEM_PC
1666
SEM_FN_NAME (iq2000bf,sb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1667
{
1668
#define FLD(f) abuf->fields.sfmt_addi.f
1669
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1670
  int UNUSED written = 0;
1671
  IADDR UNUSED pc = abuf->addr;
1672
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1673
 
1674
  {
1675
    QI opval = ANDQI (GET_H_GR (FLD (f_rt)), 255);
1676
    SETMEMQI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm)))), opval);
1677
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1678
  }
1679
 
1680
  return vpc;
1681
#undef FLD
1682
}
1683
 
1684
/* sh: sh $rt,$lo16($base) */
1685
 
1686
static SEM_PC
1687
SEM_FN_NAME (iq2000bf,sh) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1688
{
1689
#define FLD(f) abuf->fields.sfmt_addi.f
1690
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1691
  int UNUSED written = 0;
1692
  IADDR UNUSED pc = abuf->addr;
1693
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1694
 
1695
  {
1696
    HI opval = ANDHI (GET_H_GR (FLD (f_rt)), 65535);
1697
    SETMEMHI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm)))), opval);
1698
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1699
  }
1700
 
1701
  return vpc;
1702
#undef FLD
1703
}
1704
 
1705
/* sw: sw $rt,$lo16($base) */
1706
 
1707
static SEM_PC
1708
SEM_FN_NAME (iq2000bf,sw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1709
{
1710
#define FLD(f) abuf->fields.sfmt_addi.f
1711
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1712
  int UNUSED written = 0;
1713
  IADDR UNUSED pc = abuf->addr;
1714
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1715
 
1716
  {
1717
    SI opval = GET_H_GR (FLD (f_rt));
1718
    SETMEMSI (current_cpu, pc, ADDSI (GET_H_GR (FLD (f_rs)), EXTHISI (TRUNCSIHI (FLD (f_imm)))), opval);
1719
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
1720
  }
1721
 
1722
  return vpc;
1723
#undef FLD
1724
}
1725
 
1726
/* break: break */
1727
 
1728
static SEM_PC
1729
SEM_FN_NAME (iq2000bf,break) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1730
{
1731
#define FLD(f) abuf->fields.sfmt_empty.f
1732
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1733
  int UNUSED written = 0;
1734
  IADDR UNUSED pc = abuf->addr;
1735
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1736
 
1737
do_break (current_cpu, pc);
1738
 
1739
  return vpc;
1740
#undef FLD
1741
}
1742
 
1743
/* syscall: syscall */
1744
 
1745
static SEM_PC
1746
SEM_FN_NAME (iq2000bf,syscall) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1747
{
1748
#define FLD(f) abuf->fields.sfmt_empty.f
1749
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1750
  int UNUSED written = 0;
1751
  IADDR UNUSED pc = abuf->addr;
1752
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1753
 
1754
do_syscall (current_cpu);
1755
 
1756
  return vpc;
1757
#undef FLD
1758
}
1759
 
1760
/* andoui: andoui $rt,$rs,$hi16 */
1761
 
1762
static SEM_PC
1763
SEM_FN_NAME (iq2000bf,andoui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1764
{
1765
#define FLD(f) abuf->fields.sfmt_addi.f
1766
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1767
  int UNUSED written = 0;
1768
  IADDR UNUSED pc = abuf->addr;
1769
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1770
 
1771
  {
1772
    SI opval = ANDSI (GET_H_GR (FLD (f_rs)), ORSI (SLLSI (FLD (f_imm), 16), 65535));
1773
    SET_H_GR (FLD (f_rt), opval);
1774
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1775
  }
1776
 
1777
  return vpc;
1778
#undef FLD
1779
}
1780
 
1781
/* orui: orui $rt,$rs,$hi16 */
1782
 
1783
static SEM_PC
1784
SEM_FN_NAME (iq2000bf,orui) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1785
{
1786
#define FLD(f) abuf->fields.sfmt_addi.f
1787
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1788
  int UNUSED written = 0;
1789
  IADDR UNUSED pc = abuf->addr;
1790
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1791
 
1792
  {
1793
    SI opval = ORSI (GET_H_GR (FLD (f_rs)), SLLSI (FLD (f_imm), 16));
1794
    SET_H_GR (FLD (f_rt), opval);
1795
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1796
  }
1797
 
1798
  return vpc;
1799
#undef FLD
1800
}
1801
 
1802
/* bgtz: bgtz $rs,$offset */
1803
 
1804
static SEM_PC
1805
SEM_FN_NAME (iq2000bf,bgtz) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1806
{
1807
#define FLD(f) abuf->fields.sfmt_bbi.f
1808
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1809
  int UNUSED written = 0;
1810
  IADDR UNUSED pc = abuf->addr;
1811
  SEM_BRANCH_INIT
1812
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1813
 
1814
if (GTSI (GET_H_GR (FLD (f_rs)), 0)) {
1815
{
1816
  {
1817
    USI opval = FLD (i_offset);
1818
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1819
    written |= (1 << 2);
1820
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1821
  }
1822
}
1823
}
1824
 
1825
  abuf->written = written;
1826
  SEM_BRANCH_FINI (vpc);
1827
  return vpc;
1828
#undef FLD
1829
}
1830
 
1831
/* bgtzl: bgtzl $rs,$offset */
1832
 
1833
static SEM_PC
1834
SEM_FN_NAME (iq2000bf,bgtzl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1835
{
1836
#define FLD(f) abuf->fields.sfmt_bbi.f
1837
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1838
  int UNUSED written = 0;
1839
  IADDR UNUSED pc = abuf->addr;
1840
  SEM_BRANCH_INIT
1841
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1842
 
1843
if (GTSI (GET_H_GR (FLD (f_rs)), 0)) {
1844
{
1845
  {
1846
    USI opval = FLD (i_offset);
1847
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1848
    written |= (1 << 2);
1849
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1850
  }
1851
}
1852
} else {
1853
if (1)
1854
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1855
}
1856
 
1857
  abuf->written = written;
1858
  SEM_BRANCH_FINI (vpc);
1859
  return vpc;
1860
#undef FLD
1861
}
1862
 
1863
/* blez: blez $rs,$offset */
1864
 
1865
static SEM_PC
1866
SEM_FN_NAME (iq2000bf,blez) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1867
{
1868
#define FLD(f) abuf->fields.sfmt_bbi.f
1869
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1870
  int UNUSED written = 0;
1871
  IADDR UNUSED pc = abuf->addr;
1872
  SEM_BRANCH_INIT
1873
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1874
 
1875
if (LESI (GET_H_GR (FLD (f_rs)), 0)) {
1876
{
1877
  {
1878
    USI opval = FLD (i_offset);
1879
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1880
    written |= (1 << 2);
1881
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1882
  }
1883
}
1884
}
1885
 
1886
  abuf->written = written;
1887
  SEM_BRANCH_FINI (vpc);
1888
  return vpc;
1889
#undef FLD
1890
}
1891
 
1892
/* blezl: blezl $rs,$offset */
1893
 
1894
static SEM_PC
1895
SEM_FN_NAME (iq2000bf,blezl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1896
{
1897
#define FLD(f) abuf->fields.sfmt_bbi.f
1898
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1899
  int UNUSED written = 0;
1900
  IADDR UNUSED pc = abuf->addr;
1901
  SEM_BRANCH_INIT
1902
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1903
 
1904
if (LESI (GET_H_GR (FLD (f_rs)), 0)) {
1905
{
1906
  {
1907
    USI opval = FLD (i_offset);
1908
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
1909
    written |= (1 << 2);
1910
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
1911
  }
1912
}
1913
} else {
1914
if (1)
1915
  SEM_SKIP_INSN (current_cpu, sem_arg, vpc);
1916
}
1917
 
1918
  abuf->written = written;
1919
  SEM_BRANCH_FINI (vpc);
1920
  return vpc;
1921
#undef FLD
1922
}
1923
 
1924
/* mrgb: mrgb $rd,$rs,$rt,$mask */
1925
 
1926
static SEM_PC
1927
SEM_FN_NAME (iq2000bf,mrgb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1928
{
1929
#define FLD(f) abuf->fields.sfmt_mrgb.f
1930
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1931
  int UNUSED written = 0;
1932
  IADDR UNUSED pc = abuf->addr;
1933
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1934
 
1935
{
1936
  SI tmp_temp;
1937
if (NOTSI (ANDSI (FLD (f_mask), SLLSI (1, 0)))) {
1938
  tmp_temp = ANDSI (GET_H_GR (FLD (f_rs)), 255);
1939
} else {
1940
  tmp_temp = ANDSI (GET_H_GR (FLD (f_rt)), 255);
1941
}
1942
if (NOTSI (ANDSI (FLD (f_mask), SLLSI (1, 1)))) {
1943
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rs)), 65280));
1944
} else {
1945
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rt)), 65280));
1946
}
1947
if (NOTSI (ANDSI (FLD (f_mask), SLLSI (1, 2)))) {
1948
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rs)), 16711680));
1949
} else {
1950
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rt)), 16711680));
1951
}
1952
if (NOTSI (ANDSI (FLD (f_mask), SLLSI (1, 3)))) {
1953
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rs)), 0xff000000));
1954
} else {
1955
  tmp_temp = ORSI (tmp_temp, ANDSI (GET_H_GR (FLD (f_rt)), 0xff000000));
1956
}
1957
  {
1958
    SI opval = tmp_temp;
1959
    SET_H_GR (FLD (f_rd), opval);
1960
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
1961
  }
1962
}
1963
 
1964
  return vpc;
1965
#undef FLD
1966
}
1967
 
1968
/* bctxt: bctxt $rs,$offset */
1969
 
1970
static SEM_PC
1971
SEM_FN_NAME (iq2000bf,bctxt) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1972
{
1973
#define FLD(f) abuf->fields.sfmt_empty.f
1974
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1975
  int UNUSED written = 0;
1976
  IADDR UNUSED pc = abuf->addr;
1977
  SEM_BRANCH_INIT
1978
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1979
 
1980
((void) 0); /*nop*/
1981
 
1982
  SEM_BRANCH_FINI (vpc);
1983
  return vpc;
1984
#undef FLD
1985
}
1986
 
1987
/* bc0f: bc0f $offset */
1988
 
1989
static SEM_PC
1990
SEM_FN_NAME (iq2000bf,bc0f) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
1991
{
1992
#define FLD(f) abuf->fields.sfmt_empty.f
1993
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
1994
  int UNUSED written = 0;
1995
  IADDR UNUSED pc = abuf->addr;
1996
  SEM_BRANCH_INIT
1997
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
1998
 
1999
((void) 0); /*nop*/
2000
 
2001
  SEM_BRANCH_FINI (vpc);
2002
  return vpc;
2003
#undef FLD
2004
}
2005
 
2006
/* bc0fl: bc0fl $offset */
2007
 
2008
static SEM_PC
2009
SEM_FN_NAME (iq2000bf,bc0fl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2010
{
2011
#define FLD(f) abuf->fields.sfmt_empty.f
2012
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2013
  int UNUSED written = 0;
2014
  IADDR UNUSED pc = abuf->addr;
2015
  SEM_BRANCH_INIT
2016
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2017
 
2018
((void) 0); /*nop*/
2019
 
2020
  SEM_BRANCH_FINI (vpc);
2021
  return vpc;
2022
#undef FLD
2023
}
2024
 
2025
/* bc3f: bc3f $offset */
2026
 
2027
static SEM_PC
2028
SEM_FN_NAME (iq2000bf,bc3f) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2029
{
2030
#define FLD(f) abuf->fields.sfmt_empty.f
2031
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2032
  int UNUSED written = 0;
2033
  IADDR UNUSED pc = abuf->addr;
2034
  SEM_BRANCH_INIT
2035
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2036
 
2037
((void) 0); /*nop*/
2038
 
2039
  SEM_BRANCH_FINI (vpc);
2040
  return vpc;
2041
#undef FLD
2042
}
2043
 
2044
/* bc3fl: bc3fl $offset */
2045
 
2046
static SEM_PC
2047
SEM_FN_NAME (iq2000bf,bc3fl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2048
{
2049
#define FLD(f) abuf->fields.sfmt_empty.f
2050
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2051
  int UNUSED written = 0;
2052
  IADDR UNUSED pc = abuf->addr;
2053
  SEM_BRANCH_INIT
2054
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2055
 
2056
((void) 0); /*nop*/
2057
 
2058
  SEM_BRANCH_FINI (vpc);
2059
  return vpc;
2060
#undef FLD
2061
}
2062
 
2063
/* bc0t: bc0t $offset */
2064
 
2065
static SEM_PC
2066
SEM_FN_NAME (iq2000bf,bc0t) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2067
{
2068
#define FLD(f) abuf->fields.sfmt_empty.f
2069
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2070
  int UNUSED written = 0;
2071
  IADDR UNUSED pc = abuf->addr;
2072
  SEM_BRANCH_INIT
2073
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2074
 
2075
((void) 0); /*nop*/
2076
 
2077
  SEM_BRANCH_FINI (vpc);
2078
  return vpc;
2079
#undef FLD
2080
}
2081
 
2082
/* bc0tl: bc0tl $offset */
2083
 
2084
static SEM_PC
2085
SEM_FN_NAME (iq2000bf,bc0tl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2086
{
2087
#define FLD(f) abuf->fields.sfmt_empty.f
2088
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2089
  int UNUSED written = 0;
2090
  IADDR UNUSED pc = abuf->addr;
2091
  SEM_BRANCH_INIT
2092
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2093
 
2094
((void) 0); /*nop*/
2095
 
2096
  SEM_BRANCH_FINI (vpc);
2097
  return vpc;
2098
#undef FLD
2099
}
2100
 
2101
/* bc3t: bc3t $offset */
2102
 
2103
static SEM_PC
2104
SEM_FN_NAME (iq2000bf,bc3t) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2105
{
2106
#define FLD(f) abuf->fields.sfmt_empty.f
2107
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2108
  int UNUSED written = 0;
2109
  IADDR UNUSED pc = abuf->addr;
2110
  SEM_BRANCH_INIT
2111
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2112
 
2113
((void) 0); /*nop*/
2114
 
2115
  SEM_BRANCH_FINI (vpc);
2116
  return vpc;
2117
#undef FLD
2118
}
2119
 
2120
/* bc3tl: bc3tl $offset */
2121
 
2122
static SEM_PC
2123
SEM_FN_NAME (iq2000bf,bc3tl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2124
{
2125
#define FLD(f) abuf->fields.sfmt_empty.f
2126
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2127
  int UNUSED written = 0;
2128
  IADDR UNUSED pc = abuf->addr;
2129
  SEM_BRANCH_INIT
2130
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2131
 
2132
((void) 0); /*nop*/
2133
 
2134
  SEM_BRANCH_FINI (vpc);
2135
  return vpc;
2136
#undef FLD
2137
}
2138
 
2139
/* cfc0: cfc0 $rt,$rd */
2140
 
2141
static SEM_PC
2142
SEM_FN_NAME (iq2000bf,cfc0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2143
{
2144
#define FLD(f) abuf->fields.sfmt_empty.f
2145
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2146
  int UNUSED written = 0;
2147
  IADDR UNUSED pc = abuf->addr;
2148
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2149
 
2150
((void) 0); /*nop*/
2151
 
2152
  return vpc;
2153
#undef FLD
2154
}
2155
 
2156
/* cfc1: cfc1 $rt,$rd */
2157
 
2158
static SEM_PC
2159
SEM_FN_NAME (iq2000bf,cfc1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2160
{
2161
#define FLD(f) abuf->fields.sfmt_empty.f
2162
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2163
  int UNUSED written = 0;
2164
  IADDR UNUSED pc = abuf->addr;
2165
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2166
 
2167
((void) 0); /*nop*/
2168
 
2169
  return vpc;
2170
#undef FLD
2171
}
2172
 
2173
/* cfc2: cfc2 $rt,$rd */
2174
 
2175
static SEM_PC
2176
SEM_FN_NAME (iq2000bf,cfc2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2177
{
2178
#define FLD(f) abuf->fields.sfmt_empty.f
2179
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2180
  int UNUSED written = 0;
2181
  IADDR UNUSED pc = abuf->addr;
2182
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2183
 
2184
((void) 0); /*nop*/
2185
 
2186
  return vpc;
2187
#undef FLD
2188
}
2189
 
2190
/* cfc3: cfc3 $rt,$rd */
2191
 
2192
static SEM_PC
2193
SEM_FN_NAME (iq2000bf,cfc3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2194
{
2195
#define FLD(f) abuf->fields.sfmt_empty.f
2196
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2197
  int UNUSED written = 0;
2198
  IADDR UNUSED pc = abuf->addr;
2199
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2200
 
2201
((void) 0); /*nop*/
2202
 
2203
  return vpc;
2204
#undef FLD
2205
}
2206
 
2207
/* chkhdr: chkhdr $rd,$rt */
2208
 
2209
static SEM_PC
2210
SEM_FN_NAME (iq2000bf,chkhdr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2211
{
2212
#define FLD(f) abuf->fields.sfmt_empty.f
2213
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2214
  int UNUSED written = 0;
2215
  IADDR UNUSED pc = abuf->addr;
2216
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2217
 
2218
((void) 0); /*nop*/
2219
 
2220
  return vpc;
2221
#undef FLD
2222
}
2223
 
2224
/* ctc0: ctc0 $rt,$rd */
2225
 
2226
static SEM_PC
2227
SEM_FN_NAME (iq2000bf,ctc0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2228
{
2229
#define FLD(f) abuf->fields.sfmt_empty.f
2230
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2231
  int UNUSED written = 0;
2232
  IADDR UNUSED pc = abuf->addr;
2233
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2234
 
2235
((void) 0); /*nop*/
2236
 
2237
  return vpc;
2238
#undef FLD
2239
}
2240
 
2241
/* ctc1: ctc1 $rt,$rd */
2242
 
2243
static SEM_PC
2244
SEM_FN_NAME (iq2000bf,ctc1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2245
{
2246
#define FLD(f) abuf->fields.sfmt_empty.f
2247
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2248
  int UNUSED written = 0;
2249
  IADDR UNUSED pc = abuf->addr;
2250
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2251
 
2252
((void) 0); /*nop*/
2253
 
2254
  return vpc;
2255
#undef FLD
2256
}
2257
 
2258
/* ctc2: ctc2 $rt,$rd */
2259
 
2260
static SEM_PC
2261
SEM_FN_NAME (iq2000bf,ctc2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2262
{
2263
#define FLD(f) abuf->fields.sfmt_empty.f
2264
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2265
  int UNUSED written = 0;
2266
  IADDR UNUSED pc = abuf->addr;
2267
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2268
 
2269
((void) 0); /*nop*/
2270
 
2271
  return vpc;
2272
#undef FLD
2273
}
2274
 
2275
/* ctc3: ctc3 $rt,$rd */
2276
 
2277
static SEM_PC
2278
SEM_FN_NAME (iq2000bf,ctc3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2279
{
2280
#define FLD(f) abuf->fields.sfmt_empty.f
2281
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2282
  int UNUSED written = 0;
2283
  IADDR UNUSED pc = abuf->addr;
2284
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2285
 
2286
((void) 0); /*nop*/
2287
 
2288
  return vpc;
2289
#undef FLD
2290
}
2291
 
2292
/* jcr: jcr $rs */
2293
 
2294
static SEM_PC
2295
SEM_FN_NAME (iq2000bf,jcr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2296
{
2297
#define FLD(f) abuf->fields.sfmt_empty.f
2298
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2299
  int UNUSED written = 0;
2300
  IADDR UNUSED pc = abuf->addr;
2301
  SEM_BRANCH_INIT
2302
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2303
 
2304
((void) 0); /*nop*/
2305
 
2306
  SEM_BRANCH_FINI (vpc);
2307
  return vpc;
2308
#undef FLD
2309
}
2310
 
2311
/* luc32: luc32 $rt,$rd */
2312
 
2313
static SEM_PC
2314
SEM_FN_NAME (iq2000bf,luc32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2315
{
2316
#define FLD(f) abuf->fields.sfmt_empty.f
2317
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2318
  int UNUSED written = 0;
2319
  IADDR UNUSED pc = abuf->addr;
2320
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2321
 
2322
((void) 0); /*nop*/
2323
 
2324
  return vpc;
2325
#undef FLD
2326
}
2327
 
2328
/* luc32l: luc32l $rt,$rd */
2329
 
2330
static SEM_PC
2331
SEM_FN_NAME (iq2000bf,luc32l) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2332
{
2333
#define FLD(f) abuf->fields.sfmt_empty.f
2334
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2335
  int UNUSED written = 0;
2336
  IADDR UNUSED pc = abuf->addr;
2337
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2338
 
2339
((void) 0); /*nop*/
2340
 
2341
  return vpc;
2342
#undef FLD
2343
}
2344
 
2345
/* luc64: luc64 $rt,$rd */
2346
 
2347
static SEM_PC
2348
SEM_FN_NAME (iq2000bf,luc64) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2349
{
2350
#define FLD(f) abuf->fields.sfmt_empty.f
2351
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2352
  int UNUSED written = 0;
2353
  IADDR UNUSED pc = abuf->addr;
2354
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2355
 
2356
((void) 0); /*nop*/
2357
 
2358
  return vpc;
2359
#undef FLD
2360
}
2361
 
2362
/* luc64l: luc64l $rt,$rd */
2363
 
2364
static SEM_PC
2365
SEM_FN_NAME (iq2000bf,luc64l) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2366
{
2367
#define FLD(f) abuf->fields.sfmt_empty.f
2368
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2369
  int UNUSED written = 0;
2370
  IADDR UNUSED pc = abuf->addr;
2371
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2372
 
2373
((void) 0); /*nop*/
2374
 
2375
  return vpc;
2376
#undef FLD
2377
}
2378
 
2379
/* luk: luk $rt,$rd */
2380
 
2381
static SEM_PC
2382
SEM_FN_NAME (iq2000bf,luk) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2383
{
2384
#define FLD(f) abuf->fields.sfmt_empty.f
2385
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2386
  int UNUSED written = 0;
2387
  IADDR UNUSED pc = abuf->addr;
2388
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2389
 
2390
((void) 0); /*nop*/
2391
 
2392
  return vpc;
2393
#undef FLD
2394
}
2395
 
2396
/* lulck: lulck $rt */
2397
 
2398
static SEM_PC
2399
SEM_FN_NAME (iq2000bf,lulck) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2400
{
2401
#define FLD(f) abuf->fields.sfmt_empty.f
2402
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2403
  int UNUSED written = 0;
2404
  IADDR UNUSED pc = abuf->addr;
2405
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2406
 
2407
((void) 0); /*nop*/
2408
 
2409
  return vpc;
2410
#undef FLD
2411
}
2412
 
2413
/* lum32: lum32 $rt,$rd */
2414
 
2415
static SEM_PC
2416
SEM_FN_NAME (iq2000bf,lum32) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2417
{
2418
#define FLD(f) abuf->fields.sfmt_empty.f
2419
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2420
  int UNUSED written = 0;
2421
  IADDR UNUSED pc = abuf->addr;
2422
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2423
 
2424
((void) 0); /*nop*/
2425
 
2426
  return vpc;
2427
#undef FLD
2428
}
2429
 
2430
/* lum32l: lum32l $rt,$rd */
2431
 
2432
static SEM_PC
2433
SEM_FN_NAME (iq2000bf,lum32l) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2434
{
2435
#define FLD(f) abuf->fields.sfmt_empty.f
2436
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2437
  int UNUSED written = 0;
2438
  IADDR UNUSED pc = abuf->addr;
2439
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2440
 
2441
((void) 0); /*nop*/
2442
 
2443
  return vpc;
2444
#undef FLD
2445
}
2446
 
2447
/* lum64: lum64 $rt,$rd */
2448
 
2449
static SEM_PC
2450
SEM_FN_NAME (iq2000bf,lum64) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2451
{
2452
#define FLD(f) abuf->fields.sfmt_empty.f
2453
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2454
  int UNUSED written = 0;
2455
  IADDR UNUSED pc = abuf->addr;
2456
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2457
 
2458
((void) 0); /*nop*/
2459
 
2460
  return vpc;
2461
#undef FLD
2462
}
2463
 
2464
/* lum64l: lum64l $rt,$rd */
2465
 
2466
static SEM_PC
2467
SEM_FN_NAME (iq2000bf,lum64l) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2468
{
2469
#define FLD(f) abuf->fields.sfmt_empty.f
2470
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2471
  int UNUSED written = 0;
2472
  IADDR UNUSED pc = abuf->addr;
2473
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2474
 
2475
((void) 0); /*nop*/
2476
 
2477
  return vpc;
2478
#undef FLD
2479
}
2480
 
2481
/* lur: lur $rt,$rd */
2482
 
2483
static SEM_PC
2484
SEM_FN_NAME (iq2000bf,lur) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2485
{
2486
#define FLD(f) abuf->fields.sfmt_empty.f
2487
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2488
  int UNUSED written = 0;
2489
  IADDR UNUSED pc = abuf->addr;
2490
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2491
 
2492
((void) 0); /*nop*/
2493
 
2494
  return vpc;
2495
#undef FLD
2496
}
2497
 
2498
/* lurl: lurl $rt,$rd */
2499
 
2500
static SEM_PC
2501
SEM_FN_NAME (iq2000bf,lurl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2502
{
2503
#define FLD(f) abuf->fields.sfmt_empty.f
2504
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2505
  int UNUSED written = 0;
2506
  IADDR UNUSED pc = abuf->addr;
2507
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2508
 
2509
((void) 0); /*nop*/
2510
 
2511
  return vpc;
2512
#undef FLD
2513
}
2514
 
2515
/* luulck: luulck $rt */
2516
 
2517
static SEM_PC
2518
SEM_FN_NAME (iq2000bf,luulck) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2519
{
2520
#define FLD(f) abuf->fields.sfmt_empty.f
2521
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2522
  int UNUSED written = 0;
2523
  IADDR UNUSED pc = abuf->addr;
2524
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2525
 
2526
((void) 0); /*nop*/
2527
 
2528
  return vpc;
2529
#undef FLD
2530
}
2531
 
2532
/* mfc0: mfc0 $rt,$rd */
2533
 
2534
static SEM_PC
2535
SEM_FN_NAME (iq2000bf,mfc0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2536
{
2537
#define FLD(f) abuf->fields.sfmt_empty.f
2538
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2539
  int UNUSED written = 0;
2540
  IADDR UNUSED pc = abuf->addr;
2541
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2542
 
2543
((void) 0); /*nop*/
2544
 
2545
  return vpc;
2546
#undef FLD
2547
}
2548
 
2549
/* mfc1: mfc1 $rt,$rd */
2550
 
2551
static SEM_PC
2552
SEM_FN_NAME (iq2000bf,mfc1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2553
{
2554
#define FLD(f) abuf->fields.sfmt_empty.f
2555
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2556
  int UNUSED written = 0;
2557
  IADDR UNUSED pc = abuf->addr;
2558
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2559
 
2560
((void) 0); /*nop*/
2561
 
2562
  return vpc;
2563
#undef FLD
2564
}
2565
 
2566
/* mfc2: mfc2 $rt,$rd */
2567
 
2568
static SEM_PC
2569
SEM_FN_NAME (iq2000bf,mfc2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2570
{
2571
#define FLD(f) abuf->fields.sfmt_empty.f
2572
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2573
  int UNUSED written = 0;
2574
  IADDR UNUSED pc = abuf->addr;
2575
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2576
 
2577
((void) 0); /*nop*/
2578
 
2579
  return vpc;
2580
#undef FLD
2581
}
2582
 
2583
/* mfc3: mfc3 $rt,$rd */
2584
 
2585
static SEM_PC
2586
SEM_FN_NAME (iq2000bf,mfc3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2587
{
2588
#define FLD(f) abuf->fields.sfmt_empty.f
2589
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2590
  int UNUSED written = 0;
2591
  IADDR UNUSED pc = abuf->addr;
2592
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2593
 
2594
((void) 0); /*nop*/
2595
 
2596
  return vpc;
2597
#undef FLD
2598
}
2599
 
2600
/* mtc0: mtc0 $rt,$rd */
2601
 
2602
static SEM_PC
2603
SEM_FN_NAME (iq2000bf,mtc0) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2604
{
2605
#define FLD(f) abuf->fields.sfmt_empty.f
2606
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2607
  int UNUSED written = 0;
2608
  IADDR UNUSED pc = abuf->addr;
2609
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2610
 
2611
((void) 0); /*nop*/
2612
 
2613
  return vpc;
2614
#undef FLD
2615
}
2616
 
2617
/* mtc1: mtc1 $rt,$rd */
2618
 
2619
static SEM_PC
2620
SEM_FN_NAME (iq2000bf,mtc1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2621
{
2622
#define FLD(f) abuf->fields.sfmt_empty.f
2623
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2624
  int UNUSED written = 0;
2625
  IADDR UNUSED pc = abuf->addr;
2626
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2627
 
2628
((void) 0); /*nop*/
2629
 
2630
  return vpc;
2631
#undef FLD
2632
}
2633
 
2634
/* mtc2: mtc2 $rt,$rd */
2635
 
2636
static SEM_PC
2637
SEM_FN_NAME (iq2000bf,mtc2) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2638
{
2639
#define FLD(f) abuf->fields.sfmt_empty.f
2640
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2641
  int UNUSED written = 0;
2642
  IADDR UNUSED pc = abuf->addr;
2643
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2644
 
2645
((void) 0); /*nop*/
2646
 
2647
  return vpc;
2648
#undef FLD
2649
}
2650
 
2651
/* mtc3: mtc3 $rt,$rd */
2652
 
2653
static SEM_PC
2654
SEM_FN_NAME (iq2000bf,mtc3) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2655
{
2656
#define FLD(f) abuf->fields.sfmt_empty.f
2657
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2658
  int UNUSED written = 0;
2659
  IADDR UNUSED pc = abuf->addr;
2660
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2661
 
2662
((void) 0); /*nop*/
2663
 
2664
  return vpc;
2665
#undef FLD
2666
}
2667
 
2668
/* pkrl: pkrl $rd,$rt */
2669
 
2670
static SEM_PC
2671
SEM_FN_NAME (iq2000bf,pkrl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2672
{
2673
#define FLD(f) abuf->fields.sfmt_empty.f
2674
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2675
  int UNUSED written = 0;
2676
  IADDR UNUSED pc = abuf->addr;
2677
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2678
 
2679
((void) 0); /*nop*/
2680
 
2681
  return vpc;
2682
#undef FLD
2683
}
2684
 
2685
/* pkrlr1: pkrlr1 $rt,$_index,$count */
2686
 
2687
static SEM_PC
2688
SEM_FN_NAME (iq2000bf,pkrlr1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2689
{
2690
#define FLD(f) abuf->fields.sfmt_empty.f
2691
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2692
  int UNUSED written = 0;
2693
  IADDR UNUSED pc = abuf->addr;
2694
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2695
 
2696
((void) 0); /*nop*/
2697
 
2698
  return vpc;
2699
#undef FLD
2700
}
2701
 
2702
/* pkrlr30: pkrlr30 $rt,$_index,$count */
2703
 
2704
static SEM_PC
2705
SEM_FN_NAME (iq2000bf,pkrlr30) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2706
{
2707
#define FLD(f) abuf->fields.sfmt_empty.f
2708
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2709
  int UNUSED written = 0;
2710
  IADDR UNUSED pc = abuf->addr;
2711
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2712
 
2713
((void) 0); /*nop*/
2714
 
2715
  return vpc;
2716
#undef FLD
2717
}
2718
 
2719
/* rb: rb $rd,$rt */
2720
 
2721
static SEM_PC
2722
SEM_FN_NAME (iq2000bf,rb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2723
{
2724
#define FLD(f) abuf->fields.sfmt_empty.f
2725
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2726
  int UNUSED written = 0;
2727
  IADDR UNUSED pc = abuf->addr;
2728
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2729
 
2730
((void) 0); /*nop*/
2731
 
2732
  return vpc;
2733
#undef FLD
2734
}
2735
 
2736
/* rbr1: rbr1 $rt,$_index,$count */
2737
 
2738
static SEM_PC
2739
SEM_FN_NAME (iq2000bf,rbr1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2740
{
2741
#define FLD(f) abuf->fields.sfmt_empty.f
2742
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2743
  int UNUSED written = 0;
2744
  IADDR UNUSED pc = abuf->addr;
2745
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2746
 
2747
((void) 0); /*nop*/
2748
 
2749
  return vpc;
2750
#undef FLD
2751
}
2752
 
2753
/* rbr30: rbr30 $rt,$_index,$count */
2754
 
2755
static SEM_PC
2756
SEM_FN_NAME (iq2000bf,rbr30) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2757
{
2758
#define FLD(f) abuf->fields.sfmt_empty.f
2759
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2760
  int UNUSED written = 0;
2761
  IADDR UNUSED pc = abuf->addr;
2762
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2763
 
2764
((void) 0); /*nop*/
2765
 
2766
  return vpc;
2767
#undef FLD
2768
}
2769
 
2770
/* rfe: rfe */
2771
 
2772
static SEM_PC
2773
SEM_FN_NAME (iq2000bf,rfe) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2774
{
2775
#define FLD(f) abuf->fields.sfmt_empty.f
2776
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2777
  int UNUSED written = 0;
2778
  IADDR UNUSED pc = abuf->addr;
2779
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2780
 
2781
((void) 0); /*nop*/
2782
 
2783
  return vpc;
2784
#undef FLD
2785
}
2786
 
2787
/* rx: rx $rd,$rt */
2788
 
2789
static SEM_PC
2790
SEM_FN_NAME (iq2000bf,rx) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2791
{
2792
#define FLD(f) abuf->fields.sfmt_empty.f
2793
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2794
  int UNUSED written = 0;
2795
  IADDR UNUSED pc = abuf->addr;
2796
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2797
 
2798
((void) 0); /*nop*/
2799
 
2800
  return vpc;
2801
#undef FLD
2802
}
2803
 
2804
/* rxr1: rxr1 $rt,$_index,$count */
2805
 
2806
static SEM_PC
2807
SEM_FN_NAME (iq2000bf,rxr1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2808
{
2809
#define FLD(f) abuf->fields.sfmt_empty.f
2810
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2811
  int UNUSED written = 0;
2812
  IADDR UNUSED pc = abuf->addr;
2813
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2814
 
2815
((void) 0); /*nop*/
2816
 
2817
  return vpc;
2818
#undef FLD
2819
}
2820
 
2821
/* rxr30: rxr30 $rt,$_index,$count */
2822
 
2823
static SEM_PC
2824
SEM_FN_NAME (iq2000bf,rxr30) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2825
{
2826
#define FLD(f) abuf->fields.sfmt_empty.f
2827
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2828
  int UNUSED written = 0;
2829
  IADDR UNUSED pc = abuf->addr;
2830
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2831
 
2832
((void) 0); /*nop*/
2833
 
2834
  return vpc;
2835
#undef FLD
2836
}
2837
 
2838
/* sleep: sleep */
2839
 
2840
static SEM_PC
2841
SEM_FN_NAME (iq2000bf,sleep) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2842
{
2843
#define FLD(f) abuf->fields.sfmt_empty.f
2844
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2845
  int UNUSED written = 0;
2846
  IADDR UNUSED pc = abuf->addr;
2847
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2848
 
2849
((void) 0); /*nop*/
2850
 
2851
  return vpc;
2852
#undef FLD
2853
}
2854
 
2855
/* srrd: srrd $rt */
2856
 
2857
static SEM_PC
2858
SEM_FN_NAME (iq2000bf,srrd) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2859
{
2860
#define FLD(f) abuf->fields.sfmt_empty.f
2861
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2862
  int UNUSED written = 0;
2863
  IADDR UNUSED pc = abuf->addr;
2864
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2865
 
2866
((void) 0); /*nop*/
2867
 
2868
  return vpc;
2869
#undef FLD
2870
}
2871
 
2872
/* srrdl: srrdl $rt */
2873
 
2874
static SEM_PC
2875
SEM_FN_NAME (iq2000bf,srrdl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2876
{
2877
#define FLD(f) abuf->fields.sfmt_empty.f
2878
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2879
  int UNUSED written = 0;
2880
  IADDR UNUSED pc = abuf->addr;
2881
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2882
 
2883
((void) 0); /*nop*/
2884
 
2885
  return vpc;
2886
#undef FLD
2887
}
2888
 
2889
/* srulck: srulck $rt */
2890
 
2891
static SEM_PC
2892
SEM_FN_NAME (iq2000bf,srulck) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2893
{
2894
#define FLD(f) abuf->fields.sfmt_empty.f
2895
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2896
  int UNUSED written = 0;
2897
  IADDR UNUSED pc = abuf->addr;
2898
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2899
 
2900
((void) 0); /*nop*/
2901
 
2902
  return vpc;
2903
#undef FLD
2904
}
2905
 
2906
/* srwr: srwr $rt,$rd */
2907
 
2908
static SEM_PC
2909
SEM_FN_NAME (iq2000bf,srwr) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2910
{
2911
#define FLD(f) abuf->fields.sfmt_empty.f
2912
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2913
  int UNUSED written = 0;
2914
  IADDR UNUSED pc = abuf->addr;
2915
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2916
 
2917
((void) 0); /*nop*/
2918
 
2919
  return vpc;
2920
#undef FLD
2921
}
2922
 
2923
/* srwru: srwru $rt,$rd */
2924
 
2925
static SEM_PC
2926
SEM_FN_NAME (iq2000bf,srwru) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2927
{
2928
#define FLD(f) abuf->fields.sfmt_empty.f
2929
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2930
  int UNUSED written = 0;
2931
  IADDR UNUSED pc = abuf->addr;
2932
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2933
 
2934
((void) 0); /*nop*/
2935
 
2936
  return vpc;
2937
#undef FLD
2938
}
2939
 
2940
/* trapqfl: trapqfl */
2941
 
2942
static SEM_PC
2943
SEM_FN_NAME (iq2000bf,trapqfl) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2944
{
2945
#define FLD(f) abuf->fields.sfmt_empty.f
2946
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2947
  int UNUSED written = 0;
2948
  IADDR UNUSED pc = abuf->addr;
2949
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2950
 
2951
((void) 0); /*nop*/
2952
 
2953
  return vpc;
2954
#undef FLD
2955
}
2956
 
2957
/* trapqne: trapqne */
2958
 
2959
static SEM_PC
2960
SEM_FN_NAME (iq2000bf,trapqne) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2961
{
2962
#define FLD(f) abuf->fields.sfmt_empty.f
2963
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2964
  int UNUSED written = 0;
2965
  IADDR UNUSED pc = abuf->addr;
2966
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2967
 
2968
((void) 0); /*nop*/
2969
 
2970
  return vpc;
2971
#undef FLD
2972
}
2973
 
2974
/* traprel: traprel $rt */
2975
 
2976
static SEM_PC
2977
SEM_FN_NAME (iq2000bf,traprel) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2978
{
2979
#define FLD(f) abuf->fields.sfmt_empty.f
2980
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2981
  int UNUSED written = 0;
2982
  IADDR UNUSED pc = abuf->addr;
2983
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
2984
 
2985
((void) 0); /*nop*/
2986
 
2987
  return vpc;
2988
#undef FLD
2989
}
2990
 
2991
/* wb: wb $rd,$rt */
2992
 
2993
static SEM_PC
2994
SEM_FN_NAME (iq2000bf,wb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
2995
{
2996
#define FLD(f) abuf->fields.sfmt_empty.f
2997
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
2998
  int UNUSED written = 0;
2999
  IADDR UNUSED pc = abuf->addr;
3000
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3001
 
3002
((void) 0); /*nop*/
3003
 
3004
  return vpc;
3005
#undef FLD
3006
}
3007
 
3008
/* wbu: wbu $rd,$rt */
3009
 
3010
static SEM_PC
3011
SEM_FN_NAME (iq2000bf,wbu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3012
{
3013
#define FLD(f) abuf->fields.sfmt_empty.f
3014
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3015
  int UNUSED written = 0;
3016
  IADDR UNUSED pc = abuf->addr;
3017
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3018
 
3019
((void) 0); /*nop*/
3020
 
3021
  return vpc;
3022
#undef FLD
3023
}
3024
 
3025
/* wbr1: wbr1 $rt,$_index,$count */
3026
 
3027
static SEM_PC
3028
SEM_FN_NAME (iq2000bf,wbr1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3029
{
3030
#define FLD(f) abuf->fields.sfmt_empty.f
3031
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3032
  int UNUSED written = 0;
3033
  IADDR UNUSED pc = abuf->addr;
3034
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3035
 
3036
((void) 0); /*nop*/
3037
 
3038
  return vpc;
3039
#undef FLD
3040
}
3041
 
3042
/* wbr1u: wbr1u $rt,$_index,$count */
3043
 
3044
static SEM_PC
3045
SEM_FN_NAME (iq2000bf,wbr1u) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3046
{
3047
#define FLD(f) abuf->fields.sfmt_empty.f
3048
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3049
  int UNUSED written = 0;
3050
  IADDR UNUSED pc = abuf->addr;
3051
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3052
 
3053
((void) 0); /*nop*/
3054
 
3055
  return vpc;
3056
#undef FLD
3057
}
3058
 
3059
/* wbr30: wbr30 $rt,$_index,$count */
3060
 
3061
static SEM_PC
3062
SEM_FN_NAME (iq2000bf,wbr30) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3063
{
3064
#define FLD(f) abuf->fields.sfmt_empty.f
3065
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3066
  int UNUSED written = 0;
3067
  IADDR UNUSED pc = abuf->addr;
3068
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3069
 
3070
((void) 0); /*nop*/
3071
 
3072
  return vpc;
3073
#undef FLD
3074
}
3075
 
3076
/* wbr30u: wbr30u $rt,$_index,$count */
3077
 
3078
static SEM_PC
3079
SEM_FN_NAME (iq2000bf,wbr30u) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3080
{
3081
#define FLD(f) abuf->fields.sfmt_empty.f
3082
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3083
  int UNUSED written = 0;
3084
  IADDR UNUSED pc = abuf->addr;
3085
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3086
 
3087
((void) 0); /*nop*/
3088
 
3089
  return vpc;
3090
#undef FLD
3091
}
3092
 
3093
/* wx: wx $rd,$rt */
3094
 
3095
static SEM_PC
3096
SEM_FN_NAME (iq2000bf,wx) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3097
{
3098
#define FLD(f) abuf->fields.sfmt_empty.f
3099
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3100
  int UNUSED written = 0;
3101
  IADDR UNUSED pc = abuf->addr;
3102
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3103
 
3104
((void) 0); /*nop*/
3105
 
3106
  return vpc;
3107
#undef FLD
3108
}
3109
 
3110
/* wxu: wxu $rd,$rt */
3111
 
3112
static SEM_PC
3113
SEM_FN_NAME (iq2000bf,wxu) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3114
{
3115
#define FLD(f) abuf->fields.sfmt_empty.f
3116
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3117
  int UNUSED written = 0;
3118
  IADDR UNUSED pc = abuf->addr;
3119
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3120
 
3121
((void) 0); /*nop*/
3122
 
3123
  return vpc;
3124
#undef FLD
3125
}
3126
 
3127
/* wxr1: wxr1 $rt,$_index,$count */
3128
 
3129
static SEM_PC
3130
SEM_FN_NAME (iq2000bf,wxr1) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3131
{
3132
#define FLD(f) abuf->fields.sfmt_empty.f
3133
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3134
  int UNUSED written = 0;
3135
  IADDR UNUSED pc = abuf->addr;
3136
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3137
 
3138
((void) 0); /*nop*/
3139
 
3140
  return vpc;
3141
#undef FLD
3142
}
3143
 
3144
/* wxr1u: wxr1u $rt,$_index,$count */
3145
 
3146
static SEM_PC
3147
SEM_FN_NAME (iq2000bf,wxr1u) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3148
{
3149
#define FLD(f) abuf->fields.sfmt_empty.f
3150
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3151
  int UNUSED written = 0;
3152
  IADDR UNUSED pc = abuf->addr;
3153
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3154
 
3155
((void) 0); /*nop*/
3156
 
3157
  return vpc;
3158
#undef FLD
3159
}
3160
 
3161
/* wxr30: wxr30 $rt,$_index,$count */
3162
 
3163
static SEM_PC
3164
SEM_FN_NAME (iq2000bf,wxr30) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3165
{
3166
#define FLD(f) abuf->fields.sfmt_empty.f
3167
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3168
  int UNUSED written = 0;
3169
  IADDR UNUSED pc = abuf->addr;
3170
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3171
 
3172
((void) 0); /*nop*/
3173
 
3174
  return vpc;
3175
#undef FLD
3176
}
3177
 
3178
/* wxr30u: wxr30u $rt,$_index,$count */
3179
 
3180
static SEM_PC
3181
SEM_FN_NAME (iq2000bf,wxr30u) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3182
{
3183
#define FLD(f) abuf->fields.sfmt_empty.f
3184
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3185
  int UNUSED written = 0;
3186
  IADDR UNUSED pc = abuf->addr;
3187
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3188
 
3189
((void) 0); /*nop*/
3190
 
3191
  return vpc;
3192
#undef FLD
3193
}
3194
 
3195
/* ldw: ldw $rt,$lo16($base) */
3196
 
3197
static SEM_PC
3198
SEM_FN_NAME (iq2000bf,ldw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3199
{
3200
#define FLD(f) abuf->fields.sfmt_addi.f
3201
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3202
  int UNUSED written = 0;
3203
  IADDR UNUSED pc = abuf->addr;
3204
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3205
 
3206
{
3207
  SI tmp_addr;
3208
  tmp_addr = ANDSI (ADDSI (GET_H_GR (FLD (f_rs)), FLD (f_imm)), INVSI (3));
3209
  {
3210
    SI opval = GETMEMSI (current_cpu, pc, tmp_addr);
3211
    SET_H_GR (ADDSI (FLD (f_rt), 1), opval);
3212
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3213
  }
3214
  {
3215
    SI opval = GETMEMSI (current_cpu, pc, ADDSI (tmp_addr, 4));
3216
    SET_H_GR (FLD (f_rt), opval);
3217
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3218
  }
3219
}
3220
 
3221
  return vpc;
3222
#undef FLD
3223
}
3224
 
3225
/* sdw: sdw $rt,$lo16($base) */
3226
 
3227
static SEM_PC
3228
SEM_FN_NAME (iq2000bf,sdw) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3229
{
3230
#define FLD(f) abuf->fields.sfmt_addi.f
3231
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3232
  int UNUSED written = 0;
3233
  IADDR UNUSED pc = abuf->addr;
3234
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3235
 
3236
{
3237
  SI tmp_addr;
3238
  tmp_addr = ANDSI (ADDSI (GET_H_GR (FLD (f_rs)), FLD (f_imm)), INVSI (3));
3239
  {
3240
    SI opval = GET_H_GR (FLD (f_rt));
3241
    SETMEMSI (current_cpu, pc, ADDSI (tmp_addr, 4), opval);
3242
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3243
  }
3244
  {
3245
    SI opval = GET_H_GR (ADDSI (FLD (f_rt), 1));
3246
    SETMEMSI (current_cpu, pc, tmp_addr, opval);
3247
    TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
3248
  }
3249
}
3250
 
3251
  return vpc;
3252
#undef FLD
3253
}
3254
 
3255
/* j: j $jmptarg */
3256
 
3257
static SEM_PC
3258
SEM_FN_NAME (iq2000bf,j) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3259
{
3260
#define FLD(f) abuf->fields.sfmt_j.f
3261
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3262
  int UNUSED written = 0;
3263
  IADDR UNUSED pc = abuf->addr;
3264
  SEM_BRANCH_INIT
3265
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3266
 
3267
{
3268
  {
3269
    USI opval = FLD (i_jmptarg);
3270
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
3271
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3272
  }
3273
}
3274
 
3275
  SEM_BRANCH_FINI (vpc);
3276
  return vpc;
3277
#undef FLD
3278
}
3279
 
3280
/* jal: jal $jmptarg */
3281
 
3282
static SEM_PC
3283
SEM_FN_NAME (iq2000bf,jal) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3284
{
3285
#define FLD(f) abuf->fields.sfmt_j.f
3286
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3287
  int UNUSED written = 0;
3288
  IADDR UNUSED pc = abuf->addr;
3289
  SEM_BRANCH_INIT
3290
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3291
 
3292
{
3293
{
3294
  {
3295
    SI opval = ADDSI (pc, 8);
3296
    SET_H_GR (((UINT) 31), opval);
3297
    TRACE_RESULT (current_cpu, abuf, "gr", 'x', opval);
3298
  }
3299
  {
3300
    USI opval = FLD (i_jmptarg);
3301
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
3302
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3303
  }
3304
}
3305
}
3306
 
3307
  SEM_BRANCH_FINI (vpc);
3308
  return vpc;
3309
#undef FLD
3310
}
3311
 
3312
/* bmb: bmb $rs,$rt,$offset */
3313
 
3314
static SEM_PC
3315
SEM_FN_NAME (iq2000bf,bmb) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
3316
{
3317
#define FLD(f) abuf->fields.sfmt_bbi.f
3318
  ARGBUF *abuf = SEM_ARGBUF (sem_arg);
3319
  int UNUSED written = 0;
3320
  IADDR UNUSED pc = abuf->addr;
3321
  SEM_BRANCH_INIT
3322
  SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
3323
 
3324
{
3325
  BI tmp_branch_;
3326
  tmp_branch_ = 0;
3327
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 255), ANDSI (GET_H_GR (FLD (f_rt)), 255))) {
3328
  tmp_branch_ = 1;
3329
}
3330
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 65280), ANDSI (GET_H_GR (FLD (f_rt)), 65280))) {
3331
  tmp_branch_ = 1;
3332
}
3333
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 16711680), ANDSI (GET_H_GR (FLD (f_rt)), 16711680))) {
3334
  tmp_branch_ = 1;
3335
}
3336
if (EQSI (ANDSI (GET_H_GR (FLD (f_rs)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt)), 0xff000000))) {
3337
  tmp_branch_ = 1;
3338
}
3339
if (tmp_branch_) {
3340
{
3341
  {
3342
    USI opval = FLD (i_offset);
3343
    SEM_BRANCH_VIA_CACHE (current_cpu, sem_arg, opval, vpc);
3344
    written |= (1 << 3);
3345
    TRACE_RESULT (current_cpu, abuf, "pc", 'x', opval);
3346
  }
3347
}
3348
}
3349
}
3350
 
3351
  abuf->written = written;
3352
  SEM_BRANCH_FINI (vpc);
3353
  return vpc;
3354
#undef FLD
3355
}
3356
 
3357
/* Table of all semantic fns.  */
3358
 
3359
static const struct sem_fn_desc sem_fns[] = {
3360
  { IQ2000BF_INSN_X_INVALID, SEM_FN_NAME (iq2000bf,x_invalid) },
3361
  { IQ2000BF_INSN_X_AFTER, SEM_FN_NAME (iq2000bf,x_after) },
3362
  { IQ2000BF_INSN_X_BEFORE, SEM_FN_NAME (iq2000bf,x_before) },
3363
  { IQ2000BF_INSN_X_CTI_CHAIN, SEM_FN_NAME (iq2000bf,x_cti_chain) },
3364
  { IQ2000BF_INSN_X_CHAIN, SEM_FN_NAME (iq2000bf,x_chain) },
3365
  { IQ2000BF_INSN_X_BEGIN, SEM_FN_NAME (iq2000bf,x_begin) },
3366
  { IQ2000BF_INSN_ADD, SEM_FN_NAME (iq2000bf,add) },
3367
  { IQ2000BF_INSN_ADDI, SEM_FN_NAME (iq2000bf,addi) },
3368
  { IQ2000BF_INSN_ADDIU, SEM_FN_NAME (iq2000bf,addiu) },
3369
  { IQ2000BF_INSN_ADDU, SEM_FN_NAME (iq2000bf,addu) },
3370
  { IQ2000BF_INSN_ADO16, SEM_FN_NAME (iq2000bf,ado16) },
3371
  { IQ2000BF_INSN_AND, SEM_FN_NAME (iq2000bf,and) },
3372
  { IQ2000BF_INSN_ANDI, SEM_FN_NAME (iq2000bf,andi) },
3373
  { IQ2000BF_INSN_ANDOI, SEM_FN_NAME (iq2000bf,andoi) },
3374
  { IQ2000BF_INSN_NOR, SEM_FN_NAME (iq2000bf,nor) },
3375
  { IQ2000BF_INSN_OR, SEM_FN_NAME (iq2000bf,or) },
3376
  { IQ2000BF_INSN_ORI, SEM_FN_NAME (iq2000bf,ori) },
3377
  { IQ2000BF_INSN_RAM, SEM_FN_NAME (iq2000bf,ram) },
3378
  { IQ2000BF_INSN_SLL, SEM_FN_NAME (iq2000bf,sll) },
3379
  { IQ2000BF_INSN_SLLV, SEM_FN_NAME (iq2000bf,sllv) },
3380
  { IQ2000BF_INSN_SLMV, SEM_FN_NAME (iq2000bf,slmv) },
3381
  { IQ2000BF_INSN_SLT, SEM_FN_NAME (iq2000bf,slt) },
3382
  { IQ2000BF_INSN_SLTI, SEM_FN_NAME (iq2000bf,slti) },
3383
  { IQ2000BF_INSN_SLTIU, SEM_FN_NAME (iq2000bf,sltiu) },
3384
  { IQ2000BF_INSN_SLTU, SEM_FN_NAME (iq2000bf,sltu) },
3385
  { IQ2000BF_INSN_SRA, SEM_FN_NAME (iq2000bf,sra) },
3386
  { IQ2000BF_INSN_SRAV, SEM_FN_NAME (iq2000bf,srav) },
3387
  { IQ2000BF_INSN_SRL, SEM_FN_NAME (iq2000bf,srl) },
3388
  { IQ2000BF_INSN_SRLV, SEM_FN_NAME (iq2000bf,srlv) },
3389
  { IQ2000BF_INSN_SRMV, SEM_FN_NAME (iq2000bf,srmv) },
3390
  { IQ2000BF_INSN_SUB, SEM_FN_NAME (iq2000bf,sub) },
3391
  { IQ2000BF_INSN_SUBU, SEM_FN_NAME (iq2000bf,subu) },
3392
  { IQ2000BF_INSN_XOR, SEM_FN_NAME (iq2000bf,xor) },
3393
  { IQ2000BF_INSN_XORI, SEM_FN_NAME (iq2000bf,xori) },
3394
  { IQ2000BF_INSN_BBI, SEM_FN_NAME (iq2000bf,bbi) },
3395
  { IQ2000BF_INSN_BBIN, SEM_FN_NAME (iq2000bf,bbin) },
3396
  { IQ2000BF_INSN_BBV, SEM_FN_NAME (iq2000bf,bbv) },
3397
  { IQ2000BF_INSN_BBVN, SEM_FN_NAME (iq2000bf,bbvn) },
3398
  { IQ2000BF_INSN_BEQ, SEM_FN_NAME (iq2000bf,beq) },
3399
  { IQ2000BF_INSN_BEQL, SEM_FN_NAME (iq2000bf,beql) },
3400
  { IQ2000BF_INSN_BGEZ, SEM_FN_NAME (iq2000bf,bgez) },
3401
  { IQ2000BF_INSN_BGEZAL, SEM_FN_NAME (iq2000bf,bgezal) },
3402
  { IQ2000BF_INSN_BGEZALL, SEM_FN_NAME (iq2000bf,bgezall) },
3403
  { IQ2000BF_INSN_BGEZL, SEM_FN_NAME (iq2000bf,bgezl) },
3404
  { IQ2000BF_INSN_BLTZ, SEM_FN_NAME (iq2000bf,bltz) },
3405
  { IQ2000BF_INSN_BLTZL, SEM_FN_NAME (iq2000bf,bltzl) },
3406
  { IQ2000BF_INSN_BLTZAL, SEM_FN_NAME (iq2000bf,bltzal) },
3407
  { IQ2000BF_INSN_BLTZALL, SEM_FN_NAME (iq2000bf,bltzall) },
3408
  { IQ2000BF_INSN_BMB0, SEM_FN_NAME (iq2000bf,bmb0) },
3409
  { IQ2000BF_INSN_BMB1, SEM_FN_NAME (iq2000bf,bmb1) },
3410
  { IQ2000BF_INSN_BMB2, SEM_FN_NAME (iq2000bf,bmb2) },
3411
  { IQ2000BF_INSN_BMB3, SEM_FN_NAME (iq2000bf,bmb3) },
3412
  { IQ2000BF_INSN_BNE, SEM_FN_NAME (iq2000bf,bne) },
3413
  { IQ2000BF_INSN_BNEL, SEM_FN_NAME (iq2000bf,bnel) },
3414
  { IQ2000BF_INSN_JALR, SEM_FN_NAME (iq2000bf,jalr) },
3415
  { IQ2000BF_INSN_JR, SEM_FN_NAME (iq2000bf,jr) },
3416
  { IQ2000BF_INSN_LB, SEM_FN_NAME (iq2000bf,lb) },
3417
  { IQ2000BF_INSN_LBU, SEM_FN_NAME (iq2000bf,lbu) },
3418
  { IQ2000BF_INSN_LH, SEM_FN_NAME (iq2000bf,lh) },
3419
  { IQ2000BF_INSN_LHU, SEM_FN_NAME (iq2000bf,lhu) },
3420
  { IQ2000BF_INSN_LUI, SEM_FN_NAME (iq2000bf,lui) },
3421
  { IQ2000BF_INSN_LW, SEM_FN_NAME (iq2000bf,lw) },
3422
  { IQ2000BF_INSN_SB, SEM_FN_NAME (iq2000bf,sb) },
3423
  { IQ2000BF_INSN_SH, SEM_FN_NAME (iq2000bf,sh) },
3424
  { IQ2000BF_INSN_SW, SEM_FN_NAME (iq2000bf,sw) },
3425
  { IQ2000BF_INSN_BREAK, SEM_FN_NAME (iq2000bf,break) },
3426
  { IQ2000BF_INSN_SYSCALL, SEM_FN_NAME (iq2000bf,syscall) },
3427
  { IQ2000BF_INSN_ANDOUI, SEM_FN_NAME (iq2000bf,andoui) },
3428
  { IQ2000BF_INSN_ORUI, SEM_FN_NAME (iq2000bf,orui) },
3429
  { IQ2000BF_INSN_BGTZ, SEM_FN_NAME (iq2000bf,bgtz) },
3430
  { IQ2000BF_INSN_BGTZL, SEM_FN_NAME (iq2000bf,bgtzl) },
3431
  { IQ2000BF_INSN_BLEZ, SEM_FN_NAME (iq2000bf,blez) },
3432
  { IQ2000BF_INSN_BLEZL, SEM_FN_NAME (iq2000bf,blezl) },
3433
  { IQ2000BF_INSN_MRGB, SEM_FN_NAME (iq2000bf,mrgb) },
3434
  { IQ2000BF_INSN_BCTXT, SEM_FN_NAME (iq2000bf,bctxt) },
3435
  { IQ2000BF_INSN_BC0F, SEM_FN_NAME (iq2000bf,bc0f) },
3436
  { IQ2000BF_INSN_BC0FL, SEM_FN_NAME (iq2000bf,bc0fl) },
3437
  { IQ2000BF_INSN_BC3F, SEM_FN_NAME (iq2000bf,bc3f) },
3438
  { IQ2000BF_INSN_BC3FL, SEM_FN_NAME (iq2000bf,bc3fl) },
3439
  { IQ2000BF_INSN_BC0T, SEM_FN_NAME (iq2000bf,bc0t) },
3440
  { IQ2000BF_INSN_BC0TL, SEM_FN_NAME (iq2000bf,bc0tl) },
3441
  { IQ2000BF_INSN_BC3T, SEM_FN_NAME (iq2000bf,bc3t) },
3442
  { IQ2000BF_INSN_BC3TL, SEM_FN_NAME (iq2000bf,bc3tl) },
3443
  { IQ2000BF_INSN_CFC0, SEM_FN_NAME (iq2000bf,cfc0) },
3444
  { IQ2000BF_INSN_CFC1, SEM_FN_NAME (iq2000bf,cfc1) },
3445
  { IQ2000BF_INSN_CFC2, SEM_FN_NAME (iq2000bf,cfc2) },
3446
  { IQ2000BF_INSN_CFC3, SEM_FN_NAME (iq2000bf,cfc3) },
3447
  { IQ2000BF_INSN_CHKHDR, SEM_FN_NAME (iq2000bf,chkhdr) },
3448
  { IQ2000BF_INSN_CTC0, SEM_FN_NAME (iq2000bf,ctc0) },
3449
  { IQ2000BF_INSN_CTC1, SEM_FN_NAME (iq2000bf,ctc1) },
3450
  { IQ2000BF_INSN_CTC2, SEM_FN_NAME (iq2000bf,ctc2) },
3451
  { IQ2000BF_INSN_CTC3, SEM_FN_NAME (iq2000bf,ctc3) },
3452
  { IQ2000BF_INSN_JCR, SEM_FN_NAME (iq2000bf,jcr) },
3453
  { IQ2000BF_INSN_LUC32, SEM_FN_NAME (iq2000bf,luc32) },
3454
  { IQ2000BF_INSN_LUC32L, SEM_FN_NAME (iq2000bf,luc32l) },
3455
  { IQ2000BF_INSN_LUC64, SEM_FN_NAME (iq2000bf,luc64) },
3456
  { IQ2000BF_INSN_LUC64L, SEM_FN_NAME (iq2000bf,luc64l) },
3457
  { IQ2000BF_INSN_LUK, SEM_FN_NAME (iq2000bf,luk) },
3458
  { IQ2000BF_INSN_LULCK, SEM_FN_NAME (iq2000bf,lulck) },
3459
  { IQ2000BF_INSN_LUM32, SEM_FN_NAME (iq2000bf,lum32) },
3460
  { IQ2000BF_INSN_LUM32L, SEM_FN_NAME (iq2000bf,lum32l) },
3461
  { IQ2000BF_INSN_LUM64, SEM_FN_NAME (iq2000bf,lum64) },
3462
  { IQ2000BF_INSN_LUM64L, SEM_FN_NAME (iq2000bf,lum64l) },
3463
  { IQ2000BF_INSN_LUR, SEM_FN_NAME (iq2000bf,lur) },
3464
  { IQ2000BF_INSN_LURL, SEM_FN_NAME (iq2000bf,lurl) },
3465
  { IQ2000BF_INSN_LUULCK, SEM_FN_NAME (iq2000bf,luulck) },
3466
  { IQ2000BF_INSN_MFC0, SEM_FN_NAME (iq2000bf,mfc0) },
3467
  { IQ2000BF_INSN_MFC1, SEM_FN_NAME (iq2000bf,mfc1) },
3468
  { IQ2000BF_INSN_MFC2, SEM_FN_NAME (iq2000bf,mfc2) },
3469
  { IQ2000BF_INSN_MFC3, SEM_FN_NAME (iq2000bf,mfc3) },
3470
  { IQ2000BF_INSN_MTC0, SEM_FN_NAME (iq2000bf,mtc0) },
3471
  { IQ2000BF_INSN_MTC1, SEM_FN_NAME (iq2000bf,mtc1) },
3472
  { IQ2000BF_INSN_MTC2, SEM_FN_NAME (iq2000bf,mtc2) },
3473
  { IQ2000BF_INSN_MTC3, SEM_FN_NAME (iq2000bf,mtc3) },
3474
  { IQ2000BF_INSN_PKRL, SEM_FN_NAME (iq2000bf,pkrl) },
3475
  { IQ2000BF_INSN_PKRLR1, SEM_FN_NAME (iq2000bf,pkrlr1) },
3476
  { IQ2000BF_INSN_PKRLR30, SEM_FN_NAME (iq2000bf,pkrlr30) },
3477
  { IQ2000BF_INSN_RB, SEM_FN_NAME (iq2000bf,rb) },
3478
  { IQ2000BF_INSN_RBR1, SEM_FN_NAME (iq2000bf,rbr1) },
3479
  { IQ2000BF_INSN_RBR30, SEM_FN_NAME (iq2000bf,rbr30) },
3480
  { IQ2000BF_INSN_RFE, SEM_FN_NAME (iq2000bf,rfe) },
3481
  { IQ2000BF_INSN_RX, SEM_FN_NAME (iq2000bf,rx) },
3482
  { IQ2000BF_INSN_RXR1, SEM_FN_NAME (iq2000bf,rxr1) },
3483
  { IQ2000BF_INSN_RXR30, SEM_FN_NAME (iq2000bf,rxr30) },
3484
  { IQ2000BF_INSN_SLEEP, SEM_FN_NAME (iq2000bf,sleep) },
3485
  { IQ2000BF_INSN_SRRD, SEM_FN_NAME (iq2000bf,srrd) },
3486
  { IQ2000BF_INSN_SRRDL, SEM_FN_NAME (iq2000bf,srrdl) },
3487
  { IQ2000BF_INSN_SRULCK, SEM_FN_NAME (iq2000bf,srulck) },
3488
  { IQ2000BF_INSN_SRWR, SEM_FN_NAME (iq2000bf,srwr) },
3489
  { IQ2000BF_INSN_SRWRU, SEM_FN_NAME (iq2000bf,srwru) },
3490
  { IQ2000BF_INSN_TRAPQFL, SEM_FN_NAME (iq2000bf,trapqfl) },
3491
  { IQ2000BF_INSN_TRAPQNE, SEM_FN_NAME (iq2000bf,trapqne) },
3492
  { IQ2000BF_INSN_TRAPREL, SEM_FN_NAME (iq2000bf,traprel) },
3493
  { IQ2000BF_INSN_WB, SEM_FN_NAME (iq2000bf,wb) },
3494
  { IQ2000BF_INSN_WBU, SEM_FN_NAME (iq2000bf,wbu) },
3495
  { IQ2000BF_INSN_WBR1, SEM_FN_NAME (iq2000bf,wbr1) },
3496
  { IQ2000BF_INSN_WBR1U, SEM_FN_NAME (iq2000bf,wbr1u) },
3497
  { IQ2000BF_INSN_WBR30, SEM_FN_NAME (iq2000bf,wbr30) },
3498
  { IQ2000BF_INSN_WBR30U, SEM_FN_NAME (iq2000bf,wbr30u) },
3499
  { IQ2000BF_INSN_WX, SEM_FN_NAME (iq2000bf,wx) },
3500
  { IQ2000BF_INSN_WXU, SEM_FN_NAME (iq2000bf,wxu) },
3501
  { IQ2000BF_INSN_WXR1, SEM_FN_NAME (iq2000bf,wxr1) },
3502
  { IQ2000BF_INSN_WXR1U, SEM_FN_NAME (iq2000bf,wxr1u) },
3503
  { IQ2000BF_INSN_WXR30, SEM_FN_NAME (iq2000bf,wxr30) },
3504
  { IQ2000BF_INSN_WXR30U, SEM_FN_NAME (iq2000bf,wxr30u) },
3505
  { IQ2000BF_INSN_LDW, SEM_FN_NAME (iq2000bf,ldw) },
3506
  { IQ2000BF_INSN_SDW, SEM_FN_NAME (iq2000bf,sdw) },
3507
  { IQ2000BF_INSN_J, SEM_FN_NAME (iq2000bf,j) },
3508
  { IQ2000BF_INSN_JAL, SEM_FN_NAME (iq2000bf,jal) },
3509
  { IQ2000BF_INSN_BMB, SEM_FN_NAME (iq2000bf,bmb) },
3510
  { 0, 0 }
3511
};
3512
 
3513
/* Add the semantic fns to IDESC_TABLE.  */
3514
 
3515
void
3516
SEM_FN_NAME (iq2000bf,init_idesc_table) (SIM_CPU *current_cpu)
3517
{
3518
  IDESC *idesc_table = CPU_IDESC (current_cpu);
3519
  const struct sem_fn_desc *sf;
3520
  int mach_num = MACH_NUM (CPU_MACH (current_cpu));
3521
 
3522
  for (sf = &sem_fns[0]; sf->fn != 0; ++sf)
3523
    {
3524
      const CGEN_INSN *insn = idesc_table[sf->index].idata;
3525
      int valid_p = (CGEN_INSN_VIRTUAL_P (insn)
3526
                     || CGEN_INSN_MACH_HAS_P (insn, mach_num));
3527
#if FAST_P
3528
      if (valid_p)
3529
        idesc_table[sf->index].sem_fast = sf->fn;
3530
      else
3531
        idesc_table[sf->index].sem_fast = SEM_FN_NAME (iq2000bf,x_invalid);
3532
#else
3533
      if (valid_p)
3534
        idesc_table[sf->index].sem_full = sf->fn;
3535
      else
3536
        idesc_table[sf->index].sem_full = SEM_FN_NAME (iq2000bf,x_invalid);
3537
#endif
3538
    }
3539
}
3540
 

powered by: WebSVN 2.1.0

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