1 /* CPU family header for crisv10f.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2019 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 #ifndef CPU_CRISV10F_H
25 #define CPU_CRISV10F_H
27 /* Maximum number of instructions that are fetched at a time.
28 This is for LIW type instructions sets (e.g. m32r). */
29 #define MAX_LIW_INSNS 1
31 /* Maximum number of instructions that can be executed in parallel. */
32 #define MAX_PARALLEL_INSNS 1
34 /* The size of an "int" needed to hold an instruction word.
35 This is usually 32 bits, but some architectures needs 64 bits. */
36 typedef CGEN_INSN_INT CGEN_INSN_WORD
;
38 #include "cgen-engine.h"
40 /* CPU state information. */
42 /* Hardware elements. */
46 #define GET_H_PC() CPU (h_pc)
49 CPU (h_pc) = ANDSI ((x), (~ (1)));\
51 /* General purpose registers */
53 #define GET_H_GR_REAL_PC(a1) CPU (h_gr_real_pc)[a1]
54 #define SET_H_GR_REAL_PC(a1, x) (CPU (h_gr_real_pc)[a1] = (x))
55 /* Special registers for v10 */
57 #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]))
58 #define SET_H_SR_V10(index, x) \
60 if (ORIF (ORIF ((((index)) == (((UINT) 0))), (((index)) == (((UINT) 4)))), ORIF ((((index)) == (((UINT) 8))), (((index)) == (((UINT) 1)))))) {\
63 else if (ORIF ((((index)) == (((UINT) 5))), (((index)) == (((UINT) 13))))) {\
65 CPU (h_cbit) = ((NESI (ANDSI ((x), ((1) << (0))), 0)) ? (1) : (0));\
66 CPU (h_vbit) = ((NESI (ANDSI ((x), ((1) << (1))), 0)) ? (1) : (0));\
67 CPU (h_zbit) = ((NESI (ANDSI ((x), ((1) << (2))), 0)) ? (1) : (0));\
68 CPU (h_nbit) = ((NESI (ANDSI ((x), ((1) << (3))), 0)) ? (1) : (0));\
69 CPU (h_xbit) = ((NESI (ANDSI ((x), ((1) << (4))), 0)) ? (1) : (0));\
70 SET_H_IBIT (((NESI (ANDSI ((x), ((1) << (5))), 0)) ? (1) : (0)));\
71 SET_H_UBIT (((NESI (ANDSI ((x), ((1) << (6))), 0)) ? (1) : (0)));\
72 CPU (h_pbit) = ((NESI (ANDSI ((x), ((1) << (7))), 0)) ? (1) : (0));\
73 CPU (h_sr_v10[((UINT) 5)]) = (x);\
74 CPU (h_sr_v10[((UINT) 13)]) = (x);\
78 CPU (h_sr_v10[(index)]) = (x);\
83 #define GET_H_CBIT() CPU (h_cbit)
84 #define SET_H_CBIT(x) (CPU (h_cbit) = (x))
87 #define GET_H_VBIT() CPU (h_vbit)
88 #define SET_H_VBIT(x) (CPU (h_vbit) = (x))
91 #define GET_H_ZBIT() CPU (h_zbit)
92 #define SET_H_ZBIT(x) (CPU (h_zbit) = (x))
95 #define GET_H_NBIT() CPU (h_nbit)
96 #define SET_H_NBIT(x) (CPU (h_nbit) = (x))
97 /* extended-arithmetic bit */
99 #define GET_H_XBIT() CPU (h_xbit)
100 #define SET_H_XBIT(x) (CPU (h_xbit) = (x))
101 /* interrupt-enable bit */
103 #define GET_H_IBIT_PRE_V32() CPU (h_ibit_pre_v32)
104 #define SET_H_IBIT_PRE_V32(x) (CPU (h_ibit_pre_v32) = (x))
105 /* sequence-broken bit */
107 #define GET_H_PBIT() CPU (h_pbit)
108 #define SET_H_PBIT(x) (CPU (h_pbit) = (x))
111 #define GET_H_UBIT_PRE_V32() CPU (h_ubit_pre_v32)
112 #define SET_H_UBIT_PRE_V32(x) (CPU (h_ubit_pre_v32) = (x))
113 /* instruction-is-prefixed bit */
114 BI h_insn_prefixed_p_pre_v32
;
115 #define GET_H_INSN_PREFIXED_P_PRE_V32() CPU (h_insn_prefixed_p_pre_v32)
116 #define SET_H_INSN_PREFIXED_P_PRE_V32(x) (CPU (h_insn_prefixed_p_pre_v32) = (x))
117 /* Prefix-address register */
118 SI h_prefixreg_pre_v32
;
119 #define GET_H_PREFIXREG_PRE_V32() CPU (h_prefixreg_pre_v32)
120 #define SET_H_PREFIXREG_PRE_V32(x) (CPU (h_prefixreg_pre_v32) = (x))
122 #define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
127 #define GET_H_V32_NON_V32() 0
128 #define SET_H_V32_NON_V32(x) \
130 cgen_rtx_error (current_cpu, "Can't set h-v32");\
132 #define GET_H_GR(index) GET_H_GR_PC (index)
133 #define SET_H_GR(index, x) \
135 SET_H_GR_PC ((index), (x));\
137 #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])))
138 #define SET_H_GR_PC(index, x) \
141 if ((((index)) == (15))) {\
142 cgen_rtx_error (current_cpu, "General register write to PC is not implemented.");\
144 CPU (h_gr_real_pc[(index)]) = (x);\
147 #define GET_H_RAW_GR_PC(index) CPU (h_gr_real_pc[index])
148 #define SET_H_RAW_GR_PC(index, x) \
150 CPU (h_gr_real_pc[(index)]) = (x);\
152 #define GET_H_SR(index) GET_H_SR_V10 (index)
153 #define SET_H_SR(index, x) \
155 SET_H_SR_V10 ((index), (x));\
157 #define GET_H_CBIT_MOVE() GET_H_CBIT_MOVE_PRE_V32 ()
158 #define SET_H_CBIT_MOVE(x) \
160 SET_H_CBIT_MOVE_PRE_V32 ((x));\
162 #define GET_H_CBIT_MOVE_PRE_V32() CPU (h_cbit)
163 #define SET_H_CBIT_MOVE_PRE_V32(x) \
167 #define GET_H_VBIT_MOVE() GET_H_VBIT_MOVE_PRE_V32 ()
168 #define SET_H_VBIT_MOVE(x) \
170 SET_H_VBIT_MOVE_PRE_V32 ((x));\
172 #define GET_H_VBIT_MOVE_PRE_V32() CPU (h_vbit)
173 #define SET_H_VBIT_MOVE_PRE_V32(x) \
177 #define GET_H_ZBIT_MOVE() GET_H_ZBIT_MOVE_PRE_V32 ()
178 #define SET_H_ZBIT_MOVE(x) \
180 SET_H_ZBIT_MOVE_PRE_V32 ((x));\
182 #define GET_H_ZBIT_MOVE_PRE_V32() CPU (h_zbit)
183 #define SET_H_ZBIT_MOVE_PRE_V32(x) \
187 #define GET_H_NBIT_MOVE() GET_H_NBIT_MOVE_PRE_V32 ()
188 #define SET_H_NBIT_MOVE(x) \
190 SET_H_NBIT_MOVE_PRE_V32 ((x));\
192 #define GET_H_NBIT_MOVE_PRE_V32() CPU (h_nbit)
193 #define SET_H_NBIT_MOVE_PRE_V32(x) \
197 #define GET_H_IBIT() CPU (h_ibit_pre_v32)
198 #define SET_H_IBIT(x) \
200 CPU (h_ibit_pre_v32) = (x);\
202 #define GET_H_UBIT() CPU (h_ubit_pre_v32)
203 #define SET_H_UBIT(x) \
205 CPU (h_ubit_pre_v32) = (x);\
207 #define GET_H_INSN_PREFIXED_P() CPU (h_insn_prefixed_p_pre_v32)
208 #define SET_H_INSN_PREFIXED_P(x) \
210 CPU (h_insn_prefixed_p_pre_v32) = (x);\
213 /* Cover fns for register access. */
214 BI
crisv10f_h_v32_non_v32_get (SIM_CPU
*);
215 void crisv10f_h_v32_non_v32_set (SIM_CPU
*, BI
);
216 USI
crisv10f_h_pc_get (SIM_CPU
*);
217 void crisv10f_h_pc_set (SIM_CPU
*, USI
);
218 SI
crisv10f_h_gr_get (SIM_CPU
*, UINT
);
219 void crisv10f_h_gr_set (SIM_CPU
*, UINT
, SI
);
220 SI
crisv10f_h_gr_pc_get (SIM_CPU
*, UINT
);
221 void crisv10f_h_gr_pc_set (SIM_CPU
*, UINT
, SI
);
222 SI
crisv10f_h_gr_real_pc_get (SIM_CPU
*, UINT
);
223 void crisv10f_h_gr_real_pc_set (SIM_CPU
*, UINT
, SI
);
224 SI
crisv10f_h_raw_gr_pc_get (SIM_CPU
*, UINT
);
225 void crisv10f_h_raw_gr_pc_set (SIM_CPU
*, UINT
, SI
);
226 SI
crisv10f_h_sr_get (SIM_CPU
*, UINT
);
227 void crisv10f_h_sr_set (SIM_CPU
*, UINT
, SI
);
228 SI
crisv10f_h_sr_v10_get (SIM_CPU
*, UINT
);
229 void crisv10f_h_sr_v10_set (SIM_CPU
*, UINT
, SI
);
230 BI
crisv10f_h_cbit_get (SIM_CPU
*);
231 void crisv10f_h_cbit_set (SIM_CPU
*, BI
);
232 BI
crisv10f_h_cbit_move_get (SIM_CPU
*);
233 void crisv10f_h_cbit_move_set (SIM_CPU
*, BI
);
234 BI
crisv10f_h_cbit_move_pre_v32_get (SIM_CPU
*);
235 void crisv10f_h_cbit_move_pre_v32_set (SIM_CPU
*, BI
);
236 BI
crisv10f_h_vbit_get (SIM_CPU
*);
237 void crisv10f_h_vbit_set (SIM_CPU
*, BI
);
238 BI
crisv10f_h_vbit_move_get (SIM_CPU
*);
239 void crisv10f_h_vbit_move_set (SIM_CPU
*, BI
);
240 BI
crisv10f_h_vbit_move_pre_v32_get (SIM_CPU
*);
241 void crisv10f_h_vbit_move_pre_v32_set (SIM_CPU
*, BI
);
242 BI
crisv10f_h_zbit_get (SIM_CPU
*);
243 void crisv10f_h_zbit_set (SIM_CPU
*, BI
);
244 BI
crisv10f_h_zbit_move_get (SIM_CPU
*);
245 void crisv10f_h_zbit_move_set (SIM_CPU
*, BI
);
246 BI
crisv10f_h_zbit_move_pre_v32_get (SIM_CPU
*);
247 void crisv10f_h_zbit_move_pre_v32_set (SIM_CPU
*, BI
);
248 BI
crisv10f_h_nbit_get (SIM_CPU
*);
249 void crisv10f_h_nbit_set (SIM_CPU
*, BI
);
250 BI
crisv10f_h_nbit_move_get (SIM_CPU
*);
251 void crisv10f_h_nbit_move_set (SIM_CPU
*, BI
);
252 BI
crisv10f_h_nbit_move_pre_v32_get (SIM_CPU
*);
253 void crisv10f_h_nbit_move_pre_v32_set (SIM_CPU
*, BI
);
254 BI
crisv10f_h_xbit_get (SIM_CPU
*);
255 void crisv10f_h_xbit_set (SIM_CPU
*, BI
);
256 BI
crisv10f_h_ibit_get (SIM_CPU
*);
257 void crisv10f_h_ibit_set (SIM_CPU
*, BI
);
258 BI
crisv10f_h_ibit_pre_v32_get (SIM_CPU
*);
259 void crisv10f_h_ibit_pre_v32_set (SIM_CPU
*, BI
);
260 BI
crisv10f_h_pbit_get (SIM_CPU
*);
261 void crisv10f_h_pbit_set (SIM_CPU
*, BI
);
262 BI
crisv10f_h_ubit_get (SIM_CPU
*);
263 void crisv10f_h_ubit_set (SIM_CPU
*, BI
);
264 BI
crisv10f_h_ubit_pre_v32_get (SIM_CPU
*);
265 void crisv10f_h_ubit_pre_v32_set (SIM_CPU
*, BI
);
266 BI
crisv10f_h_insn_prefixed_p_get (SIM_CPU
*);
267 void crisv10f_h_insn_prefixed_p_set (SIM_CPU
*, BI
);
268 BI
crisv10f_h_insn_prefixed_p_pre_v32_get (SIM_CPU
*);
269 void crisv10f_h_insn_prefixed_p_pre_v32_set (SIM_CPU
*, BI
);
270 SI
crisv10f_h_prefixreg_pre_v32_get (SIM_CPU
*);
271 void crisv10f_h_prefixreg_pre_v32_set (SIM_CPU
*, SI
);
273 /* These must be hand-written. */
274 extern CPUREG_FETCH_FN crisv10f_fetch_register
;
275 extern CPUREG_STORE_FN crisv10f_store_register
;
279 } MODEL_CRISV10_DATA
;
281 /* Instruction argument buffer. */
284 struct { /* no operands */
294 IADDR i_o_word_pcrel
;
303 unsigned char in_h_gr_SI_14
;
304 unsigned char out_h_gr_SI_14
;
305 } sfmt_move_m_spplus_p8
;
312 INT f_indir_pc__dword
;
314 unsigned char out_Pd
;
315 } sfmt_move_c_sprv10_p9
;
317 INT f_indir_pc__word
;
319 unsigned char out_Pd
;
320 } sfmt_move_c_sprv10_p5
;
324 unsigned char out_Rd
;
327 INT f_indir_pc__dword
;
330 unsigned char out_Rd
;
333 INT f_indir_pc__word
;
336 unsigned char out_Rd
;
339 INT f_indir_pc__byte
;
342 unsigned char out_Rd
;
348 unsigned char out_Rd
;
354 unsigned char out_h_gr_SI_index_of__INT_Rd
;
357 INT f_indir_pc__dword
;
360 unsigned char out_h_gr_SI_index_of__INT_Rd
;
363 INT f_indir_pc__word
;
366 unsigned char out_h_gr_SI_index_of__INT_Rd
;
369 INT f_indir_pc__byte
;
372 unsigned char out_h_gr_SI_index_of__INT_Rd
;
378 unsigned char out_h_gr_SI_index_of__INT_Rs
;
379 } sfmt_move_spr_rv10
;
384 unsigned char out_h_gr_SI_index_of__INT_Rd
;
391 unsigned char out_h_gr_SI_index_of__INT_Rd
;
398 unsigned char out_Rd
;
399 unsigned char out_h_sr_SI_7
;
407 unsigned char out_Rs
;
408 } sfmt_move_spr_mv10
;
414 unsigned char out_Pd
;
415 unsigned char out_Rs
;
416 } sfmt_move_m_sprv10
;
423 unsigned char out_Rd
;
424 unsigned char out_Rs
;
432 unsigned char out_Rs
;
433 unsigned char out_h_gr_SI_if__SI_andif__DFLT_prefix_set_not__UINT_inc_index_of__INT_Rs_index_of__INT_Rd
;
441 unsigned char out_Rs
;
442 unsigned char out_h_gr_SI_0
;
443 unsigned char out_h_gr_SI_1
;
444 unsigned char out_h_gr_SI_10
;
445 unsigned char out_h_gr_SI_11
;
446 unsigned char out_h_gr_SI_12
;
447 unsigned char out_h_gr_SI_13
;
448 unsigned char out_h_gr_SI_14
;
449 unsigned char out_h_gr_SI_2
;
450 unsigned char out_h_gr_SI_3
;
451 unsigned char out_h_gr_SI_4
;
452 unsigned char out_h_gr_SI_5
;
453 unsigned char out_h_gr_SI_6
;
454 unsigned char out_h_gr_SI_7
;
455 unsigned char out_h_gr_SI_8
;
456 unsigned char out_h_gr_SI_9
;
464 unsigned char in_h_gr_SI_0
;
465 unsigned char in_h_gr_SI_1
;
466 unsigned char in_h_gr_SI_10
;
467 unsigned char in_h_gr_SI_11
;
468 unsigned char in_h_gr_SI_12
;
469 unsigned char in_h_gr_SI_13
;
470 unsigned char in_h_gr_SI_14
;
471 unsigned char in_h_gr_SI_15
;
472 unsigned char in_h_gr_SI_2
;
473 unsigned char in_h_gr_SI_3
;
474 unsigned char in_h_gr_SI_4
;
475 unsigned char in_h_gr_SI_5
;
476 unsigned char in_h_gr_SI_6
;
477 unsigned char in_h_gr_SI_7
;
478 unsigned char in_h_gr_SI_8
;
479 unsigned char in_h_gr_SI_9
;
480 unsigned char out_Rs
;
483 /* Writeback handler. */
485 /* Pointer to argbuf entry for insn whose results need writing back. */
486 const struct argbuf
*abuf
;
488 /* x-before handler */
490 /*const SCACHE *insns[MAX_PARALLEL_INSNS];*/
493 /* x-after handler */
497 /* This entry is used to terminate each pbb. */
499 /* Number of insns in pbb. */
501 /* Next pbb to execute. */
503 SCACHE
*branch_target
;
508 /* The ARGBUF struct. */
510 /* These are the baseclass definitions. */
515 /* ??? Temporary hack for skip insns. */
518 /* cpu specific data follows */
521 union sem_fields fields
;
526 ??? SCACHE used to contain more than just argbuf. We could delete the
527 type entirely and always just use ARGBUF, but for future concerns and as
528 a level of abstraction it is left in. */
531 struct argbuf argbuf
;
534 /* Macros to simplify extraction, reading and semantic code.
535 These define and assign the local vars that contain the insn's fields. */
537 #define EXTRACT_IFMT_EMPTY_VARS \
539 #define EXTRACT_IFMT_EMPTY_CODE \
542 #define EXTRACT_IFMT_NOP_VARS \
549 #define EXTRACT_IFMT_NOP_CODE \
551 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
552 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
553 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
554 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
555 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
557 #define EXTRACT_IFMT_MOVE_B_R_VARS \
564 #define EXTRACT_IFMT_MOVE_B_R_CODE \
566 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
567 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
568 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
569 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
570 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
572 #define EXTRACT_IFMT_MOVEPCR_VARS \
579 #define EXTRACT_IFMT_MOVEPCR_CODE \
581 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
582 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
583 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
584 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
585 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
587 #define EXTRACT_IFMT_MOVEQ_VARS \
593 #define EXTRACT_IFMT_MOVEQ_CODE \
595 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
596 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
597 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
598 f_s6 = EXTRACT_LSB0_SINT (insn, 16, 5, 6); \
600 #define EXTRACT_IFMT_MOVECBR_VARS \
602 INT f_indir_pc__byte; \
607 /* Contents of trailing part of insn. */ \
610 #define EXTRACT_IFMT_MOVECBR_CODE \
612 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
613 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
614 f_indir_pc__byte = (0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)); \
615 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
616 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
617 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
618 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
620 #define EXTRACT_IFMT_MOVECWR_VARS \
622 INT f_indir_pc__word; \
627 /* Contents of trailing part of insn. */ \
630 #define EXTRACT_IFMT_MOVECWR_CODE \
632 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
633 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
634 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)); \
635 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
636 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
637 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
638 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
640 #define EXTRACT_IFMT_MOVECDR_VARS \
641 INT f_indir_pc__dword; \
647 /* Contents of trailing part of insn. */ \
650 #define EXTRACT_IFMT_MOVECDR_CODE \
652 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
653 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
654 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
655 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
656 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
657 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
658 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
660 #define EXTRACT_IFMT_MOVUCBR_VARS \
662 INT f_indir_pc__byte; \
667 /* Contents of trailing part of insn. */ \
670 #define EXTRACT_IFMT_MOVUCBR_CODE \
672 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
673 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
674 f_indir_pc__byte = (0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)); \
675 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
676 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
677 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
678 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
680 #define EXTRACT_IFMT_MOVUCWR_VARS \
682 INT f_indir_pc__word; \
687 /* Contents of trailing part of insn. */ \
690 #define EXTRACT_IFMT_MOVUCWR_CODE \
692 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
693 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
694 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)); \
695 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
696 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
697 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
698 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
700 #define EXTRACT_IFMT_ADDQ_VARS \
706 #define EXTRACT_IFMT_ADDQ_CODE \
708 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
709 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
710 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
711 f_u6 = EXTRACT_LSB0_UINT (insn, 16, 5, 6); \
713 #define EXTRACT_IFMT_CMP_M_B_M_VARS \
721 #define EXTRACT_IFMT_CMP_M_B_M_CODE \
723 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
724 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
725 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
726 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
727 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
728 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
730 #define EXTRACT_IFMT_MOVE_R_SPRV10_VARS \
737 #define EXTRACT_IFMT_MOVE_R_SPRV10_CODE \
739 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
740 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
741 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
742 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
743 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
745 #define EXTRACT_IFMT_MOVE_SPR_RV10_VARS \
752 #define EXTRACT_IFMT_MOVE_SPR_RV10_CODE \
754 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
755 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
756 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
757 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
758 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
760 #define EXTRACT_IFMT_RET_TYPE_VARS \
767 #define EXTRACT_IFMT_RET_TYPE_CODE \
769 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
770 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
771 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
772 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
773 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
775 #define EXTRACT_IFMT_MOVE_M_SPRV10_VARS \
783 #define EXTRACT_IFMT_MOVE_M_SPRV10_CODE \
785 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
786 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
787 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
788 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
789 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
790 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
792 #define EXTRACT_IFMT_MOVE_C_SPRV10_P5_VARS \
794 INT f_indir_pc__word; \
799 /* Contents of trailing part of insn. */ \
802 #define EXTRACT_IFMT_MOVE_C_SPRV10_P5_CODE \
804 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
805 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
806 f_indir_pc__word = (0|(EXTRACT_LSB0_UINT (word_1, 32, 15, 16) << 0)); \
807 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
808 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
809 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
810 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
812 #define EXTRACT_IFMT_MOVE_C_SPRV10_P9_VARS \
813 INT f_indir_pc__dword; \
819 /* Contents of trailing part of insn. */ \
822 #define EXTRACT_IFMT_MOVE_C_SPRV10_P9_CODE \
824 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
825 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
826 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
827 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
828 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
829 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
830 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
832 #define EXTRACT_IFMT_MOVE_SPR_MV10_VARS \
840 #define EXTRACT_IFMT_MOVE_SPR_MV10_CODE \
842 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
843 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
844 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
845 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
846 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
847 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
849 #define EXTRACT_IFMT_SBFS_VARS \
857 #define EXTRACT_IFMT_SBFS_CODE \
859 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
860 f_membit = EXTRACT_LSB0_UINT (insn, 16, 11, 1); \
861 f_memmode = EXTRACT_LSB0_UINT (insn, 16, 10, 1); \
862 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
863 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
864 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
866 #define EXTRACT_IFMT_SWAP_VARS \
873 #define EXTRACT_IFMT_SWAP_CODE \
875 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
876 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
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_ASRQ_VARS \
888 #define EXTRACT_IFMT_ASRQ_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_b5 = EXTRACT_LSB0_UINT (insn, 16, 5, 1); \
894 f_u5 = EXTRACT_LSB0_UINT (insn, 16, 4, 5); \
896 #define EXTRACT_IFMT_SETF_VARS \
904 #define EXTRACT_IFMT_SETF_CODE \
906 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
907 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
908 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
909 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
910 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
911 f_dstsrc = ((((f_operand1) | (((f_operand2) << (4))))) & (255));\
913 #define EXTRACT_IFMT_BCC_B_VARS \
921 #define EXTRACT_IFMT_BCC_B_CODE \
923 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
924 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
925 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
926 f_disp9_hi = EXTRACT_LSB0_SINT (insn, 16, 0, 1); \
927 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
931 tmp_abslo = ((f_disp9_lo) << (1));\
932 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
933 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
936 #define EXTRACT_IFMT_BA_B_VARS \
944 #define EXTRACT_IFMT_BA_B_CODE \
946 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
947 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
948 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
949 f_disp9_hi = EXTRACT_LSB0_SINT (insn, 16, 0, 1); \
950 f_disp9_lo = EXTRACT_LSB0_UINT (insn, 16, 7, 7); \
954 tmp_abslo = ((f_disp9_lo) << (1));\
955 tmp_absval = ((((((f_disp9_hi) != (0))) ? ((~ (255))) : (0))) | (tmp_abslo));\
956 f_disp9 = ((((pc) + (tmp_absval))) + (((GET_H_V32_NON_V32 ()) ? (0) : (2))));\
959 #define EXTRACT_IFMT_BCC_W_VARS \
961 SI f_indir_pc__word_pcrel; \
966 /* Contents of trailing part of insn. */ \
969 #define EXTRACT_IFMT_BCC_W_CODE \
971 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
972 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
973 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)))))); \
974 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
975 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
976 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
977 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
979 #define EXTRACT_IFMT_BA_W_VARS \
981 SI f_indir_pc__word_pcrel; \
986 /* Contents of trailing part of insn. */ \
989 #define EXTRACT_IFMT_BA_W_CODE \
991 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
992 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
993 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)))))); \
994 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
995 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
996 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
997 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
999 #define EXTRACT_IFMT_JUMP_C_VARS \
1000 INT f_indir_pc__dword; \
1006 /* Contents of trailing part of insn. */ \
1008 unsigned int length;
1009 #define EXTRACT_IFMT_JUMP_C_CODE \
1011 word_1 = GETIMEMUSI (current_cpu, pc + 2); \
1012 f_indir_pc__dword = (0|(EXTRACT_LSB0_UINT (word_1, 32, 31, 32) << 0)); \
1013 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1014 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1015 f_opcode = EXTRACT_LSB0_UINT (insn, 16, 9, 4); \
1016 f_size = EXTRACT_LSB0_UINT (insn, 16, 5, 2); \
1017 f_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1019 #define EXTRACT_IFMT_BREAK_VARS \
1025 unsigned int length;
1026 #define EXTRACT_IFMT_BREAK_CODE \
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_u4 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1034 #define EXTRACT_IFMT_SCC_VARS \
1040 unsigned int length;
1041 #define EXTRACT_IFMT_SCC_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_operand1 = EXTRACT_LSB0_UINT (insn, 16, 3, 4); \
1049 #define EXTRACT_IFMT_ADDOQ_VARS \
1054 unsigned int length;
1055 #define EXTRACT_IFMT_ADDOQ_CODE \
1057 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1058 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1059 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1060 f_s8 = EXTRACT_LSB0_SINT (insn, 16, 7, 8); \
1062 #define EXTRACT_IFMT_BDAPQPC_VARS \
1067 unsigned int length;
1068 #define EXTRACT_IFMT_BDAPQPC_CODE \
1070 f_operand2 = EXTRACT_LSB0_UINT (insn, 16, 15, 4); \
1071 f_mode = EXTRACT_LSB0_UINT (insn, 16, 11, 2); \
1072 f_opcode_hi = EXTRACT_LSB0_UINT (insn, 16, 9, 2); \
1073 f_s8 = EXTRACT_LSB0_SINT (insn, 16, 7, 8); \
1075 /* Collection of various things for the trace handler to use. */
1077 typedef struct trace_record
{
1082 #endif /* CPU_CRISV10F_H */