Commit | Line | Data |
---|---|---|
88da6820 | 1 | /* Declarations for stacks of tokenized Xtensa instructions. |
43cd72b9 | 2 | Copyright (C) 2003, 2004 Free Software Foundation, Inc. |
88da6820 NC |
3 | |
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GAS is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
18 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
19 | 02110-1301, USA. */ | |
88da6820 NC |
20 | |
21 | #ifndef XTENSA_ISTACK_H | |
22 | #define XTENSA_ISTACK_H | |
23 | ||
43cd72b9 | 24 | #include "dwarf2dbg.h" |
88da6820 NC |
25 | #include "xtensa-isa.h" |
26 | ||
27 | #define MAX_ISTACK 12 | |
43cd72b9 | 28 | #define MAX_INSN_ARGS 10 |
88da6820 NC |
29 | |
30 | enum itype_enum | |
31 | { | |
32 | ITYPE_INSN, | |
33 | ITYPE_LITERAL, | |
34 | ITYPE_LABEL | |
35 | }; | |
36 | ||
37 | ||
38 | /* Literals have 1 token and no opcode. | |
39 | Labels have 1 token and no opcode. */ | |
40 | ||
41 | typedef struct tinsn_struct | |
42 | { | |
43 | enum itype_enum insn_type; | |
43cd72b9 | 44 | |
88da6820 | 45 | xtensa_opcode opcode; /* Literals have an invalid opcode. */ |
c138bc38 BW |
46 | bfd_boolean is_specific_opcode; |
47 | bfd_boolean keep_wide; | |
88da6820 NC |
48 | int ntok; |
49 | expressionS tok[MAX_INSN_ARGS]; | |
43cd72b9 BW |
50 | struct dwarf2_line_info loc; |
51 | ||
52 | struct fixP *fixup; | |
53 | ||
54 | /* Filled out by relaxation_requirements: */ | |
55 | bfd_boolean record_fix; | |
56 | enum xtensa_relax_statesE subtype; | |
57 | int literal_space; | |
58 | /* Filled out by vinsn_to_insnbuf: */ | |
59 | symbolS *symbol; | |
60 | symbolS *sub_symbol; | |
61 | offsetT offset; | |
62 | fragS *literal_frag; | |
88da6820 NC |
63 | } TInsn; |
64 | ||
65 | ||
66 | /* tinsn_stack: This is a stack of instructions to be placed. */ | |
67 | ||
68 | typedef struct tinsn_stack | |
69 | { | |
70 | int ninsn; | |
71 | TInsn insn[MAX_ISTACK]; | |
72 | } IStack; | |
73 | ||
74 | ||
7fa3d080 BW |
75 | void istack_init (IStack *); |
76 | bfd_boolean istack_empty (IStack *); | |
77 | bfd_boolean istack_full (IStack *); | |
78 | TInsn *istack_top (IStack *); | |
79 | void istack_push (IStack *, TInsn *); | |
c138bc38 | 80 | TInsn *istack_push_space (IStack *); |
7fa3d080 | 81 | void istack_pop (IStack *); |
88da6820 NC |
82 | |
83 | /* TInsn utilities. */ | |
7fa3d080 BW |
84 | void tinsn_init (TInsn *); |
85 | expressionS *tinsn_get_tok (TInsn *, int); | |
43cd72b9 BW |
86 | |
87 | ||
88 | /* vliw_insn: bundles of TInsns. */ | |
89 | ||
90 | typedef struct vliw_insn | |
91 | { | |
92 | xtensa_format format; | |
93 | xtensa_insnbuf insnbuf; | |
94 | int num_slots; | |
95 | unsigned int inside_bundle; | |
96 | TInsn slots[MAX_SLOTS]; | |
97 | xtensa_insnbuf slotbuf[MAX_SLOTS]; | |
98 | } vliw_insn; | |
88da6820 NC |
99 | |
100 | #endif /* !XTENSA_ISTACK_H */ |