1 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
2 
3 #include "test_sve_acle.h"
4 
5 /*
6 ** raddhnt_s64_tied1:
7 **	raddhnt	z0\.s, (z4\.d, z5\.d|z5\.d, z4\.d)
8 **	ret
9 */
10 TEST_DUAL_Z (raddhnt_s64_tied1, svint32_t, svint64_t,
11 	     z0 = svraddhnt_s64 (z0, z4, z5),
12 	     z0 = svraddhnt (z0, z4, z5))
13 
14 /* Bad RA choice: no preferred output sequence.  */
15 TEST_DUAL_Z_REV (raddhnt_s64_tied2, svint32_t, svint64_t,
16 		 z0_res = svraddhnt_s64 (z4, z0, z1),
17 		 z0_res = svraddhnt (z4, z0, z1))
18 
19 /* Bad RA choice: no preferred output sequence.  */
20 TEST_DUAL_Z_REV (raddhnt_s64_tied3, svint32_t, svint64_t,
21 		 z0_res = svraddhnt_s64 (z4, z1, z0),
22 		 z0_res = svraddhnt (z4, z1, z0))
23 
24 /*
25 ** raddhnt_s64_untied:
26 ** (
27 **	mov	z0\.d, z1\.d
28 **	raddhnt	z0\.s, (z4\.d, z5\.d|z5\.d, z4\.d)
29 ** |
30 **	raddhnt	z1\.s, (z4\.d, z5\.d|z5\.d, z4\.d)
31 **	mov	z0\.d, z1\.d
32 ** )
33 **	ret
34 */
35 TEST_DUAL_Z (raddhnt_s64_untied, svint32_t, svint64_t,
36 	     z0 = svraddhnt_s64 (z1, z4, z5),
37 	     z0 = svraddhnt (z1, z4, z5))
38 
39 /*
40 ** raddhnt_x0_s64_tied1:
41 **	mov	(z[0-9]+\.d), x0
42 **	raddhnt	z0\.s, (z4\.d, \1|\1, z4\.d)
43 **	ret
44 */
45 TEST_DUAL_ZX (raddhnt_x0_s64_tied1, svint32_t, svint64_t, int64_t,
46 	      z0 = svraddhnt_n_s64 (z0, z4, x0),
47 	      z0 = svraddhnt (z0, z4, x0))
48 
49 /*
50 ** raddhnt_x0_s64_untied:
51 **	mov	(z[0-9]+\.d), x0
52 ** (
53 **	mov	z0\.d, z1\.d
54 **	raddhnt	z0\.s, (z4\.d, \1|\1, z4\.d)
55 ** |
56 **	raddhnt	z1\.s, (z4\.d, \1|\1, z4\.d)
57 **	mov	z0\.d, z1\.d
58 ** )
59 **	ret
60 */
61 TEST_DUAL_ZX (raddhnt_x0_s64_untied, svint32_t, svint64_t, int64_t,
62 	      z0 = svraddhnt_n_s64 (z1, z4, x0),
63 	      z0 = svraddhnt (z1, z4, x0))
64 
65 /*
66 ** raddhnt_11_s64_tied1:
67 **	mov	(z[0-9]+\.d), #11
68 **	raddhnt	z0\.s, (z4\.d, \1|\1, z4\.d)
69 **	ret
70 */
71 TEST_DUAL_Z (raddhnt_11_s64_tied1, svint32_t, svint64_t,
72 	     z0 = svraddhnt_n_s64 (z0, z4, 11),
73 	     z0 = svraddhnt (z0, z4, 11))
74 
75 /*
76 ** raddhnt_11_s64_untied:
77 **	mov	(z[0-9]+\.d), #11
78 ** (
79 **	mov	z0\.d, z1\.d
80 **	raddhnt	z0\.s, (z4\.d, \1|\1, z4\.d)
81 ** |
82 **	raddhnt	z1\.s, (z4\.d, \1|\1, z4\.d)
83 **	mov	z0\.d, z1\.d
84 ** )
85 **	ret
86 */
87 TEST_DUAL_Z (raddhnt_11_s64_untied, svint32_t, svint64_t,
88 	     z0 = svraddhnt_n_s64 (z1, z4, 11),
89 	     z0 = svraddhnt (z1, z4, 11))
90