summaryrefslogtreecommitdiff
path: root/gcc/config/xtensa
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-26 17:33:37 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-26 17:33:37 +0000
commit4fe4af616c275d7ef04e16a46fb17775bdf364d6 (patch)
treefbacb8c8a2ddd9b0df2609df53c3b93bdbd3cac0 /gcc/config/xtensa
parent4c66acf1c4e94b61933dad43780e10430a943cdb (diff)
downloadgcc-4fe4af616c275d7ef04e16a46fb17775bdf364d6.tar.gz
* config/xtensa/xtensa-protos.h: Remove the prototype for
xtensa_builtin_saveregs. * config/xtensa/xtensa.c (TARGET_PROMOTE_FUNCTION_ARGS): New. (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. (TARGET_PROMOTE_PROTOTYPES): Likewise. (TARGET_STRUCT_VALUE_RTX): Likewise. (TARGET_RETURN_IN_MEMORY): Likewise. (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. (xtensa_builtin_saveregs): Make it static. (xtensa_return_in_memory): New. * config/xtensa/xtensa.h (PROMOTE_FUNCTION_ARGS: Remove. (PROMOTE_FUNCTION_RETURN): Likewise. (PROMOTE_PROTOTYPES): Likewise. (STRUCT_VALUE): Likewise. (RETURN_IN_MEMORY): Likewise. (EXPAND_BUILTIN_SAVEREGS): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76644 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/xtensa')
-rw-r--r--gcc/config/xtensa/xtensa-protos.h3
-rw-r--r--gcc/config/xtensa/xtensa.c28
-rw-r--r--gcc/config/xtensa/xtensa.h40
3 files changed, 30 insertions, 41 deletions
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index cf7f09075c9..7d3208be7cd 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -1,5 +1,5 @@
/* Prototypes of target machine for GNU compiler for Xtensa.
- Copyright 2001,2002,2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
This file is part of GCC.
@@ -84,7 +84,6 @@ extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern void xtensa_output_literal (FILE *, rtx, enum machine_mode, int);
extern rtx xtensa_return_addr (int, rtx);
-extern rtx xtensa_builtin_saveregs (void);
extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int);
extern enum reg_class xtensa_secondary_reload_class (enum reg_class,
enum machine_mode, rtx,
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 0debc3ee615..d5087285766 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for Tensilica's Xtensa architecture.
- Copyright 2001,2002,2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
This file is part of GCC.
@@ -200,12 +200,14 @@ static enum machine_mode xtensa_find_mode_for_size (unsigned);
static struct machine_function * xtensa_init_machine_status (void);
static void printx (FILE *, signed int);
static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT);
+static rtx xtensa_builtin_saveregs (void);
static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
int) ATTRIBUTE_UNUSED;
static void xtensa_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
static bool xtensa_rtx_costs (rtx, int, int, int *);
static tree xtensa_build_builtin_va_list (void);
+static bool xtensa_return_in_memory (tree, tree);
static int current_function_arg_words;
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
@@ -237,6 +239,21 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST xtensa_build_builtin_va_list
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY xtensa_return_in_memory
+
+#undef TARGET_EXPAND_BUILTIN_SAVEREGS
+#define TARGET_EXPAND_BUILTIN_SAVEREGS xtensa_builtin_saveregs
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -2355,7 +2372,7 @@ xtensa_build_builtin_va_list (void)
/* Save the incoming argument registers on the stack. Returns the
address of the saved registers. */
-rtx
+static rtx
xtensa_builtin_saveregs (void)
{
rtx gp_regs, dest;
@@ -3011,4 +3028,11 @@ xtensa_rtx_costs (rtx x, int code, int outer_code, int *total)
}
}
+static bool
+xtensa_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+ return ((unsigned HOST_WIDE_INT) int_size_in_bytes (type)
+ > 4 * UNITS_PER_WORD);
+}
+
#include "gt-xtensa.h"
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 88d1ba85189..f650bcd7ad9 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -1,5 +1,5 @@
/* Definitions of Tensilica's Xtensa target machine for GNU compiler.
- Copyright 2001,2002,2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
This file is part of GCC.
@@ -204,15 +204,6 @@ extern unsigned xtensa_current_frame_size;
} \
} while (0)
-/* The promotion described by `PROMOTE_MODE' should also be done for
- outgoing function arguments. */
-#define PROMOTE_FUNCTION_ARGS
-
-/* The promotion described by `PROMOTE_MODE' should also be done for
- the return value of functions. Note: `FUNCTION_VALUE' must perform
- the same promotions done by `PROMOTE_MODE'. */
-#define PROMOTE_FUNCTION_RETURN
-
/* Imitate the way many other C compilers handle alignment of
bitfields and the structures that contain them. */
#define PCC_BITFIELD_TYPE_MATTERS 1
@@ -239,10 +230,6 @@ extern unsigned xtensa_current_frame_size;
|| TREE_CODE (TYPE) == UNION_TYPE \
|| TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
-/* An argument declared as 'char' or 'short' in a prototype should
- actually be passed as an 'int'. */
-#define PROMOTE_PROTOTYPES 1
-
/* Operations between registers always perform the operation
on the full register even if a narrower mode is specified. */
#define WORD_REGISTER_OPERATIONS
@@ -425,9 +412,6 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
a real pain to get them reloaded. */
#define FPCC_REGNUM (BR_REG_FIRST + 0)
-/* Pass structure value address as an "invisible" first argument. */
-#define STRUCT_VALUE 0
-
/* It is as good or better to call a constant function address than to
call an address kept in a register. */
#define NO_FUNCTION_CSE 1
@@ -701,20 +685,10 @@ extern enum reg_class xtensa_char_to_class[256];
/* Don't worry about compatibility with PCC. */
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* For Xtensa, up to 4 words can be returned in registers. (It would
- have been nice to allow up to 6 words in registers but GCC cannot
- support that. The return value must be given one of the standard
- MODE_INT modes, and there is no 6 word mode. Instead, if we try to
- return a 6 word structure, GCC selects the next biggest mode
- (OImode, 8 words) and then the register allocator fails because
- there is no 8-register group beginning with a10.) */
-#define RETURN_IN_MEMORY(TYPE) \
- ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 4 * UNITS_PER_WORD)
-
/* Define how to find the value returned by a library function
assuming the value has mode MODE. Because we have defined
- PROMOTE_FUNCTION_RETURN, we have to perform the same promotions as
- PROMOTE_MODE. */
+ TARGET_PROMOTE_FUNCTION_RETURN that returns true, we have to
+ perform the same promotions as PROMOTE_MODE. */
#define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
@@ -932,14 +906,6 @@ typedef struct xtensa_args {
0, VOIDmode, 1, addr, Pmode); \
} while (0)
-/* If defined, is a C expression that produces the machine-specific
- code for a call to '__builtin_saveregs'. This code will be moved
- to the very beginning of the function, before any parameter access
- are made. The return value of this function should be an RTX that
- contains the value to use as the return of '__builtin_saveregs'. */
-#define EXPAND_BUILTIN_SAVEREGS \
- xtensa_builtin_saveregs
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
xtensa_va_start (valist, nextarg)