]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/s390/vector/align-2.c
S/390: Emit vector alignment hints for z13
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / s390 / vector / align-2.c
CommitLineData
b8923037 1/* { dg-do compile } */
87cb9423 2/* { dg-options "-O3 -mzarch -march=z13" } */
b8923037
AK
3
4/* The user alignment ends up in TYPE_ALIGN of the type of the
5 VAR_DECL. */
6
7typedef int __attribute__((vector_size(16),aligned(4))) v4si_4;
8typedef int __attribute__((vector_size(16),aligned(8))) v4si_8;
9typedef int __attribute__((vector_size(16),aligned(16))) v4si_16;
10typedef int __attribute__((vector_size(16),aligned(32))) v4si_32;
11
12v4si_4 a4;
13v4si_8 a8;
14v4si_16 a16;
15v4si_32 a32;
16
17void
18foo (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 } } */