1 /* Declarations for stacks of tokenized Xtensa instructions.
2 Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
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 3, or (at your option)
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.
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
18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21 #ifndef XTENSA_ISTACK_H
22 #define XTENSA_ISTACK_H
24 #include "xtensa-isa.h"
27 #define MAX_INSN_ARGS 64
37 /* Literals have 1 token and no opcode.
38 Labels have 1 token and no opcode. */
40 typedef struct tinsn_struct
42 enum itype_enum insn_type
;
44 xtensa_opcode opcode
; /* Literals have an invalid opcode. */
45 bfd_boolean is_specific_opcode
;
46 bfd_boolean keep_wide
;
48 expressionS tok
[MAX_INSN_ARGS
];
49 bfd_boolean loc_directive_seen
;
50 struct dwarf2_line_info debug_line
;
52 expressionS tls_reloc
;
54 /* Filled out by relaxation_requirements: */
55 enum xtensa_relax_statesE subtype
;
57 /* Filled out by vinsn_to_insnbuf: */
64 /* tinsn_stack: This is a stack of instructions to be placed. */
66 typedef struct tinsn_stack
69 TInsn insn
[MAX_ISTACK
];
73 void istack_init (IStack
*);
74 bfd_boolean
istack_empty (IStack
*);
75 bfd_boolean
istack_full (IStack
*);
76 TInsn
*istack_top (IStack
*);
77 void istack_push (IStack
*, TInsn
*);
78 TInsn
*istack_push_space (IStack
*);
79 void istack_pop (IStack
*);
81 /* TInsn utilities. */
82 void tinsn_init (TInsn
*);
85 /* vliw_insn: bundles of TInsns. */
87 typedef struct vliw_insn
91 unsigned int inside_bundle
;
92 TInsn slots
[MAX_SLOTS
];
93 xtensa_insnbuf insnbuf
;
94 xtensa_insnbuf slotbuf
[MAX_SLOTS
];
97 #endif /* !XTENSA_ISTACK_H */