Commit 997b8b4d by Bob Wilson Committed by Bob Wilson

xtensa-protos.h (xtensa_copy_incoming_a7): Update.

	* config/xtensa/xtensa-protos.h (xtensa_copy_incoming_a7): Update.
	(init_cumulative_args): Likewise.
	(a7_overlap_mentioned_p): Delete prototype.
	* config/xtensa/xtensa.c (struct machine_function): Replace
	incoming_a7_copied field with need_a7_copy and vararg_a7 flags.
	Add set_frame_ptr_insn field.
	(xtensa_emit_move_sequence): Update call to xtensa_copy_incoming_a7.
	(xtensa_copy_incoming_a7): Rewrite to check need_a7_copy flag and check
	if the operand is an argument in a7.  If so, copy a7 to a new pseudo
	at the function entry and replace the operand with the pseudo.
	(init_cumulative_args): Remove unused arguments.  Add new "incoming"
	argument and record this flag in CUMULATIVE_ARGS.
	(function_arg): Remove result_mode and special-case code to handle
	arguments in a7.  Instead, set need_a7_copy flag when there is an
	incoming argument in a7.
	(xtensa_expand_prologue): Remove code to search for set_frame_ptr insn
	and use the value recorded in cfun->machine->set_frame_ptr_insn.
	(xtensa_builtin_saveregs): Check for negative gp_left value.  Set
	need_a7_copy and vararg_a7 flags.  Use move_block_from_reg instead of
	special-case code.
	(a7_overlap_mentioned_p): Delete.
	* config/xtensa/xtensa.h (CUMULATIVE_ARGS): Add "incoming" flag.
	(INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Remove useless
	arguments to init_cumulative_args and pass "incoming" flag instead.
	(BLOCK_REG_PADDING): Delete.
	* config/xtensa/xtensa.md (movdi, movsf, movdf): Remove unnecessary
	checks for reload_in_progress and reload_completed.  Update calls to
	xtensa_copy_incoming_a7.
	(ashlsi3): Rename existing insn to ashlsi3_internal.  Add expander
	to call xtensa_copy_incoming_a7.

From-SVN: r77583
parent 99bee03a
2004-02-09 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa-protos.h (xtensa_copy_incoming_a7): Update.
(init_cumulative_args): Likewise.
(a7_overlap_mentioned_p): Delete prototype.
* config/xtensa/xtensa.c (struct machine_function): Replace
incoming_a7_copied field with need_a7_copy and vararg_a7 flags.
Add set_frame_ptr_insn field.
(xtensa_emit_move_sequence): Update call to xtensa_copy_incoming_a7.
(xtensa_copy_incoming_a7): Rewrite to check need_a7_copy flag and check
if the operand is an argument in a7. If so, copy a7 to a new pseudo
at the function entry and replace the operand with the pseudo.
(init_cumulative_args): Remove unused arguments. Add new "incoming"
argument and record this flag in CUMULATIVE_ARGS.
(function_arg): Remove result_mode and special-case code to handle
arguments in a7. Instead, set need_a7_copy flag when there is an
incoming argument in a7.
(xtensa_expand_prologue): Remove code to search for set_frame_ptr insn
and use the value recorded in cfun->machine->set_frame_ptr_insn.
(xtensa_builtin_saveregs): Check for negative gp_left value. Set
need_a7_copy and vararg_a7 flags. Use move_block_from_reg instead of
special-case code.
(a7_overlap_mentioned_p): Delete.
* config/xtensa/xtensa.h (CUMULATIVE_ARGS): Add "incoming" flag.
(INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Remove useless
arguments to init_cumulative_args and pass "incoming" flag instead.
(BLOCK_REG_PADDING): Delete.
* config/xtensa/xtensa.md (movdi, movsf, movdf): Remove unnecessary
checks for reload_in_progress and reload_completed. Update calls to
xtensa_copy_incoming_a7.
(ashlsi3): Rename existing insn to ashlsi3_internal. Add expander
to call xtensa_copy_incoming_a7.
2004-02-09 DJ Delorie <dj@redhat.com> 2004-02-09 DJ Delorie <dj@redhat.com>
* config/i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): No * config/i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): No
......
...@@ -68,14 +68,14 @@ extern int xtensa_expand_scc (rtx *); ...@@ -68,14 +68,14 @@ extern int xtensa_expand_scc (rtx *);
extern int xtensa_expand_block_move (rtx *); extern int xtensa_expand_block_move (rtx *);
extern void xtensa_split_operand_pair (rtx *, enum machine_mode); extern void xtensa_split_operand_pair (rtx *, enum machine_mode);
extern int xtensa_emit_move_sequence (rtx *, enum machine_mode); extern int xtensa_emit_move_sequence (rtx *, enum machine_mode);
extern bool xtensa_copy_incoming_a7 (rtx *, enum machine_mode); extern rtx xtensa_copy_incoming_a7 (rtx);
extern void xtensa_emit_block_move (rtx *, rtx *, int); extern void xtensa_emit_block_move (rtx *, rtx *, int);
extern void xtensa_expand_nonlocal_goto (rtx *); extern void xtensa_expand_nonlocal_goto (rtx *);
extern void xtensa_emit_loop_end (rtx, rtx *); extern void xtensa_emit_loop_end (rtx, rtx *);
extern char *xtensa_emit_call (int, rtx *); extern char *xtensa_emit_call (int, rtx *);
#ifdef TREE_CODE #ifdef TREE_CODE
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx); extern void init_cumulative_args (CUMULATIVE_ARGS *, int);
extern void xtensa_va_start (tree, rtx); extern void xtensa_va_start (tree, rtx);
extern rtx xtensa_va_arg (tree, tree); extern rtx xtensa_va_arg (tree, tree);
#endif /* TREE_CODE */ #endif /* TREE_CODE */
...@@ -88,7 +88,6 @@ extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int); ...@@ -88,7 +88,6 @@ extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int);
extern enum reg_class xtensa_secondary_reload_class (enum reg_class, extern enum reg_class xtensa_secondary_reload_class (enum reg_class,
enum machine_mode, rtx, enum machine_mode, rtx,
int); int);
extern int a7_overlap_mentioned_p (rtx);
#endif /* RTX_CODE */ #endif /* RTX_CODE */
#ifdef TREE_CODE #ifdef TREE_CODE
......
...@@ -736,23 +736,21 @@ extern enum reg_class xtensa_char_to_class[256]; ...@@ -736,23 +736,21 @@ extern enum reg_class xtensa_char_to_class[256];
#define FUNCTION_ARG_REGNO_P(N) \ #define FUNCTION_ARG_REGNO_P(N) \
((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST) ((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST)
/* Define a data type for recording info about an argument list /* Record the number of argument words seen so far, along with a flag to
during the scan of that argument list. This data type should indicate whether these are incoming arguments. (FUNCTION_INCOMING_ARG
hold all necessary information about the function itself is used for both incoming and outgoing args, so a separate flag is
and about the args processed so far, enough to enable macros needed. */
such as FUNCTION_ARG to determine where the next arg should go. */ typedef struct xtensa_args
typedef struct xtensa_args { {
int arg_words; /* # total words the arguments take */ int arg_words;
int incoming;
} CUMULATIVE_ARGS; } CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME) init_cumulative_args (&CUM, 0)
#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \ #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME) init_cumulative_args (&CUM, 1)
/* Update the data in CUM to advance over an argument /* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE. of mode MODE and data type TYPE.
...@@ -798,12 +796,6 @@ typedef struct xtensa_args { ...@@ -798,12 +796,6 @@ typedef struct xtensa_args {
/* Pass complex arguments independently. */ /* Pass complex arguments independently. */
#define SPLIT_COMPLEX_ARGS 1 #define SPLIT_COMPLEX_ARGS 1
/* Because Xtensa's function_arg() wraps BLKmode arguments passed in
a7 inside a PARALLEL, BLOCK_REG_PADDING needs to be defined
to get emit_group_store to do the right thing. */
#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
FUNCTION_ARG_PADDING (MODE, TYPE)
/* Profiling Xtensa code is typically done with the built-in profiling /* Profiling Xtensa code is typically done with the built-in profiling
feature of Tensilica's instruction set simulator, which does not feature of Tensilica's instruction set simulator, which does not
require any compiler support. Profiling code on a real (i.e., require any compiler support. Profiling code on a real (i.e.,
...@@ -1142,11 +1134,6 @@ typedef struct xtensa_args { ...@@ -1142,11 +1134,6 @@ typedef struct xtensa_args {
/* Prefer word-sized loads. */ /* Prefer word-sized loads. */
#define SLOW_BYTE_ACCESS 1 #define SLOW_BYTE_ACCESS 1
/* ??? Xtensa doesn't have any instructions that set integer values
based on the results of comparisons, but the simplification code in
the combiner also uses STORE_FLAG_VALUE. The default value (1) is
fine for us, but (-1) might be better. */
/* Shift instructions ignore all but the low-order few bits. */ /* Shift instructions ignore all but the low-order few bits. */
#define SHIFT_COUNT_TRUNCATED 1 #define SHIFT_COUNT_TRUNCATED 1
......
...@@ -803,15 +803,11 @@ ...@@ -803,15 +803,11 @@
if (CONSTANT_P (operands[1]) && !TARGET_CONST16) if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
operands[1] = force_const_mem (DImode, operands[1]); operands[1] = force_const_mem (DImode, operands[1]);
if (!(reload_in_progress | reload_completed)) if (!register_operand (operands[0], DImode)
{ && !register_operand (operands[1], DImode))
if (!register_operand (operands[0], DImode) operands[1] = force_reg (DImode, operands[1]);
&& !register_operand (operands[1], DImode))
operands[1] = force_reg (DImode, operands[1]);
if (xtensa_copy_incoming_a7 (operands, DImode)) operands[1] = xtensa_copy_incoming_a7 (operands[1]);
DONE;
}
}) })
(define_insn_and_split "movdi_internal" (define_insn_and_split "movdi_internal"
...@@ -934,18 +930,15 @@ ...@@ -934,18 +930,15 @@
if (!TARGET_CONST16 && CONSTANT_P (operands[1])) if (!TARGET_CONST16 && CONSTANT_P (operands[1]))
operands[1] = force_const_mem (SFmode, operands[1]); operands[1] = force_const_mem (SFmode, operands[1]);
if (!(reload_in_progress | reload_completed)) if ((!register_operand (operands[0], SFmode)
{ && !register_operand (operands[1], SFmode))
if ((!register_operand (operands[0], SFmode) || (FP_REG_P (xt_true_regnum (operands[0]))
&& !register_operand (operands[1], SFmode)) && !(reload_in_progress | reload_completed)
|| (FP_REG_P (xt_true_regnum (operands[0])) && (constantpool_mem_p (operands[1])
&& (constantpool_mem_p (operands[1]) || CONSTANT_P (operands[1]))))
|| CONSTANT_P (operands[1])))) operands[1] = force_reg (SFmode, operands[1]);
operands[1] = force_reg (SFmode, operands[1]);
operands[1] = xtensa_copy_incoming_a7 (operands[1]);
if (xtensa_copy_incoming_a7 (operands, SFmode))
DONE;
}
}) })
(define_insn "movsf_internal" (define_insn "movsf_internal"
...@@ -1015,15 +1008,11 @@ ...@@ -1015,15 +1008,11 @@
if (CONSTANT_P (operands[1]) && !TARGET_CONST16) if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
operands[1] = force_const_mem (DFmode, operands[1]); operands[1] = force_const_mem (DFmode, operands[1]);
if (!(reload_in_progress | reload_completed)) if (!register_operand (operands[0], DFmode)
{ && !register_operand (operands[1], DFmode))
if (!register_operand (operands[0], DFmode) operands[1] = force_reg (DFmode, operands[1]);
&& !register_operand (operands[1], DFmode))
operands[1] = force_reg (DFmode, operands[1]);
if (xtensa_copy_incoming_a7 (operands, DFmode)) operands[1] = xtensa_copy_incoming_a7 (operands[1]);
DONE;
}
}) })
(define_insn_and_split "movdf_internal" (define_insn_and_split "movdf_internal"
...@@ -1081,7 +1070,16 @@ ...@@ -1081,7 +1070,16 @@
;; Shift instructions. ;; Shift instructions.
(define_insn "ashlsi3" (define_expand "ashlsi3"
[(set (match_operand:SI 0 "register_operand" "")
(ashift:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "arith_operand" "")))]
""
{
operands[1] = xtensa_copy_incoming_a7 (operands[1]);
})
(define_insn "ashlsi3_internal"
[(set (match_operand:SI 0 "register_operand" "=a,a") [(set (match_operand:SI 0 "register_operand" "=a,a")
(ashift:SI (match_operand:SI 1 "register_operand" "r,r") (ashift:SI (match_operand:SI 1 "register_operand" "r,r")
(match_operand:SI 2 "arith_operand" "J,r")))] (match_operand:SI 2 "arith_operand" "J,r")))]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment