Commit 3b23a6d3 by Kai Tietz Committed by Kai Tietz

i386-protos.h (ix86_return_in_memory): Removed.

2008-05-20  Kai Tietz  <kai.tietz@onevision.com>

	* config/i386/i386-protos.h (ix86_return_in_memory): Removed.
	(ix86_i386elf_return_in_memory): Likewise.
	(ix86_i386interix_return_in_memory): Likewise.
	* config/i386/i386-interix.h (TARGET_RETURN_IN_MEMORY): Removed.
	(SUBTARGET_RETURN_IN_MEMORY): New.
	* config/i386/i386elf.h: Likewise.
	* config/i386/ptx4-i.h: Likewise.
	* config/i386/sol2-10.h: Likewise.
	* config/i386/sysv4.h: Likewise.
	* config/i386/vx-common.h: Likewise.
	* config/i386/i386.h (TARGET_RETURN_IN_MEMORY): Removed.
	* config/i386/i386.c (ix86_return_in_memory): Made static and
	make use of optional SUBTARGET_RETURN_IN_MEMORY macro.
	(ix86_i386elf_return_in_memory): Removed.
	(ix86_i386interix_return_in_memory): Removed.
	(TARGET_RETURN_IN_MEMORY): Declared within i386.c only.
	* target-def.h (TARGET_RETURN_IN_MEMORY): Remove protection #ifdef.

