mirror of git://gcc.gnu.org/git/gcc.git
xtensa-protos.h: Convert to ISO C90.
* config/xtensa/xtensa-protos.h: Convert to ISO C90. * config/xtensa/xtensa.c: Convert to ISO C90. Minor formatting fixes. From-SVN: r71669
This commit is contained in:
parent
4d76fdaabc
commit
ffbc879650
|
@ -1,3 +1,8 @@
|
||||||
|
2003-09-22 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
|
* config/xtensa/xtensa-protos.h: Convert to ISO C90.
|
||||||
|
* config/xtensa/xtensa.c: Convert to ISO C90. Minor formatting fixes.
|
||||||
|
|
||||||
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
|
2003-09-22 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
* config/mn10300/mn10300.md: Revert 2003-09-17's patch.
|
* config/mn10300/mn10300.md: Revert 2003-09-17's patch.
|
||||||
|
|
|
@ -23,92 +23,90 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||||
#define __XTENSA_PROTOS_H__
|
#define __XTENSA_PROTOS_H__
|
||||||
|
|
||||||
/* Functions to test whether an immediate fits in a given field. */
|
/* Functions to test whether an immediate fits in a given field. */
|
||||||
extern int xtensa_simm7 PARAMS ((int));
|
extern int xtensa_simm7 (int);
|
||||||
extern int xtensa_simm8 PARAMS ((int));
|
extern int xtensa_simm8 (int);
|
||||||
extern int xtensa_simm8x256 PARAMS ((int));
|
extern int xtensa_simm8x256 (int);
|
||||||
extern int xtensa_simm12b PARAMS ((int));
|
extern int xtensa_simm12b (int);
|
||||||
extern int xtensa_uimm8 PARAMS ((int));
|
extern int xtensa_uimm8 (int);
|
||||||
extern int xtensa_uimm8x2 PARAMS ((int));
|
extern int xtensa_uimm8x2 (int);
|
||||||
extern int xtensa_uimm8x4 PARAMS ((int));
|
extern int xtensa_uimm8x4 (int);
|
||||||
extern int xtensa_ai4const PARAMS ((int));
|
extern int xtensa_ai4const (int);
|
||||||
extern int xtensa_lsi4x4 PARAMS ((int));
|
extern int xtensa_lsi4x4 (int);
|
||||||
extern int xtensa_b4const PARAMS ((int));
|
extern int xtensa_b4const (int);
|
||||||
extern int xtensa_b4constu PARAMS ((int));
|
extern int xtensa_b4constu (int);
|
||||||
extern int xtensa_tp7 PARAMS ((int));
|
extern int xtensa_tp7 (int);
|
||||||
|
|
||||||
/* Functions within xtensa.c that we reference. */
|
/* Functions within xtensa.c that we reference. */
|
||||||
#ifdef RTX_CODE
|
#ifdef RTX_CODE
|
||||||
extern int xt_true_regnum PARAMS ((rtx));
|
extern int xt_true_regnum (rtx);
|
||||||
extern int add_operand PARAMS ((rtx, enum machine_mode));
|
extern int add_operand (rtx, enum machine_mode);
|
||||||
extern int arith_operand PARAMS ((rtx, enum machine_mode));
|
extern int arith_operand (rtx, enum machine_mode);
|
||||||
extern int nonimmed_operand PARAMS ((rtx, enum machine_mode));
|
extern int nonimmed_operand (rtx, enum machine_mode);
|
||||||
extern int mem_operand PARAMS ((rtx, enum machine_mode));
|
extern int mem_operand (rtx, enum machine_mode);
|
||||||
extern int xtensa_valid_move PARAMS ((enum machine_mode, rtx *operands));
|
extern int xtensa_valid_move (enum machine_mode, rtx *);
|
||||||
extern int mask_operand PARAMS ((rtx, enum machine_mode));
|
extern int mask_operand (rtx, enum machine_mode);
|
||||||
extern int extui_fldsz_operand PARAMS ((rtx, enum machine_mode));
|
extern int extui_fldsz_operand (rtx, enum machine_mode);
|
||||||
extern int sext_operand PARAMS ((rtx, enum machine_mode));
|
extern int sext_operand (rtx, enum machine_mode);
|
||||||
extern int sext_fldsz_operand PARAMS ((rtx, enum machine_mode));
|
extern int sext_fldsz_operand (rtx, enum machine_mode);
|
||||||
extern int lsbitnum_operand PARAMS ((rtx, enum machine_mode));
|
extern int lsbitnum_operand (rtx, enum machine_mode);
|
||||||
extern int branch_operand PARAMS ((rtx, enum machine_mode));
|
extern int branch_operand (rtx, enum machine_mode);
|
||||||
extern int ubranch_operand PARAMS ((rtx, enum machine_mode));
|
extern int ubranch_operand (rtx, enum machine_mode);
|
||||||
extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
|
extern int call_insn_operand (rtx, enum machine_mode);
|
||||||
extern int move_operand PARAMS ((rtx, enum machine_mode));
|
extern int move_operand (rtx, enum machine_mode);
|
||||||
extern int smalloffset_mem_p PARAMS ((rtx));
|
extern int smalloffset_mem_p (rtx);
|
||||||
extern int constantpool_address_p PARAMS ((rtx));
|
extern int constantpool_address_p (rtx);
|
||||||
extern int constantpool_mem_p PARAMS ((rtx));
|
extern int constantpool_mem_p (rtx);
|
||||||
extern int const_float_1_operand PARAMS ((rtx, enum machine_mode));
|
extern int const_float_1_operand (rtx, enum machine_mode);
|
||||||
extern int fpmem_offset_operand PARAMS ((rtx, enum machine_mode));
|
extern int fpmem_offset_operand (rtx, enum machine_mode);
|
||||||
extern void xtensa_extend_reg PARAMS ((rtx, rtx));
|
extern void xtensa_extend_reg (rtx, rtx);
|
||||||
extern int branch_operator PARAMS ((rtx, enum machine_mode));
|
extern int branch_operator (rtx, enum machine_mode);
|
||||||
extern int ubranch_operator PARAMS ((rtx, enum machine_mode));
|
extern int ubranch_operator (rtx, enum machine_mode);
|
||||||
extern int boolean_operator PARAMS ((rtx, enum machine_mode));
|
extern int boolean_operator (rtx, enum machine_mode);
|
||||||
extern void xtensa_expand_conditional_branch PARAMS ((rtx *, enum rtx_code));
|
extern void xtensa_expand_conditional_branch (rtx *, enum rtx_code);
|
||||||
extern int xtensa_expand_conditional_move PARAMS ((rtx *, int));
|
extern int xtensa_expand_conditional_move (rtx *, int);
|
||||||
extern int xtensa_expand_scc PARAMS ((rtx *));
|
extern int xtensa_expand_scc (rtx *);
|
||||||
extern int xtensa_expand_block_move PARAMS ((rtx *));
|
extern int xtensa_expand_block_move (rtx *);
|
||||||
extern void xtensa_split_operand_pair PARAMS ((rtx *, enum machine_mode));
|
extern void xtensa_split_operand_pair (rtx *, enum machine_mode);
|
||||||
extern int xtensa_emit_move_sequence PARAMS ((rtx *, enum machine_mode));
|
extern int xtensa_emit_move_sequence (rtx *, enum machine_mode);
|
||||||
extern bool xtensa_copy_incoming_a7 PARAMS ((rtx *, enum machine_mode));
|
extern bool xtensa_copy_incoming_a7 (rtx *, enum machine_mode);
|
||||||
extern void xtensa_emit_block_move PARAMS ((rtx *, rtx *, int));
|
extern void xtensa_emit_block_move (rtx *, rtx *, int);
|
||||||
extern void xtensa_expand_nonlocal_goto PARAMS ((rtx *));
|
extern void xtensa_expand_nonlocal_goto (rtx *);
|
||||||
extern void xtensa_emit_loop_end PARAMS ((rtx, rtx *));
|
extern void xtensa_emit_loop_end (rtx, rtx *);
|
||||||
extern char * xtensa_emit_call PARAMS ((int, rtx *));
|
extern char *xtensa_emit_call (int, rtx *);
|
||||||
|
|
||||||
#ifdef TREE_CODE
|
#ifdef TREE_CODE
|
||||||
extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx));
|
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
|
||||||
extern void xtensa_va_start PARAMS ((tree, rtx));
|
extern void xtensa_va_start (tree, rtx);
|
||||||
extern rtx xtensa_va_arg PARAMS ((tree, tree));
|
extern rtx xtensa_va_arg (tree, tree);
|
||||||
#endif /* TREE_CODE */
|
#endif /* TREE_CODE */
|
||||||
|
|
||||||
extern void print_operand PARAMS ((FILE *, rtx, int));
|
extern void print_operand (FILE *, rtx, int);
|
||||||
extern void print_operand_address PARAMS ((FILE *, rtx));
|
extern void print_operand_address (FILE *, rtx);
|
||||||
extern void xtensa_output_literal
|
extern void xtensa_output_literal (FILE *, rtx, enum machine_mode, int);
|
||||||
PARAMS ((FILE *, rtx, enum machine_mode, int labelno));
|
extern rtx xtensa_return_addr (int, rtx);
|
||||||
extern rtx xtensa_return_addr PARAMS ((int, rtx));
|
extern rtx xtensa_builtin_saveregs (void);
|
||||||
extern rtx xtensa_builtin_saveregs PARAMS ((void));
|
extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int);
|
||||||
extern enum reg_class xtensa_preferred_reload_class
|
extern enum reg_class xtensa_secondary_reload_class (enum reg_class,
|
||||||
PARAMS ((rtx, enum reg_class, int));
|
enum machine_mode, rtx,
|
||||||
extern enum reg_class xtensa_secondary_reload_class
|
int);
|
||||||
PARAMS ((enum reg_class, enum machine_mode, rtx, int));
|
extern int a7_overlap_mentioned_p (rtx);
|
||||||
extern int a7_overlap_mentioned_p PARAMS ((rtx x));
|
|
||||||
#endif /* RTX_CODE */
|
#endif /* RTX_CODE */
|
||||||
|
|
||||||
#ifdef TREE_CODE
|
#ifdef TREE_CODE
|
||||||
extern void function_arg_advance
|
extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree);
|
||||||
PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree));
|
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode,
|
||||||
extern struct rtx_def * function_arg
|
tree, int);
|
||||||
PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
|
extern tree xtensa_build_va_list (void);
|
||||||
extern tree xtensa_build_va_list PARAMS ((void));
|
|
||||||
#endif /* TREE_CODE */
|
#endif /* TREE_CODE */
|
||||||
|
|
||||||
extern int xtensa_mask_immediate PARAMS ((int));
|
extern int xtensa_mask_immediate (int);
|
||||||
extern int xtensa_mem_offset PARAMS ((unsigned, enum machine_mode));
|
extern int xtensa_mem_offset (unsigned, enum machine_mode);
|
||||||
extern void xtensa_setup_frame_addresses PARAMS ((void));
|
extern void xtensa_setup_frame_addresses (void);
|
||||||
extern int xtensa_dbx_register_number PARAMS ((int));
|
extern int xtensa_dbx_register_number (int);
|
||||||
extern void override_options PARAMS ((void));
|
extern void override_options (void);
|
||||||
extern long compute_frame_size PARAMS ((int));
|
extern long compute_frame_size (int);
|
||||||
extern int xtensa_frame_pointer_required PARAMS ((void));
|
extern int xtensa_frame_pointer_required (void);
|
||||||
extern void xtensa_expand_prologue PARAMS ((void));
|
extern void xtensa_expand_prologue (void);
|
||||||
extern void order_regs_for_local_alloc PARAMS ((void));
|
extern void order_regs_for_local_alloc (void);
|
||||||
|
|
||||||
#endif /* !__XTENSA_PROTOS_H__ */
|
#endif /* !__XTENSA_PROTOS_H__ */
|
||||||
|
|
|
@ -53,7 +53,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||||
arrays indexed by the test type, and not worry about the order
|
arrays indexed by the test type, and not worry about the order
|
||||||
of EQ, NE, etc. */
|
of EQ, NE, etc. */
|
||||||
|
|
||||||
enum internal_test {
|
enum internal_test
|
||||||
|
{
|
||||||
ITEST_EQ,
|
ITEST_EQ,
|
||||||
ITEST_NE,
|
ITEST_NE,
|
||||||
ITEST_GT,
|
ITEST_GT,
|
||||||
|
@ -65,7 +66,7 @@ enum internal_test {
|
||||||
ITEST_LTU,
|
ITEST_LTU,
|
||||||
ITEST_LEU,
|
ITEST_LEU,
|
||||||
ITEST_MAX
|
ITEST_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Cached operands, and operator to compare for use in set/branch on
|
/* Cached operands, and operator to compare for use in set/branch on
|
||||||
condition codes. */
|
condition codes. */
|
||||||
|
@ -189,21 +190,21 @@ enum reg_class xtensa_char_to_class[256] =
|
||||||
NO_REGS, NO_REGS, NO_REGS, NO_REGS,
|
NO_REGS, NO_REGS, NO_REGS, NO_REGS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int b4const_or_zero PARAMS ((int));
|
static int b4const_or_zero (int);
|
||||||
static enum internal_test map_test_to_internal_test PARAMS ((enum rtx_code));
|
static enum internal_test map_test_to_internal_test (enum rtx_code);
|
||||||
static rtx gen_int_relational PARAMS ((enum rtx_code, rtx, rtx, int *));
|
static rtx gen_int_relational (enum rtx_code, rtx, rtx, int *);
|
||||||
static rtx gen_float_relational PARAMS ((enum rtx_code, rtx, rtx));
|
static rtx gen_float_relational (enum rtx_code, rtx, rtx);
|
||||||
static rtx gen_conditional_move PARAMS ((rtx));
|
static rtx gen_conditional_move (rtx);
|
||||||
static rtx fixup_subreg_mem PARAMS ((rtx x));
|
static rtx fixup_subreg_mem (rtx);
|
||||||
static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
|
static enum machine_mode xtensa_find_mode_for_size (unsigned);
|
||||||
static struct machine_function * xtensa_init_machine_status PARAMS ((void));
|
static struct machine_function * xtensa_init_machine_status (void);
|
||||||
static void printx PARAMS ((FILE *, signed int));
|
static void printx (FILE *, signed int);
|
||||||
static void xtensa_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
|
static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT);
|
||||||
static unsigned int xtensa_multibss_section_type_flags
|
static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
|
||||||
PARAMS ((tree, const char *, int)) ATTRIBUTE_UNUSED;
|
int) ATTRIBUTE_UNUSED;
|
||||||
static void xtensa_select_rtx_section
|
static void xtensa_select_rtx_section (enum machine_mode, rtx,
|
||||||
PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
|
unsigned HOST_WIDE_INT);
|
||||||
static bool xtensa_rtx_costs PARAMS ((rtx, int, int, int *));
|
static bool xtensa_rtx_costs (rtx, int, int, int *);
|
||||||
|
|
||||||
static int current_function_arg_words;
|
static int current_function_arg_words;
|
||||||
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
|
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
|
||||||
|
@ -240,8 +241,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_b4constu (v)
|
xtensa_b4constu (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
switch (v)
|
switch (v)
|
||||||
{
|
{
|
||||||
|
@ -267,29 +267,25 @@ xtensa_b4constu (v)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_simm8x256 (v)
|
xtensa_simm8x256 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v & 255) == 0 && (v >= -32768 && v <= 32512);
|
return (v & 255) == 0 && (v >= -32768 && v <= 32512);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_ai4const (v)
|
xtensa_ai4const (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v == -1 || (v >= 1 && v <= 15));
|
return (v == -1 || (v >= 1 && v <= 15));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_simm7 (v)
|
xtensa_simm7 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return v >= -32 && v <= 95;
|
return v >= -32 && v <= 95;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_b4const (v)
|
xtensa_b4const (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
switch (v)
|
switch (v)
|
||||||
{
|
{
|
||||||
|
@ -315,50 +311,43 @@ xtensa_b4const (v)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_simm8 (v)
|
xtensa_simm8 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return v >= -128 && v <= 127;
|
return v >= -128 && v <= 127;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_tp7 (v)
|
xtensa_tp7 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v >= 7 && v <= 22);
|
return (v >= 7 && v <= 22);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_lsi4x4 (v)
|
xtensa_lsi4x4 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v & 3) == 0 && (v >= 0 && v <= 60);
|
return (v & 3) == 0 && (v >= 0 && v <= 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_simm12b (v)
|
xtensa_simm12b (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return v >= -2048 && v <= 2047;
|
return v >= -2048 && v <= 2047;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_uimm8 (v)
|
xtensa_uimm8 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return v >= 0 && v <= 255;
|
return v >= 0 && v <= 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_uimm8x2 (v)
|
xtensa_uimm8x2 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v & 1) == 0 && (v >= 0 && v <= 510);
|
return (v & 1) == 0 && (v >= 0 && v <= 510);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_uimm8x4 (v)
|
xtensa_uimm8x4 (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
return (v & 3) == 0 && (v >= 0 && v <= 1020);
|
return (v & 3) == 0 && (v >= 0 && v <= 1020);
|
||||||
}
|
}
|
||||||
|
@ -368,8 +357,7 @@ xtensa_uimm8x4 (v)
|
||||||
works even when reg_renumber is not initialized. */
|
works even when reg_renumber is not initialized. */
|
||||||
|
|
||||||
int
|
int
|
||||||
xt_true_regnum (x)
|
xt_true_regnum (rtx x)
|
||||||
rtx x;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (x) == REG)
|
if (GET_CODE (x) == REG)
|
||||||
{
|
{
|
||||||
|
@ -392,9 +380,7 @@ xt_true_regnum (x)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
add_operand (op, mode)
|
add_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return (xtensa_simm8 (INTVAL (op)) || xtensa_simm8x256 (INTVAL (op)));
|
return (xtensa_simm8 (INTVAL (op)) || xtensa_simm8x256 (INTVAL (op)));
|
||||||
|
@ -404,9 +390,7 @@ add_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
arith_operand (op, mode)
|
arith_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return xtensa_simm8 (INTVAL (op));
|
return xtensa_simm8 (INTVAL (op));
|
||||||
|
@ -416,9 +400,7 @@ arith_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
nonimmed_operand (op, mode)
|
nonimmed_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
/* We cannot use the standard nonimmediate_operand() predicate because
|
/* We cannot use the standard nonimmediate_operand() predicate because
|
||||||
it includes constant pool memory operands. */
|
it includes constant pool memory operands. */
|
||||||
|
@ -431,9 +413,7 @@ nonimmed_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
mem_operand (op, mode)
|
mem_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
/* We cannot use the standard memory_operand() predicate because
|
/* We cannot use the standard memory_operand() predicate because
|
||||||
it includes constant pool memory operands. */
|
it includes constant pool memory operands. */
|
||||||
|
@ -446,9 +426,7 @@ mem_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_valid_move (mode, operands)
|
xtensa_valid_move (enum machine_mode mode, rtx *operands)
|
||||||
enum machine_mode mode;
|
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
/* Either the destination or source must be a register, and the
|
/* Either the destination or source must be a register, and the
|
||||||
MAC16 accumulator doesn't count. */
|
MAC16 accumulator doesn't count. */
|
||||||
|
@ -477,9 +455,7 @@ xtensa_valid_move (mode, operands)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
mask_operand (op, mode)
|
mask_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return xtensa_mask_immediate (INTVAL (op));
|
return xtensa_mask_immediate (INTVAL (op));
|
||||||
|
@ -489,9 +465,7 @@ mask_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
extui_fldsz_operand (op, mode)
|
extui_fldsz_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
return ((GET_CODE (op) == CONST_INT)
|
return ((GET_CODE (op) == CONST_INT)
|
||||||
&& xtensa_mask_immediate ((1 << INTVAL (op)) - 1));
|
&& xtensa_mask_immediate ((1 << INTVAL (op)) - 1));
|
||||||
|
@ -499,9 +473,7 @@ extui_fldsz_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
sext_operand (op, mode)
|
sext_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (TARGET_SEXT)
|
if (TARGET_SEXT)
|
||||||
return nonimmed_operand (op, mode);
|
return nonimmed_operand (op, mode);
|
||||||
|
@ -510,18 +482,14 @@ sext_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
sext_fldsz_operand (op, mode)
|
sext_fldsz_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
return ((GET_CODE (op) == CONST_INT) && xtensa_tp7 (INTVAL (op) - 1));
|
return ((GET_CODE (op) == CONST_INT) && xtensa_tp7 (INTVAL (op) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
lsbitnum_operand (op, mode)
|
lsbitnum_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
{
|
{
|
||||||
|
@ -534,8 +502,7 @@ lsbitnum_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
b4const_or_zero (v)
|
b4const_or_zero (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
if (v == 0)
|
if (v == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -544,9 +511,7 @@ b4const_or_zero (v)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
branch_operand (op, mode)
|
branch_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return b4const_or_zero (INTVAL (op));
|
return b4const_or_zero (INTVAL (op));
|
||||||
|
@ -556,9 +521,7 @@ branch_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ubranch_operand (op, mode)
|
ubranch_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return xtensa_b4constu (INTVAL (op));
|
return xtensa_b4constu (INTVAL (op));
|
||||||
|
@ -568,9 +531,7 @@ ubranch_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
call_insn_operand (op, mode)
|
call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
if ((GET_CODE (op) == REG)
|
if ((GET_CODE (op) == REG)
|
||||||
&& (op != arg_pointer_rtx)
|
&& (op != arg_pointer_rtx)
|
||||||
|
@ -619,9 +580,7 @@ call_insn_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
move_operand (op, mode)
|
move_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (register_operand (op, mode)
|
if (register_operand (op, mode)
|
||||||
|| memory_operand (op, mode))
|
|| memory_operand (op, mode))
|
||||||
|
@ -659,8 +618,7 @@ move_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
smalloffset_mem_p (op)
|
smalloffset_mem_p (rtx op)
|
||||||
rtx op;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == MEM)
|
if (GET_CODE (op) == MEM)
|
||||||
{
|
{
|
||||||
|
@ -682,8 +640,7 @@ smalloffset_mem_p (op)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
constantpool_address_p (addr)
|
constantpool_address_p (rtx addr)
|
||||||
rtx addr;
|
|
||||||
{
|
{
|
||||||
rtx sym = addr;
|
rtx sym = addr;
|
||||||
|
|
||||||
|
@ -713,8 +670,7 @@ constantpool_address_p (addr)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
constantpool_mem_p (op)
|
constantpool_mem_p (rtx op)
|
||||||
rtx op;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == MEM)
|
if (GET_CODE (op) == MEM)
|
||||||
return constantpool_address_p (XEXP (op, 0));
|
return constantpool_address_p (XEXP (op, 0));
|
||||||
|
@ -725,9 +681,7 @@ constantpool_mem_p (op)
|
||||||
/* Accept the floating point constant 1 in the appropriate mode. */
|
/* Accept the floating point constant 1 in the appropriate mode. */
|
||||||
|
|
||||||
int
|
int
|
||||||
const_float_1_operand (op, mode)
|
const_float_1_operand (rtx op, enum machine_mode mode)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
REAL_VALUE_TYPE d;
|
REAL_VALUE_TYPE d;
|
||||||
static REAL_VALUE_TYPE onedf;
|
static REAL_VALUE_TYPE onedf;
|
||||||
|
@ -756,9 +710,7 @@ const_float_1_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
fpmem_offset_operand (op, mode)
|
fpmem_offset_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||||
rtx op;
|
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (op) == CONST_INT)
|
if (GET_CODE (op) == CONST_INT)
|
||||||
return xtensa_mem_offset (INTVAL (op), SFmode);
|
return xtensa_mem_offset (INTVAL (op), SFmode);
|
||||||
|
@ -767,9 +719,7 @@ fpmem_offset_operand (op, mode)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_extend_reg (dst, src)
|
xtensa_extend_reg (rtx dst, rtx src)
|
||||||
rtx dst;
|
|
||||||
rtx src;
|
|
||||||
{
|
{
|
||||||
rtx temp = gen_reg_rtx (SImode);
|
rtx temp = gen_reg_rtx (SImode);
|
||||||
rtx shift = GEN_INT (BITS_PER_WORD - GET_MODE_BITSIZE (GET_MODE (src)));
|
rtx shift = GEN_INT (BITS_PER_WORD - GET_MODE_BITSIZE (GET_MODE (src)));
|
||||||
|
@ -784,9 +734,7 @@ xtensa_extend_reg (dst, src)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
branch_operator (x, mode)
|
branch_operator (rtx x, enum machine_mode mode)
|
||||||
rtx x;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_MODE (x) != mode)
|
if (GET_MODE (x) != mode)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -806,9 +754,7 @@ branch_operator (x, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ubranch_operator (x, mode)
|
ubranch_operator (rtx x, enum machine_mode mode)
|
||||||
rtx x;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_MODE (x) != mode)
|
if (GET_MODE (x) != mode)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -826,9 +772,7 @@ ubranch_operator (x, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
boolean_operator (x, mode)
|
boolean_operator (rtx x, enum machine_mode mode)
|
||||||
rtx x;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (GET_MODE (x) != mode)
|
if (GET_MODE (x) != mode)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -846,8 +790,7 @@ boolean_operator (x, mode)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_mask_immediate (v)
|
xtensa_mask_immediate (int v)
|
||||||
int v;
|
|
||||||
{
|
{
|
||||||
#define MAX_MASK_SIZE 16
|
#define MAX_MASK_SIZE 16
|
||||||
int mask_size;
|
int mask_size;
|
||||||
|
@ -866,9 +809,7 @@ xtensa_mask_immediate (v)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_mem_offset (v, mode)
|
xtensa_mem_offset (unsigned v, enum machine_mode mode)
|
||||||
unsigned v;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
@ -898,11 +839,10 @@ xtensa_mem_offset (v, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Make normal rtx_code into something we can index from an array */
|
/* Make normal rtx_code into something we can index from an array. */
|
||||||
|
|
||||||
static enum internal_test
|
static enum internal_test
|
||||||
map_test_to_internal_test (test_code)
|
map_test_to_internal_test (enum rtx_code test_code)
|
||||||
enum rtx_code test_code;
|
|
||||||
{
|
{
|
||||||
enum internal_test test = ITEST_MAX;
|
enum internal_test test = ITEST_MAX;
|
||||||
|
|
||||||
|
@ -929,15 +869,15 @@ map_test_to_internal_test (test_code)
|
||||||
the comparison expression. */
|
the comparison expression. */
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
gen_int_relational (test_code, cmp0, cmp1, p_invert)
|
gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
|
||||||
enum rtx_code test_code; /* relational test (EQ, etc) */
|
rtx cmp0, /* first operand to compare */
|
||||||
rtx cmp0; /* first operand to compare */
|
rtx cmp1, /* second operand to compare */
|
||||||
rtx cmp1; /* second operand to compare */
|
int *p_invert /* whether branch needs to reverse test */)
|
||||||
int *p_invert; /* whether branch needs to reverse its test */
|
|
||||||
{
|
{
|
||||||
struct cmp_info {
|
struct cmp_info
|
||||||
|
{
|
||||||
enum rtx_code test_code; /* test code to use in insn */
|
enum rtx_code test_code; /* test code to use in insn */
|
||||||
int (*const_range_p) PARAMS ((int)); /* predicate function to check range */
|
int (*const_range_p) (int); /* predicate function to check range */
|
||||||
int const_add; /* constant to add (convert LE -> LT) */
|
int const_add; /* constant to add (convert LE -> LT) */
|
||||||
int reverse_regs; /* reverse registers in test */
|
int reverse_regs; /* reverse registers in test */
|
||||||
int invert_const; /* != 0 if invert value if cmp1 is constant */
|
int invert_const; /* != 0 if invert value if cmp1 is constant */
|
||||||
|
@ -1028,12 +968,11 @@ gen_int_relational (test_code, cmp0, cmp1, p_invert)
|
||||||
the comparison expression. */
|
the comparison expression. */
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
gen_float_relational (test_code, cmp0, cmp1)
|
gen_float_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
|
||||||
enum rtx_code test_code; /* relational test (EQ, etc) */
|
rtx cmp0, /* first operand to compare */
|
||||||
rtx cmp0; /* first operand to compare */
|
rtx cmp1 /* second operand to compare */)
|
||||||
rtx cmp1; /* second operand to compare */
|
|
||||||
{
|
{
|
||||||
rtx (*gen_fn) PARAMS ((rtx, rtx, rtx));
|
rtx (*gen_fn) (rtx, rtx, rtx);
|
||||||
rtx brtmp;
|
rtx brtmp;
|
||||||
int reverse_regs, invert;
|
int reverse_regs, invert;
|
||||||
|
|
||||||
|
@ -1065,9 +1004,7 @@ gen_float_relational (test_code, cmp0, cmp1)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_expand_conditional_branch (operands, test_code)
|
xtensa_expand_conditional_branch (rtx *operands, enum rtx_code test_code)
|
||||||
rtx *operands;
|
|
||||||
enum rtx_code test_code;
|
|
||||||
{
|
{
|
||||||
enum cmp_type type = branch_type;
|
enum cmp_type type = branch_type;
|
||||||
rtx cmp0 = branch_cmp[0];
|
rtx cmp0 = branch_cmp[0];
|
||||||
|
@ -1114,8 +1051,7 @@ xtensa_expand_conditional_branch (operands, test_code)
|
||||||
|
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
gen_conditional_move (cmp)
|
gen_conditional_move (rtx cmp)
|
||||||
rtx cmp;
|
|
||||||
{
|
{
|
||||||
enum rtx_code code = GET_CODE (cmp);
|
enum rtx_code code = GET_CODE (cmp);
|
||||||
rtx op0 = branch_cmp[0];
|
rtx op0 = branch_cmp[0];
|
||||||
|
@ -1188,12 +1124,10 @@ gen_conditional_move (cmp)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_expand_conditional_move (operands, isflt)
|
xtensa_expand_conditional_move (rtx *operands, int isflt)
|
||||||
rtx *operands;
|
|
||||||
int isflt;
|
|
||||||
{
|
{
|
||||||
rtx cmp;
|
rtx cmp;
|
||||||
rtx (*gen_fn) PARAMS ((rtx, rtx, rtx, rtx, rtx));
|
rtx (*gen_fn) (rtx, rtx, rtx, rtx, rtx);
|
||||||
|
|
||||||
if (!(cmp = gen_conditional_move (operands[1])))
|
if (!(cmp = gen_conditional_move (operands[1])))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1214,13 +1148,12 @@ xtensa_expand_conditional_move (operands, isflt)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_expand_scc (operands)
|
xtensa_expand_scc (rtx *operands)
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
rtx dest = operands[0];
|
rtx dest = operands[0];
|
||||||
rtx cmp = operands[1];
|
rtx cmp = operands[1];
|
||||||
rtx one_tmp, zero_tmp;
|
rtx one_tmp, zero_tmp;
|
||||||
rtx (*gen_fn) PARAMS ((rtx, rtx, rtx, rtx, rtx));
|
rtx (*gen_fn) (rtx, rtx, rtx, rtx, rtx);
|
||||||
|
|
||||||
if (!(cmp = gen_conditional_move (cmp)))
|
if (!(cmp = gen_conditional_move (cmp)))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1242,9 +1175,7 @@ xtensa_expand_scc (operands)
|
||||||
for the output, i.e., the input operands are twice as big as MODE. */
|
for the output, i.e., the input operands are twice as big as MODE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_split_operand_pair (operands, mode)
|
xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode)
|
||||||
rtx operands[4];
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
switch (GET_CODE (operands[1]))
|
switch (GET_CODE (operands[1]))
|
||||||
{
|
{
|
||||||
|
@ -1291,9 +1222,7 @@ xtensa_split_operand_pair (operands, mode)
|
||||||
normally. */
|
normally. */
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_emit_move_sequence (operands, mode)
|
xtensa_emit_move_sequence (rtx *operands, enum machine_mode mode)
|
||||||
rtx *operands;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (CONSTANT_P (operands[1])
|
if (CONSTANT_P (operands[1])
|
||||||
&& GET_CODE (operands[1]) != CONSTANT_P_RTX
|
&& GET_CODE (operands[1]) != CONSTANT_P_RTX
|
||||||
|
@ -1345,8 +1274,7 @@ xtensa_emit_move_sequence (operands, mode)
|
||||||
|
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
fixup_subreg_mem (x)
|
fixup_subreg_mem (rtx x)
|
||||||
rtx x;
|
|
||||||
{
|
{
|
||||||
if (GET_CODE (x) == SUBREG
|
if (GET_CODE (x) == SUBREG
|
||||||
&& GET_CODE (SUBREG_REG (x)) == REG
|
&& GET_CODE (SUBREG_REG (x)) == REG
|
||||||
|
@ -1373,9 +1301,7 @@ fixup_subreg_mem (x)
|
||||||
the scheduler away, we should avoid any problems. */
|
the scheduler away, we should avoid any problems. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
xtensa_copy_incoming_a7 (operands, mode)
|
xtensa_copy_incoming_a7 (rtx *operands, enum machine_mode mode)
|
||||||
rtx *operands;
|
|
||||||
enum machine_mode mode;
|
|
||||||
{
|
{
|
||||||
if (a7_overlap_mentioned_p (operands[1])
|
if (a7_overlap_mentioned_p (operands[1])
|
||||||
&& !cfun->machine->incoming_a7_copied)
|
&& !cfun->machine->incoming_a7_copied)
|
||||||
|
@ -1441,8 +1367,7 @@ xtensa_copy_incoming_a7 (operands, mode)
|
||||||
operands[3] is the alignment */
|
operands[3] is the alignment */
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_expand_block_move (operands)
|
xtensa_expand_block_move (rtx *operands)
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
rtx dest = operands[0];
|
rtx dest = operands[0];
|
||||||
rtx src = operands[1];
|
rtx src = operands[1];
|
||||||
|
@ -1484,16 +1409,14 @@ xtensa_expand_block_move (operands)
|
||||||
temporary registers, store those N values, and repeat until the
|
temporary registers, store those N values, and repeat until the
|
||||||
complete block has been moved. N=delay_slots+1 */
|
complete block has been moved. N=delay_slots+1 */
|
||||||
|
|
||||||
struct meminsnbuf {
|
struct meminsnbuf
|
||||||
|
{
|
||||||
char template[30];
|
char template[30];
|
||||||
rtx operands[2];
|
rtx operands[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_emit_block_move (operands, tmpregs, delay_slots)
|
xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots)
|
||||||
rtx *operands;
|
|
||||||
rtx *tmpregs;
|
|
||||||
int delay_slots;
|
|
||||||
{
|
{
|
||||||
rtx dest = operands[0];
|
rtx dest = operands[0];
|
||||||
rtx src = operands[1];
|
rtx src = operands[1];
|
||||||
|
@ -1582,8 +1505,7 @@ xtensa_emit_block_move (operands, tmpregs, delay_slots)
|
||||||
|
|
||||||
|
|
||||||
static enum machine_mode
|
static enum machine_mode
|
||||||
xtensa_find_mode_for_size (item_size)
|
xtensa_find_mode_for_size (unsigned item_size)
|
||||||
unsigned item_size;
|
|
||||||
{
|
{
|
||||||
enum machine_mode mode, tmode;
|
enum machine_mode mode, tmode;
|
||||||
|
|
||||||
|
@ -1614,8 +1536,7 @@ xtensa_find_mode_for_size (item_size)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_expand_nonlocal_goto (operands)
|
xtensa_expand_nonlocal_goto (rtx *operands)
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
rtx goto_handler = operands[1];
|
rtx goto_handler = operands[1];
|
||||||
rtx containing_fp = operands[3];
|
rtx containing_fp = operands[3];
|
||||||
|
@ -1638,14 +1559,14 @@ xtensa_expand_nonlocal_goto (operands)
|
||||||
|
|
||||||
|
|
||||||
static struct machine_function *
|
static struct machine_function *
|
||||||
xtensa_init_machine_status ()
|
xtensa_init_machine_status (void)
|
||||||
{
|
{
|
||||||
return ggc_alloc_cleared (sizeof (struct machine_function));
|
return ggc_alloc_cleared (sizeof (struct machine_function));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_setup_frame_addresses ()
|
xtensa_setup_frame_addresses (void)
|
||||||
{
|
{
|
||||||
/* Set flag to cause FRAME_POINTER_REQUIRED to be set. */
|
/* Set flag to cause FRAME_POINTER_REQUIRED to be set. */
|
||||||
cfun->machine->accesses_prev_frame = 1;
|
cfun->machine->accesses_prev_frame = 1;
|
||||||
|
@ -1670,9 +1591,7 @@ xtensa_setup_frame_addresses ()
|
||||||
when the branch is taken. */
|
when the branch is taken. */
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_emit_loop_end (insn, operands)
|
xtensa_emit_loop_end (rtx insn, rtx *operands)
|
||||||
rtx insn;
|
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
char done = 0;
|
char done = 0;
|
||||||
|
|
||||||
|
@ -1711,9 +1630,7 @@ xtensa_emit_loop_end (insn, operands)
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
xtensa_emit_call (callop, operands)
|
xtensa_emit_call (int callop, rtx *operands)
|
||||||
int callop;
|
|
||||||
rtx *operands;
|
|
||||||
{
|
{
|
||||||
static char result[64];
|
static char result[64];
|
||||||
rtx tgt = operands[callop];
|
rtx tgt = operands[callop];
|
||||||
|
@ -1732,8 +1649,7 @@ xtensa_emit_call (callop, operands)
|
||||||
/* Return the stabs register number to use for 'regno'. */
|
/* Return the stabs register number to use for 'regno'. */
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_dbx_register_number (regno)
|
xtensa_dbx_register_number (int regno)
|
||||||
int regno;
|
|
||||||
{
|
{
|
||||||
int first = -1;
|
int first = -1;
|
||||||
|
|
||||||
|
@ -1777,21 +1693,18 @@ xtensa_dbx_register_number (regno)
|
||||||
/* Initialize CUMULATIVE_ARGS for a function. */
|
/* Initialize CUMULATIVE_ARGS for a function. */
|
||||||
|
|
||||||
void
|
void
|
||||||
init_cumulative_args (cum, fntype, libname)
|
init_cumulative_args (CUMULATIVE_ARGS *cum,
|
||||||
CUMULATIVE_ARGS *cum; /* argument info to initialize */
|
tree fntype ATTRIBUTE_UNUSED,
|
||||||
tree fntype ATTRIBUTE_UNUSED; /* tree ptr for function decl */
|
rtx libname ATTRIBUTE_UNUSED)
|
||||||
rtx libname ATTRIBUTE_UNUSED; /* SYMBOL_REF of library name or 0 */
|
|
||||||
{
|
{
|
||||||
cum->arg_words = 0;
|
cum->arg_words = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Advance the argument to the next argument position. */
|
/* Advance the argument to the next argument position. */
|
||||||
|
|
||||||
void
|
void
|
||||||
function_arg_advance (cum, mode, type)
|
function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type)
|
||||||
CUMULATIVE_ARGS *cum; /* current arg information */
|
|
||||||
enum machine_mode mode; /* current arg mode */
|
|
||||||
tree type; /* type of the argument or 0 if lib support */
|
|
||||||
{
|
{
|
||||||
int words, max;
|
int words, max;
|
||||||
int *arg_words;
|
int *arg_words;
|
||||||
|
@ -1811,14 +1724,12 @@ function_arg_advance (cum, mode, type)
|
||||||
|
|
||||||
|
|
||||||
/* Return an RTL expression containing the register for the given mode,
|
/* Return an RTL expression containing the register for the given mode,
|
||||||
or 0 if the argument is to be passed on the stack. */
|
or 0 if the argument is to be passed on the stack. INCOMING_P is non-zero
|
||||||
|
if this is an incoming argument to the current function. */
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
function_arg (cum, mode, type, incoming_p)
|
function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
|
||||||
CUMULATIVE_ARGS *cum; /* current arg information */
|
int incoming_p)
|
||||||
enum machine_mode mode; /* current arg mode */
|
|
||||||
tree type; /* type of the argument or 0 if lib support */
|
|
||||||
int incoming_p; /* computing the incoming registers? */
|
|
||||||
{
|
{
|
||||||
int regbase, words, max;
|
int regbase, words, max;
|
||||||
int *arg_words;
|
int *arg_words;
|
||||||
|
@ -1871,7 +1782,7 @@ function_arg (cum, mode, type, incoming_p)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
override_options ()
|
override_options (void)
|
||||||
{
|
{
|
||||||
int regno;
|
int regno;
|
||||||
enum machine_mode mode;
|
enum machine_mode mode;
|
||||||
|
@ -1982,11 +1893,9 @@ override_options ()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
printx (file, val)
|
printx (FILE *file, signed int val)
|
||||||
FILE *file;
|
|
||||||
signed int val;
|
|
||||||
{
|
{
|
||||||
/* print a hexadecimal value in a nice way */
|
/* Print a hexadecimal value in a nice way. */
|
||||||
if ((val > -0xa) && (val < 0xa))
|
if ((val > -0xa) && (val < 0xa))
|
||||||
fprintf (file, "%d", val);
|
fprintf (file, "%d", val);
|
||||||
else if (val < 0)
|
else if (val < 0)
|
||||||
|
@ -1997,10 +1906,7 @@ printx (file, val)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
print_operand (file, x, letter)
|
print_operand (FILE *file, rtx x, int letter)
|
||||||
FILE *file; /* file to write to */
|
|
||||||
rtx x; /* operand to print */
|
|
||||||
int letter; /* %<letter> or 0 */
|
|
||||||
{
|
{
|
||||||
if (!x)
|
if (!x)
|
||||||
error ("PRINT_OPERAND null pointer");
|
error ("PRINT_OPERAND null pointer");
|
||||||
|
@ -2146,9 +2052,7 @@ print_operand (file, x, letter)
|
||||||
reference whose address is ADDR. ADDR is an RTL expression. */
|
reference whose address is ADDR. ADDR is an RTL expression. */
|
||||||
|
|
||||||
void
|
void
|
||||||
print_operand_address (file, addr)
|
print_operand_address (FILE *file, rtx addr)
|
||||||
FILE *file;
|
|
||||||
rtx addr;
|
|
||||||
{
|
{
|
||||||
if (!addr)
|
if (!addr)
|
||||||
error ("PRINT_OPERAND_ADDRESS, null pointer");
|
error ("PRINT_OPERAND_ADDRESS, null pointer");
|
||||||
|
@ -2204,11 +2108,7 @@ print_operand_address (file, addr)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_output_literal (file, x, mode, labelno)
|
xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
|
||||||
FILE *file;
|
|
||||||
rtx x;
|
|
||||||
enum machine_mode mode;
|
|
||||||
int labelno;
|
|
||||||
{
|
{
|
||||||
long value_long[2];
|
long value_long[2];
|
||||||
REAL_VALUE_TYPE r;
|
REAL_VALUE_TYPE r;
|
||||||
|
@ -2274,10 +2174,9 @@ xtensa_output_literal (file, x, mode, labelno)
|
||||||
#define XTENSA_STACK_ALIGN(LOC) (((LOC) + STACK_BYTES-1) & ~(STACK_BYTES-1))
|
#define XTENSA_STACK_ALIGN(LOC) (((LOC) + STACK_BYTES-1) & ~(STACK_BYTES-1))
|
||||||
|
|
||||||
long
|
long
|
||||||
compute_frame_size (size)
|
compute_frame_size (int size)
|
||||||
int size; /* # of var. bytes allocated */
|
|
||||||
{
|
{
|
||||||
/* add space for the incoming static chain value */
|
/* Add space for the incoming static chain value. */
|
||||||
if (current_function_needs_context)
|
if (current_function_needs_context)
|
||||||
size += (1 * UNITS_PER_WORD);
|
size += (1 * UNITS_PER_WORD);
|
||||||
|
|
||||||
|
@ -2290,7 +2189,7 @@ compute_frame_size (size)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
xtensa_frame_pointer_required ()
|
xtensa_frame_pointer_required (void)
|
||||||
{
|
{
|
||||||
/* The code to expand builtin_frame_addr and builtin_return_addr
|
/* The code to expand builtin_frame_addr and builtin_return_addr
|
||||||
currently uses the hard_frame_pointer instead of frame_pointer.
|
currently uses the hard_frame_pointer instead of frame_pointer.
|
||||||
|
@ -2305,7 +2204,7 @@ xtensa_frame_pointer_required ()
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_expand_prologue ()
|
xtensa_expand_prologue (void)
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT total_size;
|
HOST_WIDE_INT total_size;
|
||||||
rtx size_rtx;
|
rtx size_rtx;
|
||||||
|
@ -2379,18 +2278,15 @@ xtensa_expand_prologue ()
|
||||||
/* Clear variables at function end. */
|
/* Clear variables at function end. */
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_function_epilogue (file, size)
|
xtensa_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
|
||||||
FILE *file ATTRIBUTE_UNUSED;
|
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
|
||||||
HOST_WIDE_INT size ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
xtensa_current_frame_size = 0;
|
xtensa_current_frame_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
xtensa_return_addr (count, frame)
|
xtensa_return_addr (int count, rtx frame)
|
||||||
int count;
|
|
||||||
rtx frame;
|
|
||||||
{
|
{
|
||||||
rtx result, retaddr;
|
rtx result, retaddr;
|
||||||
|
|
||||||
|
@ -2428,7 +2324,7 @@ xtensa_return_addr (count, frame)
|
||||||
argument word N for N >= 6. */
|
argument word N for N >= 6. */
|
||||||
|
|
||||||
tree
|
tree
|
||||||
xtensa_build_va_list ()
|
xtensa_build_va_list (void)
|
||||||
{
|
{
|
||||||
tree f_stk, f_reg, f_ndx, record, type_decl;
|
tree f_stk, f_reg, f_ndx, record, type_decl;
|
||||||
|
|
||||||
|
@ -2461,7 +2357,7 @@ xtensa_build_va_list ()
|
||||||
address of the saved registers. */
|
address of the saved registers. */
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
xtensa_builtin_saveregs ()
|
xtensa_builtin_saveregs (void)
|
||||||
{
|
{
|
||||||
rtx gp_regs, dest;
|
rtx gp_regs, dest;
|
||||||
int arg_words = current_function_arg_words;
|
int arg_words = current_function_arg_words;
|
||||||
|
@ -2499,9 +2395,7 @@ xtensa_builtin_saveregs ()
|
||||||
current function to fill in an initial va_list. */
|
current function to fill in an initial va_list. */
|
||||||
|
|
||||||
void
|
void
|
||||||
xtensa_va_start (valist, nextarg)
|
xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||||
tree valist;
|
|
||||||
rtx nextarg ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
tree f_stk, stk;
|
tree f_stk, stk;
|
||||||
tree f_reg, reg;
|
tree f_reg, reg;
|
||||||
|
@ -2545,8 +2439,7 @@ xtensa_va_start (valist, nextarg)
|
||||||
/* Implement `va_arg'. */
|
/* Implement `va_arg'. */
|
||||||
|
|
||||||
rtx
|
rtx
|
||||||
xtensa_va_arg (valist, type)
|
xtensa_va_arg (tree valist, tree type)
|
||||||
tree valist, type;
|
|
||||||
{
|
{
|
||||||
tree f_stk, stk;
|
tree f_stk, stk;
|
||||||
tree f_reg, reg;
|
tree f_reg, reg;
|
||||||
|
@ -2581,8 +2474,7 @@ xtensa_va_arg (valist, type)
|
||||||
/* First align __va_ndx to a double word boundary if necessary for this arg:
|
/* First align __va_ndx to a double word boundary if necessary for this arg:
|
||||||
|
|
||||||
if (__alignof__ (TYPE) > 4)
|
if (__alignof__ (TYPE) > 4)
|
||||||
(AP).__va_ndx = (((AP).__va_ndx + 7) & -8)
|
(AP).__va_ndx = (((AP).__va_ndx + 7) & -8); */
|
||||||
*/
|
|
||||||
|
|
||||||
if (TYPE_ALIGN (type) > BITS_PER_WORD)
|
if (TYPE_ALIGN (type) > BITS_PER_WORD)
|
||||||
{
|
{
|
||||||
|
@ -2599,8 +2491,7 @@ xtensa_va_arg (valist, type)
|
||||||
/* Increment __va_ndx to point past the argument:
|
/* Increment __va_ndx to point past the argument:
|
||||||
|
|
||||||
orig_ndx = (AP).__va_ndx;
|
orig_ndx = (AP).__va_ndx;
|
||||||
(AP).__va_ndx += __va_size (TYPE);
|
(AP).__va_ndx += __va_size (TYPE); */
|
||||||
*/
|
|
||||||
|
|
||||||
orig_ndx = gen_reg_rtx (SImode);
|
orig_ndx = gen_reg_rtx (SImode);
|
||||||
r = expand_expr (ndx, orig_ndx, SImode, EXPAND_NORMAL);
|
r = expand_expr (ndx, orig_ndx, SImode, EXPAND_NORMAL);
|
||||||
|
@ -2618,8 +2509,7 @@ xtensa_va_arg (valist, type)
|
||||||
|
|
||||||
if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4
|
if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4
|
||||||
&& !MUST_PASS_IN_STACK (type))
|
&& !MUST_PASS_IN_STACK (type))
|
||||||
__array = (AP).__va_reg;
|
__array = (AP).__va_reg; */
|
||||||
*/
|
|
||||||
|
|
||||||
array = gen_reg_rtx (Pmode);
|
array = gen_reg_rtx (Pmode);
|
||||||
|
|
||||||
|
@ -2652,8 +2542,7 @@ xtensa_va_arg (valist, type)
|
||||||
if (orig_ndx < __MAX_ARGS_IN_REGISTERS * 4)
|
if (orig_ndx < __MAX_ARGS_IN_REGISTERS * 4)
|
||||||
(AP).__va_ndx = __MAX_ARGS_IN_REGISTERS * 4 + __va_size (TYPE);
|
(AP).__va_ndx = __MAX_ARGS_IN_REGISTERS * 4 + __va_size (TYPE);
|
||||||
__array = (AP).__va_stk;
|
__array = (AP).__va_stk;
|
||||||
}
|
} */
|
||||||
*/
|
|
||||||
|
|
||||||
lab_false2 = gen_label_rtx ();
|
lab_false2 = gen_label_rtx ();
|
||||||
emit_cmp_and_jump_insns (orig_ndx,
|
emit_cmp_and_jump_insns (orig_ndx,
|
||||||
|
@ -2684,8 +2573,7 @@ xtensa_va_arg (valist, type)
|
||||||
: __va_size (TYPE))
|
: __va_size (TYPE))
|
||||||
|
|
||||||
The results are endian-dependent because values smaller than one word
|
The results are endian-dependent because values smaller than one word
|
||||||
are aligned differently.
|
are aligned differently. */
|
||||||
*/
|
|
||||||
|
|
||||||
size = gen_reg_rtx (SImode);
|
size = gen_reg_rtx (SImode);
|
||||||
emit_move_insn (size, va_size);
|
emit_move_insn (size, va_size);
|
||||||
|
@ -2718,10 +2606,7 @@ xtensa_va_arg (valist, type)
|
||||||
|
|
||||||
|
|
||||||
enum reg_class
|
enum reg_class
|
||||||
xtensa_preferred_reload_class (x, class, isoutput)
|
xtensa_preferred_reload_class (rtx x, enum reg_class class, int isoutput)
|
||||||
rtx x;
|
|
||||||
enum reg_class class;
|
|
||||||
int isoutput;
|
|
||||||
{
|
{
|
||||||
if (!isoutput && CONSTANT_P (x) && GET_CODE (x) == CONST_DOUBLE)
|
if (!isoutput && CONSTANT_P (x) && GET_CODE (x) == CONST_DOUBLE)
|
||||||
return NO_REGS;
|
return NO_REGS;
|
||||||
|
@ -2740,11 +2625,9 @@ xtensa_preferred_reload_class (x, class, isoutput)
|
||||||
|
|
||||||
|
|
||||||
enum reg_class
|
enum reg_class
|
||||||
xtensa_secondary_reload_class (class, mode, x, isoutput)
|
xtensa_secondary_reload_class (enum reg_class class,
|
||||||
enum reg_class class;
|
enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
rtx x, int isoutput)
|
||||||
rtx x;
|
|
||||||
int isoutput;
|
|
||||||
{
|
{
|
||||||
int regno;
|
int regno;
|
||||||
|
|
||||||
|
@ -2768,7 +2651,7 @@ xtensa_secondary_reload_class (class, mode, x, isoutput)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
order_regs_for_local_alloc ()
|
order_regs_for_local_alloc (void)
|
||||||
{
|
{
|
||||||
if (!leaf_function_p ())
|
if (!leaf_function_p ())
|
||||||
{
|
{
|
||||||
|
@ -2813,8 +2696,7 @@ order_regs_for_local_alloc ()
|
||||||
references to a7 (as opposed to hard_frame_pointer_rtx). */
|
references to a7 (as opposed to hard_frame_pointer_rtx). */
|
||||||
|
|
||||||
int
|
int
|
||||||
a7_overlap_mentioned_p (x)
|
a7_overlap_mentioned_p (rtx x)
|
||||||
rtx x;
|
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
unsigned int x_regno;
|
unsigned int x_regno;
|
||||||
|
@ -2863,10 +2745,7 @@ a7_overlap_mentioned_p (x)
|
||||||
name ends with ".bss", add SECTION_BSS to the flags. */
|
name ends with ".bss", add SECTION_BSS to the flags. */
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
xtensa_multibss_section_type_flags (decl, name, reloc)
|
xtensa_multibss_section_type_flags (tree decl, const char *name, int reloc)
|
||||||
tree decl;
|
|
||||||
const char *name;
|
|
||||||
int reloc;
|
|
||||||
{
|
{
|
||||||
unsigned int flags = default_section_type_flags (decl, name, reloc);
|
unsigned int flags = default_section_type_flags (decl, name, reloc);
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
|
@ -2889,23 +2768,20 @@ xtensa_multibss_section_type_flags (decl, name, reloc)
|
||||||
/* The literal pool stays with the function. */
|
/* The literal pool stays with the function. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xtensa_select_rtx_section (mode, x, align)
|
xtensa_select_rtx_section (enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
rtx x ATTRIBUTE_UNUSED,
|
||||||
rtx x ATTRIBUTE_UNUSED;
|
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
|
||||||
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
|
|
||||||
{
|
{
|
||||||
function_section (current_function_decl);
|
function_section (current_function_decl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Compute a (partial) cost for rtx X. Return true if the complete
|
/* Compute a (partial) cost for rtx X. Return true if the complete
|
||||||
cost has been computed, and false if subexpressions should be
|
cost has been computed, and false if subexpressions should be
|
||||||
scanned. In either case, *TOTAL contains the cost result. */
|
scanned. In either case, *TOTAL contains the cost result. */
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
xtensa_rtx_costs (x, code, outer_code, total)
|
xtensa_rtx_costs (rtx x, int code, int outer_code, int *total)
|
||||||
rtx x;
|
|
||||||
int code, outer_code;
|
|
||||||
int *total;
|
|
||||||
{
|
{
|
||||||
switch (code)
|
switch (code)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue