mmix.h (FUNCTION_INCOMING_ARG_REGNO_P): Don't define bogus target macro.

* config/mmix/mmix.h (FUNCTION_INCOMING_ARG_REGNO_P): Don't define
	bogus target macro.
	(INCOMING_REGNO, OUTGOING_REGNO): Define.
	* config/mmix/mmix.c (mmix_opposite_regno): New function.
	* config/mmix/mmix-protos.h (mmix_opposite_regno): Prototype.

From-SVN: r128744
This commit is contained in:
Hans-Peter Nilsson 2007-09-25 02:18:37 +00:00 committed by Hans-Peter Nilsson
parent ab3e1ef66a
commit 60e90d090b
4 changed files with 30 additions and 10 deletions

View File

@ -1,5 +1,11 @@
2007-09-25 Hans-Peter Nilsson <hp@bitrange.com> 2007-09-25 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.h (FUNCTION_INCOMING_ARG_REGNO_P): Don't define
bogus target macro.
(INCOMING_REGNO, OUTGOING_REGNO): Define.
* config/mmix/mmix.c (mmix_opposite_regno): New function.
* config/mmix/mmix-protos.h (mmix_opposite_regno): Prototype.
* config/mmix/mmix.md ("*cmpcc_folded"): In condition, gate * config/mmix/mmix.md ("*cmpcc_folded"): In condition, gate
with REG_P tests before REGNO access. with REG_P tests before REGNO access.

View File

@ -49,6 +49,7 @@ extern void mmix_asm_output_align (FILE *, int);
extern int mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT); extern int mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT);
extern void mmix_output_register_setting (FILE *, int, HOST_WIDEST_INT, int); extern void mmix_output_register_setting (FILE *, int, HOST_WIDEST_INT, int);
extern void mmix_conditional_register_usage (void); extern void mmix_conditional_register_usage (void);
extern int mmix_opposite_regno (int, int);
extern int mmix_local_regno (int); extern int mmix_local_regno (int);
extern int mmix_dbx_register_number (int); extern int mmix_dbx_register_number (int);
extern int mmix_use_simple_return (void); extern int mmix_use_simple_return (void);

View File

@ -319,6 +319,26 @@ mmix_conditional_register_usage (void)
reg_names[i]++; reg_names[i]++;
} }
/* INCOMING_REGNO and OUTGOING_REGNO worker function.
Those two macros must only be applied to function argument
registers. FIXME: for their current use in gcc, it'd be better
with an explicit specific additional FUNCTION_INCOMING_ARG_REGNO_P
a'la FUNCTION_ARG / FUNCTION_INCOMING_ARG instead of forcing the
target to commit to a fixed mapping and for any unspecified
register use. */
int
mmix_opposite_regno (int regno, int incoming)
{
if (!mmix_function_arg_regno_p (regno, incoming))
return regno;
return
regno - (incoming
? MMIX_FIRST_INCOMING_ARG_REGNUM - MMIX_FIRST_ARG_REGNUM
: MMIX_FIRST_ARG_REGNUM - MMIX_FIRST_INCOMING_ARG_REGNUM);
}
/* LOCAL_REGNO. /* LOCAL_REGNO.
All registers that are part of the register stack and that will be All registers that are part of the register stack and that will be
saved are local. */ saved are local. */

View File

@ -319,13 +319,9 @@ extern int target_flags;
#define CONDITIONAL_REGISTER_USAGE mmix_conditional_register_usage () #define CONDITIONAL_REGISTER_USAGE mmix_conditional_register_usage ()
/* No INCOMING_REGNO or OUTGOING_REGNO, since those macros are not usable #define INCOMING_REGNO(OUT) mmix_opposite_regno (OUT, 0)
for MMIX: it doesn't have a fixed register window size. FIXME: Perhaps
we should say something about $0..$15 may sometimes be the incoming #define OUTGOING_REGNO(IN) mmix_opposite_regno (IN, 1)
$16..$31. Those macros need better documentation; it looks like
they're just bogus and that FUNCTION_INCOMING_ARG_REGNO_P and
FUNCTION_OUTGOING_VALUE should be used where they're used. For the
moment, do nothing; things seem to work anyway. */
/* Defining LOCAL_REGNO is necessary in presence of prologue/epilogue, /* Defining LOCAL_REGNO is necessary in presence of prologue/epilogue,
else GCC will be confused that those registers aren't saved and else GCC will be confused that those registers aren't saved and
@ -644,9 +640,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#define FUNCTION_ARG_REGNO_P(REGNO) \ #define FUNCTION_ARG_REGNO_P(REGNO) \
mmix_function_arg_regno_p (REGNO, 0) mmix_function_arg_regno_p (REGNO, 0)
#define FUNCTION_INCOMING_ARG_REGNO_P(REGNO) \
mmix_function_arg_regno_p (REGNO, 1)
/* Node: Register Arguments */ /* Node: Register Arguments */