Commit | Line | Data |
---|---|---|
88da6820 | 1 | /* Declarations for stacks of tokenized Xtensa instructions. |
aa820537 AM |
2 | Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 |
3 | Free Software Foundation, Inc. | |
88da6820 NC |
4 | |
5 | This file is part of GAS, the GNU Assembler. | |
6 | ||
7 | GAS is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
88da6820 NC |
10 | any later version. |
11 | ||
12 | GAS is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
19 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
20 | 02110-1301, USA. */ | |
88da6820 NC |
21 | |
22 | #ifndef XTENSA_ISTACK_H | |
23 | #define XTENSA_ISTACK_H | |
24 | ||
25 | #include "xtensa-isa.h" | |
26 | ||
27 | #define MAX_ISTACK 12 | |
c22a967f | 28 | #define MAX_INSN_ARGS 64 |
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]; | |
b224e962 BW |
50 | bfd_boolean loc_directive_seen; |
51 | struct dwarf2_line_info debug_line; | |
43cd72b9 | 52 | |
19e8f41a BW |
53 | /* This field is used for two types of special pseudo ops: |
54 | 1. TLS-related operations. Eg: callx8.tls | |
55 | 2. j.l label, a2 | |
56 | ||
57 | For the tls-related operations, it will hold a tls-related opcode | |
58 | and info to be used in a fixup. For j.l it will hold a | |
59 | register to be used during relaxation. */ | |
60 | expressionS extra_arg; | |
28dbbc02 | 61 | |
43cd72b9 | 62 | /* Filled out by relaxation_requirements: */ |
43cd72b9 BW |
63 | enum xtensa_relax_statesE subtype; |
64 | int literal_space; | |
19e8f41a | 65 | |
43cd72b9 BW |
66 | /* Filled out by vinsn_to_insnbuf: */ |
67 | symbolS *symbol; | |
43cd72b9 BW |
68 | offsetT offset; |
69 | fragS *literal_frag; | |
88da6820 NC |
70 | } TInsn; |
71 | ||
72 | ||
73 | /* tinsn_stack: This is a stack of instructions to be placed. */ | |
74 | ||
75 | typedef struct tinsn_stack | |
76 | { | |
77 | int ninsn; | |
78 | TInsn insn[MAX_ISTACK]; | |
79 | } IStack; | |
80 | ||
81 | ||
7fa3d080 BW |
82 | void istack_init (IStack *); |
83 | bfd_boolean istack_empty (IStack *); | |
84 | bfd_boolean istack_full (IStack *); | |
85 | TInsn *istack_top (IStack *); | |
86 | void istack_push (IStack *, TInsn *); | |
c138bc38 | 87 | TInsn *istack_push_space (IStack *); |
7fa3d080 | 88 | void istack_pop (IStack *); |
88da6820 NC |
89 | |
90 | /* TInsn utilities. */ | |
7fa3d080 | 91 | void tinsn_init (TInsn *); |
43cd72b9 BW |
92 | |
93 | ||
94 | /* vliw_insn: bundles of TInsns. */ | |
95 | ||
96 | typedef struct vliw_insn | |
97 | { | |
98 | xtensa_format format; | |
43cd72b9 BW |
99 | int num_slots; |
100 | unsigned int inside_bundle; | |
101 | TInsn slots[MAX_SLOTS]; | |
65738a7d | 102 | xtensa_insnbuf insnbuf; |
43cd72b9 BW |
103 | xtensa_insnbuf slotbuf[MAX_SLOTS]; |
104 | } vliw_insn; | |
88da6820 NC |
105 | |
106 | #endif /* !XTENSA_ISTACK_H */ |