]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/rsubhnt_s16.c
[AArch64] Add support for the SVE2 ACLE
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve2 / acle / asm / rsubhnt_s16.c
1 /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
2
3 #include "test_sve_acle.h"
4
5 /*
6 ** rsubhnt_s16_tied1:
7 ** rsubhnt z0\.b, z4\.h, z5\.h
8 ** ret
9 */
10 TEST_DUAL_Z (rsubhnt_s16_tied1, svint8_t, svint16_t,
11 z0 = svrsubhnt_s16 (z0, z4, z5),
12 z0 = svrsubhnt (z0, z4, z5))
13
14 /* Bad RA choice: no preferred output sequence. */
15 TEST_DUAL_Z_REV (rsubhnt_s16_tied2, svint8_t, svint16_t,
16 z0_res = svrsubhnt_s16 (z4, z0, z1),
17 z0_res = svrsubhnt (z4, z0, z1))
18
19 /* Bad RA choice: no preferred output sequence. */
20 TEST_DUAL_Z_REV (rsubhnt_s16_tied3, svint8_t, svint16_t,
21 z0_res = svrsubhnt_s16 (z4, z1, z0),
22 z0_res = svrsubhnt (z4, z1, z0))
23
24 /*
25 ** rsubhnt_s16_untied:
26 ** (
27 ** mov z0\.d, z1\.d
28 ** rsubhnt z0\.b, z4\.h, z5\.h
29 ** |
30 ** rsubhnt z1\.b, z4\.h, z5\.h
31 ** mov z0\.d, z1\.d
32 ** )
33 ** ret
34 */
35 TEST_DUAL_Z (rsubhnt_s16_untied, svint8_t, svint16_t,
36 z0 = svrsubhnt_s16 (z1, z4, z5),
37 z0 = svrsubhnt (z1, z4, z5))
38
39 /*
40 ** rsubhnt_w0_s16_tied1:
41 ** mov (z[0-9]+\.h), w0
42 ** rsubhnt z0\.b, z4\.h, \1
43 ** ret
44 */
45 TEST_DUAL_ZX (rsubhnt_w0_s16_tied1, svint8_t, svint16_t, int16_t,
46 z0 = svrsubhnt_n_s16 (z0, z4, x0),
47 z0 = svrsubhnt (z0, z4, x0))
48
49 /*
50 ** rsubhnt_w0_s16_untied:
51 ** mov (z[0-9]+\.h), w0
52 ** (
53 ** mov z0\.d, z1\.d
54 ** rsubhnt z0\.b, z4\.h, \1
55 ** |
56 ** rsubhnt z1\.b, z4\.h, \1
57 ** mov z0\.d, z1\.d
58 ** )
59 ** ret
60 */
61 TEST_DUAL_ZX (rsubhnt_w0_s16_untied, svint8_t, svint16_t, int16_t,
62 z0 = svrsubhnt_n_s16 (z1, z4, x0),
63 z0 = svrsubhnt (z1, z4, x0))
64
65 /*
66 ** rsubhnt_11_s16_tied1:
67 ** mov (z[0-9]+\.h), #11
68 ** rsubhnt z0\.b, z4\.h, \1
69 ** ret
70 */
71 TEST_DUAL_Z (rsubhnt_11_s16_tied1, svint8_t, svint16_t,
72 z0 = svrsubhnt_n_s16 (z0, z4, 11),
73 z0 = svrsubhnt (z0, z4, 11))
74
75 /*
76 ** rsubhnt_11_s16_untied:
77 ** mov (z[0-9]+\.h), #11
78 ** (
79 ** mov z0\.d, z1\.d
80 ** rsubhnt z0\.b, z4\.h, \1
81 ** |
82 ** rsubhnt z1\.b, z4\.h, \1
83 ** mov z0\.d, z1\.d
84 ** )
85 ** ret
86 */
87 TEST_DUAL_Z (rsubhnt_11_s16_untied, svint8_t, svint16_t,
88 z0 = svrsubhnt_n_s16 (z1, z4, 11),
89 z0 = svrsubhnt (z1, z4, 11))