| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -mzarch -march=z13" } */ |
| 3 |
|
| 4 |
/* The user alignment ends up in TYPE_ALIGN of the type of the |
| 5 |
VAR_DECL. */ |
| 6 |
|
| 7 |
typedef int __attribute__((vector_size(16),aligned(4))) v4si_4; |
| 8 |
typedef int __attribute__((vector_size(16),aligned(8))) v4si_8; |
| 9 |
typedef int __attribute__((vector_size(16),aligned(16))) v4si_16; |
| 10 |
typedef int __attribute__((vector_size(16),aligned(32))) v4si_32; |
| 11 |
|
| 12 |
v4si_4 a4; |
| 13 |
v4si_8 a8; |
| 14 |
v4si_16 a16; |
| 15 |
v4si_32 a32; |
| 16 |
|
| 17 |
void |
| 18 |
foo (v4si_8 a) |
| 19 |
{ |
| 20 |
a4 += a; /* vl ... vst ... */ |
| 21 |
a8 += a; /* vl ...,3 vst ...,3 */ |
| 22 |
a16 += a; /* vl ...,4 vst ...,4 */ |
| 23 |
a32 += a; /* vl ...,4 vst ...,4 */ |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler-times "vl\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),3\n" 1 } } */ |
| 27 |
/* { dg-final { scan-assembler-times "vl\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),4\n" 2 } } */ |
| 28 |
/* { dg-final { scan-assembler-times "vst\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),3\n" 1 } } */ |
| 29 |
/* { dg-final { scan-assembler-times "vst\t%v\[0-9\]*,\[0-9\]*\\(%r\[0-9\]*\\),4" 2 } } */ |