From-SVN: r135604
parent be9ed5d5
2008-05-20 Kai Tietz <kai.tietz@onevision.com>
* config/i386/i386-protos.h (ix86_return_in_memory): Removed.
(ix86_i386elf_return_in_memory): Likewise.
(ix86_i386interix_return_in_memory): Likewise.
* config/i386/i386-interix.h (TARGET_RETURN_IN_MEMORY): Removed.
(SUBTARGET_RETURN_IN_MEMORY): New.
* config/i386/i386elf.h: Likewise.
* config/i386/ptx4-i.h: Likewise.
* config/i386/sol2-10.h: Likewise.
* config/i386/sysv4.h: Likewise.
* config/i386/vx-common.h: Likewise.
* config/i386/i386.h (TARGET_RETURN_IN_MEMORY): Removed.
* config/i386/i386.c (ix86_return_in_memory): Made static and
make use of optional SUBTARGET_RETURN_IN_MEMORY macro.
(ix86_i386elf_return_in_memory): Removed.
(ix86_i386interix_return_in_memory): Removed.
(TARGET_RETURN_IN_MEMORY): Declared within i386.c only.
* target-def.h (TARGET_RETURN_IN_MEMORY): Remove protection #ifdef.
2008-05-20 Alexandre Oliva <aoliva@redhat.com>
* cselib.c (cselib_record_sets): Use correct mode for IF_THEN_ELSE.
......
......@@ -34,7 +34,10 @@ along with GCC; see the file COPYING3. If not see
#endif
#undef TARGET_64BIT_MS_ABI
#define TARGET_64BIT_MS_ABI TARGET_64BIT
#define TARGET_64BIT_MS_ABI (!cfun ? DEFAULT_ABI == MS_ABI : TARGET_64BIT && cfun->machine->call_abi == MS_ABI)
#undef DEFAULT_ABI
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
......@@ -123,12 +126,6 @@ along with GCC; see the file COPYING3. If not see
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 32
#undef REG_PARM_STACK_SPACE
#define REG_PARM_STACK_SPACE(FNDECL) (TARGET_64BIT_MS_ABI ? 32 : 0)
#undef OUTGOING_REG_PARM_STACK_SPACE
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) (TARGET_64BIT_MS_ABI ? 1 : 0)
#undef REGPARM_MAX
#define REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : 3)
......@@ -214,7 +211,7 @@ do { \
#define CHECK_STACK_LIMIT 4000
#undef STACK_BOUNDARY
#define STACK_BOUNDARY (TARGET_64BIT_MS_ABI ? 128 : BITS_PER_WORD)
#define STACK_BOUNDARY (DEFAULT_ABI == MS_ABI ? 128 : BITS_PER_WORD)
/* By default, target has a 80387, uses IEEE compatible arithmetic,
returns float values in the 387 and needs stack probes.
......
......@@ -357,5 +357,6 @@ extern void i386_pe_unique_section (tree, int);
#define DEFAULT_PCC_STRUCT_RETURN 0
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_i386interix_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
(TYPE_MODE (TYPE) == BLKmode \
|| (AGGREGATE_TYPE_P (TYPE) && int_size_in_bytes (TYPE) > 8 ))
\ No newline at end of file
......@@ -134,12 +134,12 @@ extern rtx ix86_libcall_value (enum machine_mode);
extern bool ix86_function_value_regno_p (int);
extern bool ix86_function_arg_regno_p (int);
extern int ix86_function_arg_boundary (enum machine_mode, tree);
extern bool ix86_return_in_memory (const_tree, const_tree);
extern bool ix86_sol10_return_in_memory (const_tree,const_tree);
extern bool ix86_i386elf_return_in_memory (const_tree,const_tree);
extern bool ix86_i386interix_return_in_memory (const_tree,const_tree);
extern rtx ix86_force_to_memory (enum machine_mode, rtx);
extern void ix86_free_from_memory (enum machine_mode);
extern int ix86_cfun_abi (void);
extern int ix86_function_abi (const_tree);
extern int ix86_function_type_abi (const_tree);
extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx,
rtx, rtx, rtx, rtx);
extern bool ix86_hard_regno_mode_ok (int, enum machine_mode);
......
......@@ -446,7 +446,17 @@ extern tree x86_mfence;
#define TARGET_MACHO 0
/* Likewise, for the Windows 64-bit ABI. */
#define TARGET_64BIT_MS_ABI 0
#define TARGET_64BIT_MS_ABI (TARGET_64BIT && ix86_cfun_abi () == MS_ABI)
/* Available call abi. */
enum
{
SYSV_ABI = 0,
MS_ABI = 1
};
/* The default abi form used by target. */
#define DEFAULT_ABI SYSV_ABI
/* Subtargets may reset this to 1 in order to enable 96-bit long double
with the rounding mode forced to 53 bits. */
......@@ -804,7 +814,8 @@ enum target_cpu_default
#define PARM_BOUNDARY BITS_PER_WORD
/* Boundary (in *bits*) on which stack pointer should be aligned. */
#define STACK_BOUNDARY BITS_PER_WORD
#define STACK_BOUNDARY (TARGET_64BIT && DEFAULT_ABI == MS_ABI ? 128 \
: BITS_PER_WORD)
/* Boundary (in *bits*) on which the stack pointer prefers to be
aligned; the compiler cannot rely on having this alignment. */
......@@ -1029,6 +1040,35 @@ enum target_cpu_default
#define ORDER_REGS_FOR_LOCAL_ALLOC x86_order_regs_for_local_alloc ()
/* regclass.c */
extern void init_regs (void);
#define OVERRIDE_ABI_FORMAT(FNDECL) \
do { \
if (FNDECL == NULL) \
cfun->machine->call_abi = DEFAULT_ABI; \
else \
cfun->machine->call_abi = ix86_function_type_abi (TREE_TYPE (FNDECL)); \
if (cfun->machine->call_abi == MS_ABI && call_used_regs) \
{ \
if (call_used_regs[4 /*RSI*/] != 0 || call_used_regs[5 /*RDI*/] != 0) \
{ \
call_used_regs[4 /*RSI*/] = 0; \
call_used_regs[5 /*RDI*/] = 0; \
init_regs (); \
} \
} \
else if (TARGET_64BIT && call_used_regs) \
{ \
if (call_used_regs[4 /*RSI*/] != 1 || call_used_regs[5 /*RDI*/] != 1) \
{ \
call_used_regs[4 /*RSI*/] = 1; \
call_used_regs[5 /*RDI*/] = 1; \
init_regs (); \
} \
} \
} while (0)
/* Macro to conditionally modify fixed_regs/call_used_regs. */
#define CONDITIONAL_REGISTER_USAGE \
do { \
......@@ -1079,11 +1119,6 @@ do { \
for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) \
reg_names[i] = ""; \
} \
if (TARGET_64BIT_MS_ABI) \
{ \
call_used_regs[4 /*RSI*/] = 0; \
call_used_regs[5 /*RDI*/] = 0; \
} \
} while (0)
/* Return number of consecutive hard regs needed starting at reg REGNO
......@@ -1261,25 +1296,6 @@ do { \
#define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_"
/* A C expression which can inhibit the returning of certain function
values in registers, based on the type of value. A nonzero value
says to return the function value in memory, just as large
structures are always returned. Here TYPE will be a C expression
of type `tree', representing the data type of the value.
Note that values of mode `BLKmode' must be explicitly handled by
this macro. Also, the option `-fpcc-struct-return' takes effect
regardless of this macro. On most systems, it is possible to
leave the macro undefined; this causes a default definition to be
used, whose value is the constant 1 for `BLKmode' values, and 0
otherwise.
Do not use this macro to indicate that structures and unions
should always be returned in memory. You should instead use
`DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
#define TARGET_RETURN_IN_MEMORY ix86_return_in_memory
/* This is overridden by <cygwin.h>. */
#define MS_AGGREGATE_RETURN 0
......@@ -1628,7 +1644,11 @@ enum reg_class
This space can be allocated by the caller, or be a part of the
machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
which. */
#define REG_PARM_STACK_SPACE(FNDECL) 0
#define REG_PARM_STACK_SPACE(FNDECL) ix86_reg_parm_stack_space (FNDECL)
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) (ix86_function_type_abi (FNTYPE) == MS_ABI ? 1 : 0)
extern unsigned int ix86_reg_parm_stack_space (const_tree);
/* Value is the number of bytes of arguments automatically
popped when returning from a subroutine call.
......@@ -1690,6 +1710,8 @@ typedef struct ix86_args {
int maybe_vaarg; /* true for calls to possibly vardic fncts. */
int float_in_sse; /* 1 if in 32-bit mode SFmode (2 for DFmode) should
be passed in SSE registers. Otherwise 0. */
int call_abi; /* Set to SYSV_ABI for sysv abi. Otherwise
MS_ABI for ms abi. */
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
......@@ -2467,6 +2489,9 @@ struct machine_function GTY(())
ix86_current_function_calls_tls_descriptor macro for a better
approximation. */
int tls_descriptor_call_expanded_p;
/* This value is used for amd64 targets and specifies the current abi
to be used. MS_ABI means ms abi. Otherwise SYSV_ABI means sysv abi. */
int call_abi;
};
#define ix86_stack_locals (cfun->machine->stack_locals)
......
......@@ -29,8 +29,9 @@ along with GCC; see the file COPYING3. If not see
/* The ELF ABI for the i386 says that records and unions are returned
in memory. */
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
(TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
#undef CPP_SPEC
#define CPP_SPEC ""
......
......@@ -38,7 +38,7 @@ along with GCC; see the file COPYING3. If not see
builtin_define_std ("WINNT"); \
builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \
TYPE_PRECISION (intmax_type_node));\
if (TARGET_64BIT_MS_ABI) \
if (TARGET_64BIT && DEFAULT_ABI == MS_ABI) \
{ \
builtin_define ("__MINGW64__"); \
builtin_define_std ("WIN64"); \
......
......@@ -27,8 +27,9 @@ along with GCC; see the file COPYING3. If not see
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
(TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8));
#define TARGET_OS_CPP_BUILTINS() \
do \
......
......@@ -110,5 +110,5 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_sol10_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
ix86_sol10_return_in_memory (TYPE, FNTYPE)
......@@ -25,8 +25,9 @@ along with GCC; see the file COPYING3. If not see
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
(TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8));
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
......
......@@ -22,5 +22,5 @@ along with GCC; see the file COPYING3. If not see
/* VxWorks uses the same ABI as Solaris 10. */
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY ix86_sol10_return_in_memory
#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
ix86_sol10_return_in_memory (TYPE, FNTYPE)
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