1 /* { dg-do compile } */
2 /* { dg-options "-O -fno-stack-clash-protection -g" } */
3 /* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */
4 
5 #include <arm_sve.h>
6 
7 /*
8 ** callee_float:
9 **	ptrue	p3\.b, all
10 **	ld1h	(z(?:2[4-9]|3[0-1]).h), p3/z, \[x4\]
11 **	st1h	\1, p2, \[x0\]
12 **	st1h	z4\.h, p1, \[x0\]
13 **	st1h	z5\.h, p1, \[x1\]
14 **	st1w	z6\.s, p1, \[x2\]
15 **	st1d	z7\.d, p1, \[x3\]
16 **	st1h	z0\.h, p0, \[x0\]
17 **	st1h	z1\.h, p0, \[x1\]
18 **	st1w	z2\.s, p0, \[x2\]
19 **	st1d	z3\.d, p0, \[x3\]
20 **	ret
21 */
22 void __attribute__((noipa))
callee_float(float16_t * x0,float16_t * x1,float32_t * x2,float64_t * x3,svfloat16_t z0,svfloat16_t z1,svfloat32_t z2,svfloat64_t z3,svfloat16_t z4,svfloat16_t z5,svfloat32_t z6,svfloat64_t z7,svfloat16_t z8,svbool_t p0,svbool_t p1,svbool_t p2)23 callee_float (float16_t *x0, float16_t *x1, float32_t *x2, float64_t *x3,
24 	      svfloat16_t z0, svfloat16_t z1, svfloat32_t z2, svfloat64_t z3,
25 	      svfloat16_t z4, svfloat16_t z5, svfloat32_t z6, svfloat64_t z7,
26 	      svfloat16_t z8,
27 	      svbool_t p0, svbool_t p1, svbool_t p2)
28 {
29   svst1 (p2, x0, z8);
30   svst1 (p1, x0, z4);
31   svst1 (p1, x1, z5);
32   svst1 (p1, x2, z6);
33   svst1 (p1, x3, z7);
34   svst1 (p0, x0, z0);
35   svst1 (p0, x1, z1);
36   svst1 (p0, x2, z2);
37   svst1 (p0, x3, z3);
38 }
39 
40 void __attribute__((noipa))
caller_float(float16_t * x0,float16_t * x1,float32_t * x2,float64_t * x3)41 caller_float (float16_t *x0, float16_t *x1, float32_t *x2, float64_t *x3)
42 {
43   callee_float (x0, x1, x2, x3,
44 		svdup_f16 (0),
45 		svdup_f16 (1),
46 		svdup_f32 (2),
47 		svdup_f64 (3),
48 		svdup_f16 (4),
49 		svdup_f16 (5),
50 		svdup_f32 (6),
51 		svdup_f64 (7),
52 		svdup_f16 (8),
53 		svptrue_pat_b8 (SV_VL1),
54 		svptrue_pat_b16 (SV_VL2),
55 		svptrue_pat_b32 (SV_VL3));
56 }
57 
58 /* { dg-final { scan-assembler {\tmov\tz0\.[bhsd], #0\n} } } */
59 /* { dg-final { scan-assembler {\tfmov\tz1\.h, #1\.0} } } */
60 /* { dg-final { scan-assembler {\tfmov\tz2\.s, #2\.0} } } */
61 /* { dg-final { scan-assembler {\tfmov\tz3\.d, #3\.0} } } */
62 /* { dg-final { scan-assembler {\tfmov\tz4\.h, #4\.0} } } */
63 /* { dg-final { scan-assembler {\tfmov\tz5\.h, #5\.0} } } */
64 /* { dg-final { scan-assembler {\tfmov\tz6\.s, #6\.0} } } */
65 /* { dg-final { scan-assembler {\tfmov\tz7\.d, #7\.0} } } */
66 /* { dg-final { scan-assembler {\tmov\tx4, sp\n} } } */
67 /* { dg-final { scan-assembler {\tfmov\t(z[0-9]+\.h), #8\.0.*\tst1h\t\1, p[0-7], \[x4\]\n} } } */
68 /* { dg-final { scan-assembler {\tptrue\tp0\.b, vl1\n} } } */
69 /* { dg-final { scan-assembler {\tptrue\tp1\.h, vl2\n} } } */
70 /* { dg-final { scan-assembler {\tptrue\tp2\.s, vl3\n} } } */
71