| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O3 -mzarch -march=z13 --save-temps" } */ |
| 3 |
/* { dg-require-effective-target s390_vx } */ |
| 4 |
|
| 5 |
typedef unsigned char uv16qi __attribute__((vector_size(16))); |
| 6 |
typedef unsigned short uv8hi __attribute__((vector_size(16))); |
| 7 |
typedef unsigned int uv4si __attribute__((vector_size(16))); |
| 8 |
typedef unsigned long long uv2di __attribute__((vector_size(16))); |
| 9 |
|
| 10 |
uv2di __attribute__((noinline)) |
| 11 |
foo1 () |
| 12 |
{ |
| 13 |
return (uv2di){ 0x7f0f, 0x7f0f }; |
| 14 |
} |
| 15 |
/* { dg-final { scan-assembler-times "vrepi\t%v24,32527,3" 1 } } */ |
| 16 |
|
| 17 |
uv4si __attribute__((noinline)) |
| 18 |
foo2 () |
| 19 |
{ |
| 20 |
return (uv4si){ 0x7f0f, 0x7f0f, 0x7f0f, 0x7f0f }; |
| 21 |
} |
| 22 |
/* { dg-final { scan-assembler-times "vrepi\t%v24,32527,2" 1 } } */ |
| 23 |
|
| 24 |
uv8hi __attribute__((noinline)) |
| 25 |
foo3 () |
| 26 |
{ |
| 27 |
return (uv8hi){ 0x7f0f, 0x7f0f, 0x7f0f, 0x7f0f, |
| 28 |
0x7f0f, 0x7f0f, 0x7f0f, 0x7f0f }; |
| 29 |
} |
| 30 |
/* { dg-final { scan-assembler-times "vrepi\t%v24,32527,1" 1 } } */ |
| 31 |
|
| 32 |
uv16qi __attribute__((noinline)) |
| 33 |
foo4 () |
| 34 |
{ |
| 35 |
return (uv16qi){ 0x77, 0x77, 0x77, 0x77, |
| 36 |
0x77, 0x77, 0x77, 0x77, |
| 37 |
0x77, 0x77, 0x77, 0x77, |
| 38 |
0x77, 0x77, 0x77, 0x77 }; |
| 39 |
} |
| 40 |
/* { dg-final { scan-assembler-times "vrepi\t%v24,119,0" 1 } } */ |
| 41 |
|
| 42 |
int |
| 43 |
main () |
| 44 |
{ |
| 45 |
if (foo1()[1] != 0x7f0f) |
| 46 |
__builtin_abort (); |
| 47 |
|
| 48 |
if (foo2()[1] != 0x7f0f) |
| 49 |
__builtin_abort (); |
| 50 |
|
| 51 |
if (foo3()[1] != 0x7f0f) |
| 52 |
__builtin_abort (); |
| 53 |
|
| 54 |
if (foo4()[1] != 0x77) |
| 55 |
__builtin_abort (); |
| 56 |
|
| 57 |
return 0; |
| 58 |
} |