| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -msse2 -mno-avx -fipa-ra -fomit-frame-pointer" } */ |
| 3 |
|
| 4 |
typedef double v2df __attribute__((vector_size (16))); |
| 5 |
|
| 6 |
static v2df __attribute__((noinline)) |
| 7 |
bar (v2df a) |
| 8 |
{ |
| 9 |
return a + (v2df){ 3.0, 4.0 }; |
| 10 |
} |
| 11 |
|
| 12 |
v2df __attribute__((noinline)) |
| 13 |
foo (v2df y) |
| 14 |
{ |
| 15 |
return y + bar (y); |
| 16 |
} |
| 17 |
|
| 18 |
/* Check presence of all insns on xmm registers. These checks are expected to |
| 19 |
pass with both -fipa-ra and -fno-ipa-ra. */ |
| 20 |
|
| 21 |
/* Darwin local constant symbol is "lC0", ELF targets ".LC0" */ |
| 22 |
/* { dg-final { scan-assembler-times {addpd\t\.?[Ll]C0.*, %xmm0} 1 { target { { ! ia32 } || nonpic } } } } */ |
| 23 |
/* { dg-final { scan-assembler-times {movapd\t\.?[Ll]C0.*, %xmm1} 1 { target { ia32 && { ! nonpic } } } } } */ |
| 24 |
|
| 25 |
/* We happen to get this for both cases, but in different positions. */ |
| 26 |
/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */ |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { target { { ! ia32 } || nonpic } } } } */ |
| 29 |
/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm2" 1 { target { ia32 && { ! nonpic } } } } } */ |
| 30 |
/* { dg-final { scan-assembler-times "addpd\t%xmm2, %xmm0" 1 { target { ia32 && { ! nonpic } } } } } */ |
| 31 |
|
| 32 |
/* Check absence of save/restore of xmm1 register. */ |
| 33 |
/* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%\[re\]?sp\\)" } } */ |
| 34 |
/* { dg-final { scan-assembler-not "movapd\t\\(%\[re\]?sp\\), %xmm1" } } */ |