1 /* { dg-do compile { target { s390*-*-* } } } */
2 /* { dg-options "-O3 -mzarch -march=z14 -mzvector" } */
3
4 #include <vecintrin.h>
5
6 typedef float __attribute__((aligned(8))) float_aligned;
7
8 vector float
foo(float_aligned * a)9 foo (float_aligned *a)
10 {
11 return vec_xl (0, a);
12 }
13
14 vector float
bar(const float_aligned * a)15 bar (const float_aligned *a)
16 {
17 return vec_xl (0, a);
18 }
19
20 void
baz(float_aligned * f,vector float a)21 baz (float_aligned *f, vector float a)
22 {
23 vec_xst (a, 0, f);
24 }
25
26 vector float
foo2(float_aligned * a)27 foo2 (float_aligned *a)
28 {
29 return vec_xlw4 (0, a);
30 }
31
32 vector float
bar2(const float_aligned * a)33 bar2 (const float_aligned *a)
34 {
35 return vec_xlw4 (0, a);
36 }
37
38 void
baz2(float_aligned * f,vector float a)39 baz2 (float_aligned *f, vector float a)
40 {
41 vec_xstw4 (a, 0, f);
42 }
43
44 /* Make sure alignment hints are generated if the source or target
45 operand is properly aligned. */
46
47 /* { dg-final { scan-assembler-times "vl\t%v\[0-9\]*,0\\(%r2\\),3" 4 } } */
48 /* { dg-final { scan-assembler-times "vst\t%v\[0-9\]*,0\\(%r2\\),3" 2 } } */
49