1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
5 
6 #include <arm_sve.h>
7 
8 #ifdef SVE_OVERLOADED_FORMS
9 // A simple used,unused... macro, long enough to represent any SVE builtin.
10 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
11 #else
12 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
13 #endif
14 
test_svhsubr_s8_z(svbool_t pg,svint8_t op1,svint8_t op2)15 svint8_t test_svhsubr_s8_z(svbool_t pg, svint8_t op1, svint8_t op2)
16 {
17   // CHECK-LABEL: test_svhsubr_s8_z
18   // CHECK: %[[SEL:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sel.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> zeroinitializer)
19   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %op2)
20   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
21   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
22   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s8_z'}}
23   return SVE_ACLE_FUNC(svhsubr,_s8,_z,)(pg, op1, op2);
24 }
25 
test_svhsubr_s16_z(svbool_t pg,svint16_t op1,svint16_t op2)26 svint16_t test_svhsubr_s16_z(svbool_t pg, svint16_t op1, svint16_t op2)
27 {
28   // CHECK-LABEL: test_svhsubr_s16_z
29   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
30   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sel.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> zeroinitializer)
31   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %op2)
32   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
33   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
34   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s16_z'}}
35   return SVE_ACLE_FUNC(svhsubr,_s16,_z,)(pg, op1, op2);
36 }
37 
test_svhsubr_s32_z(svbool_t pg,svint32_t op1,svint32_t op2)38 svint32_t test_svhsubr_s32_z(svbool_t pg, svint32_t op1, svint32_t op2)
39 {
40   // CHECK-LABEL: test_svhsubr_s32_z
41   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
42   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> zeroinitializer)
43   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %op2)
44   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
45   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
46   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s32_z'}}
47   return SVE_ACLE_FUNC(svhsubr,_s32,_z,)(pg, op1, op2);
48 }
49 
test_svhsubr_s64_z(svbool_t pg,svint64_t op1,svint64_t op2)50 svint64_t test_svhsubr_s64_z(svbool_t pg, svint64_t op1, svint64_t op2)
51 {
52   // CHECK-LABEL: test_svhsubr_s64_z
53   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
54   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.sel.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> zeroinitializer)
55   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %op2)
56   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
57   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
58   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s64_z'}}
59   return SVE_ACLE_FUNC(svhsubr,_s64,_z,)(pg, op1, op2);
60 }
61 
test_svhsubr_u8_z(svbool_t pg,svuint8_t op1,svuint8_t op2)62 svuint8_t test_svhsubr_u8_z(svbool_t pg, svuint8_t op1, svuint8_t op2)
63 {
64   // CHECK-LABEL: test_svhsubr_u8_z
65   // CHECK: %[[SEL:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sel.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> zeroinitializer)
66   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %op2)
67   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
68   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
69   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u8_z'}}
70   return SVE_ACLE_FUNC(svhsubr,_u8,_z,)(pg, op1, op2);
71 }
72 
test_svhsubr_u16_z(svbool_t pg,svuint16_t op1,svuint16_t op2)73 svuint16_t test_svhsubr_u16_z(svbool_t pg, svuint16_t op1, svuint16_t op2)
74 {
75   // CHECK-LABEL: test_svhsubr_u16_z
76   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
77   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sel.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> zeroinitializer)
78   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %op2)
79   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
80   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
81   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u16_z'}}
82   return SVE_ACLE_FUNC(svhsubr,_u16,_z,)(pg, op1, op2);
83 }
84 
test_svhsubr_u32_z(svbool_t pg,svuint32_t op1,svuint32_t op2)85 svuint32_t test_svhsubr_u32_z(svbool_t pg, svuint32_t op1, svuint32_t op2)
86 {
87   // CHECK-LABEL: test_svhsubr_u32_z
88   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
89   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> zeroinitializer)
90   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %op2)
91   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
92   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
93   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u32_z'}}
94   return SVE_ACLE_FUNC(svhsubr,_u32,_z,)(pg, op1, op2);
95 }
96 
test_svhsubr_u64_z(svbool_t pg,svuint64_t op1,svuint64_t op2)97 svuint64_t test_svhsubr_u64_z(svbool_t pg, svuint64_t op1, svuint64_t op2)
98 {
99   // CHECK-LABEL: test_svhsubr_u64_z
100   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
101   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.sel.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> zeroinitializer)
102   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %op2)
103   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
104   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
105   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u64_z'}}
106   return SVE_ACLE_FUNC(svhsubr,_u64,_z,)(pg, op1, op2);
107 }
108 
test_svhsubr_s8_m(svbool_t pg,svint8_t op1,svint8_t op2)109 svint8_t test_svhsubr_s8_m(svbool_t pg, svint8_t op1, svint8_t op2)
110 {
111   // CHECK-LABEL: test_svhsubr_s8_m
112   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
113   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
114   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
115   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s8_m'}}
116   return SVE_ACLE_FUNC(svhsubr,_s8,_m,)(pg, op1, op2);
117 }
118 
test_svhsubr_s16_m(svbool_t pg,svint16_t op1,svint16_t op2)119 svint16_t test_svhsubr_s16_m(svbool_t pg, svint16_t op1, svint16_t op2)
120 {
121   // CHECK-LABEL: test_svhsubr_s16_m
122   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
123   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
124   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
125   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
126   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s16_m'}}
127   return SVE_ACLE_FUNC(svhsubr,_s16,_m,)(pg, op1, op2);
128 }
129 
test_svhsubr_s32_m(svbool_t pg,svint32_t op1,svint32_t op2)130 svint32_t test_svhsubr_s32_m(svbool_t pg, svint32_t op1, svint32_t op2)
131 {
132   // CHECK-LABEL: test_svhsubr_s32_m
133   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
134   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
135   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
136   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
137   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s32_m'}}
138   return SVE_ACLE_FUNC(svhsubr,_s32,_m,)(pg, op1, op2);
139 }
140 
test_svhsubr_s64_m(svbool_t pg,svint64_t op1,svint64_t op2)141 svint64_t test_svhsubr_s64_m(svbool_t pg, svint64_t op1, svint64_t op2)
142 {
143   // CHECK-LABEL: test_svhsubr_s64_m
144   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
145   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
146   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
147   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
148   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s64_m'}}
149   return SVE_ACLE_FUNC(svhsubr,_s64,_m,)(pg, op1, op2);
150 }
151 
test_svhsubr_u8_m(svbool_t pg,svuint8_t op1,svuint8_t op2)152 svuint8_t test_svhsubr_u8_m(svbool_t pg, svuint8_t op1, svuint8_t op2)
153 {
154   // CHECK-LABEL: test_svhsubr_u8_m
155   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
156   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
157   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
158   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u8_m'}}
159   return SVE_ACLE_FUNC(svhsubr,_u8,_m,)(pg, op1, op2);
160 }
161 
test_svhsubr_u16_m(svbool_t pg,svuint16_t op1,svuint16_t op2)162 svuint16_t test_svhsubr_u16_m(svbool_t pg, svuint16_t op1, svuint16_t op2)
163 {
164   // CHECK-LABEL: test_svhsubr_u16_m
165   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
166   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
167   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
168   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
169   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u16_m'}}
170   return SVE_ACLE_FUNC(svhsubr,_u16,_m,)(pg, op1, op2);
171 }
172 
test_svhsubr_u32_m(svbool_t pg,svuint32_t op1,svuint32_t op2)173 svuint32_t test_svhsubr_u32_m(svbool_t pg, svuint32_t op1, svuint32_t op2)
174 {
175   // CHECK-LABEL: test_svhsubr_u32_m
176   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
177   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
178   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
179   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
180   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u32_m'}}
181   return SVE_ACLE_FUNC(svhsubr,_u32,_m,)(pg, op1, op2);
182 }
183 
test_svhsubr_u64_m(svbool_t pg,svuint64_t op1,svuint64_t op2)184 svuint64_t test_svhsubr_u64_m(svbool_t pg, svuint64_t op1, svuint64_t op2)
185 {
186   // CHECK-LABEL: test_svhsubr_u64_m
187   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
188   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
189   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
190   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
191   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u64_m'}}
192   return SVE_ACLE_FUNC(svhsubr,_u64,_m,)(pg, op1, op2);
193 }
194 
test_svhsubr_s8_x(svbool_t pg,svint8_t op1,svint8_t op2)195 svint8_t test_svhsubr_s8_x(svbool_t pg, svint8_t op1, svint8_t op2)
196 {
197   // CHECK-LABEL: test_svhsubr_s8_x
198   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
199   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
200   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
201   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s8_x'}}
202   return SVE_ACLE_FUNC(svhsubr,_s8,_x,)(pg, op1, op2);
203 }
204 
test_svhsubr_s16_x(svbool_t pg,svint16_t op1,svint16_t op2)205 svint16_t test_svhsubr_s16_x(svbool_t pg, svint16_t op1, svint16_t op2)
206 {
207   // CHECK-LABEL: test_svhsubr_s16_x
208   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
209   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
210   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
211   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
212   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s16_x'}}
213   return SVE_ACLE_FUNC(svhsubr,_s16,_x,)(pg, op1, op2);
214 }
215 
test_svhsubr_s32_x(svbool_t pg,svint32_t op1,svint32_t op2)216 svint32_t test_svhsubr_s32_x(svbool_t pg, svint32_t op1, svint32_t op2)
217 {
218   // CHECK-LABEL: test_svhsubr_s32_x
219   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
220   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
221   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
222   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
223   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s32_x'}}
224   return SVE_ACLE_FUNC(svhsubr,_s32,_x,)(pg, op1, op2);
225 }
226 
test_svhsubr_s64_x(svbool_t pg,svint64_t op1,svint64_t op2)227 svint64_t test_svhsubr_s64_x(svbool_t pg, svint64_t op1, svint64_t op2)
228 {
229   // CHECK-LABEL: test_svhsubr_s64_x
230   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
231   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
232   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
233   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
234   // expected-warning@+1 {{implicit declaration of function 'svhsubr_s64_x'}}
235   return SVE_ACLE_FUNC(svhsubr,_s64,_x,)(pg, op1, op2);
236 }
237 
test_svhsubr_u8_x(svbool_t pg,svuint8_t op1,svuint8_t op2)238 svuint8_t test_svhsubr_u8_x(svbool_t pg, svuint8_t op1, svuint8_t op2)
239 {
240   // CHECK-LABEL: test_svhsubr_u8_x
241   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
242   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
243   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
244   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u8_x'}}
245   return SVE_ACLE_FUNC(svhsubr,_u8,_x,)(pg, op1, op2);
246 }
247 
test_svhsubr_u16_x(svbool_t pg,svuint16_t op1,svuint16_t op2)248 svuint16_t test_svhsubr_u16_x(svbool_t pg, svuint16_t op1, svuint16_t op2)
249 {
250   // CHECK-LABEL: test_svhsubr_u16_x
251   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
252   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
253   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
254   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
255   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u16_x'}}
256   return SVE_ACLE_FUNC(svhsubr,_u16,_x,)(pg, op1, op2);
257 }
258 
test_svhsubr_u32_x(svbool_t pg,svuint32_t op1,svuint32_t op2)259 svuint32_t test_svhsubr_u32_x(svbool_t pg, svuint32_t op1, svuint32_t op2)
260 {
261   // CHECK-LABEL: test_svhsubr_u32_x
262   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
263   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
264   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
265   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
266   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u32_x'}}
267   return SVE_ACLE_FUNC(svhsubr,_u32,_x,)(pg, op1, op2);
268 }
269 
test_svhsubr_u64_x(svbool_t pg,svuint64_t op1,svuint64_t op2)270 svuint64_t test_svhsubr_u64_x(svbool_t pg, svuint64_t op1, svuint64_t op2)
271 {
272   // CHECK-LABEL: test_svhsubr_u64_x
273   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
274   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
275   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
276   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
277   // expected-warning@+1 {{implicit declaration of function 'svhsubr_u64_x'}}
278   return SVE_ACLE_FUNC(svhsubr,_u64,_x,)(pg, op1, op2);
279 }
280 
test_svhsubr_n_s8_z(svbool_t pg,svint8_t op1,int8_t op2)281 svint8_t test_svhsubr_n_s8_z(svbool_t pg, svint8_t op1, int8_t op2)
282 {
283   // CHECK-LABEL: test_svhsubr_n_s8_z
284   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
285   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %[[DUP]])
286   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
287   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
288   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s8_z'}}
289   return SVE_ACLE_FUNC(svhsubr,_n_s8,_z,)(pg, op1, op2);
290 }
291 
test_svhsubr_n_s16_z(svbool_t pg,svint16_t op1,int16_t op2)292 svint16_t test_svhsubr_n_s16_z(svbool_t pg, svint16_t op1, int16_t op2)
293 {
294   // CHECK-LABEL: test_svhsubr_n_s16_z
295   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
296   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
297   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sel.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> zeroinitializer)
298   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %[[DUP]])
299   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
300   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
301   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s16_z'}}
302   return SVE_ACLE_FUNC(svhsubr,_n_s16,_z,)(pg, op1, op2);
303 }
304 
test_svhsubr_n_s32_z(svbool_t pg,svint32_t op1,int32_t op2)305 svint32_t test_svhsubr_n_s32_z(svbool_t pg, svint32_t op1, int32_t op2)
306 {
307   // CHECK-LABEL: test_svhsubr_n_s32_z
308   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
309   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
310   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> zeroinitializer)
311   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %[[DUP]])
312   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
313   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
314   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s32_z'}}
315   return SVE_ACLE_FUNC(svhsubr,_n_s32,_z,)(pg, op1, op2);
316 }
317 
test_svhsubr_n_s64_z(svbool_t pg,svint64_t op1,int64_t op2)318 svint64_t test_svhsubr_n_s64_z(svbool_t pg, svint64_t op1, int64_t op2)
319 {
320   // CHECK-LABEL: test_svhsubr_n_s64_z
321   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
322   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
323   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.sel.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> zeroinitializer)
324   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %[[DUP]])
325   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
326   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
327   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s64_z'}}
328   return SVE_ACLE_FUNC(svhsubr,_n_s64,_z,)(pg, op1, op2);
329 }
330 
test_svhsubr_n_u8_z(svbool_t pg,svuint8_t op1,uint8_t op2)331 svuint8_t test_svhsubr_n_u8_z(svbool_t pg, svuint8_t op1, uint8_t op2)
332 {
333   // CHECK-LABEL: test_svhsubr_n_u8_z
334   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
335   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sel.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> zeroinitializer)
336   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %[[DUP]])
337   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
338   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
339   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u8_z'}}
340   return SVE_ACLE_FUNC(svhsubr,_n_u8,_z,)(pg, op1, op2);
341 }
342 
test_svhsubr_n_u16_z(svbool_t pg,svuint16_t op1,uint16_t op2)343 svuint16_t test_svhsubr_n_u16_z(svbool_t pg, svuint16_t op1, uint16_t op2)
344 {
345   // CHECK-LABEL: test_svhsubr_n_u16_z
346   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
347   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
348   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sel.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> zeroinitializer)
349   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %[[DUP]])
350   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
351   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
352   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u16_z'}}
353   return SVE_ACLE_FUNC(svhsubr,_n_u16,_z,)(pg, op1, op2);
354 }
355 
test_svhsubr_n_u32_z(svbool_t pg,svuint32_t op1,uint32_t op2)356 svuint32_t test_svhsubr_n_u32_z(svbool_t pg, svuint32_t op1, uint32_t op2)
357 {
358   // CHECK-LABEL: test_svhsubr_n_u32_z
359   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
360   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
361   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sel.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> zeroinitializer)
362   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %[[DUP]])
363   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
364   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
365   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u32_z'}}
366   return SVE_ACLE_FUNC(svhsubr,_n_u32,_z,)(pg, op1, op2);
367 }
368 
test_svhsubr_n_u64_z(svbool_t pg,svuint64_t op1,uint64_t op2)369 svuint64_t test_svhsubr_n_u64_z(svbool_t pg, svuint64_t op1, uint64_t op2)
370 {
371   // CHECK-LABEL: test_svhsubr_n_u64_z
372   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
373   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
374   // CHECK-DAG: %[[SEL:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.sel.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> zeroinitializer)
375   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %[[DUP]])
376   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
377   // overload-warning@+2 {{implicit declaration of function 'svhsubr_z'}}
378   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u64_z'}}
379   return SVE_ACLE_FUNC(svhsubr,_n_u64,_z,)(pg, op1, op2);
380 }
381 
test_svhsubr_n_s8_m(svbool_t pg,svint8_t op1,int8_t op2)382 svint8_t test_svhsubr_n_s8_m(svbool_t pg, svint8_t op1, int8_t op2)
383 {
384   // CHECK-LABEL: test_svhsubr_n_s8_m
385   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
386   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
387   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
388   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
389   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s8_m'}}
390   return SVE_ACLE_FUNC(svhsubr,_n_s8,_m,)(pg, op1, op2);
391 }
392 
test_svhsubr_n_s16_m(svbool_t pg,svint16_t op1,int16_t op2)393 svint16_t test_svhsubr_n_s16_m(svbool_t pg, svint16_t op1, int16_t op2)
394 {
395   // CHECK-LABEL: test_svhsubr_n_s16_m
396   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
397   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
398   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
399   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
400   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
401   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s16_m'}}
402   return SVE_ACLE_FUNC(svhsubr,_n_s16,_m,)(pg, op1, op2);
403 }
404 
test_svhsubr_n_s32_m(svbool_t pg,svint32_t op1,int32_t op2)405 svint32_t test_svhsubr_n_s32_m(svbool_t pg, svint32_t op1, int32_t op2)
406 {
407   // CHECK-LABEL: test_svhsubr_n_s32_m
408   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
409   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
410   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
411   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
412   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
413   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s32_m'}}
414   return SVE_ACLE_FUNC(svhsubr,_n_s32,_m,)(pg, op1, op2);
415 }
416 
test_svhsubr_n_s64_m(svbool_t pg,svint64_t op1,int64_t op2)417 svint64_t test_svhsubr_n_s64_m(svbool_t pg, svint64_t op1, int64_t op2)
418 {
419   // CHECK-LABEL: test_svhsubr_n_s64_m
420   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
421   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
422   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
423   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
424   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
425   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s64_m'}}
426   return SVE_ACLE_FUNC(svhsubr,_n_s64,_m,)(pg, op1, op2);
427 }
428 
test_svhsubr_n_u8_m(svbool_t pg,svuint8_t op1,uint8_t op2)429 svuint8_t test_svhsubr_n_u8_m(svbool_t pg, svuint8_t op1, uint8_t op2)
430 {
431   // CHECK-LABEL: test_svhsubr_n_u8_m
432   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
433   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
434   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
435   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
436   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u8_m'}}
437   return SVE_ACLE_FUNC(svhsubr,_n_u8,_m,)(pg, op1, op2);
438 }
439 
test_svhsubr_n_u16_m(svbool_t pg,svuint16_t op1,uint16_t op2)440 svuint16_t test_svhsubr_n_u16_m(svbool_t pg, svuint16_t op1, uint16_t op2)
441 {
442   // CHECK-LABEL: test_svhsubr_n_u16_m
443   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
444   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
445   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
446   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
447   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
448   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u16_m'}}
449   return SVE_ACLE_FUNC(svhsubr,_n_u16,_m,)(pg, op1, op2);
450 }
451 
test_svhsubr_n_u32_m(svbool_t pg,svuint32_t op1,uint32_t op2)452 svuint32_t test_svhsubr_n_u32_m(svbool_t pg, svuint32_t op1, uint32_t op2)
453 {
454   // CHECK-LABEL: test_svhsubr_n_u32_m
455   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
456   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
457   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
458   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
459   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
460   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u32_m'}}
461   return SVE_ACLE_FUNC(svhsubr,_n_u32,_m,)(pg, op1, op2);
462 }
463 
test_svhsubr_n_u64_m(svbool_t pg,svuint64_t op1,uint64_t op2)464 svuint64_t test_svhsubr_n_u64_m(svbool_t pg, svuint64_t op1, uint64_t op2)
465 {
466   // CHECK-LABEL: test_svhsubr_n_u64_m
467   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
468   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
469   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
470   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
471   // overload-warning@+2 {{implicit declaration of function 'svhsubr_m'}}
472   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u64_m'}}
473   return SVE_ACLE_FUNC(svhsubr,_n_u64,_m,)(pg, op1, op2);
474 }
475 
test_svhsubr_n_s8_x(svbool_t pg,svint8_t op1,int8_t op2)476 svint8_t test_svhsubr_n_s8_x(svbool_t pg, svint8_t op1, int8_t op2)
477 {
478   // CHECK-LABEL: test_svhsubr_n_s8_x
479   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
480   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
481   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
482   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
483   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s8_x'}}
484   return SVE_ACLE_FUNC(svhsubr,_n_s8,_x,)(pg, op1, op2);
485 }
486 
test_svhsubr_n_s16_x(svbool_t pg,svint16_t op1,int16_t op2)487 svint16_t test_svhsubr_n_s16_x(svbool_t pg, svint16_t op1, int16_t op2)
488 {
489   // CHECK-LABEL: test_svhsubr_n_s16_x
490   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
491   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
492   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
493   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
494   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
495   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s16_x'}}
496   return SVE_ACLE_FUNC(svhsubr,_n_s16,_x,)(pg, op1, op2);
497 }
498 
test_svhsubr_n_s32_x(svbool_t pg,svint32_t op1,int32_t op2)499 svint32_t test_svhsubr_n_s32_x(svbool_t pg, svint32_t op1, int32_t op2)
500 {
501   // CHECK-LABEL: test_svhsubr_n_s32_x
502   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
503   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
504   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
505   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
506   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
507   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s32_x'}}
508   return SVE_ACLE_FUNC(svhsubr,_n_s32,_x,)(pg, op1, op2);
509 }
510 
test_svhsubr_n_s64_x(svbool_t pg,svint64_t op1,int64_t op2)511 svint64_t test_svhsubr_n_s64_x(svbool_t pg, svint64_t op1, int64_t op2)
512 {
513   // CHECK-LABEL: test_svhsubr_n_s64_x
514   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
515   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
516   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.shsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
517   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
518   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
519   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_s64_x'}}
520   return SVE_ACLE_FUNC(svhsubr,_n_s64,_x,)(pg, op1, op2);
521 }
522 
test_svhsubr_n_u8_x(svbool_t pg,svuint8_t op1,uint8_t op2)523 svuint8_t test_svhsubr_n_u8_x(svbool_t pg, svuint8_t op1, uint8_t op2)
524 {
525   // CHECK-LABEL: test_svhsubr_n_u8_x
526   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
527   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uhsubr.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
528   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
529   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
530   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u8_x'}}
531   return SVE_ACLE_FUNC(svhsubr,_n_u8,_x,)(pg, op1, op2);
532 }
533 
test_svhsubr_n_u16_x(svbool_t pg,svuint16_t op1,uint16_t op2)534 svuint16_t test_svhsubr_n_u16_x(svbool_t pg, svuint16_t op1, uint16_t op2)
535 {
536   // CHECK-LABEL: test_svhsubr_n_u16_x
537   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
538   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
539   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uhsubr.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
540   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
541   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
542   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u16_x'}}
543   return SVE_ACLE_FUNC(svhsubr,_n_u16,_x,)(pg, op1, op2);
544 }
545 
test_svhsubr_n_u32_x(svbool_t pg,svuint32_t op1,uint32_t op2)546 svuint32_t test_svhsubr_n_u32_x(svbool_t pg, svuint32_t op1, uint32_t op2)
547 {
548   // CHECK-LABEL: test_svhsubr_n_u32_x
549   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
550   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
551   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uhsubr.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
552   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
553   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
554   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u32_x'}}
555   return SVE_ACLE_FUNC(svhsubr,_n_u32,_x,)(pg, op1, op2);
556 }
557 
test_svhsubr_n_u64_x(svbool_t pg,svuint64_t op1,uint64_t op2)558 svuint64_t test_svhsubr_n_u64_x(svbool_t pg, svuint64_t op1, uint64_t op2)
559 {
560   // CHECK-LABEL: test_svhsubr_n_u64_x
561   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
562   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
563   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.uhsubr.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
564   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
565   // overload-warning@+2 {{implicit declaration of function 'svhsubr_x'}}
566   // expected-warning@+1 {{implicit declaration of function 'svhsubr_n_u64_x'}}
567   return SVE_ACLE_FUNC(svhsubr,_n_u64,_x,)(pg, op1, op2);
568 }
569