aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2007-09-25 02:18:37 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2007-09-25 02:18:37 +0000
commit60e90d090baeb13169246bc81bdc81f41af17aaf (patch)
tree279d03b71ee46d3272e5b0ad4fae87ca2e80c8ae /gcc/config
parentab3e1ef66a7e5d765ffb9730c0894487211e0f82 (diff)
downloadgcc-60e90d090baeb13169246bc81bdc81f41af17aaf.zip
gcc-60e90d090baeb13169246bc81bdc81f41af17aaf.tar.gz
gcc-60e90d090baeb13169246bc81bdc81f41af17aaf.tar.bz2
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
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c20
-rw-r--r--gcc/config/mmix/mmix.h13
3 files changed, 24 insertions, 10 deletions
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index c963147..d71064a 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -49,6 +49,7 @@ extern void mmix_asm_output_align (FILE *, 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_conditional_register_usage (void);
+extern int mmix_opposite_regno (int, int);
extern int mmix_local_regno (int);
extern int mmix_dbx_register_number (int);
extern int mmix_use_simple_return (void);
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 699a30d..a55b0dc 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -319,6 +319,26 @@ mmix_conditional_register_usage (void)
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.
All registers that are part of the register stack and that will be
saved are local. */
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 8f09cdb..19aab6f 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -319,13 +319,9 @@ extern int target_flags;
#define CONDITIONAL_REGISTER_USAGE mmix_conditional_register_usage ()
-/* No INCOMING_REGNO or OUTGOING_REGNO, since those macros are not usable
- 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
- $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. */
+#define INCOMING_REGNO(OUT) mmix_opposite_regno (OUT, 0)
+
+#define OUTGOING_REGNO(IN) mmix_opposite_regno (IN, 1)
/* Defining LOCAL_REGNO is necessary in presence of prologue/epilogue,
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) \
mmix_function_arg_regno_p (REGNO, 0)
-#define FUNCTION_INCOMING_ARG_REGNO_P(REGNO) \
- mmix_function_arg_regno_p (REGNO, 1)
-
/* Node: Register Arguments */