1 /* CPU family header for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2004 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.
25 #ifndef CPU_CRISV10F_H
26 #define CPU_CRISV10F_H
28 /* Maximum number of instructions that are fetched at a time.
29 This is for LIW type instructions sets (e.g. m32r). */
30 #define MAX_LIW_INSNS 1
32 /* Maximum number of instructions that can be executed in parallel. */
33 #define MAX_PARALLEL_INSNS 1
35 /* CPU state information. */
37 /* Hardware elements. */
41 #define GET_H_PC() CPU (h_pc)
44 CPU (h_pc) = ANDSI ((x), (~ (1)));\
46 /* General purpose registers */
48 #define GET_H_GR_REAL_PC(a1) CPU (h_gr_real_pc)[a1]
49 #define SET_H_GR_REAL_PC(a1, x) (CPU (h_gr_real_pc)[a1] = (x))
50 /* Special registers for v10 */
52 #define GET_H_SR_V10(index) (ORIF (ORIF (((index) == (((UINT) 0))), ((index) == (((UINT) 4)))), ((index) == (((UINT) 8))))) ? (0) : (((index) == (((UINT) 1)))) ? (10) : (ORIF (((index) == (((UINT) 5))), ((index) == (((UINT) 13))))) ? (ORSI (ANDSI (CPU (h_sr_v10[((UINT) 5)]), 0xffffff00), ORSI (ZEXTBISI (CPU (h_cbit)), ORSI (SLLSI (ZEXTBISI (CPU (h_vbit)), 1), ORSI (SLLSI (ZEXTBISI (CPU (h_zbit)), 2), ORSI (SLLSI (ZEXTBISI (CPU (h_nbit)), 3), ORSI (SLLSI (ZEXTBISI (CPU (h_xbit)), 4), ORSI (SLLSI (ZEXTBISI (GET_H_IBIT ()), 5), ORSI (SLLSI (ZEXTBISI (GET_H_UBIT ()), 6), ORSI (SLLSI (ZEXTBISI (CPU (h_pbit)), 7), 0)))))))))) : (CPU (h_sr_v10[index]))
53 #define SET_H_SR_V10(index, x) \
55 if (ORIF (ORIF ((((index)) == (((UINT) 0))), (((index)) == (((UINT) 4)))), ORIF ((((index)) == (((UINT) 8))), (((index)) == (((UINT) 1)))))) {\
58 else if (ORIF ((((index)) == (((UINT) 5))), (((index)) == (((UINT) 13))))) {\
60 CPU (h_cbit) = ((NESI (ANDSI ((x), ((1) << (0))), 0)) ? (1) : (0));\
61 CPU (h_vbit) = ((NESI (ANDSI ((x), ((1) << (1))), 0)) ? (1) : (0));\
62 CPU (h_zbit) = ((NESI (ANDSI ((x), ((1) << (2))), 0)) ? (1) : (0));\
63 CPU (h_nbit) = ((NESI (ANDSI ((x), ((1) << (3))), 0)) ? (1) : (0));\
64 CPU (h_xbit) = ((NESI (ANDSI ((x), ((1) << (4))), 0)) ? (1) : (0));\
65 SET_H_IBIT (((NESI (ANDSI ((x), ((1) << (5))), 0)) ? (1) : (0)));\
66 SET_H_UBIT (((NESI (ANDSI ((x), ((1) << (6))), 0)) ? (1) : (0)));\
67 CPU (h_pbit) = ((NESI (ANDSI ((x), ((1) << (7))), 0)) ? (1) : (0));\
68 CPU (h_sr_v10[((UINT) 5)]) = (x);\
69 CPU (h_sr_v10[((UINT) 13)]) = (x);\
73 CPU (h_sr_v10[(index)]) = (x);\
78 #define GET_H_CBIT() CPU (h_cbit)
79 #define SET_H_CBIT(x) (CPU (h_cbit) = (x))
82 #define GET_H_VBIT() CPU (h_vbit)
83 #define SET_H_VBIT(x) (CPU (h_vbit) = (x))
86 #define GET_H_ZBIT() CPU (h_zbit)
87 #define SET_H_ZBIT(x) (CPU (h_zbit) = (x))
90 #define GET_H_NBIT() CPU (h_nbit)
91 #define SET_H_NBIT(x) (CPU (h_nbit) = (x))
92 /* extended-arithmetic bit */
94 #define GET_H_XBIT() CPU (h_xbit)
95 #define SET_H_XBIT(x) (CPU (h_xbit) = (x))
96 /* interrupt-enable bit */
98 #define GET_H_IBIT_PRE_V32() CPU (h_ibit_pre_v32)
99 #define SET_H_IBIT_PRE_V32(x) (CPU (h_ibit_pre_v32) = (x))
100 /* sequence-broken bit */
102 #define GET_H_PBIT() CPU (h_pbit)
103 #define SET_H_PBIT(x) (CPU (h_pbit) = (x))
106 #define GET_H_UBIT_PRE_V32() CPU (h_ubit_pre_v32)
107 #define SET_H_UBIT_PRE_V32(x) (CPU (h_ubit_pre_v32) = (x))
108 /* instruction-is-prefixed bit */
109 BI h_insn_prefixed_p_pre_v32;
110 #define GET_H_INSN_PREFIXED_P_PRE_V32() CPU (h_insn_prefixed_p_pre_v32)
111 #define SET_H_INSN_PREFIXED_P_PRE_V32(x) (CPU (h_insn_prefixed_p_pre_v32) = (x))
112 /* Prefix-address register */
113 SI h_prefixreg_pre_v32;
114 #define GET_H_PREFIXREG_PRE_V32() CPU (h_prefixreg_pre_v32)
115 #define SET_H_PREFIXREG_PRE_V32(x) (CPU (h_prefixreg_pre_v32) = (x))
117 #define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
122 #define GET_H_V32_NON_V32() 0
123 #define SET_H_V32_NON_V32(x) \
125 cgen_rtx_error (current_cpu, "Can't set h-v32");\
127 #define GET_H_GR(index) GET_H_GR_PC (index)
128 #define SET_H_GR(index, x) \
130 SET_H_GR_PC ((index), (x));\
132 #define GET_H_GR_PC(index) ((((index) == (15))) ? ((cgen_rtx_error (current_cpu, "General register read of PC is not implemented."), 0)) : (CPU (h_gr_real_pc[index])))
133 #define SET_H_GR_PC(index, x) \
136 if ((((index)) == (15))) {\
137 cgen_rtx_error (current_cpu, "General register write to PC is not implemented.");\
139 CPU (h_gr_real_pc[(index)]) = (x);\
142 #define GET_H_RAW_GR_PC(index) CPU (h_gr_real_pc[index])
143 #define SET_H_RAW_GR_PC(index, x) \
145 CPU (h_gr_real_pc[(index)]) = (x);\
147 #define GET_H_SR(index) GET_H_SR_V10 (index)
148 #define SET_H_SR(index, x) \
150 SET_H_SR_V10 ((index), (x));\
152 #define GET_H_CBIT_MOVE() GET_H_CBIT_MOVE_PRE_V32 ()
153 #define SET_H_CBIT_MOVE(x) \
155 SET_H_CBIT_MOVE_PRE_V32 ((x));\
157 #define GET_H_CBIT_MOVE_PRE_V32() CPU (h_cbit)
158 #define SET_H_CBIT_MOVE_PRE_V32(x) \
162 #define GET_H_VBIT_MOVE() GET_H_VBIT_MOVE_PRE_V32 ()
163 #define SET_H_VBIT_MOVE(x) \
165 SET_H_VBIT_MOVE_PRE_V32 ((x));\
167 #define GET_H_VBIT_MOVE_PRE_V32() CPU (h_vbit)
168 #define SET_H_VBIT_MOVE_PRE_V32(x) \
172 #define GET_H_ZBIT_MOVE() GET_H_ZBIT_MOVE_PRE_V32 ()
173 #define SET_H_ZBIT_MOVE(x) \
175 SET_H_ZBIT_MOVE_PRE_V32 ((x));\
177 #define GET_H_ZBIT_MOVE_PRE_V32() CPU (h_zbit)
178 #define SET_H_ZBIT_MOVE_PRE_V32(x) \
182 #define GET_H_NBIT_MOVE() GET_H_NBIT_MOVE_PRE_V32 ()
183 #define SET_H_NBIT_MOVE(x) \
185 SET_H_NBIT_MOVE_PRE_V32 ((x));\
187 #define GET_H_NBIT_MOVE_PRE_V32() CPU (h_nbit)
188 #define SET_H_NBIT_MOVE_PRE_V32(x) \
192 #define GET_H_IBIT() CPU (h_ibit_pre_v32)
193 #define SET_H_IBIT(x) \
195 CPU (h_ibit_pre_v32) = (x);\
197 #define GET_H_UBIT() CPU (h_ubit_pre_v32)
198 #define SET_H_UBIT(x) \
200 CPU (h_ubit_pre_v32) = (x);\
202 #define GET_H_INSN_PREFIXED_P() CPU (h_insn_prefixed_p_pre_v32)
203 #define SET_H_INSN_PREFIXED_P(x) \
205 CPU (h_insn_prefixed_p_pre_v32) = (x);\
208 /* Cover fns for register access. */
209 BI crisv10f_h_v32_non_v32_get (SIM_CPU *);
210 void crisv10f_h_v32_non_v32_set (SIM_CPU *, BI);
211 USI crisv10f_h_pc_get (SIM_CPU *);
212 void crisv10f_h_pc_set (SIM_CPU *, USI);
213 SI crisv10f_h_gr_get (SIM_CPU *, UINT);
214 void crisv10f_h_gr_set (SIM_CPU *, UINT, SI);
215 SI crisv10f_h_gr_pc_get (SIM_CPU *, UINT);
216 void crisv10f_h_gr_pc_set (SIM_CPU *, UINT, SI);
217 SI crisv10f_h_gr_real_pc_get (SIM_CPU *, UINT);
218 void crisv10f_h_gr_real_pc_set (SIM_CPU *, UINT, SI);
219 SI crisv10f_h_raw_gr_pc_get (SIM_CPU *, UINT);
220 void crisv10f_h_raw_gr_pc_set (SIM_CPU *, UINT, SI);
221 SI crisv10f_h_sr_get (SIM_CPU *, UINT);
222 void crisv10f_h_sr_set (SIM_CPU *, UINT, SI);
223 SI crisv10f_h_sr_v10_get (SIM_CPU *, UINT);
224 void crisv10f_h_sr_v10_set (SIM_CPU *, UINT, SI);
225 BI crisv10f_h_cbit_get (SIM_CPU *);
226 void crisv10f_h_cbit_set (SIM_CPU *, BI);
227 BI crisv10f_h_cbit_move_get (SIM_CPU *);
228 void crisv10f_h_cbit_move_set (SIM_CPU *, BI);
229 BI crisv10f_h_cbit_move_pre_v32_get (SIM_CPU *);
230 void crisv10f_h_cbit_move_pre_v32_set (SIM_CPU *, BI);
231 BI crisv10f_h_vbit_get (SIM_CPU *);
232 void crisv10f_h_vbit_set (SIM_CPU *, BI);
233 BI crisv10f_h_vbit_move_get (SIM_CPU *);
234 void crisv10f_h_vbit_move_set (SIM_CPU *, BI);
235 BI crisv10f_h_vbit_move_pre_v32_get (SIM_CPU *);
236 void crisv10f_h_vbit_move_pre_v32_set (SIM_CPU *, BI);
237 BI crisv10f_h_zbit_get (SIM_CPU *);
238 void crisv10f_h_zbit_set (SIM_CPU *, BI);
239 BI crisv10f_h_zbit_move_get (SIM_CPU *);
240 void crisv10f_h_zbit_move_set (SIM_CPU *, BI);
241 BI crisv10f_h_zbit_move_pre_v32_get (SIM_CPU *);
242 void crisv10f_h_zbit_move_pre_v32_set (SIM_CPU *, BI);
243 BI crisv10f_h_nbit_get (SIM_CPU *);
244 void crisv10f_h_nbit_set (SIM_CPU *, BI);
245 BI crisv10f_h_nbit_move_get (SIM_CPU *);
246 void crisv10f_h_nbit_move_set (SIM_CPU *, BI);
247 BI crisv10f_h_nbit_move_pre_v32_get (SIM_CPU *);
248 void crisv10f_h_nbit_move_pre_v32_set (SIM_CPU *, BI);
249 BI crisv10f_h_xbit_get (SIM_CPU *);
250 void crisv10f_h_xbit_set (SIM_CPU *, BI);
251 BI crisv10f_h_ibit_get (SIM_CPU *);
252 void crisv10f_h_ibit_set (SIM_CPU *, BI);
253 BI crisv10f_h_ibit_pre_v32_get (SIM_CPU *);
254 void crisv10f_h_ibit_pre_v32_set (SIM_CPU *, BI);
255 BI crisv10f_h_pbit_get (SIM_CPU *);
256 void crisv10f_h_pbit_set (SIM_CPU *, BI);
257 BI crisv10f_h_ubit_get (SIM_CPU *);
258 void crisv10f_h_ubit_set (SIM_CPU *, BI);
259 BI crisv10f_h_ubit_pre_v32_get (SIM_CPU *);
260 void crisv10f_h_ubit_pre_v32_set (SIM_CPU *, BI);
261 BI crisv10f_h_insn_prefixed_p_get (SIM_CPU *);
262 void crisv10f_h_insn_prefixed_p_set (SIM_CPU *, BI);
263 BI crisv10f_h_insn_prefixed_p_pre_v32_get (SIM_CPU *);
264 void crisv10f_h_insn_prefixed_p_pre_v32_set (SIM_CPU *, BI);
265 SI crisv10f_h_prefixreg_pre_v32_get (SIM_CPU *);
266 void crisv10f_h_prefixreg_pre_v32_set (SIM_CPU *, SI);
268 /* These must be hand-written. */
269 extern CPUREG_FETCH_FN crisv10f_fetch_register;
270 extern CPUREG_STORE_FN crisv10f_store_register;
274 } MODEL_CRISV10_DATA;
276 /* Instruction argument buffer. */
279 struct { /* no operands */
289 IADDR i_o_word_pcrel;
302 INT f_indir_pc__dword;
304 unsigned char out_Pd;
305 } sfmt_move_c_sprv10_p8;
307 INT f_indir_pc__word;
309 unsigned char out_Pd;
310 } sfmt_move_c_sprv10_p4;
312 INT f_indir_pc__byte;
314 unsigned char out_Pd;
315 } sfmt_move_c_sprv10_p0;
319 unsigned char out_Rd;
322 INT f_indir_pc__dword;
325 unsigned char out_Rd;
328 INT f_indir_pc__word;
331 unsigned char out_Rd;
334 INT f_indir_pc__byte;
337 unsigned char out_Rd;
343 unsigned char out_Rd;
349 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
352 INT f_indir_pc__dword;
355 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
358 INT f_indir_pc__word;
361 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
364 INT f_indir_pc__byte;
367 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
373 unsigned char out_h_gr_SI_index_of__DFLT_Rs;
374 } sfmt_move_spr_rv10;
379 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
386 unsigned char out_h_gr_SI_index_of__DFLT_Rd;
393 unsigned char out_Rd;
394 unsigned char out_h_sr_SI_7;
402 unsigned char out_Rs;
403 } sfmt_move_spr_mv10;
409 unsigned char out_Pd;
410 unsigned char out_Rs;
411 } sfmt_move_m_sprv10;
418 unsigned char out_Rd;
419 unsigned char out_Rs;
427 unsigned char out_Rs;
428 unsigned char out_h_gr_SI_if__SI_andif__DFLT_prefix_set_not__DFLT_inc_index_of__DFLT_Rs_index_of__DFLT_Rd;
436 unsigned char out_Rs;
437 unsigned char out_h_gr_SI_0;
438 unsigned char out_h_gr_SI_1;
439 unsigned char out_h_gr_SI_10;
440 unsigned char out_h_gr_SI_11;
441 unsigned char out_h_gr_SI_12;
442 unsigned char out_h_gr_SI_13;
443 unsigned char out_h_gr_SI_14;
444 unsigned char out_h_gr_SI_2;
445 unsigned char out_h_gr_SI_3;
446 unsigned char out_h_gr_SI_4;
447 unsigned char out_h_gr_SI_5;
448 unsigned char out_h_gr_SI_6;
449 unsigned char out_h_gr_SI_7;
450 unsigned char out_h_gr_SI_8;
451 unsigned char out_h_gr_SI_9;
459 unsigned char in_h_gr_SI_0;
460 unsigned char in_h_gr_SI_1;
461 unsigned char in_h_gr_SI_10;
462 unsigned char in_h_gr_SI_11;
463 unsigned char in_h_gr_SI_12;
464 unsigned char in_h_gr_SI_13;
465 unsigned char in_h_gr_SI_14;
466 unsigned char in_h_gr_SI_15;
467 unsigned char in_h_gr_SI_2;
468 unsigned char in_h_gr_SI_3;
469 unsigned char in_h_gr_SI_4;
470 unsigned char in_h_gr_SI_5;
471 unsigned char in_h_gr_SI_6;
472 unsigned char in_h_gr_SI_7;
473 unsigned char in_h_gr_SI_8;
474 unsigned char in_h_gr_SI_9;
475 unsigned char out_Rs;
478 /* Writeback handler. */
480 /* Pointer to argbuf entry for insn whose results need writing back. */
481 const struct argbuf *abuf;
483 /* x-before handler */
485 /*const SCACHE *insns[MAX_PARALLEL_INSNS];*/
488 /* x-after handler */
492 /* This entry is used to terminate each pbb. */
494 /* Number of insns in pbb. */
496 /* Next pbb to execute. */
498 SCACHE *branch_target;
503 /* The ARGBUF struct. */
505 /* These are the baseclass definitions. */
510 /* ??? Temporary hack for skip insns. */
513 /* cpu specific data follows */
516 union sem_fields fields;
521 ??? SCACHE used to contain more than just argbuf. We could delete the
522 type entirely and always just use ARGBUF, but for future concerns and as
523 a level of abstraction it is left in. */
526 struct argbuf argbuf;
529 /* Macros to simplify extraction, reading and semantic code.
530 These define and assign the local vars that contain the insn's fields. */
532 #define EXTRACT_IFMT_EMPTY_VARS \
534 #define EXTRACT_IFMT_EMPTY_CODE \
537 #define EXTRACT_IFMT_NOP_VARS \
544 #define EXTRACT_IFMT_NOP_CODE \
546 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
547 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
548 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
549 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
550 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
552 #define EXTRACT_IFMT_MOVE_B_R_VARS \
559 #define EXTRACT_IFMT_MOVE_B_R_CODE \
561 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
562 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
563 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
564 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
565 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
567 #define EXTRACT_IFMT_MOVEPCR_VARS \
574 #define EXTRACT_IFMT_MOVEPCR_CODE \
576 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
577 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
578 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
579 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
580 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
582 #define EXTRACT_IFMT_MOVEQ_VARS \
588 #define EXTRACT_IFMT_MOVEQ_CODE \
590 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
591 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
592 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
593 f_s6 = EXTRACT_LSB0_INT (insn, 16, 5, 6); \
595 #define EXTRACT_IFMT_MOVECBR_VARS \
597 INT f_indir_pc__byte; \
602 /* Contents of trailing part of insn. */ \
605 #define EXTRACT_IFMT_MOVECBR_CODE \
607 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
608 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
609 f_indir_pc__byte = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
610 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
611 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
612 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
613 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
615 #define EXTRACT_IFMT_MOVECWR_VARS \
617 INT f_indir_pc__word; \
622 /* Contents of trailing part of insn. */ \
625 #define EXTRACT_IFMT_MOVECWR_CODE \
627 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
628 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
629 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
630 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
631 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
632 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
633 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
635 #define EXTRACT_IFMT_MOVECDR_VARS \
636 INT f_indir_pc__dword; \
642 /* Contents of trailing part of insn. */ \
645 #define EXTRACT_IFMT_MOVECDR_CODE \
647 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
648 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
649 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
650 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
651 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
652 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
653 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
655 #define EXTRACT_IFMT_MOVUCBR_VARS \
657 INT f_indir_pc__byte; \
662 /* Contents of trailing part of insn. */ \
665 #define EXTRACT_IFMT_MOVUCBR_CODE \
667 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
668 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
669 f_indir_pc__byte = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
670 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
671 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
672 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
673 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
675 #define EXTRACT_IFMT_MOVUCWR_VARS \
677 INT f_indir_pc__word; \
682 /* Contents of trailing part of insn. */ \
685 #define EXTRACT_IFMT_MOVUCWR_CODE \
687 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
688 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
689 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
690 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
691 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
692 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
693 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
695 #define EXTRACT_IFMT_ADDQ_VARS \
701 #define EXTRACT_IFMT_ADDQ_CODE \
703 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
704 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
705 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
706 f_u6 = EXTRACT_LSB0_UINT (insn, 16, 5, 6); \
708 #define EXTRACT_IFMT_CMP_M_B_M_VARS \
716 #define EXTRACT_IFMT_CMP_M_B_M_CODE \
718 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
719 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
720 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
721 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
722 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
723 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
725 #define EXTRACT_IFMT_MOVE_R_SPRV10_VARS \
732 #define EXTRACT_IFMT_MOVE_R_SPRV10_CODE \
734 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
735 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
736 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
737 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
738 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
740 #define EXTRACT_IFMT_MOVE_SPR_RV10_VARS \
747 #define EXTRACT_IFMT_MOVE_SPR_RV10_CODE \
749 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
750 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
751 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
752 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
753 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
755 #define EXTRACT_IFMT_RET_TYPE_VARS \
762 #define EXTRACT_IFMT_RET_TYPE_CODE \
764 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
765 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
766 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
767 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
768 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
770 #define EXTRACT_IFMT_MOVE_M_SPRV10_VARS \
778 #define EXTRACT_IFMT_MOVE_M_SPRV10_CODE \
780 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
781 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
782 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
783 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
784 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
785 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
787 #define EXTRACT_IFMT_MOVE_C_SPRV10_P0_VARS \
789 INT f_indir_pc__byte; \
794 /* Contents of trailing part of insn. */ \
797 #define EXTRACT_IFMT_MOVE_C_SPRV10_P0_CODE \
799 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
800 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
801 f_indir_pc__byte = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
802 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
803 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
804 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
805 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
807 #define EXTRACT_IFMT_MOVE_C_SPRV10_P4_VARS \
809 INT f_indir_pc__word; \
814 /* Contents of trailing part of insn. */ \
817 #define EXTRACT_IFMT_MOVE_C_SPRV10_P4_CODE \
819 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
820 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
821 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)); \
822 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
823 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
824 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
825 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
827 #define EXTRACT_IFMT_MOVE_C_SPRV10_P8_VARS \
828 INT f_indir_pc__dword; \
834 /* Contents of trailing part of insn. */ \
837 #define EXTRACT_IFMT_MOVE_C_SPRV10_P8_CODE \
839 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
840 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
841 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
842 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
843 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
844 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
845 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
847 #define EXTRACT_IFMT_MOVE_SPR_MV10_VARS \
855 #define EXTRACT_IFMT_MOVE_SPR_MV10_CODE \
857 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
858 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
859 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
860 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
861 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
862 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
864 #define EXTRACT_IFMT_SBFS_VARS \
872 #define EXTRACT_IFMT_SBFS_CODE \
874 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
875 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
876 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
877 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
878 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
879 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
881 #define EXTRACT_IFMT_SWAP_VARS \
888 #define EXTRACT_IFMT_SWAP_CODE \
890 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
891 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
892 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
893 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
894 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
896 #define EXTRACT_IFMT_ASRQ_VARS \
903 #define EXTRACT_IFMT_ASRQ_CODE \
905 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
906 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
907 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
908 f_b5 = EXTRACT_LSB0_UINT (insn, 16, 5, 1); \
909 f_u5 = EXTRACT_LSB0_UINT (insn, 16, 4, 5); \
911 #define EXTRACT_IFMT_SETF_VARS \
919 #define EXTRACT_IFMT_SETF_CODE \
921 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
922 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
923 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
924 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
925 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
926 f_dstsrc = ((((f_operand1) | (((f_operand2) << (4))))) & (255));\
928 #define EXTRACT_IFMT_BCC_B_VARS \
936 #define EXTRACT_IFMT_BCC_B_CODE \
938 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
939 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
940 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
941 f_disp9_hi = EXTRACT_LSB0_INT (insn, 16, 0, 1); \
942 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
946 tmp_abslo = ((f_disp9_lo) << (1));\
947 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
948 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
951 #define EXTRACT_IFMT_BA_B_VARS \
959 #define EXTRACT_IFMT_BA_B_CODE \
961 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
962 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
963 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
964 f_disp9_hi = EXTRACT_LSB0_INT (insn, 16, 0, 1); \
965 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
969 tmp_abslo = ((f_disp9_lo) << (1));\
970 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
971 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
974 #define EXTRACT_IFMT_BCC_W_VARS \
976 SI f_indir_pc__word_pcrel; \
981 /* Contents of trailing part of insn. */ \
984 #define EXTRACT_IFMT_BCC_W_CODE \
986 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
987 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
988 f_indir_pc__word_pcrel = ((EXTHISI (((HI) (UINT) ((0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)))))) + (((pc) + (((GET_H_V32_NON_V32 ()) ? (0) : (4)))))); \
989 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
990 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
991 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
992 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
994 #define EXTRACT_IFMT_BA_W_VARS \
996 SI f_indir_pc__word_pcrel; \
1001 /* Contents of trailing part of insn. */ \
1003 unsigned int length;
1004 #define EXTRACT_IFMT_BA_W_CODE \
1006 word_1 = GETIMEMUHI (current_cpu, pc + 2); \
1007 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1008 f_indir_pc__word_pcrel = ((EXTHISI (((HI) (UINT) ((0|(EXTRACT_LSB0_UINT (word_1, 16, 15, 16) << 0)))))) + (((pc) + (((GET_H_V32_NON_V32 ()) ? (0) : (4)))))); \
1009 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1010 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1011 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1012 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1014 #define EXTRACT_IFMT_JUMP_C_VARS \
1015 INT f_indir_pc__dword; \
1021 /* Contents of trailing part of insn. */ \
1023 unsigned int length;
1024 #define EXTRACT_IFMT_JUMP_C_CODE \
1026 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
1027 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
1028 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1029 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1030 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1031 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1032 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1034 #define EXTRACT_IFMT_BREAK_VARS \
1040 unsigned int length;
1041 #define EXTRACT_IFMT_BREAK_CODE \
1043 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1044 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1045 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1046 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1047 f_u4 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1049 #define EXTRACT_IFMT_SCC_VARS \
1055 unsigned int length;
1056 #define EXTRACT_IFMT_SCC_CODE \
1058 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1059 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1060 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1061 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1062 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1064 #define EXTRACT_IFMT_ADDOQ_VARS \
1069 unsigned int length;
1070 #define EXTRACT_IFMT_ADDOQ_CODE \
1072 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1073 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1074 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1075 f_s8 = EXTRACT_LSB0_INT (insn, 16, 7, 8); \
1077 #define EXTRACT_IFMT_BDAPQPC_VARS \
1082 unsigned int length;
1083 #define EXTRACT_IFMT_BDAPQPC_CODE \
1085 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1086 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1087 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1088 f_s8 = EXTRACT_LSB0_INT (insn, 16, 7, 8); \
1090 /* Collection of various things for the trace handler to use. */
1092 typedef struct trace_record {
1097 #endif /* CPU_CRISV10F_H */