1 /* Simulator instruction operand reader for m32r.
3 This file is machine generated with CGEN.
5 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
7 This file is part of the GNU Simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
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.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 /* The labels have the case they have because the enum of insn types
29 is all uppercase and in the non-stdc case the fmt symbol is built
32 The order here must match the order in m32rx_decode_vars in decode.c. */
34 static void *labels
[] = {
35 && case_read_READ_ILLEGAL
,
36 && case_read_READ_FMT_ADD
,
37 && case_read_READ_FMT_ADD3
,
38 && case_read_READ_FMT_ADD
,
39 && case_read_READ_FMT_AND3
,
40 && case_read_READ_FMT_ADD
,
41 && case_read_READ_FMT_OR3
,
42 && case_read_READ_FMT_ADD
,
43 && case_read_READ_FMT_AND3
,
44 && case_read_READ_FMT_ADDI
,
45 && case_read_READ_FMT_ADDV
,
46 && case_read_READ_FMT_ADDV3
,
47 && case_read_READ_FMT_ADDX
,
48 && case_read_READ_FMT_BC8
,
49 && case_read_READ_FMT_BC24
,
50 && case_read_READ_FMT_BEQ
,
51 && case_read_READ_FMT_BEQZ
,
52 && case_read_READ_FMT_BEQZ
,
53 && case_read_READ_FMT_BEQZ
,
54 && case_read_READ_FMT_BEQZ
,
55 && case_read_READ_FMT_BEQZ
,
56 && case_read_READ_FMT_BEQZ
,
57 && case_read_READ_FMT_BL8
,
58 && case_read_READ_FMT_BL24
,
59 && case_read_READ_FMT_BCL8
,
60 && case_read_READ_FMT_BCL24
,
61 && case_read_READ_FMT_BC8
,
62 && case_read_READ_FMT_BC24
,
63 && case_read_READ_FMT_BEQ
,
64 && case_read_READ_FMT_BRA8
,
65 && case_read_READ_FMT_BRA24
,
66 && case_read_READ_FMT_BCL8
,
67 && case_read_READ_FMT_BCL24
,
68 && case_read_READ_FMT_CMP
,
69 && case_read_READ_FMT_CMPI
,
70 && case_read_READ_FMT_CMP
,
71 && case_read_READ_FMT_CMPI
,
72 && case_read_READ_FMT_CMP
,
73 && case_read_READ_FMT_CMPZ
,
74 && case_read_READ_FMT_DIV
,
75 && case_read_READ_FMT_DIV
,
76 && case_read_READ_FMT_DIV
,
77 && case_read_READ_FMT_DIV
,
78 && case_read_READ_FMT_DIV
,
79 && case_read_READ_FMT_JC
,
80 && case_read_READ_FMT_JC
,
81 && case_read_READ_FMT_JL
,
82 && case_read_READ_FMT_JMP
,
83 && case_read_READ_FMT_LD
,
84 && case_read_READ_FMT_LD_D
,
85 && case_read_READ_FMT_LDB
,
86 && case_read_READ_FMT_LDB_D
,
87 && case_read_READ_FMT_LDH
,
88 && case_read_READ_FMT_LDH_D
,
89 && case_read_READ_FMT_LDB
,
90 && case_read_READ_FMT_LDB_D
,
91 && case_read_READ_FMT_LDH
,
92 && case_read_READ_FMT_LDH_D
,
93 && case_read_READ_FMT_LD_PLUS
,
94 && case_read_READ_FMT_LD24
,
95 && case_read_READ_FMT_LDI8
,
96 && case_read_READ_FMT_LDI16
,
97 && case_read_READ_FMT_LOCK
,
98 && case_read_READ_FMT_MACHI_A
,
99 && case_read_READ_FMT_MACHI_A
,
100 && case_read_READ_FMT_MACWHI
,
101 && case_read_READ_FMT_MACWHI
,
102 && case_read_READ_FMT_ADD
,
103 && case_read_READ_FMT_MULHI_A
,
104 && case_read_READ_FMT_MULHI_A
,
105 && case_read_READ_FMT_MULWHI
,
106 && case_read_READ_FMT_MULWHI
,
107 && case_read_READ_FMT_MV
,
108 && case_read_READ_FMT_MVFACHI_A
,
109 && case_read_READ_FMT_MVFACHI_A
,
110 && case_read_READ_FMT_MVFACHI_A
,
111 && case_read_READ_FMT_MVFC
,
112 && case_read_READ_FMT_MVTACHI_A
,
113 && case_read_READ_FMT_MVTACHI_A
,
114 && case_read_READ_FMT_MVTC
,
115 && case_read_READ_FMT_MV
,
116 && case_read_READ_FMT_NOP
,
117 && case_read_READ_FMT_MV
,
118 && case_read_READ_FMT_RAC_DSI
,
119 && case_read_READ_FMT_RAC_DSI
,
120 && case_read_READ_FMT_RTE
,
121 && case_read_READ_FMT_SETH
,
122 && case_read_READ_FMT_ADD
,
123 && case_read_READ_FMT_SLL3
,
124 && case_read_READ_FMT_SLLI
,
125 && case_read_READ_FMT_ADD
,
126 && case_read_READ_FMT_SLL3
,
127 && case_read_READ_FMT_SLLI
,
128 && case_read_READ_FMT_ADD
,
129 && case_read_READ_FMT_SLL3
,
130 && case_read_READ_FMT_SLLI
,
131 && case_read_READ_FMT_ST
,
132 && case_read_READ_FMT_ST_D
,
133 && case_read_READ_FMT_STB
,
134 && case_read_READ_FMT_STB_D
,
135 && case_read_READ_FMT_STH
,
136 && case_read_READ_FMT_STH_D
,
137 && case_read_READ_FMT_ST_PLUS
,
138 && case_read_READ_FMT_ST_PLUS
,
139 && case_read_READ_FMT_ADD
,
140 && case_read_READ_FMT_ADDV
,
141 && case_read_READ_FMT_ADDX
,
142 && case_read_READ_FMT_TRAP
,
143 && case_read_READ_FMT_UNLOCK
,
144 && case_read_READ_FMT_SATB
,
145 && case_read_READ_FMT_SATB
,
146 && case_read_READ_FMT_SAT
,
147 && case_read_READ_FMT_CMPZ
,
148 && case_read_READ_FMT_SADD
,
149 && case_read_READ_FMT_MACWU1
,
150 && case_read_READ_FMT_MACWHI
,
151 && case_read_READ_FMT_MULWU1
,
152 && case_read_READ_FMT_MACWU1
,
153 && case_read_READ_FMT_SC
,
154 && case_read_READ_FMT_SC
,
157 extern DECODE
*m32rx_decode_vars
[];
160 for (i
= 0; m32rx_decode_vars
[i
] != 0; ++i
)
161 m32rx_decode_vars
[i
]->read
= labels
[i
];
163 #endif /* DEFINE_LABELS */
169 SWITCH (read
, decode
->read
)
172 CASE (read
, READ_ILLEGAL
) :
174 sim_engine_illegal_insn (current_cpu
, NULL_CIA
/*FIXME*/);
178 CASE (read
, READ_FMT_ADD
) : /* e.g. add $dr,$sr */
180 #define OPRND(f) par_exec->operands.fmt_add.f
181 EXTRACT_FMT_ADD_VARS
/* f-op1 f-r1 f-op2 f-r2 */
184 /* Fetch the input operands for the semantic handler. */
185 OPRND (dr
) = CPU (h_gr
[f_r1
]);
186 OPRND (sr
) = CPU (h_gr
[f_r2
]);
191 CASE (read
, READ_FMT_ADD3
) : /* e.g. add3 $dr,$sr,$hash$slo16 */
193 #define OPRND(f) par_exec->operands.fmt_add3.f
194 EXTRACT_FMT_ADD3_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
195 EXTRACT_FMT_ADD3_CODE
197 /* Fetch the input operands for the semantic handler. */
198 OPRND (slo16
) = f_simm16
;
199 OPRND (sr
) = CPU (h_gr
[f_r2
]);
204 CASE (read
, READ_FMT_AND3
) : /* e.g. and3 $dr,$sr,$uimm16 */
206 #define OPRND(f) par_exec->operands.fmt_and3.f
207 EXTRACT_FMT_AND3_VARS
/* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
208 EXTRACT_FMT_AND3_CODE
210 /* Fetch the input operands for the semantic handler. */
211 OPRND (sr
) = CPU (h_gr
[f_r2
]);
212 OPRND (uimm16
) = f_uimm16
;
217 CASE (read
, READ_FMT_OR3
) : /* e.g. or3 $dr,$sr,$hash$ulo16 */
219 #define OPRND(f) par_exec->operands.fmt_or3.f
220 EXTRACT_FMT_OR3_VARS
/* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
223 /* Fetch the input operands for the semantic handler. */
224 OPRND (sr
) = CPU (h_gr
[f_r2
]);
225 OPRND (ulo16
) = f_uimm16
;
230 CASE (read
, READ_FMT_ADDI
) : /* e.g. addi $dr,$simm8 */
232 #define OPRND(f) par_exec->operands.fmt_addi.f
233 EXTRACT_FMT_ADDI_VARS
/* f-op1 f-r1 f-simm8 */
234 EXTRACT_FMT_ADDI_CODE
236 /* Fetch the input operands for the semantic handler. */
237 OPRND (dr
) = CPU (h_gr
[f_r1
]);
238 OPRND (simm8
) = f_simm8
;
243 CASE (read
, READ_FMT_ADDV
) : /* e.g. addv $dr,$sr */
245 #define OPRND(f) par_exec->operands.fmt_addv.f
246 EXTRACT_FMT_ADDV_VARS
/* f-op1 f-r1 f-op2 f-r2 */
247 EXTRACT_FMT_ADDV_CODE
249 /* Fetch the input operands for the semantic handler. */
250 OPRND (dr
) = CPU (h_gr
[f_r1
]);
251 OPRND (sr
) = CPU (h_gr
[f_r2
]);
256 CASE (read
, READ_FMT_ADDV3
) : /* e.g. addv3 $dr,$sr,$simm16 */
258 #define OPRND(f) par_exec->operands.fmt_addv3.f
259 EXTRACT_FMT_ADDV3_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
260 EXTRACT_FMT_ADDV3_CODE
262 /* Fetch the input operands for the semantic handler. */
263 OPRND (simm16
) = f_simm16
;
264 OPRND (sr
) = CPU (h_gr
[f_r2
]);
269 CASE (read
, READ_FMT_ADDX
) : /* e.g. addx $dr,$sr */
271 #define OPRND(f) par_exec->operands.fmt_addx.f
272 EXTRACT_FMT_ADDX_VARS
/* f-op1 f-r1 f-op2 f-r2 */
273 EXTRACT_FMT_ADDX_CODE
275 /* Fetch the input operands for the semantic handler. */
276 OPRND (condbit
) = CPU (h_cond
);
277 OPRND (dr
) = CPU (h_gr
[f_r1
]);
278 OPRND (sr
) = CPU (h_gr
[f_r2
]);
283 CASE (read
, READ_FMT_BC8
) : /* e.g. bc $disp8 */
285 #define OPRND(f) par_exec->operands.fmt_bc8.f
286 EXTRACT_FMT_BC8_VARS
/* f-op1 f-r1 f-disp8 */
289 /* Fetch the input operands for the semantic handler. */
290 OPRND (condbit
) = CPU (h_cond
);
291 RECORD_IADDR (OPRND (disp8
), (pc
& -4L) + f_disp8
);
296 CASE (read
, READ_FMT_BC24
) : /* e.g. bc $disp24 */
298 #define OPRND(f) par_exec->operands.fmt_bc24.f
299 EXTRACT_FMT_BC24_VARS
/* f-op1 f-r1 f-disp24 */
300 EXTRACT_FMT_BC24_CODE
302 /* Fetch the input operands for the semantic handler. */
303 OPRND (condbit
) = CPU (h_cond
);
304 OPRND (disp24
) = pc
+ f_disp24
;
309 CASE (read
, READ_FMT_BEQ
) : /* e.g. beq $src1,$src2,$disp16 */
311 #define OPRND(f) par_exec->operands.fmt_beq.f
312 EXTRACT_FMT_BEQ_VARS
/* f-op1 f-r1 f-op2 f-r2 f-disp16 */
315 /* Fetch the input operands for the semantic handler. */
316 OPRND (disp16
) = pc
+ f_disp16
;
317 OPRND (src1
) = CPU (h_gr
[f_r1
]);
318 OPRND (src2
) = CPU (h_gr
[f_r2
]);
323 CASE (read
, READ_FMT_BEQZ
) : /* e.g. beqz $src2,$disp16 */
325 #define OPRND(f) par_exec->operands.fmt_beqz.f
326 EXTRACT_FMT_BEQZ_VARS
/* f-op1 f-r1 f-op2 f-r2 f-disp16 */
327 EXTRACT_FMT_BEQZ_CODE
329 /* Fetch the input operands for the semantic handler. */
330 OPRND (disp16
) = pc
+ f_disp16
;
331 OPRND (src2
) = CPU (h_gr
[f_r2
]);
336 CASE (read
, READ_FMT_BL8
) : /* e.g. bl $disp8 */
338 #define OPRND(f) par_exec->operands.fmt_bl8.f
339 EXTRACT_FMT_BL8_VARS
/* f-op1 f-r1 f-disp8 */
342 /* Fetch the input operands for the semantic handler. */
343 RECORD_IADDR (OPRND (disp8
), (pc
& -4L) + f_disp8
);
344 OPRND (pc
) = CPU (h_pc
);
349 CASE (read
, READ_FMT_BL24
) : /* e.g. bl $disp24 */
351 #define OPRND(f) par_exec->operands.fmt_bl24.f
352 EXTRACT_FMT_BL24_VARS
/* f-op1 f-r1 f-disp24 */
353 EXTRACT_FMT_BL24_CODE
355 /* Fetch the input operands for the semantic handler. */
356 OPRND (disp24
) = pc
+ f_disp24
;
357 OPRND (pc
) = CPU (h_pc
);
362 CASE (read
, READ_FMT_BCL8
) : /* e.g. bcl $disp8 */
364 #define OPRND(f) par_exec->operands.fmt_bcl8.f
365 EXTRACT_FMT_BCL8_VARS
/* f-op1 f-r1 f-disp8 */
366 EXTRACT_FMT_BCL8_CODE
368 /* Fetch the input operands for the semantic handler. */
369 OPRND (condbit
) = CPU (h_cond
);
370 RECORD_IADDR (OPRND (disp8
), (pc
& -4L) + f_disp8
);
371 OPRND (pc
) = CPU (h_pc
);
376 CASE (read
, READ_FMT_BCL24
) : /* e.g. bcl $disp24 */
378 #define OPRND(f) par_exec->operands.fmt_bcl24.f
379 EXTRACT_FMT_BCL24_VARS
/* f-op1 f-r1 f-disp24 */
380 EXTRACT_FMT_BCL24_CODE
382 /* Fetch the input operands for the semantic handler. */
383 OPRND (condbit
) = CPU (h_cond
);
384 OPRND (disp24
) = pc
+ f_disp24
;
385 OPRND (pc
) = CPU (h_pc
);
390 CASE (read
, READ_FMT_BRA8
) : /* e.g. bra $disp8 */
392 #define OPRND(f) par_exec->operands.fmt_bra8.f
393 EXTRACT_FMT_BRA8_VARS
/* f-op1 f-r1 f-disp8 */
394 EXTRACT_FMT_BRA8_CODE
396 /* Fetch the input operands for the semantic handler. */
397 RECORD_IADDR (OPRND (disp8
), (pc
& -4L) + f_disp8
);
402 CASE (read
, READ_FMT_BRA24
) : /* e.g. bra $disp24 */
404 #define OPRND(f) par_exec->operands.fmt_bra24.f
405 EXTRACT_FMT_BRA24_VARS
/* f-op1 f-r1 f-disp24 */
406 EXTRACT_FMT_BRA24_CODE
408 /* Fetch the input operands for the semantic handler. */
409 OPRND (disp24
) = pc
+ f_disp24
;
414 CASE (read
, READ_FMT_CMP
) : /* e.g. cmp $src1,$src2 */
416 #define OPRND(f) par_exec->operands.fmt_cmp.f
417 EXTRACT_FMT_CMP_VARS
/* f-op1 f-r1 f-op2 f-r2 */
420 /* Fetch the input operands for the semantic handler. */
421 OPRND (src1
) = CPU (h_gr
[f_r1
]);
422 OPRND (src2
) = CPU (h_gr
[f_r2
]);
427 CASE (read
, READ_FMT_CMPI
) : /* e.g. cmpi $src2,$simm16 */
429 #define OPRND(f) par_exec->operands.fmt_cmpi.f
430 EXTRACT_FMT_CMPI_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
431 EXTRACT_FMT_CMPI_CODE
433 /* Fetch the input operands for the semantic handler. */
434 OPRND (simm16
) = f_simm16
;
435 OPRND (src2
) = CPU (h_gr
[f_r2
]);
440 CASE (read
, READ_FMT_CMPZ
) : /* e.g. cmpz $src2 */
442 #define OPRND(f) par_exec->operands.fmt_cmpz.f
443 EXTRACT_FMT_CMPZ_VARS
/* f-op1 f-r1 f-op2 f-r2 */
444 EXTRACT_FMT_CMPZ_CODE
446 /* Fetch the input operands for the semantic handler. */
447 OPRND (src2
) = CPU (h_gr
[f_r2
]);
452 CASE (read
, READ_FMT_DIV
) : /* e.g. div $dr,$sr */
454 #define OPRND(f) par_exec->operands.fmt_div.f
455 EXTRACT_FMT_DIV_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
458 /* Fetch the input operands for the semantic handler. */
459 OPRND (dr
) = CPU (h_gr
[f_r1
]);
460 OPRND (sr
) = CPU (h_gr
[f_r2
]);
465 CASE (read
, READ_FMT_JC
) : /* e.g. jc $sr */
467 #define OPRND(f) par_exec->operands.fmt_jc.f
468 EXTRACT_FMT_JC_VARS
/* f-op1 f-r1 f-op2 f-r2 */
471 /* Fetch the input operands for the semantic handler. */
472 OPRND (condbit
) = CPU (h_cond
);
473 OPRND (sr
) = CPU (h_gr
[f_r2
]);
478 CASE (read
, READ_FMT_JL
) : /* e.g. jl $sr */
480 #define OPRND(f) par_exec->operands.fmt_jl.f
481 EXTRACT_FMT_JL_VARS
/* f-op1 f-r1 f-op2 f-r2 */
484 /* Fetch the input operands for the semantic handler. */
485 OPRND (pc
) = CPU (h_pc
);
486 OPRND (sr
) = CPU (h_gr
[f_r2
]);
491 CASE (read
, READ_FMT_JMP
) : /* e.g. jmp $sr */
493 #define OPRND(f) par_exec->operands.fmt_jmp.f
494 EXTRACT_FMT_JMP_VARS
/* f-op1 f-r1 f-op2 f-r2 */
497 /* Fetch the input operands for the semantic handler. */
498 OPRND (sr
) = CPU (h_gr
[f_r2
]);
503 CASE (read
, READ_FMT_LD
) : /* e.g. ld $dr,@$sr */
505 #define OPRND(f) par_exec->operands.fmt_ld.f
506 EXTRACT_FMT_LD_VARS
/* f-op1 f-r1 f-op2 f-r2 */
509 /* Fetch the input operands for the semantic handler. */
510 OPRND (h_memory_sr
) = GETMEMSI (current_cpu
, CPU (h_gr
[f_r2
]));
511 OPRND (sr
) = CPU (h_gr
[f_r2
]);
516 CASE (read
, READ_FMT_LD_D
) : /* e.g. ld $dr,@($slo16,$sr) */
518 #define OPRND(f) par_exec->operands.fmt_ld_d.f
519 EXTRACT_FMT_LD_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
520 EXTRACT_FMT_LD_D_CODE
522 /* Fetch the input operands for the semantic handler. */
523 OPRND (h_memory_add_WI_sr_slo16
) = GETMEMSI (current_cpu
, ADDSI (CPU (h_gr
[f_r2
]), f_simm16
));
524 OPRND (slo16
) = f_simm16
;
525 OPRND (sr
) = CPU (h_gr
[f_r2
]);
530 CASE (read
, READ_FMT_LDB
) : /* e.g. ldb $dr,@$sr */
532 #define OPRND(f) par_exec->operands.fmt_ldb.f
533 EXTRACT_FMT_LDB_VARS
/* f-op1 f-r1 f-op2 f-r2 */
536 /* Fetch the input operands for the semantic handler. */
537 OPRND (h_memory_sr
) = GETMEMQI (current_cpu
, CPU (h_gr
[f_r2
]));
538 OPRND (sr
) = CPU (h_gr
[f_r2
]);
543 CASE (read
, READ_FMT_LDB_D
) : /* e.g. ldb $dr,@($slo16,$sr) */
545 #define OPRND(f) par_exec->operands.fmt_ldb_d.f
546 EXTRACT_FMT_LDB_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
547 EXTRACT_FMT_LDB_D_CODE
549 /* Fetch the input operands for the semantic handler. */
550 OPRND (h_memory_add_WI_sr_slo16
) = GETMEMQI (current_cpu
, ADDSI (CPU (h_gr
[f_r2
]), f_simm16
));
551 OPRND (slo16
) = f_simm16
;
552 OPRND (sr
) = CPU (h_gr
[f_r2
]);
557 CASE (read
, READ_FMT_LDH
) : /* e.g. ldh $dr,@$sr */
559 #define OPRND(f) par_exec->operands.fmt_ldh.f
560 EXTRACT_FMT_LDH_VARS
/* f-op1 f-r1 f-op2 f-r2 */
563 /* Fetch the input operands for the semantic handler. */
564 OPRND (h_memory_sr
) = GETMEMHI (current_cpu
, CPU (h_gr
[f_r2
]));
565 OPRND (sr
) = CPU (h_gr
[f_r2
]);
570 CASE (read
, READ_FMT_LDH_D
) : /* e.g. ldh $dr,@($slo16,$sr) */
572 #define OPRND(f) par_exec->operands.fmt_ldh_d.f
573 EXTRACT_FMT_LDH_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
574 EXTRACT_FMT_LDH_D_CODE
576 /* Fetch the input operands for the semantic handler. */
577 OPRND (h_memory_add_WI_sr_slo16
) = GETMEMHI (current_cpu
, ADDSI (CPU (h_gr
[f_r2
]), f_simm16
));
578 OPRND (slo16
) = f_simm16
;
579 OPRND (sr
) = CPU (h_gr
[f_r2
]);
584 CASE (read
, READ_FMT_LD_PLUS
) : /* e.g. ld $dr,@$sr+ */
586 #define OPRND(f) par_exec->operands.fmt_ld_plus.f
587 EXTRACT_FMT_LD_PLUS_VARS
/* f-op1 f-r1 f-op2 f-r2 */
588 EXTRACT_FMT_LD_PLUS_CODE
590 /* Fetch the input operands for the semantic handler. */
591 OPRND (h_memory_sr
) = GETMEMSI (current_cpu
, CPU (h_gr
[f_r2
]));
592 OPRND (sr
) = CPU (h_gr
[f_r2
]);
597 CASE (read
, READ_FMT_LD24
) : /* e.g. ld24 $dr,$uimm24 */
599 #define OPRND(f) par_exec->operands.fmt_ld24.f
600 EXTRACT_FMT_LD24_VARS
/* f-op1 f-r1 f-uimm24 */
601 EXTRACT_FMT_LD24_CODE
603 /* Fetch the input operands for the semantic handler. */
604 OPRND (uimm24
) = f_uimm24
;
609 CASE (read
, READ_FMT_LDI8
) : /* e.g. ldi $dr,$simm8 */
611 #define OPRND(f) par_exec->operands.fmt_ldi8.f
612 EXTRACT_FMT_LDI8_VARS
/* f-op1 f-r1 f-simm8 */
613 EXTRACT_FMT_LDI8_CODE
615 /* Fetch the input operands for the semantic handler. */
616 OPRND (simm8
) = f_simm8
;
621 CASE (read
, READ_FMT_LDI16
) : /* e.g. ldi $dr,$hash$slo16 */
623 #define OPRND(f) par_exec->operands.fmt_ldi16.f
624 EXTRACT_FMT_LDI16_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
625 EXTRACT_FMT_LDI16_CODE
627 /* Fetch the input operands for the semantic handler. */
628 OPRND (slo16
) = f_simm16
;
633 CASE (read
, READ_FMT_LOCK
) : /* e.g. lock $dr,@$sr */
635 #define OPRND(f) par_exec->operands.fmt_lock.f
636 EXTRACT_FMT_LOCK_VARS
/* f-op1 f-r1 f-op2 f-r2 */
637 EXTRACT_FMT_LOCK_CODE
639 /* Fetch the input operands for the semantic handler. */
640 OPRND (h_memory_sr
) = GETMEMSI (current_cpu
, CPU (h_gr
[f_r2
]));
641 OPRND (sr
) = CPU (h_gr
[f_r2
]);
646 CASE (read
, READ_FMT_MACHI_A
) : /* e.g. machi $src1,$src2,$acc */
648 #define OPRND(f) par_exec->operands.fmt_machi_a.f
649 EXTRACT_FMT_MACHI_A_VARS
/* f-op1 f-r1 f-acc f-op23 f-r2 */
650 EXTRACT_FMT_MACHI_A_CODE
652 /* Fetch the input operands for the semantic handler. */
653 OPRND (acc
) = m32rx_h_accums_get (current_cpu
, f_acc
);
654 OPRND (src1
) = CPU (h_gr
[f_r1
]);
655 OPRND (src2
) = CPU (h_gr
[f_r2
]);
660 CASE (read
, READ_FMT_MACWHI
) : /* e.g. macwhi $src1,$src2 */
662 #define OPRND(f) par_exec->operands.fmt_macwhi.f
663 EXTRACT_FMT_MACWHI_VARS
/* f-op1 f-r1 f-op2 f-r2 */
664 EXTRACT_FMT_MACWHI_CODE
666 /* Fetch the input operands for the semantic handler. */
667 OPRND (accum
) = CPU (h_accum
);
668 OPRND (src1
) = CPU (h_gr
[f_r1
]);
669 OPRND (src2
) = CPU (h_gr
[f_r2
]);
674 CASE (read
, READ_FMT_MULHI_A
) : /* e.g. mulhi $src1,$src2,$acc */
676 #define OPRND(f) par_exec->operands.fmt_mulhi_a.f
677 EXTRACT_FMT_MULHI_A_VARS
/* f-op1 f-r1 f-acc f-op23 f-r2 */
678 EXTRACT_FMT_MULHI_A_CODE
680 /* Fetch the input operands for the semantic handler. */
681 OPRND (src1
) = CPU (h_gr
[f_r1
]);
682 OPRND (src2
) = CPU (h_gr
[f_r2
]);
687 CASE (read
, READ_FMT_MULWHI
) : /* e.g. mulwhi $src1,$src2 */
689 #define OPRND(f) par_exec->operands.fmt_mulwhi.f
690 EXTRACT_FMT_MULWHI_VARS
/* f-op1 f-r1 f-op2 f-r2 */
691 EXTRACT_FMT_MULWHI_CODE
693 /* Fetch the input operands for the semantic handler. */
694 OPRND (src1
) = CPU (h_gr
[f_r1
]);
695 OPRND (src2
) = CPU (h_gr
[f_r2
]);
700 CASE (read
, READ_FMT_MV
) : /* e.g. mv $dr,$sr */
702 #define OPRND(f) par_exec->operands.fmt_mv.f
703 EXTRACT_FMT_MV_VARS
/* f-op1 f-r1 f-op2 f-r2 */
706 /* Fetch the input operands for the semantic handler. */
707 OPRND (sr
) = CPU (h_gr
[f_r2
]);
712 CASE (read
, READ_FMT_MVFACHI_A
) : /* e.g. mvfachi $dr,$accs */
714 #define OPRND(f) par_exec->operands.fmt_mvfachi_a.f
715 EXTRACT_FMT_MVFACHI_A_VARS
/* f-op1 f-r1 f-op2 f-accs f-op3 */
716 EXTRACT_FMT_MVFACHI_A_CODE
718 /* Fetch the input operands for the semantic handler. */
719 OPRND (accs
) = m32rx_h_accums_get (current_cpu
, f_accs
);
724 CASE (read
, READ_FMT_MVFC
) : /* e.g. mvfc $dr,$scr */
726 #define OPRND(f) par_exec->operands.fmt_mvfc.f
727 EXTRACT_FMT_MVFC_VARS
/* f-op1 f-r1 f-op2 f-r2 */
728 EXTRACT_FMT_MVFC_CODE
730 /* Fetch the input operands for the semantic handler. */
731 OPRND (scr
) = m32rx_h_cr_get (current_cpu
, f_r2
);
736 CASE (read
, READ_FMT_MVTACHI_A
) : /* e.g. mvtachi $src1,$accs */
738 #define OPRND(f) par_exec->operands.fmt_mvtachi_a.f
739 EXTRACT_FMT_MVTACHI_A_VARS
/* f-op1 f-r1 f-op2 f-accs f-op3 */
740 EXTRACT_FMT_MVTACHI_A_CODE
742 /* Fetch the input operands for the semantic handler. */
743 OPRND (accs
) = m32rx_h_accums_get (current_cpu
, f_accs
);
744 OPRND (src1
) = CPU (h_gr
[f_r1
]);
749 CASE (read
, READ_FMT_MVTC
) : /* e.g. mvtc $sr,$dcr */
751 #define OPRND(f) par_exec->operands.fmt_mvtc.f
752 EXTRACT_FMT_MVTC_VARS
/* f-op1 f-r1 f-op2 f-r2 */
753 EXTRACT_FMT_MVTC_CODE
755 /* Fetch the input operands for the semantic handler. */
756 OPRND (sr
) = CPU (h_gr
[f_r2
]);
761 CASE (read
, READ_FMT_NOP
) : /* e.g. nop */
763 #define OPRND(f) par_exec->operands.fmt_nop.f
764 EXTRACT_FMT_NOP_VARS
/* f-op1 f-r1 f-op2 f-r2 */
767 /* Fetch the input operands for the semantic handler. */
772 CASE (read
, READ_FMT_RAC_DSI
) : /* e.g. rac $accd,$accs,$imm1 */
774 #define OPRND(f) par_exec->operands.fmt_rac_dsi.f
775 EXTRACT_FMT_RAC_DSI_VARS
/* f-op1 f-accd f-bits67 f-op2 f-accs f-bit14 f-imm1 */
776 EXTRACT_FMT_RAC_DSI_CODE
778 /* Fetch the input operands for the semantic handler. */
779 OPRND (accs
) = m32rx_h_accums_get (current_cpu
, f_accs
);
780 OPRND (imm1
) = f_imm1
;
785 CASE (read
, READ_FMT_RTE
) : /* e.g. rte */
787 #define OPRND(f) par_exec->operands.fmt_rte.f
788 EXTRACT_FMT_RTE_VARS
/* f-op1 f-r1 f-op2 f-r2 */
791 /* Fetch the input operands for the semantic handler. */
792 OPRND (h_bcond_0
) = CPU (h_bcond
);
793 OPRND (h_bie_0
) = CPU (h_bie
);
794 OPRND (h_bpc_0
) = CPU (h_bpc
);
795 OPRND (h_bsm_0
) = CPU (h_bsm
);
800 CASE (read
, READ_FMT_SETH
) : /* e.g. seth $dr,$hash$hi16 */
802 #define OPRND(f) par_exec->operands.fmt_seth.f
803 EXTRACT_FMT_SETH_VARS
/* f-op1 f-r1 f-op2 f-r2 f-hi16 */
804 EXTRACT_FMT_SETH_CODE
806 /* Fetch the input operands for the semantic handler. */
807 OPRND (hi16
) = f_hi16
;
812 CASE (read
, READ_FMT_SLL3
) : /* e.g. sll3 $dr,$sr,$simm16 */
814 #define OPRND(f) par_exec->operands.fmt_sll3.f
815 EXTRACT_FMT_SLL3_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
816 EXTRACT_FMT_SLL3_CODE
818 /* Fetch the input operands for the semantic handler. */
819 OPRND (simm16
) = f_simm16
;
820 OPRND (sr
) = CPU (h_gr
[f_r2
]);
825 CASE (read
, READ_FMT_SLLI
) : /* e.g. slli $dr,$uimm5 */
827 #define OPRND(f) par_exec->operands.fmt_slli.f
828 EXTRACT_FMT_SLLI_VARS
/* f-op1 f-r1 f-shift-op2 f-uimm5 */
829 EXTRACT_FMT_SLLI_CODE
831 /* Fetch the input operands for the semantic handler. */
832 OPRND (dr
) = CPU (h_gr
[f_r1
]);
833 OPRND (uimm5
) = f_uimm5
;
838 CASE (read
, READ_FMT_ST
) : /* e.g. st $src1,@$src2 */
840 #define OPRND(f) par_exec->operands.fmt_st.f
841 EXTRACT_FMT_ST_VARS
/* f-op1 f-r1 f-op2 f-r2 */
844 /* Fetch the input operands for the semantic handler. */
845 OPRND (src1
) = CPU (h_gr
[f_r1
]);
846 OPRND (src2
) = CPU (h_gr
[f_r2
]);
851 CASE (read
, READ_FMT_ST_D
) : /* e.g. st $src1,@($slo16,$src2) */
853 #define OPRND(f) par_exec->operands.fmt_st_d.f
854 EXTRACT_FMT_ST_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
855 EXTRACT_FMT_ST_D_CODE
857 /* Fetch the input operands for the semantic handler. */
858 OPRND (slo16
) = f_simm16
;
859 OPRND (src1
) = CPU (h_gr
[f_r1
]);
860 OPRND (src2
) = CPU (h_gr
[f_r2
]);
865 CASE (read
, READ_FMT_STB
) : /* e.g. stb $src1,@$src2 */
867 #define OPRND(f) par_exec->operands.fmt_stb.f
868 EXTRACT_FMT_STB_VARS
/* f-op1 f-r1 f-op2 f-r2 */
871 /* Fetch the input operands for the semantic handler. */
872 OPRND (src1
) = CPU (h_gr
[f_r1
]);
873 OPRND (src2
) = CPU (h_gr
[f_r2
]);
878 CASE (read
, READ_FMT_STB_D
) : /* e.g. stb $src1,@($slo16,$src2) */
880 #define OPRND(f) par_exec->operands.fmt_stb_d.f
881 EXTRACT_FMT_STB_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
882 EXTRACT_FMT_STB_D_CODE
884 /* Fetch the input operands for the semantic handler. */
885 OPRND (slo16
) = f_simm16
;
886 OPRND (src1
) = CPU (h_gr
[f_r1
]);
887 OPRND (src2
) = CPU (h_gr
[f_r2
]);
892 CASE (read
, READ_FMT_STH
) : /* e.g. sth $src1,@$src2 */
894 #define OPRND(f) par_exec->operands.fmt_sth.f
895 EXTRACT_FMT_STH_VARS
/* f-op1 f-r1 f-op2 f-r2 */
898 /* Fetch the input operands for the semantic handler. */
899 OPRND (src1
) = CPU (h_gr
[f_r1
]);
900 OPRND (src2
) = CPU (h_gr
[f_r2
]);
905 CASE (read
, READ_FMT_STH_D
) : /* e.g. sth $src1,@($slo16,$src2) */
907 #define OPRND(f) par_exec->operands.fmt_sth_d.f
908 EXTRACT_FMT_STH_D_VARS
/* f-op1 f-r1 f-op2 f-r2 f-simm16 */
909 EXTRACT_FMT_STH_D_CODE
911 /* Fetch the input operands for the semantic handler. */
912 OPRND (slo16
) = f_simm16
;
913 OPRND (src1
) = CPU (h_gr
[f_r1
]);
914 OPRND (src2
) = CPU (h_gr
[f_r2
]);
919 CASE (read
, READ_FMT_ST_PLUS
) : /* e.g. st $src1,@+$src2 */
921 #define OPRND(f) par_exec->operands.fmt_st_plus.f
922 EXTRACT_FMT_ST_PLUS_VARS
/* f-op1 f-r1 f-op2 f-r2 */
923 EXTRACT_FMT_ST_PLUS_CODE
925 /* Fetch the input operands for the semantic handler. */
926 OPRND (src1
) = CPU (h_gr
[f_r1
]);
927 OPRND (src2
) = CPU (h_gr
[f_r2
]);
932 CASE (read
, READ_FMT_TRAP
) : /* e.g. trap $uimm4 */
934 #define OPRND(f) par_exec->operands.fmt_trap.f
935 EXTRACT_FMT_TRAP_VARS
/* f-op1 f-r1 f-op2 f-uimm4 */
936 EXTRACT_FMT_TRAP_CODE
938 /* Fetch the input operands for the semantic handler. */
939 OPRND (pc
) = CPU (h_pc
);
940 OPRND (h_cr_0
) = m32rx_h_cr_get (current_cpu
, 0);
941 OPRND (uimm4
) = f_uimm4
;
946 CASE (read
, READ_FMT_UNLOCK
) : /* e.g. unlock $src1,@$src2 */
948 #define OPRND(f) par_exec->operands.fmt_unlock.f
949 EXTRACT_FMT_UNLOCK_VARS
/* f-op1 f-r1 f-op2 f-r2 */
950 EXTRACT_FMT_UNLOCK_CODE
952 /* Fetch the input operands for the semantic handler. */
953 OPRND (h_lock_0
) = CPU (h_lock
);
954 OPRND (src1
) = CPU (h_gr
[f_r1
]);
955 OPRND (src2
) = CPU (h_gr
[f_r2
]);
960 CASE (read
, READ_FMT_SATB
) : /* e.g. satb $dr,$sr */
962 #define OPRND(f) par_exec->operands.fmt_satb.f
963 EXTRACT_FMT_SATB_VARS
/* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
964 EXTRACT_FMT_SATB_CODE
966 /* Fetch the input operands for the semantic handler. */
967 OPRND (sr
) = CPU (h_gr
[f_r2
]);
972 CASE (read
, READ_FMT_SAT
) : /* e.g. sat $dr,$sr */
974 #define OPRND(f) par_exec->operands.fmt_sat.f
975 EXTRACT_FMT_SAT_VARS
/* f-op1 f-r1 f-op2 f-r2 f-uimm16 */
978 /* Fetch the input operands for the semantic handler. */
979 OPRND (condbit
) = CPU (h_cond
);
980 OPRND (sr
) = CPU (h_gr
[f_r2
]);
985 CASE (read
, READ_FMT_SADD
) : /* e.g. sadd */
987 #define OPRND(f) par_exec->operands.fmt_sadd.f
988 EXTRACT_FMT_SADD_VARS
/* f-op1 f-r1 f-op2 f-r2 */
989 EXTRACT_FMT_SADD_CODE
991 /* Fetch the input operands for the semantic handler. */
992 OPRND (h_accums_0
) = m32rx_h_accums_get (current_cpu
, 0);
993 OPRND (h_accums_1
) = m32rx_h_accums_get (current_cpu
, 1);
998 CASE (read
, READ_FMT_MACWU1
) : /* e.g. macwu1 $src1,$src2 */
1000 #define OPRND(f) par_exec->operands.fmt_macwu1.f
1001 EXTRACT_FMT_MACWU1_VARS
/* f-op1 f-r1 f-op2 f-r2 */
1002 EXTRACT_FMT_MACWU1_CODE
1004 /* Fetch the input operands for the semantic handler. */
1005 OPRND (h_accums_1
) = m32rx_h_accums_get (current_cpu
, 1);
1006 OPRND (src1
) = CPU (h_gr
[f_r1
]);
1007 OPRND (src2
) = CPU (h_gr
[f_r2
]);
1012 CASE (read
, READ_FMT_MULWU1
) : /* e.g. mulwu1 $src1,$src2 */
1014 #define OPRND(f) par_exec->operands.fmt_mulwu1.f
1015 EXTRACT_FMT_MULWU1_VARS
/* f-op1 f-r1 f-op2 f-r2 */
1016 EXTRACT_FMT_MULWU1_CODE
1018 /* Fetch the input operands for the semantic handler. */
1019 OPRND (src1
) = CPU (h_gr
[f_r1
]);
1020 OPRND (src2
) = CPU (h_gr
[f_r2
]);
1025 CASE (read
, READ_FMT_SC
) : /* e.g. sc */
1027 #define OPRND(f) par_exec->operands.fmt_sc.f
1028 EXTRACT_FMT_SC_VARS
/* f-op1 f-r1 f-op2 f-r2 */
1031 /* Fetch the input operands for the semantic handler. */
1032 OPRND (condbit
) = CPU (h_cond
);
1038 ENDSWITCH (read
) /* End of read switch. */
1041 #endif /* DEFINE_SWITCH */