/* tc-xtensa.h -- Header file for tc-xtensa.c.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#ifndef TC_XTENSA
#define TC_XTENSA 1
-#ifdef ANSI_PROTOTYPES
struct fix;
-#endif
-
-#ifndef BFD_ASSEMBLER
-#error Xtensa support requires BFD_ASSEMBLER
-#endif
#ifndef OBJ_ELF
#error Xtensa support requires ELF object format
does not fit, use the specified expansion. This is similar to
"NARROW", except that these may not be expanded in order to align
code. */
-
+
RELAX_IMMED_STEP1,
/* The last instruction in this fragment (at->fr_opcode) contains a
literal. It has already been expanded at least 1 step. */
RELAX_MAYBE_UNREACHABLE,
/* This marks the location as possibly unreachable. These are placed
after a branch that may be relaxed into a branch and jump. If the
- branch is relaxed, then this frag will be converted to a
+ branch is relaxed, then this frag will be converted to a
RELAX_UNREACHABLE frag. */
RELAX_NONE
unsigned int is_assembly_state_set : 1;
unsigned int is_no_density : 1;
unsigned int is_no_transform : 1;
+ unsigned int use_longcalls : 1;
unsigned int use_absolute_literals : 1;
/* Inhibits relaxation of machine-dependent alignment frags the
fragS *literal_frag;
/* The destination segment for literal frags. (Note that this is only
- valid after xtensa_move_literals. */
+ valid after xtensa_move_literals.) This field is also used for
+ LITERAL_POOL_END frags. */
segT lit_seg;
+ /* Frag chain for LITERAL_POOL_BEGIN frags. */
+ struct frchain *lit_frchain;
+
/* For the relaxation scheme, some literal fragments can have their
expansions modified by an instruction that relaxes. */
int text_expansion[MAX_SLOTS];
extern void xtensa_init_fix_data (struct fix *);
extern void xtensa_frag_init (fragS *);
extern int xtensa_force_relocation (struct fix *);
+extern int xtensa_validate_fix_sub (struct fix *);
extern void xtensa_frob_label (struct symbol *);
extern void xtensa_end (void);
extern void xtensa_post_relax_hook (void);
#define TC_FRAG_TYPE struct xtensa_frag_type
#define TC_FRAG_INIT(frag) xtensa_frag_init (frag)
#define TC_FORCE_RELOCATION(fix) xtensa_force_relocation (fix)
+#define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
+ (! SEG_NORMAL (seg) || xtensa_force_relocation (fix))
+#define TC_VALIDATE_FIX_SUB(fix) xtensa_validate_fix_sub (fix)
#define NO_PSEUDO_DOT xtensa_check_inside_bundle ()
#define tc_canonicalize_symbol_name(s) xtensa_section_rename (s)
#define tc_canonicalize_section_name(s) xtensa_section_rename (s)
/* Returns the number of units the opcode uses. */
typedef int (*opcode_num_units_func) (void *, xtensa_opcode);
-/* Given an opcode and an index into the opcode's funcUnit list,
+/* Given an opcode and an index into the opcode's funcUnit list,
returns the unit used for the index. */
typedef int (*opcode_funcUnit_use_unit_func) (void *, xtensa_opcode, int);
-/* Given an opcode and an index into the opcode's funcUnit list,
+/* Given an opcode and an index into the opcode's funcUnit list,
returns the cycle during which the unit is used. */
typedef int (*opcode_funcUnit_use_stage_func) (void *, xtensa_opcode, int);
-/* The above typedefs parameterize the resource_table so that the
+/* The above typedefs parameterize the resource_table so that the
optional scheduler doesn't need its own resource reservation system.
-
- For simple resource checking, which is all that happens normally,
- the functions will be as follows (with some wrapping to make the
- interface more convenient):
+
+ For simple resource checking, which is all that happens normally,
+ the functions will be as follows (with some wrapping to make the
+ interface more convenient):
unit_num_copies_func = xtensa_funcUnit_num_copies
opcode_num_units_func = xtensa_opcode_num_funcUnit_uses
opcode_funcUnit_use_unit_func = xtensa_opcode_funcUnit_use->unit
opcode_funcUnit_use_stage_func = xtensa_opcode_funcUnit_use->stage
- Of course the optional scheduler has its own reservation table
+ Of course the optional scheduler has its own reservation table
and functions. */
int opcode_funcUnit_use_unit (void *, xtensa_opcode, int);
opcode_num_units_func opcode_num_units;
opcode_funcUnit_use_unit_func opcode_unit_use;
opcode_funcUnit_use_stage_func opcode_unit_stage;
- char **units;
+ unsigned char **units;
} resource_table;
-resource_table *new_resource_table
- (void *, int, int, unit_num_copies_func, opcode_num_units_func,
+resource_table *new_resource_table
+ (void *, int, int, unit_num_copies_func, opcode_num_units_func,
opcode_funcUnit_use_unit_func, opcode_funcUnit_use_stage_func);
void resize_resource_table (resource_table *, int);
void clear_resource_table (resource_table *);