1 /* CPU family header for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2007 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, write to the Free Software Foundation, Inc.,
21 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 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;
298 unsigned char in_h_gr_SI_14;
299 unsigned char out_h_gr_SI_14;
300 } sfmt_move_m_spplus_p8;
307 INT f_indir_pc__dword;
309 unsigned char out_Pd;
310 } sfmt_move_c_sprv10_p9;
312 INT f_indir_pc__word;
314 unsigned char out_Pd;
315 } sfmt_move_c_sprv10_p5;
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 = GETIMEMUSI (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, 32, 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 = GETIMEMUSI (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, 32, 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 = GETIMEMUSI (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, 32, 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 = GETIMEMUSI (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, 32, 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_P5_VARS \
789 INT f_indir_pc__word; \
794 /* Contents of trailing part of insn. */ \
797 #define EXTRACT_IFMT_MOVE_C_SPRV10_P5_CODE \
799 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
800 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
801 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 32, 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_P9_VARS \
808 INT f_indir_pc__dword; \
814 /* Contents of trailing part of insn. */ \
817 #define EXTRACT_IFMT_MOVE_C_SPRV10_P9_CODE \
819 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
820 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
821 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
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_SPR_MV10_VARS \
835 #define EXTRACT_IFMT_MOVE_SPR_MV10_CODE \
837 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
838 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
839 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
840 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
841 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
842 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
844 #define EXTRACT_IFMT_SBFS_VARS \
852 #define EXTRACT_IFMT_SBFS_CODE \
854 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
855 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
856 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
857 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
858 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
859 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
861 #define EXTRACT_IFMT_SWAP_VARS \
868 #define EXTRACT_IFMT_SWAP_CODE \
870 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
871 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
872 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
873 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
874 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
876 #define EXTRACT_IFMT_ASRQ_VARS \
883 #define EXTRACT_IFMT_ASRQ_CODE \
885 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
886 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
887 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
888 f_b5 = EXTRACT_LSB0_UINT (insn, 16, 5, 1); \
889 f_u5 = EXTRACT_LSB0_UINT (insn, 16, 4, 5); \
891 #define EXTRACT_IFMT_SETF_VARS \
899 #define EXTRACT_IFMT_SETF_CODE \
901 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
902 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
903 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
904 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
905 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
906 f_dstsrc = ((((f_operand1) | (((f_operand2) << (4))))) & (255));\
908 #define EXTRACT_IFMT_BCC_B_VARS \
916 #define EXTRACT_IFMT_BCC_B_CODE \
918 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
919 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
920 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
921 f_disp9_hi = EXTRACT_LSB0_INT (insn, 16, 0, 1); \
922 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
926 tmp_abslo = ((f_disp9_lo) << (1));\
927 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
928 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
931 #define EXTRACT_IFMT_BA_B_VARS \
939 #define EXTRACT_IFMT_BA_B_CODE \
941 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
942 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
943 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
944 f_disp9_hi = EXTRACT_LSB0_INT (insn, 16, 0, 1); \
945 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
949 tmp_abslo = ((f_disp9_lo) << (1));\
950 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
951 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
954 #define EXTRACT_IFMT_BCC_W_VARS \
956 SI f_indir_pc__word_pcrel; \
961 /* Contents of trailing part of insn. */ \
964 #define EXTRACT_IFMT_BCC_W_CODE \
966 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
967 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
968 f_indir_pc__word_pcrel = ((EXTHISI (((HI) (UINT) ((0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)))))) + (((pc) + (((GET_H_V32_NON_V32 ()) ? (0) : (4)))))); \
969 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
970 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
971 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
972 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
974 #define EXTRACT_IFMT_BA_W_VARS \
976 SI f_indir_pc__word_pcrel; \
981 /* Contents of trailing part of insn. */ \
984 #define EXTRACT_IFMT_BA_W_CODE \
986 word_1 = GETIMEMUSI (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, 32, 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_JUMP_C_VARS \
995 INT f_indir_pc__dword; \
1001 /* Contents of trailing part of insn. */ \
1003 unsigned int length;
1004 #define EXTRACT_IFMT_JUMP_C_CODE \
1006 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
1007 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
1008 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 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_BREAK_VARS \
1020 unsigned int length;
1021 #define EXTRACT_IFMT_BREAK_CODE \
1023 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1024 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1025 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1026 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1027 f_u4 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1029 #define EXTRACT_IFMT_SCC_VARS \
1035 unsigned int length;
1036 #define EXTRACT_IFMT_SCC_CODE \
1038 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1039 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1040 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1041 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1042 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1044 #define EXTRACT_IFMT_ADDOQ_VARS \
1049 unsigned int length;
1050 #define EXTRACT_IFMT_ADDOQ_CODE \
1052 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1053 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1054 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1055 f_s8 = EXTRACT_LSB0_INT (insn, 16, 7, 8); \
1057 #define EXTRACT_IFMT_BDAPQPC_VARS \
1062 unsigned int length;
1063 #define EXTRACT_IFMT_BDAPQPC_CODE \
1065 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1066 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1067 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1068 f_s8 = EXTRACT_LSB0_INT (insn, 16, 7, 8); \
1070 /* Collection of various things for the trace handler to use. */
1072 typedef struct trace_record {
1077 #endif /* CPU_CRISV10F_H */