Add xmm-register version of fuse-caller-save testcase

2014-07-13  Tom de Vries  <tom@codesourcery.com>

	* gcc.target/i386/fuse-caller-save-xmm-run.c: New test.
	* gcc.target/i386/fuse-caller-save-xmm.c: New test.

From-SVN: r212495
This commit is contained in:
Tom de Vries 2014-07-13 14:32:01 +00:00 committed by Tom de Vries
parent c6abdc366a
commit 9c2c4e622c
3 changed files with 74 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-07-13 Tom de Vries <tom@codesourcery.com>
* gcc.target/i386/fuse-caller-save-xmm-run.c: New test.
* gcc.target/i386/fuse-caller-save-xmm.c: New test.
2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
PR C++/60209 - Declaration of user-defined literal operator cause error

View File

@ -0,0 +1,32 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse -fuse-caller-save" } */
typedef double v2df __attribute__((vector_size (16)));
static v2df __attribute__((noinline))
bar (v2df a)
{
return a + (v2df){ 3.0, 3.0 };
}
v2df __attribute__((noinline))
foo (v2df y)
{
return y + bar (y);
}
int
main (void)
{
int success;
union {
v2df v;
double d[2];
} u;
u.v = foo ((v2df){ 5.0, 5.0});
success = (u.d[0] == 13.0
&& u.d[1] == 13.0);
return !success;
}

View File

@ -0,0 +1,37 @@
/* { dg-do compile } */
/* { dg-options "-O2 -msse -fuse-caller-save" } */
typedef double v2df __attribute__((vector_size (16)));
static v2df __attribute__((noinline))
bar (v2df a)
{
return a + (v2df){ 3.0, 3.0 };
}
v2df __attribute__((noinline))
foo (v2df y)
{
return y + bar (y);
}
int
main (void)
{
int success;
union {
v2df v;
double d[2];
} u;
u.v = foo ((v2df){ 5.0, 5.0});
success = (u.d[0] == 13.0
&& u.d[1] == 13.0);
return !success;
}
/* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%rsp\\)" } } */
/* { dg-final { scan-assembler-not "movapd\t\\(%rsp\\), %xmm1" } } */
/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 1 } } */
/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 32" 1 } } */