1 /* Simulator instruction semantics for iq2000bf.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2020 Free Software Foundation, Inc.
7 This file is part of the GNU simulators.
9 This file is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, see <http://www.gnu.org/licenses/>.
24 #define WANT_CPU iq2000bf
25 #define WANT_CPU_IQ2000BF
32 #define GET_ATTR(cpu, num, attr) CGEN_ATTR_VALUE (NULL, abuf->idesc->attrs, CGEN_INSN_##attr)
34 /* This is used so that we can compile two copies of the semantic code,
35 one with full feature support and one without that runs fast(er).
36 FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
38 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
39 #undef CGEN_TRACE_RESULT
40 #define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
42 #define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
45 /* x-invalid: --invalid-- */
48 SEM_FN_NAME (iq2000bf
,x_invalid
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
50 #define FLD(f) abuf->fields.sfmt_empty.f
51 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
52 int UNUSED written
= 0;
53 IADDR UNUSED pc
= abuf
->addr
;
54 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
57 /* Update the recorded pc in the cpu state struct.
58 Only necessary for WITH_SCACHE case, but to avoid the
59 conditional compilation .... */
61 /* Virtual insns have zero size. Overwrite vpc with address of next insn
62 using the default-insn-bitsize spec. When executing insns in parallel
63 we may want to queue the fault and continue execution. */
64 vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
65 vpc
= sim_engine_invalid_insn (current_cpu
, pc
, vpc
);
72 /* x-after: --after-- */
75 SEM_FN_NAME (iq2000bf
,x_after
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
77 #define FLD(f) abuf->fields.sfmt_empty.f
78 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
79 int UNUSED written
= 0;
80 IADDR UNUSED pc
= abuf
->addr
;
81 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
84 #if WITH_SCACHE_PBB_IQ2000BF
85 iq2000bf_pbb_after (current_cpu
, sem_arg
);
93 /* x-before: --before-- */
96 SEM_FN_NAME (iq2000bf
,x_before
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
98 #define FLD(f) abuf->fields.sfmt_empty.f
99 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
100 int UNUSED written
= 0;
101 IADDR UNUSED pc
= abuf
->addr
;
102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
105 #if WITH_SCACHE_PBB_IQ2000BF
106 iq2000bf_pbb_before (current_cpu
, sem_arg
);
114 /* x-cti-chain: --cti-chain-- */
117 SEM_FN_NAME (iq2000bf
,x_cti_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
119 #define FLD(f) abuf->fields.sfmt_empty.f
120 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
121 int UNUSED written
= 0;
122 IADDR UNUSED pc
= abuf
->addr
;
123 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
126 #if WITH_SCACHE_PBB_IQ2000BF
128 vpc
= iq2000bf_pbb_cti_chain (current_cpu
, sem_arg
,
129 pbb_br_type
, pbb_br_npc
);
132 /* FIXME: Allow provision of explicit ifmt spec in insn spec. */
133 vpc
= iq2000bf_pbb_cti_chain (current_cpu
, sem_arg
,
134 CPU_PBB_BR_TYPE (current_cpu
),
135 CPU_PBB_BR_NPC (current_cpu
));
144 /* x-chain: --chain-- */
147 SEM_FN_NAME (iq2000bf
,x_chain
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
149 #define FLD(f) abuf->fields.sfmt_empty.f
150 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
151 int UNUSED written
= 0;
152 IADDR UNUSED pc
= abuf
->addr
;
153 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
156 #if WITH_SCACHE_PBB_IQ2000BF
157 vpc
= iq2000bf_pbb_chain (current_cpu
, sem_arg
);
168 /* x-begin: --begin-- */
171 SEM_FN_NAME (iq2000bf
,x_begin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
173 #define FLD(f) abuf->fields.sfmt_empty.f
174 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
175 int UNUSED written
= 0;
176 IADDR UNUSED pc
= abuf
->addr
;
177 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 0);
180 #if WITH_SCACHE_PBB_IQ2000BF
181 #if defined DEFINE_SWITCH || defined FAST_P
182 /* In the switch case FAST_P is a constant, allowing several optimizations
183 in any called inline functions. */
184 vpc
= iq2000bf_pbb_begin (current_cpu
, FAST_P
);
186 #if 0 /* cgen engine can't handle dynamic fast/full switching yet. */
187 vpc
= iq2000bf_pbb_begin (current_cpu
, STATE_RUN_FAST_P (CPU_STATE (current_cpu
)));
189 vpc
= iq2000bf_pbb_begin (current_cpu
, 0);
199 /* add: add $rd,$rs,$rt */
202 SEM_FN_NAME (iq2000bf
,add
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
204 #define FLD(f) abuf->fields.sfmt_mrgb.f
205 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
206 int UNUSED written
= 0;
207 IADDR UNUSED pc
= abuf
->addr
;
208 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
211 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
212 SET_H_GR (FLD (f_rd
), opval
);
213 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
220 /* addi: addi $rt,$rs,$lo16 */
223 SEM_FN_NAME (iq2000bf
,addi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
225 #define FLD(f) abuf->fields.sfmt_addi.f
226 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
227 int UNUSED written
= 0;
228 IADDR UNUSED pc
= abuf
->addr
;
229 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
232 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))));
233 SET_H_GR (FLD (f_rt
), opval
);
234 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
241 /* addiu: addiu $rt,$rs,$lo16 */
244 SEM_FN_NAME (iq2000bf
,addiu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
246 #define FLD(f) abuf->fields.sfmt_addi.f
247 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
248 int UNUSED written
= 0;
249 IADDR UNUSED pc
= abuf
->addr
;
250 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
253 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))));
254 SET_H_GR (FLD (f_rt
), opval
);
255 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
262 /* addu: addu $rd,$rs,$rt */
265 SEM_FN_NAME (iq2000bf
,addu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
267 #define FLD(f) abuf->fields.sfmt_mrgb.f
268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
269 int UNUSED written
= 0;
270 IADDR UNUSED pc
= abuf
->addr
;
271 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
274 SI opval
= ADDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
275 SET_H_GR (FLD (f_rd
), opval
);
276 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
283 /* ado16: ado16 $rd,$rs,$rt */
286 SEM_FN_NAME (iq2000bf
,ado16
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
288 #define FLD(f) abuf->fields.sfmt_mrgb.f
289 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
290 int UNUSED written
= 0;
291 IADDR UNUSED pc
= abuf
->addr
;
292 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
297 tmp_low
= ADDHI (ANDHI (GET_H_GR (FLD (f_rs
)), 65535), ANDHI (GET_H_GR (FLD (f_rt
)), 65535));
298 tmp_high
= ADDHI (SRLSI (GET_H_GR (FLD (f_rs
)), 16), SRLSI (GET_H_GR (FLD (f_rt
)), 16));
300 SI opval
= ORSI (SLLSI (tmp_high
, 16), tmp_low
);
301 SET_H_GR (FLD (f_rd
), opval
);
302 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
310 /* and: and $rd,$rs,$rt */
313 SEM_FN_NAME (iq2000bf
,and) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
315 #define FLD(f) abuf->fields.sfmt_mrgb.f
316 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
317 int UNUSED written
= 0;
318 IADDR UNUSED pc
= abuf
->addr
;
319 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
322 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
323 SET_H_GR (FLD (f_rd
), opval
);
324 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
331 /* andi: andi $rt,$rs,$lo16 */
334 SEM_FN_NAME (iq2000bf
,andi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
336 #define FLD(f) abuf->fields.sfmt_addi.f
337 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
338 int UNUSED written
= 0;
339 IADDR UNUSED pc
= abuf
->addr
;
340 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
343 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
344 SET_H_GR (FLD (f_rt
), opval
);
345 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
352 /* andoi: andoi $rt,$rs,$lo16 */
355 SEM_FN_NAME (iq2000bf
,andoi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
357 #define FLD(f) abuf->fields.sfmt_addi.f
358 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
359 int UNUSED written
= 0;
360 IADDR UNUSED pc
= abuf
->addr
;
361 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
364 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ORSI (0xffff0000, EXTHISI (TRUNCSIHI (FLD (f_imm
)))));
365 SET_H_GR (FLD (f_rt
), opval
);
366 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
373 /* nor: nor $rd,$rs,$rt */
376 SEM_FN_NAME (iq2000bf
,nor
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
378 #define FLD(f) abuf->fields.sfmt_mrgb.f
379 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
380 int UNUSED written
= 0;
381 IADDR UNUSED pc
= abuf
->addr
;
382 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
385 SI opval
= INVSI (ORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
))));
386 SET_H_GR (FLD (f_rd
), opval
);
387 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
394 /* or: or $rd,$rs,$rt */
397 SEM_FN_NAME (iq2000bf
,or) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
399 #define FLD(f) abuf->fields.sfmt_mrgb.f
400 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
401 int UNUSED written
= 0;
402 IADDR UNUSED pc
= abuf
->addr
;
403 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
406 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
407 SET_H_GR (FLD (f_rd
), opval
);
408 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
415 /* ori: ori $rt,$rs,$lo16 */
418 SEM_FN_NAME (iq2000bf
,ori
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
420 #define FLD(f) abuf->fields.sfmt_addi.f
421 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
422 int UNUSED written
= 0;
423 IADDR UNUSED pc
= abuf
->addr
;
424 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
427 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
428 SET_H_GR (FLD (f_rt
), opval
);
429 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
436 /* ram: ram $rd,$rt,$shamt,$maskl,$maskr */
439 SEM_FN_NAME (iq2000bf
,ram
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
441 #define FLD(f) abuf->fields.sfmt_ram.f
442 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
443 int UNUSED written
= 0;
444 IADDR UNUSED pc
= abuf
->addr
;
445 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
449 SI opval
= RORSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
450 SET_H_GR (FLD (f_rd
), opval
);
451 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
454 SI opval
= ANDSI (GET_H_GR (FLD (f_rd
)), SRLSI (0xffffffff, FLD (f_maskl
)));
455 SET_H_GR (FLD (f_rd
), opval
);
456 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
459 SI opval
= ANDSI (GET_H_GR (FLD (f_rd
)), SLLSI (0xffffffff, FLD (f_rs
)));
460 SET_H_GR (FLD (f_rd
), opval
);
461 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
469 /* sll: sll $rd,$rt,$shamt */
472 SEM_FN_NAME (iq2000bf
,sll
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
474 #define FLD(f) abuf->fields.sfmt_ram.f
475 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
476 int UNUSED written
= 0;
477 IADDR UNUSED pc
= abuf
->addr
;
478 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
481 SI opval
= SLLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
482 SET_H_GR (FLD (f_rd
), opval
);
483 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
490 /* sllv: sllv $rd,$rt,$rs */
493 SEM_FN_NAME (iq2000bf
,sllv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
495 #define FLD(f) abuf->fields.sfmt_mrgb.f
496 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
497 int UNUSED written
= 0;
498 IADDR UNUSED pc
= abuf
->addr
;
499 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
502 SI opval
= SLLSI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
503 SET_H_GR (FLD (f_rd
), opval
);
504 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
511 /* slmv: slmv $rd,$rt,$rs,$shamt */
514 SEM_FN_NAME (iq2000bf
,slmv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
516 #define FLD(f) abuf->fields.sfmt_ram.f
517 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
518 int UNUSED written
= 0;
519 IADDR UNUSED pc
= abuf
->addr
;
520 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
523 SI opval
= ANDSI (SLLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
)), SRLSI (0xffffffff, GET_H_GR (FLD (f_rs
))));
524 SET_H_GR (FLD (f_rd
), opval
);
525 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
532 /* slt: slt $rd,$rs,$rt */
535 SEM_FN_NAME (iq2000bf
,slt
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
537 #define FLD(f) abuf->fields.sfmt_mrgb.f
538 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
539 int UNUSED written
= 0;
540 IADDR UNUSED pc
= abuf
->addr
;
541 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
543 if (LTSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
546 SET_H_GR (FLD (f_rd
), opval
);
548 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
553 SET_H_GR (FLD (f_rd
), opval
);
555 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
559 abuf
->written
= written
;
564 /* slti: slti $rt,$rs,$imm */
567 SEM_FN_NAME (iq2000bf
,slti
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
569 #define FLD(f) abuf->fields.sfmt_addi.f
570 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
571 int UNUSED written
= 0;
572 IADDR UNUSED pc
= abuf
->addr
;
573 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
575 if (LTSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))) {
578 SET_H_GR (FLD (f_rt
), opval
);
580 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
585 SET_H_GR (FLD (f_rt
), opval
);
587 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
591 abuf
->written
= written
;
596 /* sltiu: sltiu $rt,$rs,$imm */
599 SEM_FN_NAME (iq2000bf
,sltiu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
601 #define FLD(f) abuf->fields.sfmt_addi.f
602 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
603 int UNUSED written
= 0;
604 IADDR UNUSED pc
= abuf
->addr
;
605 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
607 if (LTUSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))) {
610 SET_H_GR (FLD (f_rt
), opval
);
612 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
617 SET_H_GR (FLD (f_rt
), opval
);
619 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
623 abuf
->written
= written
;
628 /* sltu: sltu $rd,$rs,$rt */
631 SEM_FN_NAME (iq2000bf
,sltu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
633 #define FLD(f) abuf->fields.sfmt_mrgb.f
634 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
635 int UNUSED written
= 0;
636 IADDR UNUSED pc
= abuf
->addr
;
637 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
639 if (LTUSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
642 SET_H_GR (FLD (f_rd
), opval
);
644 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
649 SET_H_GR (FLD (f_rd
), opval
);
651 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
655 abuf
->written
= written
;
660 /* sra: sra $rd,$rt,$shamt */
663 SEM_FN_NAME (iq2000bf
,sra
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
665 #define FLD(f) abuf->fields.sfmt_ram.f
666 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
667 int UNUSED written
= 0;
668 IADDR UNUSED pc
= abuf
->addr
;
669 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
672 SI opval
= SRASI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
673 SET_H_GR (FLD (f_rd
), opval
);
674 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
681 /* srav: srav $rd,$rt,$rs */
684 SEM_FN_NAME (iq2000bf
,srav
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
686 #define FLD(f) abuf->fields.sfmt_mrgb.f
687 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
688 int UNUSED written
= 0;
689 IADDR UNUSED pc
= abuf
->addr
;
690 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
693 SI opval
= SRASI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
694 SET_H_GR (FLD (f_rd
), opval
);
695 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
702 /* srl: srl $rd,$rt,$shamt */
705 SEM_FN_NAME (iq2000bf
,srl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
707 #define FLD(f) abuf->fields.sfmt_ram.f
708 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
709 int UNUSED written
= 0;
710 IADDR UNUSED pc
= abuf
->addr
;
711 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
714 SI opval
= SRLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
));
715 SET_H_GR (FLD (f_rd
), opval
);
716 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
723 /* srlv: srlv $rd,$rt,$rs */
726 SEM_FN_NAME (iq2000bf
,srlv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
728 #define FLD(f) abuf->fields.sfmt_mrgb.f
729 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
730 int UNUSED written
= 0;
731 IADDR UNUSED pc
= abuf
->addr
;
732 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
735 SI opval
= SRLSI (GET_H_GR (FLD (f_rt
)), ANDSI (GET_H_GR (FLD (f_rs
)), 31));
736 SET_H_GR (FLD (f_rd
), opval
);
737 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
744 /* srmv: srmv $rd,$rt,$rs,$shamt */
747 SEM_FN_NAME (iq2000bf
,srmv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
749 #define FLD(f) abuf->fields.sfmt_ram.f
750 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
751 int UNUSED written
= 0;
752 IADDR UNUSED pc
= abuf
->addr
;
753 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
756 SI opval
= ANDSI (SRLSI (GET_H_GR (FLD (f_rt
)), FLD (f_shamt
)), SLLSI (0xffffffff, GET_H_GR (FLD (f_rs
))));
757 SET_H_GR (FLD (f_rd
), opval
);
758 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
765 /* sub: sub $rd,$rs,$rt */
768 SEM_FN_NAME (iq2000bf
,sub
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
770 #define FLD(f) abuf->fields.sfmt_mrgb.f
771 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
772 int UNUSED written
= 0;
773 IADDR UNUSED pc
= abuf
->addr
;
774 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
777 SI opval
= SUBSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
778 SET_H_GR (FLD (f_rd
), opval
);
779 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
786 /* subu: subu $rd,$rs,$rt */
789 SEM_FN_NAME (iq2000bf
,subu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
791 #define FLD(f) abuf->fields.sfmt_mrgb.f
792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
793 int UNUSED written
= 0;
794 IADDR UNUSED pc
= abuf
->addr
;
795 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
798 SI opval
= SUBSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
799 SET_H_GR (FLD (f_rd
), opval
);
800 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
807 /* xor: xor $rd,$rs,$rt */
810 SEM_FN_NAME (iq2000bf
,xor) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
812 #define FLD(f) abuf->fields.sfmt_mrgb.f
813 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
814 int UNUSED written
= 0;
815 IADDR UNUSED pc
= abuf
->addr
;
816 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
819 SI opval
= XORSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)));
820 SET_H_GR (FLD (f_rd
), opval
);
821 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
828 /* xori: xori $rt,$rs,$lo16 */
831 SEM_FN_NAME (iq2000bf
,xori
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
833 #define FLD(f) abuf->fields.sfmt_addi.f
834 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
835 int UNUSED written
= 0;
836 IADDR UNUSED pc
= abuf
->addr
;
837 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
840 SI opval
= XORSI (GET_H_GR (FLD (f_rs
)), ZEXTSISI (FLD (f_imm
)));
841 SET_H_GR (FLD (f_rt
), opval
);
842 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
849 /* bbi: bbi $rs($bitnum),$offset */
852 SEM_FN_NAME (iq2000bf
,bbi
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
854 #define FLD(f) abuf->fields.sfmt_bbi.f
855 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
856 int UNUSED written
= 0;
857 IADDR UNUSED pc
= abuf
->addr
;
859 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
861 if (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, FLD (f_rt
)))) {
864 USI opval
= FLD (i_offset
);
865 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
867 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
872 abuf
->written
= written
;
873 SEM_BRANCH_FINI (vpc
);
878 /* bbin: bbin $rs($bitnum),$offset */
881 SEM_FN_NAME (iq2000bf
,bbin
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
883 #define FLD(f) abuf->fields.sfmt_bbi.f
884 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
885 int UNUSED written
= 0;
886 IADDR UNUSED pc
= abuf
->addr
;
888 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
890 if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, FLD (f_rt
))))) {
893 USI opval
= FLD (i_offset
);
894 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
896 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
901 abuf
->written
= written
;
902 SEM_BRANCH_FINI (vpc
);
907 /* bbv: bbv $rs,$rt,$offset */
910 SEM_FN_NAME (iq2000bf
,bbv
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
912 #define FLD(f) abuf->fields.sfmt_bbi.f
913 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
914 int UNUSED written
= 0;
915 IADDR UNUSED pc
= abuf
->addr
;
917 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
919 if (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt
)), 31)))) {
922 USI opval
= FLD (i_offset
);
923 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
925 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
930 abuf
->written
= written
;
931 SEM_BRANCH_FINI (vpc
);
936 /* bbvn: bbvn $rs,$rt,$offset */
939 SEM_FN_NAME (iq2000bf
,bbvn
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
941 #define FLD(f) abuf->fields.sfmt_bbi.f
942 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
943 int UNUSED written
= 0;
944 IADDR UNUSED pc
= abuf
->addr
;
946 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
948 if (NOTSI (ANDSI (GET_H_GR (FLD (f_rs
)), SLLSI (1, ANDSI (GET_H_GR (FLD (f_rt
)), 31))))) {
951 USI opval
= FLD (i_offset
);
952 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
954 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
959 abuf
->written
= written
;
960 SEM_BRANCH_FINI (vpc
);
965 /* beq: beq $rs,$rt,$offset */
968 SEM_FN_NAME (iq2000bf
,beq
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
970 #define FLD(f) abuf->fields.sfmt_bbi.f
971 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
972 int UNUSED written
= 0;
973 IADDR UNUSED pc
= abuf
->addr
;
975 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
977 if (EQSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
980 USI opval
= FLD (i_offset
);
981 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
983 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
988 abuf
->written
= written
;
989 SEM_BRANCH_FINI (vpc
);
994 /* beql: beql $rs,$rt,$offset */
997 SEM_FN_NAME (iq2000bf
,beql
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
999 #define FLD(f) abuf->fields.sfmt_bbi.f
1000 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1001 int UNUSED written
= 0;
1002 IADDR UNUSED pc
= abuf
->addr
;
1004 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1006 if (EQSI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1009 USI opval
= FLD (i_offset
);
1010 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1011 written
|= (1 << 3);
1012 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1017 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1020 abuf
->written
= written
;
1021 SEM_BRANCH_FINI (vpc
);
1026 /* bgez: bgez $rs,$offset */
1029 SEM_FN_NAME (iq2000bf
,bgez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1031 #define FLD(f) abuf->fields.sfmt_bbi.f
1032 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1033 int UNUSED written
= 0;
1034 IADDR UNUSED pc
= abuf
->addr
;
1036 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1038 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1041 USI opval
= FLD (i_offset
);
1042 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1043 written
|= (1 << 2);
1044 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1049 abuf
->written
= written
;
1050 SEM_BRANCH_FINI (vpc
);
1055 /* bgezal: bgezal $rs,$offset */
1058 SEM_FN_NAME (iq2000bf
,bgezal
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1060 #define FLD(f) abuf->fields.sfmt_bbi.f
1061 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1062 int UNUSED written
= 0;
1063 IADDR UNUSED pc
= abuf
->addr
;
1065 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1067 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1070 SI opval
= ADDSI (pc
, 8);
1071 SET_H_GR (((UINT
) 31), opval
);
1072 written
|= (1 << 3);
1073 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1077 USI opval
= FLD (i_offset
);
1078 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1079 written
|= (1 << 4);
1080 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1086 abuf
->written
= written
;
1087 SEM_BRANCH_FINI (vpc
);
1092 /* bgezall: bgezall $rs,$offset */
1095 SEM_FN_NAME (iq2000bf
,bgezall
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1097 #define FLD(f) abuf->fields.sfmt_bbi.f
1098 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1099 int UNUSED written
= 0;
1100 IADDR UNUSED pc
= abuf
->addr
;
1102 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1104 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1107 SI opval
= ADDSI (pc
, 8);
1108 SET_H_GR (((UINT
) 31), opval
);
1109 written
|= (1 << 3);
1110 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1114 USI opval
= FLD (i_offset
);
1115 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1116 written
|= (1 << 4);
1117 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1123 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1126 abuf
->written
= written
;
1127 SEM_BRANCH_FINI (vpc
);
1132 /* bgezl: bgezl $rs,$offset */
1135 SEM_FN_NAME (iq2000bf
,bgezl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1137 #define FLD(f) abuf->fields.sfmt_bbi.f
1138 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1139 int UNUSED written
= 0;
1140 IADDR UNUSED pc
= abuf
->addr
;
1142 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1144 if (GESI (GET_H_GR (FLD (f_rs
)), 0)) {
1147 USI opval
= FLD (i_offset
);
1148 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1149 written
|= (1 << 2);
1150 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1155 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1158 abuf
->written
= written
;
1159 SEM_BRANCH_FINI (vpc
);
1164 /* bltz: bltz $rs,$offset */
1167 SEM_FN_NAME (iq2000bf
,bltz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1169 #define FLD(f) abuf->fields.sfmt_bbi.f
1170 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1171 int UNUSED written
= 0;
1172 IADDR UNUSED pc
= abuf
->addr
;
1174 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1176 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1179 USI opval
= FLD (i_offset
);
1180 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1181 written
|= (1 << 2);
1182 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1187 abuf
->written
= written
;
1188 SEM_BRANCH_FINI (vpc
);
1193 /* bltzl: bltzl $rs,$offset */
1196 SEM_FN_NAME (iq2000bf
,bltzl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1198 #define FLD(f) abuf->fields.sfmt_bbi.f
1199 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1200 int UNUSED written
= 0;
1201 IADDR UNUSED pc
= abuf
->addr
;
1203 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1205 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1208 USI opval
= FLD (i_offset
);
1209 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1210 written
|= (1 << 2);
1211 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1216 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1219 abuf
->written
= written
;
1220 SEM_BRANCH_FINI (vpc
);
1225 /* bltzal: bltzal $rs,$offset */
1228 SEM_FN_NAME (iq2000bf
,bltzal
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1230 #define FLD(f) abuf->fields.sfmt_bbi.f
1231 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1232 int UNUSED written
= 0;
1233 IADDR UNUSED pc
= abuf
->addr
;
1235 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1237 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1240 SI opval
= ADDSI (pc
, 8);
1241 SET_H_GR (((UINT
) 31), opval
);
1242 written
|= (1 << 3);
1243 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1247 USI opval
= FLD (i_offset
);
1248 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1249 written
|= (1 << 4);
1250 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1256 abuf
->written
= written
;
1257 SEM_BRANCH_FINI (vpc
);
1262 /* bltzall: bltzall $rs,$offset */
1265 SEM_FN_NAME (iq2000bf
,bltzall
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1267 #define FLD(f) abuf->fields.sfmt_bbi.f
1268 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1269 int UNUSED written
= 0;
1270 IADDR UNUSED pc
= abuf
->addr
;
1272 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1274 if (LTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1277 SI opval
= ADDSI (pc
, 8);
1278 SET_H_GR (((UINT
) 31), opval
);
1279 written
|= (1 << 3);
1280 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1284 USI opval
= FLD (i_offset
);
1285 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1286 written
|= (1 << 4);
1287 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1293 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1296 abuf
->written
= written
;
1297 SEM_BRANCH_FINI (vpc
);
1302 /* bmb0: bmb0 $rs,$rt,$offset */
1305 SEM_FN_NAME (iq2000bf
,bmb0
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1307 #define FLD(f) abuf->fields.sfmt_bbi.f
1308 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1309 int UNUSED written
= 0;
1310 IADDR UNUSED pc
= abuf
->addr
;
1312 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1314 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 255), ANDSI (GET_H_GR (FLD (f_rt
)), 255))) {
1317 USI opval
= FLD (i_offset
);
1318 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1319 written
|= (1 << 3);
1320 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1325 abuf
->written
= written
;
1326 SEM_BRANCH_FINI (vpc
);
1331 /* bmb1: bmb1 $rs,$rt,$offset */
1334 SEM_FN_NAME (iq2000bf
,bmb1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1336 #define FLD(f) abuf->fields.sfmt_bbi.f
1337 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1338 int UNUSED written
= 0;
1339 IADDR UNUSED pc
= abuf
->addr
;
1341 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1343 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 65280), ANDSI (GET_H_GR (FLD (f_rt
)), 65280))) {
1346 USI opval
= FLD (i_offset
);
1347 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1348 written
|= (1 << 3);
1349 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1354 abuf
->written
= written
;
1355 SEM_BRANCH_FINI (vpc
);
1360 /* bmb2: bmb2 $rs,$rt,$offset */
1363 SEM_FN_NAME (iq2000bf
,bmb2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1365 #define FLD(f) abuf->fields.sfmt_bbi.f
1366 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1367 int UNUSED written
= 0;
1368 IADDR UNUSED pc
= abuf
->addr
;
1370 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1372 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 16711680), ANDSI (GET_H_GR (FLD (f_rt
)), 16711680))) {
1375 USI opval
= FLD (i_offset
);
1376 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1377 written
|= (1 << 3);
1378 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1383 abuf
->written
= written
;
1384 SEM_BRANCH_FINI (vpc
);
1389 /* bmb3: bmb3 $rs,$rt,$offset */
1392 SEM_FN_NAME (iq2000bf
,bmb3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1394 #define FLD(f) abuf->fields.sfmt_bbi.f
1395 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1396 int UNUSED written
= 0;
1397 IADDR UNUSED pc
= abuf
->addr
;
1399 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1401 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000))) {
1404 USI opval
= FLD (i_offset
);
1405 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1406 written
|= (1 << 3);
1407 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1412 abuf
->written
= written
;
1413 SEM_BRANCH_FINI (vpc
);
1418 /* bne: bne $rs,$rt,$offset */
1421 SEM_FN_NAME (iq2000bf
,bne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1423 #define FLD(f) abuf->fields.sfmt_bbi.f
1424 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1425 int UNUSED written
= 0;
1426 IADDR UNUSED pc
= abuf
->addr
;
1428 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1430 if (NESI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1433 USI opval
= FLD (i_offset
);
1434 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1435 written
|= (1 << 3);
1436 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1441 abuf
->written
= written
;
1442 SEM_BRANCH_FINI (vpc
);
1447 /* bnel: bnel $rs,$rt,$offset */
1450 SEM_FN_NAME (iq2000bf
,bnel
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1452 #define FLD(f) abuf->fields.sfmt_bbi.f
1453 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1454 int UNUSED written
= 0;
1455 IADDR UNUSED pc
= abuf
->addr
;
1457 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1459 if (NESI (GET_H_GR (FLD (f_rs
)), GET_H_GR (FLD (f_rt
)))) {
1462 USI opval
= FLD (i_offset
);
1463 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1464 written
|= (1 << 3);
1465 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1470 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1473 abuf
->written
= written
;
1474 SEM_BRANCH_FINI (vpc
);
1479 /* jalr: jalr $rd,$rs */
1482 SEM_FN_NAME (iq2000bf
,jalr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1484 #define FLD(f) abuf->fields.sfmt_mrgb.f
1485 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1486 int UNUSED written
= 0;
1487 IADDR UNUSED pc
= abuf
->addr
;
1489 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1494 SI opval
= ADDSI (pc
, 8);
1495 SET_H_GR (FLD (f_rd
), opval
);
1496 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1499 USI opval
= GET_H_GR (FLD (f_rs
));
1500 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1501 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1506 SEM_BRANCH_FINI (vpc
);
1514 SEM_FN_NAME (iq2000bf
,jr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1516 #define FLD(f) abuf->fields.sfmt_bbi.f
1517 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1518 int UNUSED written
= 0;
1519 IADDR UNUSED pc
= abuf
->addr
;
1521 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1525 USI opval
= GET_H_GR (FLD (f_rs
));
1526 SEM_BRANCH_VIA_ADDR (current_cpu
, sem_arg
, opval
, vpc
);
1527 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1531 SEM_BRANCH_FINI (vpc
);
1536 /* lb: lb $rt,$lo16($base) */
1539 SEM_FN_NAME (iq2000bf
,lb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1541 #define FLD(f) abuf->fields.sfmt_addi.f
1542 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1543 int UNUSED written
= 0;
1544 IADDR UNUSED pc
= abuf
->addr
;
1545 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1548 SI opval
= EXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1549 SET_H_GR (FLD (f_rt
), opval
);
1550 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1557 /* lbu: lbu $rt,$lo16($base) */
1560 SEM_FN_NAME (iq2000bf
,lbu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1562 #define FLD(f) abuf->fields.sfmt_addi.f
1563 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1564 int UNUSED written
= 0;
1565 IADDR UNUSED pc
= abuf
->addr
;
1566 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1569 SI opval
= ZEXTQISI (GETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1570 SET_H_GR (FLD (f_rt
), opval
);
1571 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1578 /* lh: lh $rt,$lo16($base) */
1581 SEM_FN_NAME (iq2000bf
,lh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1583 #define FLD(f) abuf->fields.sfmt_addi.f
1584 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1585 int UNUSED written
= 0;
1586 IADDR UNUSED pc
= abuf
->addr
;
1587 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1590 SI opval
= EXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1591 SET_H_GR (FLD (f_rt
), opval
);
1592 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1599 /* lhu: lhu $rt,$lo16($base) */
1602 SEM_FN_NAME (iq2000bf
,lhu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1604 #define FLD(f) abuf->fields.sfmt_addi.f
1605 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1606 int UNUSED written
= 0;
1607 IADDR UNUSED pc
= abuf
->addr
;
1608 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1611 SI opval
= ZEXTHISI (GETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
))))));
1612 SET_H_GR (FLD (f_rt
), opval
);
1613 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1620 /* lui: lui $rt,$hi16 */
1623 SEM_FN_NAME (iq2000bf
,lui
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1625 #define FLD(f) abuf->fields.sfmt_addi.f
1626 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1627 int UNUSED written
= 0;
1628 IADDR UNUSED pc
= abuf
->addr
;
1629 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1632 SI opval
= SLLSI (FLD (f_imm
), 16);
1633 SET_H_GR (FLD (f_rt
), opval
);
1634 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1641 /* lw: lw $rt,$lo16($base) */
1644 SEM_FN_NAME (iq2000bf
,lw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1646 #define FLD(f) abuf->fields.sfmt_addi.f
1647 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1648 int UNUSED written
= 0;
1649 IADDR UNUSED pc
= abuf
->addr
;
1650 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1653 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))));
1654 SET_H_GR (FLD (f_rt
), opval
);
1655 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1662 /* sb: sb $rt,$lo16($base) */
1665 SEM_FN_NAME (iq2000bf
,sb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1667 #define FLD(f) abuf->fields.sfmt_addi.f
1668 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1669 int UNUSED written
= 0;
1670 IADDR UNUSED pc
= abuf
->addr
;
1671 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1674 QI opval
= ANDQI (GET_H_GR (FLD (f_rt
)), 255);
1675 SETMEMQI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1676 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1683 /* sh: sh $rt,$lo16($base) */
1686 SEM_FN_NAME (iq2000bf
,sh
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1688 #define FLD(f) abuf->fields.sfmt_addi.f
1689 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1690 int UNUSED written
= 0;
1691 IADDR UNUSED pc
= abuf
->addr
;
1692 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1695 HI opval
= ANDHI (GET_H_GR (FLD (f_rt
)), 65535);
1696 SETMEMHI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1697 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1704 /* sw: sw $rt,$lo16($base) */
1707 SEM_FN_NAME (iq2000bf
,sw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1709 #define FLD(f) abuf->fields.sfmt_addi.f
1710 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1711 int UNUSED written
= 0;
1712 IADDR UNUSED pc
= abuf
->addr
;
1713 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1716 SI opval
= GET_H_GR (FLD (f_rt
));
1717 SETMEMSI (current_cpu
, pc
, ADDSI (GET_H_GR (FLD (f_rs
)), EXTHISI (TRUNCSIHI (FLD (f_imm
)))), opval
);
1718 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
1728 SEM_FN_NAME (iq2000bf
,break) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1730 #define FLD(f) abuf->fields.sfmt_empty.f
1731 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1732 int UNUSED written
= 0;
1733 IADDR UNUSED pc
= abuf
->addr
;
1734 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1736 do_break (current_cpu
, pc
);
1742 /* syscall: syscall */
1745 SEM_FN_NAME (iq2000bf
,syscall
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1747 #define FLD(f) abuf->fields.sfmt_empty.f
1748 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1749 int UNUSED written
= 0;
1750 IADDR UNUSED pc
= abuf
->addr
;
1751 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1753 do_syscall (current_cpu
);
1759 /* andoui: andoui $rt,$rs,$hi16 */
1762 SEM_FN_NAME (iq2000bf
,andoui
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1764 #define FLD(f) abuf->fields.sfmt_addi.f
1765 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1766 int UNUSED written
= 0;
1767 IADDR UNUSED pc
= abuf
->addr
;
1768 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1771 SI opval
= ANDSI (GET_H_GR (FLD (f_rs
)), ORSI (SLLSI (FLD (f_imm
), 16), 65535));
1772 SET_H_GR (FLD (f_rt
), opval
);
1773 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1780 /* orui: orui $rt,$rs,$hi16 */
1783 SEM_FN_NAME (iq2000bf
,orui
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1785 #define FLD(f) abuf->fields.sfmt_addi.f
1786 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1787 int UNUSED written
= 0;
1788 IADDR UNUSED pc
= abuf
->addr
;
1789 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1792 SI opval
= ORSI (GET_H_GR (FLD (f_rs
)), SLLSI (FLD (f_imm
), 16));
1793 SET_H_GR (FLD (f_rt
), opval
);
1794 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1801 /* bgtz: bgtz $rs,$offset */
1804 SEM_FN_NAME (iq2000bf
,bgtz
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1806 #define FLD(f) abuf->fields.sfmt_bbi.f
1807 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1808 int UNUSED written
= 0;
1809 IADDR UNUSED pc
= abuf
->addr
;
1811 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1813 if (GTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1816 USI opval
= FLD (i_offset
);
1817 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1818 written
|= (1 << 2);
1819 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1824 abuf
->written
= written
;
1825 SEM_BRANCH_FINI (vpc
);
1830 /* bgtzl: bgtzl $rs,$offset */
1833 SEM_FN_NAME (iq2000bf
,bgtzl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1835 #define FLD(f) abuf->fields.sfmt_bbi.f
1836 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1837 int UNUSED written
= 0;
1838 IADDR UNUSED pc
= abuf
->addr
;
1840 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1842 if (GTSI (GET_H_GR (FLD (f_rs
)), 0)) {
1845 USI opval
= FLD (i_offset
);
1846 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1847 written
|= (1 << 2);
1848 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1853 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1856 abuf
->written
= written
;
1857 SEM_BRANCH_FINI (vpc
);
1862 /* blez: blez $rs,$offset */
1865 SEM_FN_NAME (iq2000bf
,blez
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1867 #define FLD(f) abuf->fields.sfmt_bbi.f
1868 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1869 int UNUSED written
= 0;
1870 IADDR UNUSED pc
= abuf
->addr
;
1872 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1874 if (LESI (GET_H_GR (FLD (f_rs
)), 0)) {
1877 USI opval
= FLD (i_offset
);
1878 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1879 written
|= (1 << 2);
1880 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1885 abuf
->written
= written
;
1886 SEM_BRANCH_FINI (vpc
);
1891 /* blezl: blezl $rs,$offset */
1894 SEM_FN_NAME (iq2000bf
,blezl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1896 #define FLD(f) abuf->fields.sfmt_bbi.f
1897 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1898 int UNUSED written
= 0;
1899 IADDR UNUSED pc
= abuf
->addr
;
1901 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1903 if (LESI (GET_H_GR (FLD (f_rs
)), 0)) {
1906 USI opval
= FLD (i_offset
);
1907 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
1908 written
|= (1 << 2);
1909 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
1914 SEM_SKIP_INSN (current_cpu
, sem_arg
, vpc
);
1917 abuf
->written
= written
;
1918 SEM_BRANCH_FINI (vpc
);
1923 /* mrgb: mrgb $rd,$rs,$rt,$mask */
1926 SEM_FN_NAME (iq2000bf
,mrgb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1928 #define FLD(f) abuf->fields.sfmt_mrgb.f
1929 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1930 int UNUSED written
= 0;
1931 IADDR UNUSED pc
= abuf
->addr
;
1932 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1936 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 0)))) {
1937 tmp_temp
= ANDSI (GET_H_GR (FLD (f_rs
)), 255);
1939 tmp_temp
= ANDSI (GET_H_GR (FLD (f_rt
)), 255);
1941 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 1)))) {
1942 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 65280));
1944 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 65280));
1946 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 2)))) {
1947 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 16711680));
1949 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 16711680));
1951 if (NOTSI (ANDSI (FLD (f_mask
), SLLSI (1, 3)))) {
1952 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000));
1954 tmp_temp
= ORSI (tmp_temp
, ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000));
1957 SI opval
= tmp_temp
;
1958 SET_H_GR (FLD (f_rd
), opval
);
1959 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
1967 /* bctxt: bctxt $rs,$offset */
1970 SEM_FN_NAME (iq2000bf
,bctxt
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1972 #define FLD(f) abuf->fields.sfmt_empty.f
1973 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1974 int UNUSED written
= 0;
1975 IADDR UNUSED pc
= abuf
->addr
;
1977 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
1981 SEM_BRANCH_FINI (vpc
);
1986 /* bc0f: bc0f $offset */
1989 SEM_FN_NAME (iq2000bf
,bc0f
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
1991 #define FLD(f) abuf->fields.sfmt_empty.f
1992 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
1993 int UNUSED written
= 0;
1994 IADDR UNUSED pc
= abuf
->addr
;
1996 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2000 SEM_BRANCH_FINI (vpc
);
2005 /* bc0fl: bc0fl $offset */
2008 SEM_FN_NAME (iq2000bf
,bc0fl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2010 #define FLD(f) abuf->fields.sfmt_empty.f
2011 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2012 int UNUSED written
= 0;
2013 IADDR UNUSED pc
= abuf
->addr
;
2015 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2019 SEM_BRANCH_FINI (vpc
);
2024 /* bc3f: bc3f $offset */
2027 SEM_FN_NAME (iq2000bf
,bc3f
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2029 #define FLD(f) abuf->fields.sfmt_empty.f
2030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2031 int UNUSED written
= 0;
2032 IADDR UNUSED pc
= abuf
->addr
;
2034 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2038 SEM_BRANCH_FINI (vpc
);
2043 /* bc3fl: bc3fl $offset */
2046 SEM_FN_NAME (iq2000bf
,bc3fl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2048 #define FLD(f) abuf->fields.sfmt_empty.f
2049 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2050 int UNUSED written
= 0;
2051 IADDR UNUSED pc
= abuf
->addr
;
2053 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2057 SEM_BRANCH_FINI (vpc
);
2062 /* bc0t: bc0t $offset */
2065 SEM_FN_NAME (iq2000bf
,bc0t
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2067 #define FLD(f) abuf->fields.sfmt_empty.f
2068 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2069 int UNUSED written
= 0;
2070 IADDR UNUSED pc
= abuf
->addr
;
2072 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2076 SEM_BRANCH_FINI (vpc
);
2081 /* bc0tl: bc0tl $offset */
2084 SEM_FN_NAME (iq2000bf
,bc0tl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2086 #define FLD(f) abuf->fields.sfmt_empty.f
2087 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2088 int UNUSED written
= 0;
2089 IADDR UNUSED pc
= abuf
->addr
;
2091 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2095 SEM_BRANCH_FINI (vpc
);
2100 /* bc3t: bc3t $offset */
2103 SEM_FN_NAME (iq2000bf
,bc3t
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2105 #define FLD(f) abuf->fields.sfmt_empty.f
2106 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2107 int UNUSED written
= 0;
2108 IADDR UNUSED pc
= abuf
->addr
;
2110 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2114 SEM_BRANCH_FINI (vpc
);
2119 /* bc3tl: bc3tl $offset */
2122 SEM_FN_NAME (iq2000bf
,bc3tl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2124 #define FLD(f) abuf->fields.sfmt_empty.f
2125 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2126 int UNUSED written
= 0;
2127 IADDR UNUSED pc
= abuf
->addr
;
2129 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2133 SEM_BRANCH_FINI (vpc
);
2138 /* cfc0: cfc0 $rt,$rd */
2141 SEM_FN_NAME (iq2000bf
,cfc0
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2143 #define FLD(f) abuf->fields.sfmt_empty.f
2144 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2145 int UNUSED written
= 0;
2146 IADDR UNUSED pc
= abuf
->addr
;
2147 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2155 /* cfc1: cfc1 $rt,$rd */
2158 SEM_FN_NAME (iq2000bf
,cfc1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2160 #define FLD(f) abuf->fields.sfmt_empty.f
2161 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2162 int UNUSED written
= 0;
2163 IADDR UNUSED pc
= abuf
->addr
;
2164 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2172 /* cfc2: cfc2 $rt,$rd */
2175 SEM_FN_NAME (iq2000bf
,cfc2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2177 #define FLD(f) abuf->fields.sfmt_empty.f
2178 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2179 int UNUSED written
= 0;
2180 IADDR UNUSED pc
= abuf
->addr
;
2181 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2189 /* cfc3: cfc3 $rt,$rd */
2192 SEM_FN_NAME (iq2000bf
,cfc3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2194 #define FLD(f) abuf->fields.sfmt_empty.f
2195 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2196 int UNUSED written
= 0;
2197 IADDR UNUSED pc
= abuf
->addr
;
2198 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2206 /* chkhdr: chkhdr $rd,$rt */
2209 SEM_FN_NAME (iq2000bf
,chkhdr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2211 #define FLD(f) abuf->fields.sfmt_empty.f
2212 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2213 int UNUSED written
= 0;
2214 IADDR UNUSED pc
= abuf
->addr
;
2215 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2223 /* ctc0: ctc0 $rt,$rd */
2226 SEM_FN_NAME (iq2000bf
,ctc0
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2228 #define FLD(f) abuf->fields.sfmt_empty.f
2229 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2230 int UNUSED written
= 0;
2231 IADDR UNUSED pc
= abuf
->addr
;
2232 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2240 /* ctc1: ctc1 $rt,$rd */
2243 SEM_FN_NAME (iq2000bf
,ctc1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2245 #define FLD(f) abuf->fields.sfmt_empty.f
2246 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2247 int UNUSED written
= 0;
2248 IADDR UNUSED pc
= abuf
->addr
;
2249 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2257 /* ctc2: ctc2 $rt,$rd */
2260 SEM_FN_NAME (iq2000bf
,ctc2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2262 #define FLD(f) abuf->fields.sfmt_empty.f
2263 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2264 int UNUSED written
= 0;
2265 IADDR UNUSED pc
= abuf
->addr
;
2266 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2274 /* ctc3: ctc3 $rt,$rd */
2277 SEM_FN_NAME (iq2000bf
,ctc3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2279 #define FLD(f) abuf->fields.sfmt_empty.f
2280 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2281 int UNUSED written
= 0;
2282 IADDR UNUSED pc
= abuf
->addr
;
2283 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2294 SEM_FN_NAME (iq2000bf
,jcr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2296 #define FLD(f) abuf->fields.sfmt_empty.f
2297 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2298 int UNUSED written
= 0;
2299 IADDR UNUSED pc
= abuf
->addr
;
2301 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2305 SEM_BRANCH_FINI (vpc
);
2310 /* luc32: luc32 $rt,$rd */
2313 SEM_FN_NAME (iq2000bf
,luc32
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2315 #define FLD(f) abuf->fields.sfmt_empty.f
2316 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2317 int UNUSED written
= 0;
2318 IADDR UNUSED pc
= abuf
->addr
;
2319 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2327 /* luc32l: luc32l $rt,$rd */
2330 SEM_FN_NAME (iq2000bf
,luc32l
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2332 #define FLD(f) abuf->fields.sfmt_empty.f
2333 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2334 int UNUSED written
= 0;
2335 IADDR UNUSED pc
= abuf
->addr
;
2336 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2344 /* luc64: luc64 $rt,$rd */
2347 SEM_FN_NAME (iq2000bf
,luc64
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2349 #define FLD(f) abuf->fields.sfmt_empty.f
2350 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2351 int UNUSED written
= 0;
2352 IADDR UNUSED pc
= abuf
->addr
;
2353 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2361 /* luc64l: luc64l $rt,$rd */
2364 SEM_FN_NAME (iq2000bf
,luc64l
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2366 #define FLD(f) abuf->fields.sfmt_empty.f
2367 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2368 int UNUSED written
= 0;
2369 IADDR UNUSED pc
= abuf
->addr
;
2370 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2378 /* luk: luk $rt,$rd */
2381 SEM_FN_NAME (iq2000bf
,luk
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2383 #define FLD(f) abuf->fields.sfmt_empty.f
2384 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2385 int UNUSED written
= 0;
2386 IADDR UNUSED pc
= abuf
->addr
;
2387 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2395 /* lulck: lulck $rt */
2398 SEM_FN_NAME (iq2000bf
,lulck
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2400 #define FLD(f) abuf->fields.sfmt_empty.f
2401 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2402 int UNUSED written
= 0;
2403 IADDR UNUSED pc
= abuf
->addr
;
2404 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2412 /* lum32: lum32 $rt,$rd */
2415 SEM_FN_NAME (iq2000bf
,lum32
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2417 #define FLD(f) abuf->fields.sfmt_empty.f
2418 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2419 int UNUSED written
= 0;
2420 IADDR UNUSED pc
= abuf
->addr
;
2421 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2429 /* lum32l: lum32l $rt,$rd */
2432 SEM_FN_NAME (iq2000bf
,lum32l
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2434 #define FLD(f) abuf->fields.sfmt_empty.f
2435 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2436 int UNUSED written
= 0;
2437 IADDR UNUSED pc
= abuf
->addr
;
2438 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2446 /* lum64: lum64 $rt,$rd */
2449 SEM_FN_NAME (iq2000bf
,lum64
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2451 #define FLD(f) abuf->fields.sfmt_empty.f
2452 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2453 int UNUSED written
= 0;
2454 IADDR UNUSED pc
= abuf
->addr
;
2455 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2463 /* lum64l: lum64l $rt,$rd */
2466 SEM_FN_NAME (iq2000bf
,lum64l
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2468 #define FLD(f) abuf->fields.sfmt_empty.f
2469 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2470 int UNUSED written
= 0;
2471 IADDR UNUSED pc
= abuf
->addr
;
2472 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2480 /* lur: lur $rt,$rd */
2483 SEM_FN_NAME (iq2000bf
,lur
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2485 #define FLD(f) abuf->fields.sfmt_empty.f
2486 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2487 int UNUSED written
= 0;
2488 IADDR UNUSED pc
= abuf
->addr
;
2489 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2497 /* lurl: lurl $rt,$rd */
2500 SEM_FN_NAME (iq2000bf
,lurl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2502 #define FLD(f) abuf->fields.sfmt_empty.f
2503 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2504 int UNUSED written
= 0;
2505 IADDR UNUSED pc
= abuf
->addr
;
2506 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2514 /* luulck: luulck $rt */
2517 SEM_FN_NAME (iq2000bf
,luulck
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2519 #define FLD(f) abuf->fields.sfmt_empty.f
2520 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2521 int UNUSED written
= 0;
2522 IADDR UNUSED pc
= abuf
->addr
;
2523 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2531 /* mfc0: mfc0 $rt,$rd */
2534 SEM_FN_NAME (iq2000bf
,mfc0
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2536 #define FLD(f) abuf->fields.sfmt_empty.f
2537 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2538 int UNUSED written
= 0;
2539 IADDR UNUSED pc
= abuf
->addr
;
2540 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2548 /* mfc1: mfc1 $rt,$rd */
2551 SEM_FN_NAME (iq2000bf
,mfc1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2553 #define FLD(f) abuf->fields.sfmt_empty.f
2554 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2555 int UNUSED written
= 0;
2556 IADDR UNUSED pc
= abuf
->addr
;
2557 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2565 /* mfc2: mfc2 $rt,$rd */
2568 SEM_FN_NAME (iq2000bf
,mfc2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2570 #define FLD(f) abuf->fields.sfmt_empty.f
2571 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2572 int UNUSED written
= 0;
2573 IADDR UNUSED pc
= abuf
->addr
;
2574 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2582 /* mfc3: mfc3 $rt,$rd */
2585 SEM_FN_NAME (iq2000bf
,mfc3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2587 #define FLD(f) abuf->fields.sfmt_empty.f
2588 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2589 int UNUSED written
= 0;
2590 IADDR UNUSED pc
= abuf
->addr
;
2591 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2599 /* mtc0: mtc0 $rt,$rd */
2602 SEM_FN_NAME (iq2000bf
,mtc0
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2604 #define FLD(f) abuf->fields.sfmt_empty.f
2605 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2606 int UNUSED written
= 0;
2607 IADDR UNUSED pc
= abuf
->addr
;
2608 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2616 /* mtc1: mtc1 $rt,$rd */
2619 SEM_FN_NAME (iq2000bf
,mtc1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2621 #define FLD(f) abuf->fields.sfmt_empty.f
2622 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2623 int UNUSED written
= 0;
2624 IADDR UNUSED pc
= abuf
->addr
;
2625 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2633 /* mtc2: mtc2 $rt,$rd */
2636 SEM_FN_NAME (iq2000bf
,mtc2
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2638 #define FLD(f) abuf->fields.sfmt_empty.f
2639 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2640 int UNUSED written
= 0;
2641 IADDR UNUSED pc
= abuf
->addr
;
2642 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2650 /* mtc3: mtc3 $rt,$rd */
2653 SEM_FN_NAME (iq2000bf
,mtc3
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2655 #define FLD(f) abuf->fields.sfmt_empty.f
2656 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2657 int UNUSED written
= 0;
2658 IADDR UNUSED pc
= abuf
->addr
;
2659 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2667 /* pkrl: pkrl $rd,$rt */
2670 SEM_FN_NAME (iq2000bf
,pkrl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2672 #define FLD(f) abuf->fields.sfmt_empty.f
2673 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2674 int UNUSED written
= 0;
2675 IADDR UNUSED pc
= abuf
->addr
;
2676 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2684 /* pkrlr1: pkrlr1 $rt,$_index,$count */
2687 SEM_FN_NAME (iq2000bf
,pkrlr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2689 #define FLD(f) abuf->fields.sfmt_empty.f
2690 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2691 int UNUSED written
= 0;
2692 IADDR UNUSED pc
= abuf
->addr
;
2693 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2701 /* pkrlr30: pkrlr30 $rt,$_index,$count */
2704 SEM_FN_NAME (iq2000bf
,pkrlr30
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2706 #define FLD(f) abuf->fields.sfmt_empty.f
2707 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2708 int UNUSED written
= 0;
2709 IADDR UNUSED pc
= abuf
->addr
;
2710 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2718 /* rb: rb $rd,$rt */
2721 SEM_FN_NAME (iq2000bf
,rb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2723 #define FLD(f) abuf->fields.sfmt_empty.f
2724 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2725 int UNUSED written
= 0;
2726 IADDR UNUSED pc
= abuf
->addr
;
2727 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2735 /* rbr1: rbr1 $rt,$_index,$count */
2738 SEM_FN_NAME (iq2000bf
,rbr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2740 #define FLD(f) abuf->fields.sfmt_empty.f
2741 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2742 int UNUSED written
= 0;
2743 IADDR UNUSED pc
= abuf
->addr
;
2744 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2752 /* rbr30: rbr30 $rt,$_index,$count */
2755 SEM_FN_NAME (iq2000bf
,rbr30
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2757 #define FLD(f) abuf->fields.sfmt_empty.f
2758 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2759 int UNUSED written
= 0;
2760 IADDR UNUSED pc
= abuf
->addr
;
2761 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2772 SEM_FN_NAME (iq2000bf
,rfe
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2774 #define FLD(f) abuf->fields.sfmt_empty.f
2775 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2776 int UNUSED written
= 0;
2777 IADDR UNUSED pc
= abuf
->addr
;
2778 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2786 /* rx: rx $rd,$rt */
2789 SEM_FN_NAME (iq2000bf
,rx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2791 #define FLD(f) abuf->fields.sfmt_empty.f
2792 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2793 int UNUSED written
= 0;
2794 IADDR UNUSED pc
= abuf
->addr
;
2795 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2803 /* rxr1: rxr1 $rt,$_index,$count */
2806 SEM_FN_NAME (iq2000bf
,rxr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2808 #define FLD(f) abuf->fields.sfmt_empty.f
2809 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2810 int UNUSED written
= 0;
2811 IADDR UNUSED pc
= abuf
->addr
;
2812 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2820 /* rxr30: rxr30 $rt,$_index,$count */
2823 SEM_FN_NAME (iq2000bf
,rxr30
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2825 #define FLD(f) abuf->fields.sfmt_empty.f
2826 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2827 int UNUSED written
= 0;
2828 IADDR UNUSED pc
= abuf
->addr
;
2829 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2840 SEM_FN_NAME (iq2000bf
,sleep
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2842 #define FLD(f) abuf->fields.sfmt_empty.f
2843 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2844 int UNUSED written
= 0;
2845 IADDR UNUSED pc
= abuf
->addr
;
2846 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2854 /* srrd: srrd $rt */
2857 SEM_FN_NAME (iq2000bf
,srrd
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2859 #define FLD(f) abuf->fields.sfmt_empty.f
2860 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2861 int UNUSED written
= 0;
2862 IADDR UNUSED pc
= abuf
->addr
;
2863 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2871 /* srrdl: srrdl $rt */
2874 SEM_FN_NAME (iq2000bf
,srrdl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2876 #define FLD(f) abuf->fields.sfmt_empty.f
2877 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2878 int UNUSED written
= 0;
2879 IADDR UNUSED pc
= abuf
->addr
;
2880 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2888 /* srulck: srulck $rt */
2891 SEM_FN_NAME (iq2000bf
,srulck
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2893 #define FLD(f) abuf->fields.sfmt_empty.f
2894 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2895 int UNUSED written
= 0;
2896 IADDR UNUSED pc
= abuf
->addr
;
2897 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2905 /* srwr: srwr $rt,$rd */
2908 SEM_FN_NAME (iq2000bf
,srwr
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2910 #define FLD(f) abuf->fields.sfmt_empty.f
2911 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2912 int UNUSED written
= 0;
2913 IADDR UNUSED pc
= abuf
->addr
;
2914 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2922 /* srwru: srwru $rt,$rd */
2925 SEM_FN_NAME (iq2000bf
,srwru
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2927 #define FLD(f) abuf->fields.sfmt_empty.f
2928 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2929 int UNUSED written
= 0;
2930 IADDR UNUSED pc
= abuf
->addr
;
2931 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2939 /* trapqfl: trapqfl */
2942 SEM_FN_NAME (iq2000bf
,trapqfl
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2944 #define FLD(f) abuf->fields.sfmt_empty.f
2945 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2946 int UNUSED written
= 0;
2947 IADDR UNUSED pc
= abuf
->addr
;
2948 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2956 /* trapqne: trapqne */
2959 SEM_FN_NAME (iq2000bf
,trapqne
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2961 #define FLD(f) abuf->fields.sfmt_empty.f
2962 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2963 int UNUSED written
= 0;
2964 IADDR UNUSED pc
= abuf
->addr
;
2965 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2973 /* traprel: traprel $rt */
2976 SEM_FN_NAME (iq2000bf
,traprel
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2978 #define FLD(f) abuf->fields.sfmt_empty.f
2979 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2980 int UNUSED written
= 0;
2981 IADDR UNUSED pc
= abuf
->addr
;
2982 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
2990 /* wb: wb $rd,$rt */
2993 SEM_FN_NAME (iq2000bf
,wb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
2995 #define FLD(f) abuf->fields.sfmt_empty.f
2996 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
2997 int UNUSED written
= 0;
2998 IADDR UNUSED pc
= abuf
->addr
;
2999 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3007 /* wbu: wbu $rd,$rt */
3010 SEM_FN_NAME (iq2000bf
,wbu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3012 #define FLD(f) abuf->fields.sfmt_empty.f
3013 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3014 int UNUSED written
= 0;
3015 IADDR UNUSED pc
= abuf
->addr
;
3016 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3024 /* wbr1: wbr1 $rt,$_index,$count */
3027 SEM_FN_NAME (iq2000bf
,wbr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3029 #define FLD(f) abuf->fields.sfmt_empty.f
3030 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3031 int UNUSED written
= 0;
3032 IADDR UNUSED pc
= abuf
->addr
;
3033 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3041 /* wbr1u: wbr1u $rt,$_index,$count */
3044 SEM_FN_NAME (iq2000bf
,wbr1u
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3046 #define FLD(f) abuf->fields.sfmt_empty.f
3047 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3048 int UNUSED written
= 0;
3049 IADDR UNUSED pc
= abuf
->addr
;
3050 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3058 /* wbr30: wbr30 $rt,$_index,$count */
3061 SEM_FN_NAME (iq2000bf
,wbr30
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3063 #define FLD(f) abuf->fields.sfmt_empty.f
3064 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3065 int UNUSED written
= 0;
3066 IADDR UNUSED pc
= abuf
->addr
;
3067 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3075 /* wbr30u: wbr30u $rt,$_index,$count */
3078 SEM_FN_NAME (iq2000bf
,wbr30u
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3080 #define FLD(f) abuf->fields.sfmt_empty.f
3081 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3082 int UNUSED written
= 0;
3083 IADDR UNUSED pc
= abuf
->addr
;
3084 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3092 /* wx: wx $rd,$rt */
3095 SEM_FN_NAME (iq2000bf
,wx
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3097 #define FLD(f) abuf->fields.sfmt_empty.f
3098 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3099 int UNUSED written
= 0;
3100 IADDR UNUSED pc
= abuf
->addr
;
3101 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3109 /* wxu: wxu $rd,$rt */
3112 SEM_FN_NAME (iq2000bf
,wxu
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3114 #define FLD(f) abuf->fields.sfmt_empty.f
3115 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3116 int UNUSED written
= 0;
3117 IADDR UNUSED pc
= abuf
->addr
;
3118 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3126 /* wxr1: wxr1 $rt,$_index,$count */
3129 SEM_FN_NAME (iq2000bf
,wxr1
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3131 #define FLD(f) abuf->fields.sfmt_empty.f
3132 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3133 int UNUSED written
= 0;
3134 IADDR UNUSED pc
= abuf
->addr
;
3135 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3143 /* wxr1u: wxr1u $rt,$_index,$count */
3146 SEM_FN_NAME (iq2000bf
,wxr1u
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3148 #define FLD(f) abuf->fields.sfmt_empty.f
3149 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3150 int UNUSED written
= 0;
3151 IADDR UNUSED pc
= abuf
->addr
;
3152 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3160 /* wxr30: wxr30 $rt,$_index,$count */
3163 SEM_FN_NAME (iq2000bf
,wxr30
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3165 #define FLD(f) abuf->fields.sfmt_empty.f
3166 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3167 int UNUSED written
= 0;
3168 IADDR UNUSED pc
= abuf
->addr
;
3169 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3177 /* wxr30u: wxr30u $rt,$_index,$count */
3180 SEM_FN_NAME (iq2000bf
,wxr30u
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3182 #define FLD(f) abuf->fields.sfmt_empty.f
3183 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3184 int UNUSED written
= 0;
3185 IADDR UNUSED pc
= abuf
->addr
;
3186 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3194 /* ldw: ldw $rt,$lo16($base) */
3197 SEM_FN_NAME (iq2000bf
,ldw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3199 #define FLD(f) abuf->fields.sfmt_addi.f
3200 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3201 int UNUSED written
= 0;
3202 IADDR UNUSED pc
= abuf
->addr
;
3203 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3207 tmp_addr
= ANDSI (ADDSI (GET_H_GR (FLD (f_rs
)), FLD (f_imm
)), INVSI (3));
3209 SI opval
= GETMEMSI (current_cpu
, pc
, tmp_addr
);
3210 SET_H_GR (ADDSI (FLD (f_rt
), 1), opval
);
3211 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3214 SI opval
= GETMEMSI (current_cpu
, pc
, ADDSI (tmp_addr
, 4));
3215 SET_H_GR (FLD (f_rt
), opval
);
3216 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3224 /* sdw: sdw $rt,$lo16($base) */
3227 SEM_FN_NAME (iq2000bf
,sdw
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3229 #define FLD(f) abuf->fields.sfmt_addi.f
3230 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3231 int UNUSED written
= 0;
3232 IADDR UNUSED pc
= abuf
->addr
;
3233 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3237 tmp_addr
= ANDSI (ADDSI (GET_H_GR (FLD (f_rs
)), FLD (f_imm
)), INVSI (3));
3239 SI opval
= GET_H_GR (FLD (f_rt
));
3240 SETMEMSI (current_cpu
, pc
, ADDSI (tmp_addr
, 4), opval
);
3241 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3244 SI opval
= GET_H_GR (ADDSI (FLD (f_rt
), 1));
3245 SETMEMSI (current_cpu
, pc
, tmp_addr
, opval
);
3246 CGEN_TRACE_RESULT (current_cpu
, abuf
, "memory", 'x', opval
);
3257 SEM_FN_NAME (iq2000bf
,j
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3259 #define FLD(f) abuf->fields.sfmt_j.f
3260 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3261 int UNUSED written
= 0;
3262 IADDR UNUSED pc
= abuf
->addr
;
3264 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3268 USI opval
= FLD (i_jmptarg
);
3269 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3270 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3274 SEM_BRANCH_FINI (vpc
);
3279 /* jal: jal $jmptarg */
3282 SEM_FN_NAME (iq2000bf
,jal
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3284 #define FLD(f) abuf->fields.sfmt_j.f
3285 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3286 int UNUSED written
= 0;
3287 IADDR UNUSED pc
= abuf
->addr
;
3289 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3294 SI opval
= ADDSI (pc
, 8);
3295 SET_H_GR (((UINT
) 31), opval
);
3296 CGEN_TRACE_RESULT (current_cpu
, abuf
, "gr", 'x', opval
);
3299 USI opval
= FLD (i_jmptarg
);
3300 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3301 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3306 SEM_BRANCH_FINI (vpc
);
3311 /* bmb: bmb $rs,$rt,$offset */
3314 SEM_FN_NAME (iq2000bf
,bmb
) (SIM_CPU
*current_cpu
, SEM_ARG sem_arg
)
3316 #define FLD(f) abuf->fields.sfmt_bbi.f
3317 ARGBUF
*abuf
= SEM_ARGBUF (sem_arg
);
3318 int UNUSED written
= 0;
3319 IADDR UNUSED pc
= abuf
->addr
;
3321 SEM_PC vpc
= SEM_NEXT_VPC (sem_arg
, pc
, 4);
3326 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 255), ANDSI (GET_H_GR (FLD (f_rt
)), 255))) {
3329 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 65280), ANDSI (GET_H_GR (FLD (f_rt
)), 65280))) {
3332 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 16711680), ANDSI (GET_H_GR (FLD (f_rt
)), 16711680))) {
3335 if (EQSI (ANDSI (GET_H_GR (FLD (f_rs
)), 0xff000000), ANDSI (GET_H_GR (FLD (f_rt
)), 0xff000000))) {
3341 USI opval
= FLD (i_offset
);
3342 SEM_BRANCH_VIA_CACHE (current_cpu
, sem_arg
, opval
, vpc
);
3343 written
|= (1 << 3);
3344 CGEN_TRACE_RESULT (current_cpu
, abuf
, "pc", 'x', opval
);
3350 abuf
->written
= written
;
3351 SEM_BRANCH_FINI (vpc
);
3356 /* Table of all semantic fns. */
3358 static const struct sem_fn_desc sem_fns
[] = {
3359 { IQ2000BF_INSN_X_INVALID
, SEM_FN_NAME (iq2000bf
,x_invalid
) },
3360 { IQ2000BF_INSN_X_AFTER
, SEM_FN_NAME (iq2000bf
,x_after
) },
3361 { IQ2000BF_INSN_X_BEFORE
, SEM_FN_NAME (iq2000bf
,x_before
) },
3362 { IQ2000BF_INSN_X_CTI_CHAIN
, SEM_FN_NAME (iq2000bf
,x_cti_chain
) },
3363 { IQ2000BF_INSN_X_CHAIN
, SEM_FN_NAME (iq2000bf
,x_chain
) },
3364 { IQ2000BF_INSN_X_BEGIN
, SEM_FN_NAME (iq2000bf
,x_begin
) },
3365 { IQ2000BF_INSN_ADD
, SEM_FN_NAME (iq2000bf
,add
) },
3366 { IQ2000BF_INSN_ADDI
, SEM_FN_NAME (iq2000bf
,addi
) },
3367 { IQ2000BF_INSN_ADDIU
, SEM_FN_NAME (iq2000bf
,addiu
) },
3368 { IQ2000BF_INSN_ADDU
, SEM_FN_NAME (iq2000bf
,addu
) },
3369 { IQ2000BF_INSN_ADO16
, SEM_FN_NAME (iq2000bf
,ado16
) },
3370 { IQ2000BF_INSN_AND
, SEM_FN_NAME (iq2000bf
,and) },
3371 { IQ2000BF_INSN_ANDI
, SEM_FN_NAME (iq2000bf
,andi
) },
3372 { IQ2000BF_INSN_ANDOI
, SEM_FN_NAME (iq2000bf
,andoi
) },
3373 { IQ2000BF_INSN_NOR
, SEM_FN_NAME (iq2000bf
,nor
) },
3374 { IQ2000BF_INSN_OR
, SEM_FN_NAME (iq2000bf
,or) },
3375 { IQ2000BF_INSN_ORI
, SEM_FN_NAME (iq2000bf
,ori
) },
3376 { IQ2000BF_INSN_RAM
, SEM_FN_NAME (iq2000bf
,ram
) },
3377 { IQ2000BF_INSN_SLL
, SEM_FN_NAME (iq2000bf
,sll
) },
3378 { IQ2000BF_INSN_SLLV
, SEM_FN_NAME (iq2000bf
,sllv
) },
3379 { IQ2000BF_INSN_SLMV
, SEM_FN_NAME (iq2000bf
,slmv
) },
3380 { IQ2000BF_INSN_SLT
, SEM_FN_NAME (iq2000bf
,slt
) },
3381 { IQ2000BF_INSN_SLTI
, SEM_FN_NAME (iq2000bf
,slti
) },
3382 { IQ2000BF_INSN_SLTIU
, SEM_FN_NAME (iq2000bf
,sltiu
) },
3383 { IQ2000BF_INSN_SLTU
, SEM_FN_NAME (iq2000bf
,sltu
) },
3384 { IQ2000BF_INSN_SRA
, SEM_FN_NAME (iq2000bf
,sra
) },
3385 { IQ2000BF_INSN_SRAV
, SEM_FN_NAME (iq2000bf
,srav
) },
3386 { IQ2000BF_INSN_SRL
, SEM_FN_NAME (iq2000bf
,srl
) },
3387 { IQ2000BF_INSN_SRLV
, SEM_FN_NAME (iq2000bf
,srlv
) },
3388 { IQ2000BF_INSN_SRMV
, SEM_FN_NAME (iq2000bf
,srmv
) },
3389 { IQ2000BF_INSN_SUB
, SEM_FN_NAME (iq2000bf
,sub
) },
3390 { IQ2000BF_INSN_SUBU
, SEM_FN_NAME (iq2000bf
,subu
) },
3391 { IQ2000BF_INSN_XOR
, SEM_FN_NAME (iq2000bf
,xor) },
3392 { IQ2000BF_INSN_XORI
, SEM_FN_NAME (iq2000bf
,xori
) },
3393 { IQ2000BF_INSN_BBI
, SEM_FN_NAME (iq2000bf
,bbi
) },
3394 { IQ2000BF_INSN_BBIN
, SEM_FN_NAME (iq2000bf
,bbin
) },
3395 { IQ2000BF_INSN_BBV
, SEM_FN_NAME (iq2000bf
,bbv
) },
3396 { IQ2000BF_INSN_BBVN
, SEM_FN_NAME (iq2000bf
,bbvn
) },
3397 { IQ2000BF_INSN_BEQ
, SEM_FN_NAME (iq2000bf
,beq
) },
3398 { IQ2000BF_INSN_BEQL
, SEM_FN_NAME (iq2000bf
,beql
) },
3399 { IQ2000BF_INSN_BGEZ
, SEM_FN_NAME (iq2000bf
,bgez
) },
3400 { IQ2000BF_INSN_BGEZAL
, SEM_FN_NAME (iq2000bf
,bgezal
) },
3401 { IQ2000BF_INSN_BGEZALL
, SEM_FN_NAME (iq2000bf
,bgezall
) },
3402 { IQ2000BF_INSN_BGEZL
, SEM_FN_NAME (iq2000bf
,bgezl
) },
3403 { IQ2000BF_INSN_BLTZ
, SEM_FN_NAME (iq2000bf
,bltz
) },
3404 { IQ2000BF_INSN_BLTZL
, SEM_FN_NAME (iq2000bf
,bltzl
) },
3405 { IQ2000BF_INSN_BLTZAL
, SEM_FN_NAME (iq2000bf
,bltzal
) },
3406 { IQ2000BF_INSN_BLTZALL
, SEM_FN_NAME (iq2000bf
,bltzall
) },
3407 { IQ2000BF_INSN_BMB0
, SEM_FN_NAME (iq2000bf
,bmb0
) },
3408 { IQ2000BF_INSN_BMB1
, SEM_FN_NAME (iq2000bf
,bmb1
) },
3409 { IQ2000BF_INSN_BMB2
, SEM_FN_NAME (iq2000bf
,bmb2
) },
3410 { IQ2000BF_INSN_BMB3
, SEM_FN_NAME (iq2000bf
,bmb3
) },
3411 { IQ2000BF_INSN_BNE
, SEM_FN_NAME (iq2000bf
,bne
) },
3412 { IQ2000BF_INSN_BNEL
, SEM_FN_NAME (iq2000bf
,bnel
) },
3413 { IQ2000BF_INSN_JALR
, SEM_FN_NAME (iq2000bf
,jalr
) },
3414 { IQ2000BF_INSN_JR
, SEM_FN_NAME (iq2000bf
,jr
) },
3415 { IQ2000BF_INSN_LB
, SEM_FN_NAME (iq2000bf
,lb
) },
3416 { IQ2000BF_INSN_LBU
, SEM_FN_NAME (iq2000bf
,lbu
) },
3417 { IQ2000BF_INSN_LH
, SEM_FN_NAME (iq2000bf
,lh
) },
3418 { IQ2000BF_INSN_LHU
, SEM_FN_NAME (iq2000bf
,lhu
) },
3419 { IQ2000BF_INSN_LUI
, SEM_FN_NAME (iq2000bf
,lui
) },
3420 { IQ2000BF_INSN_LW
, SEM_FN_NAME (iq2000bf
,lw
) },
3421 { IQ2000BF_INSN_SB
, SEM_FN_NAME (iq2000bf
,sb
) },
3422 { IQ2000BF_INSN_SH
, SEM_FN_NAME (iq2000bf
,sh
) },
3423 { IQ2000BF_INSN_SW
, SEM_FN_NAME (iq2000bf
,sw
) },
3424 { IQ2000BF_INSN_BREAK
, SEM_FN_NAME (iq2000bf
,break) },
3425 { IQ2000BF_INSN_SYSCALL
, SEM_FN_NAME (iq2000bf
,syscall
) },
3426 { IQ2000BF_INSN_ANDOUI
, SEM_FN_NAME (iq2000bf
,andoui
) },
3427 { IQ2000BF_INSN_ORUI
, SEM_FN_NAME (iq2000bf
,orui
) },
3428 { IQ2000BF_INSN_BGTZ
, SEM_FN_NAME (iq2000bf
,bgtz
) },
3429 { IQ2000BF_INSN_BGTZL
, SEM_FN_NAME (iq2000bf
,bgtzl
) },
3430 { IQ2000BF_INSN_BLEZ
, SEM_FN_NAME (iq2000bf
,blez
) },
3431 { IQ2000BF_INSN_BLEZL
, SEM_FN_NAME (iq2000bf
,blezl
) },
3432 { IQ2000BF_INSN_MRGB
, SEM_FN_NAME (iq2000bf
,mrgb
) },
3433 { IQ2000BF_INSN_BCTXT
, SEM_FN_NAME (iq2000bf
,bctxt
) },
3434 { IQ2000BF_INSN_BC0F
, SEM_FN_NAME (iq2000bf
,bc0f
) },
3435 { IQ2000BF_INSN_BC0FL
, SEM_FN_NAME (iq2000bf
,bc0fl
) },
3436 { IQ2000BF_INSN_BC3F
, SEM_FN_NAME (iq2000bf
,bc3f
) },
3437 { IQ2000BF_INSN_BC3FL
, SEM_FN_NAME (iq2000bf
,bc3fl
) },
3438 { IQ2000BF_INSN_BC0T
, SEM_FN_NAME (iq2000bf
,bc0t
) },
3439 { IQ2000BF_INSN_BC0TL
, SEM_FN_NAME (iq2000bf
,bc0tl
) },
3440 { IQ2000BF_INSN_BC3T
, SEM_FN_NAME (iq2000bf
,bc3t
) },
3441 { IQ2000BF_INSN_BC3TL
, SEM_FN_NAME (iq2000bf
,bc3tl
) },
3442 { IQ2000BF_INSN_CFC0
, SEM_FN_NAME (iq2000bf
,cfc0
) },
3443 { IQ2000BF_INSN_CFC1
, SEM_FN_NAME (iq2000bf
,cfc1
) },
3444 { IQ2000BF_INSN_CFC2
, SEM_FN_NAME (iq2000bf
,cfc2
) },
3445 { IQ2000BF_INSN_CFC3
, SEM_FN_NAME (iq2000bf
,cfc3
) },
3446 { IQ2000BF_INSN_CHKHDR
, SEM_FN_NAME (iq2000bf
,chkhdr
) },
3447 { IQ2000BF_INSN_CTC0
, SEM_FN_NAME (iq2000bf
,ctc0
) },
3448 { IQ2000BF_INSN_CTC1
, SEM_FN_NAME (iq2000bf
,ctc1
) },
3449 { IQ2000BF_INSN_CTC2
, SEM_FN_NAME (iq2000bf
,ctc2
) },
3450 { IQ2000BF_INSN_CTC3
, SEM_FN_NAME (iq2000bf
,ctc3
) },
3451 { IQ2000BF_INSN_JCR
, SEM_FN_NAME (iq2000bf
,jcr
) },
3452 { IQ2000BF_INSN_LUC32
, SEM_FN_NAME (iq2000bf
,luc32
) },
3453 { IQ2000BF_INSN_LUC32L
, SEM_FN_NAME (iq2000bf
,luc32l
) },
3454 { IQ2000BF_INSN_LUC64
, SEM_FN_NAME (iq2000bf
,luc64
) },
3455 { IQ2000BF_INSN_LUC64L
, SEM_FN_NAME (iq2000bf
,luc64l
) },
3456 { IQ2000BF_INSN_LUK
, SEM_FN_NAME (iq2000bf
,luk
) },
3457 { IQ2000BF_INSN_LULCK
, SEM_FN_NAME (iq2000bf
,lulck
) },
3458 { IQ2000BF_INSN_LUM32
, SEM_FN_NAME (iq2000bf
,lum32
) },
3459 { IQ2000BF_INSN_LUM32L
, SEM_FN_NAME (iq2000bf
,lum32l
) },
3460 { IQ2000BF_INSN_LUM64
, SEM_FN_NAME (iq2000bf
,lum64
) },
3461 { IQ2000BF_INSN_LUM64L
, SEM_FN_NAME (iq2000bf
,lum64l
) },
3462 { IQ2000BF_INSN_LUR
, SEM_FN_NAME (iq2000bf
,lur
) },
3463 { IQ2000BF_INSN_LURL
, SEM_FN_NAME (iq2000bf
,lurl
) },
3464 { IQ2000BF_INSN_LUULCK
, SEM_FN_NAME (iq2000bf
,luulck
) },
3465 { IQ2000BF_INSN_MFC0
, SEM_FN_NAME (iq2000bf
,mfc0
) },
3466 { IQ2000BF_INSN_MFC1
, SEM_FN_NAME (iq2000bf
,mfc1
) },
3467 { IQ2000BF_INSN_MFC2
, SEM_FN_NAME (iq2000bf
,mfc2
) },
3468 { IQ2000BF_INSN_MFC3
, SEM_FN_NAME (iq2000bf
,mfc3
) },
3469 { IQ2000BF_INSN_MTC0
, SEM_FN_NAME (iq2000bf
,mtc0
) },
3470 { IQ2000BF_INSN_MTC1
, SEM_FN_NAME (iq2000bf
,mtc1
) },
3471 { IQ2000BF_INSN_MTC2
, SEM_FN_NAME (iq2000bf
,mtc2
) },
3472 { IQ2000BF_INSN_MTC3
, SEM_FN_NAME (iq2000bf
,mtc3
) },
3473 { IQ2000BF_INSN_PKRL
, SEM_FN_NAME (iq2000bf
,pkrl
) },
3474 { IQ2000BF_INSN_PKRLR1
, SEM_FN_NAME (iq2000bf
,pkrlr1
) },
3475 { IQ2000BF_INSN_PKRLR30
, SEM_FN_NAME (iq2000bf
,pkrlr30
) },
3476 { IQ2000BF_INSN_RB
, SEM_FN_NAME (iq2000bf
,rb
) },
3477 { IQ2000BF_INSN_RBR1
, SEM_FN_NAME (iq2000bf
,rbr1
) },
3478 { IQ2000BF_INSN_RBR30
, SEM_FN_NAME (iq2000bf
,rbr30
) },
3479 { IQ2000BF_INSN_RFE
, SEM_FN_NAME (iq2000bf
,rfe
) },
3480 { IQ2000BF_INSN_RX
, SEM_FN_NAME (iq2000bf
,rx
) },
3481 { IQ2000BF_INSN_RXR1
, SEM_FN_NAME (iq2000bf
,rxr1
) },
3482 { IQ2000BF_INSN_RXR30
, SEM_FN_NAME (iq2000bf
,rxr30
) },
3483 { IQ2000BF_INSN_SLEEP
, SEM_FN_NAME (iq2000bf
,sleep
) },
3484 { IQ2000BF_INSN_SRRD
, SEM_FN_NAME (iq2000bf
,srrd
) },
3485 { IQ2000BF_INSN_SRRDL
, SEM_FN_NAME (iq2000bf
,srrdl
) },
3486 { IQ2000BF_INSN_SRULCK
, SEM_FN_NAME (iq2000bf
,srulck
) },
3487 { IQ2000BF_INSN_SRWR
, SEM_FN_NAME (iq2000bf
,srwr
) },
3488 { IQ2000BF_INSN_SRWRU
, SEM_FN_NAME (iq2000bf
,srwru
) },
3489 { IQ2000BF_INSN_TRAPQFL
, SEM_FN_NAME (iq2000bf
,trapqfl
) },
3490 { IQ2000BF_INSN_TRAPQNE
, SEM_FN_NAME (iq2000bf
,trapqne
) },
3491 { IQ2000BF_INSN_TRAPREL
, SEM_FN_NAME (iq2000bf
,traprel
) },
3492 { IQ2000BF_INSN_WB
, SEM_FN_NAME (iq2000bf
,wb
) },
3493 { IQ2000BF_INSN_WBU
, SEM_FN_NAME (iq2000bf
,wbu
) },
3494 { IQ2000BF_INSN_WBR1
, SEM_FN_NAME (iq2000bf
,wbr1
) },
3495 { IQ2000BF_INSN_WBR1U
, SEM_FN_NAME (iq2000bf
,wbr1u
) },
3496 { IQ2000BF_INSN_WBR30
, SEM_FN_NAME (iq2000bf
,wbr30
) },
3497 { IQ2000BF_INSN_WBR30U
, SEM_FN_NAME (iq2000bf
,wbr30u
) },
3498 { IQ2000BF_INSN_WX
, SEM_FN_NAME (iq2000bf
,wx
) },
3499 { IQ2000BF_INSN_WXU
, SEM_FN_NAME (iq2000bf
,wxu
) },
3500 { IQ2000BF_INSN_WXR1
, SEM_FN_NAME (iq2000bf
,wxr1
) },
3501 { IQ2000BF_INSN_WXR1U
, SEM_FN_NAME (iq2000bf
,wxr1u
) },
3502 { IQ2000BF_INSN_WXR30
, SEM_FN_NAME (iq2000bf
,wxr30
) },
3503 { IQ2000BF_INSN_WXR30U
, SEM_FN_NAME (iq2000bf
,wxr30u
) },
3504 { IQ2000BF_INSN_LDW
, SEM_FN_NAME (iq2000bf
,ldw
) },
3505 { IQ2000BF_INSN_SDW
, SEM_FN_NAME (iq2000bf
,sdw
) },
3506 { IQ2000BF_INSN_J
, SEM_FN_NAME (iq2000bf
,j
) },
3507 { IQ2000BF_INSN_JAL
, SEM_FN_NAME (iq2000bf
,jal
) },
3508 { IQ2000BF_INSN_BMB
, SEM_FN_NAME (iq2000bf
,bmb
) },
3512 /* Add the semantic fns to IDESC_TABLE. */
3515 SEM_FN_NAME (iq2000bf
,init_idesc_table
) (SIM_CPU
*current_cpu
)
3517 IDESC
*idesc_table
= CPU_IDESC (current_cpu
);
3518 const struct sem_fn_desc
*sf
;
3519 int mach_num
= MACH_NUM (CPU_MACH (current_cpu
));
3521 for (sf
= &sem_fns
[0]; sf
->fn
!= 0; ++sf
)
3523 const CGEN_INSN
*insn
= idesc_table
[sf
->index
].idata
;
3524 int valid_p
= (CGEN_INSN_VIRTUAL_P (insn
)
3525 || CGEN_INSN_MACH_HAS_P (insn
, mach_num
));
3528 idesc_table
[sf
->index
].sem_fast
= sf
->fn
;
3530 idesc_table
[sf
->index
].sem_fast
= SEM_FN_NAME (iq2000bf
,x_invalid
);
3533 idesc_table
[sf
->index
].sem_full
= sf
->fn
;
3535 idesc_table
[sf
->index
].sem_full
= SEM_FN_NAME (iq2000bf
,x_invalid
);