diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-02-07 22:10:56 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@gcc.gnu.org> | 2003-02-07 22:10:56 +0000 |
commit | 5e062767b9dd4ab2ac51da35b684e574dcfd72b0 (patch) | |
tree | d107b6618e9140191b8cee61ba375eec8558425d | |
parent | b0b74f371eb96d60047b221711bb98361fde5f58 (diff) | |
download | gcc-5e062767b9dd4ab2ac51da35b684e574dcfd72b0.zip gcc-5e062767b9dd4ab2ac51da35b684e574dcfd72b0.tar.gz gcc-5e062767b9dd4ab2ac51da35b684e574dcfd72b0.tar.bz2 |
i386.h (MS_AGGREGATE_RETURN): New define.
* config/i386/i386.h (MS_AGGREGATE_RETURN): New define.
* config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default
definition.
* config/i386/i386.h (ix86_return_in_memory): Return aggregate
types of up to 8 bytes via registers if MS_AGGREGATE_RETURN.
From-SVN: r62547
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/cygwin.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 18 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 3 |
4 files changed, 28 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fbeef5..7df7302 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-03-07 Danny Smith <dannysmith@users.sourceforge.net> + + * config/i386/i386.h (MS_AGGREGATE_RETURN): New define. + * config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default + definition. + * config/i386/i386.h (ix86_return_in_memory): Return aggregate + types of up to 8 bytes via registers if MS_AGGREGATE_RETURN. + Fri Feb 7 22:22:40 CET 2003 Jan Hubicka <jh@suse.cz> * i386.md (movdi_rex64_1): Fix mmx<->int move opcode. diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h index 7697898..085c3e7 100644 --- a/gcc/config/i386/cygwin.h +++ b/gcc/config/i386/cygwin.h @@ -410,6 +410,11 @@ extern int i386_pe_dllimport_name_p PARAMS ((const char *)); #undef DEFAULT_PCC_STRUCT_RETURN #define DEFAULT_PCC_STRUCT_RETURN 0 +/* MSVC returns aggregate types of up to 8 bytes via registers. + See i386.c:ix86_return_in_memory. */ +#undef MS_AGGREGATE_RETURN +#define MS_AGGREGATE_RETURN 1 + /* No data type wants to be aligned rounder than this. */ #undef BIGGEST_ALIGNMENT #define BIGGEST_ALIGNMENT 128 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 23f2494..def53d0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2608,12 +2608,18 @@ ix86_return_in_memory (type) } else { - if (TYPE_MODE (type) == BLKmode - || (VECTOR_MODE_P (TYPE_MODE (type)) - && int_size_in_bytes (type) == 8) - || (int_size_in_bytes (type) > 12 && TYPE_MODE (type) != TImode - && TYPE_MODE (type) != TFmode - && !VECTOR_MODE_P (TYPE_MODE (type)))) + if (TYPE_MODE (type) == BLKmode) + return 1; + else if (MS_AGGREGATE_RETURN + && AGGREGATE_TYPE_P (type) + && int_size_in_bytes(type) <= 8) + return 0; + else if ((VECTOR_MODE_P (TYPE_MODE (type)) + && int_size_in_bytes (type) == 8) + || (int_size_in_bytes (type) > 12 + && TYPE_MODE (type) != TImode + && TYPE_MODE (type) != TFmode + && !VECTOR_MODE_P (TYPE_MODE (type)))) return 1; return 0; } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 8d1b5e4..8373e32 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1208,6 +1208,9 @@ do { \ #define RETURN_IN_MEMORY(TYPE) \ ix86_return_in_memory (TYPE) +/* This is overriden by <cygwin.h>. */ +#define MS_AGGREGATE_RETURN 0 + /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. |