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

Subversion Repositories openrisc_me

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

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

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

powered by: WebSVN 2.1.0

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