aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gcc.gnu.org>2009-02-21 07:55:53 -0800
committerH.J. Lu <hjl@gcc.gnu.org>2009-02-21 07:55:53 -0800
commit4c64d3ddec2b86cd3b0ecef3c377affbb87cc370 (patch)
treef1eb5758efb9476dedea3465aa55b25a0cdb7e92 /gcc
parentb46513275fb47dc41e5481daebeb6eac24af2f4c (diff)
downloadgcc-4c64d3ddec2b86cd3b0ecef3c377affbb87cc370.zip
gcc-4c64d3ddec2b86cd3b0ecef3c377affbb87cc370.tar.gz
gcc-4c64d3ddec2b86cd3b0ecef3c377affbb87cc370.tar.bz2
re PR target/39256 (__m256 isn't returned in ymm0 in 32bit)
gcc/ 2008-02-21 H.J. Lu <hongjiu.lu@intel.com> PR target/39256 * config/i386/i386.c (type_natural_mode): Remove an extra space in the warning message. (function_value_32): Handle 32-byte vector modes. (return_in_memory_32): Likewise. gcc/testsuite/ 2008-02-21 Uros Bizjak <ubizjak@gmail.com> PR target/39256 * gcc.target/i386/abi-2.c: New. From-SVN: r144355
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.c13
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/abi-2.c8
4 files changed, 32 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0594bf6..c7e1c2f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39256
+ * config/i386/i386.c (type_natural_mode): Remove an extra
+ space in the warning message.
+ (function_value_32): Handle 32-byte vector modes.
+ (return_in_memory_32): Likewise.
+
2009-02-21 Richard Sandiford <rdsandiford@googlemail.com>
* loop-iv.c (truncate_value): New function.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e41f501..d247d07 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4759,7 +4759,7 @@ type_natural_mode (const_tree type, CUMULATIVE_ARGS *cum)
{
warnedavx = true;
warning (0, "AVX vector argument without AVX "
- " enabled changes the ABI");
+ "enabled changes the ABI");
}
return TYPE_MODE (type);
}
@@ -6019,6 +6019,11 @@ function_value_32 (enum machine_mode orig_mode, enum machine_mode mode,
|| (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16))
regno = TARGET_SSE ? FIRST_SSE_REG : 0;
+ /* 32-byte vector modes in %ymm0. */
+ else if (mode == OImode
+ || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 32))
+ regno = TARGET_AVX ? FIRST_SSE_REG : 0;
+
/* Floating point return values in %st(0) (unless -mno-fp-ret-in-387). */
else if (X87_FLOAT_MODE_P (mode) && TARGET_FLOAT_RETURNS_IN_80387)
regno = FIRST_FLOAT_REG;
@@ -6158,7 +6163,7 @@ return_in_memory_32 (const_tree type, enum machine_mode mode)
if (MS_AGGREGATE_RETURN && AGGREGATE_TYPE_P (type) && size <= 8)
return 0;
- if (VECTOR_MODE_P (mode) || mode == TImode)
+ if (VECTOR_MODE_P (mode) || mode == TImode || mode == OImode)
{
/* User-created vectors small enough to fit in EAX. */
if (size < 8)
@@ -6172,6 +6177,10 @@ return_in_memory_32 (const_tree type, enum machine_mode mode)
/* SSE values are returned in XMM0, except when it doesn't exist. */
if (size == 16)
return (TARGET_SSE ? 0 : 1);
+
+ /* AVX values are returned in YMM0, except when it doesn't exist. */
+ if (size == 32)
+ return TARGET_AVX ? 0 : 1;
}
if (mode == XFmode)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4cde518..160b9f6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/39256
+ * gcc.target/i386/abi-2.c: New.
+
2009-02-21 Kaz Kojima <kkojima@gcc.gnu.org>
* gcc.c-torture/execute/pr39228.x: New.
diff --git a/gcc/testsuite/gcc.target/i386/abi-2.c b/gcc/testsuite/gcc.target/i386/abi-2.c
new file mode 100644
index 0000000..5ed6b4a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/abi-2.c
@@ -0,0 +1,8 @@
+/* Make certain that we pass __m256i in the correct register for AVX. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -mavx" } */
+
+typedef long long __m256i __attribute__ ((__vector_size__ (32)));
+__m256i foo (void) { return (__m256i){ 1, 2, 3, 4 }; }
+
+/* { dg-final { scan-assembler-times "ymm0" 1 } } */