summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-26 07:22:14 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-26 07:22:14 +0000
commitc19a839cc9aa27f35802e523c7f951e5fc7a1ea9 (patch)
tree25874e5824405772f821da236adc7c4f1e697677
parentceac8e8c6835aebc64f9b8f6457eb5333f4046a4 (diff)
downloadppe42-gcc-c19a839cc9aa27f35802e523c7f951e5fc7a1ea9.tar.gz
ppe42-gcc-c19a839cc9aa27f35802e523c7f951e5fc7a1ea9.zip
gcc/
200x-xx-xx Richard Sandiford <richard@codesourcery.com> Mark Mitchell <mark@codesourcery.com> * config/i386/i386-protos.h (ix86_sol10_return_in_memory): Declare. * config/i386/i386.c (ix86_sol10_return_in_memory): New function. * config/i386/sol2-10.h (RETURN_IN_MEMORY): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124176 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386-protos.h1
-rw-r--r--gcc/config/i386/i386.c37
-rw-r--r--gcc/config/i386/sol2-10.h9
4 files changed, 46 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5dec3751ec0..ad1928a2784 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,11 @@
2007-04-26 Richard Sandiford <richard@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * config/i386/i386-protos.h (ix86_sol10_return_in_memory): Declare.
+ * config/i386/i386.c (ix86_sol10_return_in_memory): New function.
+ * config/i386/sol2-10.h (RETURN_IN_MEMORY): Use it.
+
+2007-04-26 Richard Sandiford <richard@codesourcery.com>
PR driver/31107
* doc/invoke.texi (%:print-asm-header): Document.
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index a37901156c7..3dca7c587a6 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -134,6 +134,7 @@ 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 int ix86_return_in_memory (tree);
+extern int ix86_sol10_return_in_memory (tree);
extern void ix86_va_start (tree, rtx);
extern rtx ix86_va_arg (tree, tree);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2e0586bf95a..adc2be7d0b3 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4372,6 +4372,43 @@ ix86_return_in_memory (tree type)
return return_in_memory_32 (type, mode);
}
+/* Return false iff TYPE is returned in memory. This version is used
+ on Solaris 10. It is similar to the generic ix86_return_in_memory,
+ but differs notably in that when MMX is available, 8-byte vectors
+ are returned in memory, rather than in MMX registers. */
+
+int
+ix86_sol10_return_in_memory (tree type)
+{
+ int needed_intregs, needed_sseregs, size;
+ enum machine_mode mode = type_natural_mode (type);
+
+ if (TARGET_64BIT)
+ return return_in_memory_64 (type, mode);
+
+ if (mode == BLKmode)
+ return 1;
+
+ size = int_size_in_bytes (type);
+
+ if (VECTOR_MODE_P (mode))
+ {
+ /* Return in memory only if MMX registers *are* available. This
+ seems backwards, but it is consistent with the existing
+ Solaris x86 ABI. */
+ if (size == 8)
+ return TARGET_MMX;
+ if (size == 16)
+ return !TARGET_SSE;
+ }
+ else if (mode == TImode)
+ return !TARGET_SSE;
+ else if (mode == XFmode)
+ return 0;
+
+ return size > 12;
+}
+
/* When returning SSE vector types, we have a choice of either
(1) being abi incompatible with a -march switch, or
(2) generating an error.
diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h
index 587e56fe7fa..a3eb1f50a68 100644
--- a/gcc/config/i386/sol2-10.h
+++ b/gcc/config/i386/sol2-10.h
@@ -111,12 +111,5 @@ Boston, MA 02110-1301, USA. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
-/* In 32-bit mode, follow the SVR4 ABI definition; in 64-bit mode, use
- the AMD64 ABI definition. */
#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- (TARGET_64BIT \
- ? ix86_return_in_memory (TYPE) \
- : (TYPE_MODE (TYPE) == BLKmode \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) \
- && int_size_in_bytes (TYPE) == 8)))
+#define RETURN_IN_MEMORY ix86_sol10_return_in_memory
OpenPOWER on IntegriCloud