aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/mmix/mmix-protos.h4
-rw-r--r--gcc/config/mmix/mmix.c35
-rw-r--r--gcc/config/mmix/mmix.h21
3 files changed, 34 insertions, 26 deletions
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index a5ae7c8..23152f3 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -1,5 +1,5 @@
/* Prototypes for exported functions defined in mmix.c
- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC.
@@ -60,8 +60,6 @@ extern int mmix_function_value_regno_p (int);
extern int mmix_data_alignment (tree, int);
extern int mmix_constant_alignment (tree, int);
extern int mmix_local_alignment (tree, int);
-extern void mmix_setup_incoming_varargs
- (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
extern void mmix_asm_output_pool_prologue (FILE *, const char *, tree, int);
extern void mmix_asm_output_aligned_common (FILE *, const char *, int, int);
extern void mmix_asm_output_aligned_local (FILE *, const char *, int, int);
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 764e9b8..8c74d22 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for MMIX.
- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC.
@@ -133,9 +133,12 @@ static void mmix_target_asm_function_epilogue (FILE *, HOST_WIDE_INT);
static void mmix_reorg (void);
static void mmix_asm_output_mi_thunk
(FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
+static void mmix_setup_incoming_varargs
+ (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
static void mmix_file_start (void);
static void mmix_file_end (void);
static bool mmix_rtx_costs (rtx, int, int, int *);
+static rtx mmix_struct_value_rtx (tree, int);
/* Target structure macros. Listed by node. See `Using and Porting GCC'
@@ -187,6 +190,21 @@ static bool mmix_rtx_costs (rtx, int, int, int *);
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mmix_reorg
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#if 0
+/* Apparently not doing TRT if int < register-size. FIXME: Perhaps
+ FUNCTION_VALUE and LIBCALL_VALUE needs tweaking as some ports say. */
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#endif
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx
+
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS mmix_setup_incoming_varargs
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Functions that are expansions for target macros.
@@ -803,9 +821,11 @@ mmix_function_profiler (FILE *stream ATTRIBUTE_UNUSED,
sorry ("function_profiler support for MMIX");
}
-/* SETUP_INCOMING_VARARGS. */
+/* Worker function for TARGET_SETUP_INCOMING_VARARGS. For the moment,
+ let's stick to pushing argument registers on the stack. Later, we
+ can parse all arguments in registers, to improve performance. */
-void
+static void
mmix_setup_incoming_varargs (CUMULATIVE_ARGS *args_so_farp,
enum machine_mode mode,
tree vartype,
@@ -2938,6 +2958,15 @@ mmix_intval (rtx x)
fatal_insn ("MMIX Internal: This is not a constant:", x);
}
+/* Worker function for TARGET_STRUCT_VALUE_RTX. */
+
+static rtx
+mmix_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, MMIX_STRUCT_VALUE_REGNUM);
+}
+
/*
* Local variables:
* eval: (c-set-style "gnu")
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 62a258e..19a0afe 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for MMIX.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of GCC.
@@ -293,14 +293,6 @@ extern int target_flags;
} \
} while (0)
-#define PROMOTE_FUNCTION_ARGS
-
-#if 0
-/* Apparently not doing TRT if int < register-size. FIXME: Perhaps
- FUNCTION_VALUE and LIBCALL_VALUE needs tweaking as some ports say. */
-#define PROMOTE_FUNCTION_RETURN
-#endif
-
/* I'm a little bit undecided about this one. It might be beneficial to
promote all operations. */
#define PROMOTE_FOR_CALL_ONLY
@@ -779,11 +771,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
mmix_function_value_regno_p (REGNO)
-/* Node: Aggregate Return */
-
-#define STRUCT_VALUE_REGNUM MMIX_STRUCT_VALUE_REGNUM
-
-
/* Node: Caller Saves */
/* (empty) */
@@ -806,12 +793,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
/* Node: Varargs */
-/* For the moment, let's stick to pushing argument registers on the stack.
- Later, we can parse all arguments in registers, to improve
- performance. */
-#define SETUP_INCOMING_VARARGS(A, M, T, P, S) \
- mmix_setup_incoming_varargs(&(A), M, T, &(P), S)
-
/* FIXME: This and other EXPAND_BUILTIN_VA_... target macros are not
documented, although used by several targets. */
#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \