| 1 |
/* Expected instruction selection as characterized by |
| 2 |
scan-assembler-times directives below is only relevant to |
| 3 |
little-endian targets. */ |
| 4 |
/* { dg-do compile { target { powerpc64le-*-* } } } */ |
| 5 |
/* { dg-skip-if "" { powerpc*-*-darwin* } } */ |
| 6 |
/* { dg-options "-O2 -mdejagnu-cpu=power7 -mabi=altivec" } */ |
| 7 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 8 |
/* { dg-final { scan-assembler-times "lvx" 1 } } */ |
| 9 |
/* { dg-final { scan-assembler-times "stvx" 1 } } */ |
| 10 |
/* { dg-final { scan-assembler-not "ld" } } */ |
| 11 |
/* { dg-final { scan-assembler-not "lwz" } } */ |
| 12 |
/* { dg-final { scan-assembler-not "stw" } } */ |
| 13 |
/* { dg-final { scan-assembler-not "addi" } } */ |
| 14 |
|
| 15 |
typedef vector long long v2di_type; |
| 16 |
|
| 17 |
v2di_type |
| 18 |
return_v2di (v2di_type *ptr) |
| 19 |
{ |
| 20 |
/* As of pr48857, should generate lxvd2x 34,0,3 |
| 21 |
followed by xxpermdi 34,34,34,2. Subsequent optimization |
| 22 |
recognizes that ptr refers to an aligned vector and replaces |
| 23 |
this with lvx 2,0,3. */ |
| 24 |
return *ptr; |
| 25 |
} |
| 26 |
|
| 27 |
void |
| 28 |
pass_v2di (v2di_type arg, v2di_type *ptr) |
| 29 |
{ |
| 30 |
/* As of pr48857, should generate xxpermdi 34,34,34,2 followed by |
| 31 |
stxvd2x 34,0,5. Subsequent optimization recognizes that ptr |
| 32 |
refers to an aligned vector and replaces this with stvx 2,0,5. */ |
| 33 |
*ptr = arg; |
| 34 |
} |
| 35 |
|