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 #include <arm_sve.h>
6 
7 #ifdef SVE_OVERLOADED_FORMS
8 // A simple used,unused... macro, long enough to represent any SVE builtin.
9 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
10 #else
11 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
12 #endif
13 
test_svsqadd_u8_m(svbool_t pg,svuint8_t op1,svint8_t op2)14 svuint8_t test_svsqadd_u8_m(svbool_t pg, svuint8_t op1, svint8_t op2)
15 {
16   // CHECK-LABEL: test_svsqadd_u8_m
17   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
18   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
19   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
20   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u8_m'}}
21   return SVE_ACLE_FUNC(svsqadd,_u8,_m,)(pg, op1, op2);
22 }
23 
test_svsqadd_u16_m(svbool_t pg,svuint16_t op1,svint16_t op2)24 svuint16_t test_svsqadd_u16_m(svbool_t pg, svuint16_t op1, svint16_t op2)
25 {
26   // CHECK-LABEL: test_svsqadd_u16_m
27   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
28   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
29   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
30   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
31   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u16_m'}}
32   return SVE_ACLE_FUNC(svsqadd,_u16,_m,)(pg, op1, op2);
33 }
34 
test_svsqadd_u32_m(svbool_t pg,svuint32_t op1,svint32_t op2)35 svuint32_t test_svsqadd_u32_m(svbool_t pg, svuint32_t op1, svint32_t op2)
36 {
37   // CHECKA-LABEL: test_svsqadd_u32_m
38   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
39   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
40   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
41   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
42   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u32_m'}}
43   return SVE_ACLE_FUNC(svsqadd,_u32,_m,)(pg, op1, op2);
44 }
45 
test_svsqadd_u64_m(svbool_t pg,svuint64_t op1,svint64_t op2)46 svuint64_t test_svsqadd_u64_m(svbool_t pg, svuint64_t op1, svint64_t op2)
47 {
48   // CHECK-LABEL: test_svsqadd_u64_m
49   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
50   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
51   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
52   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
53   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u64_m'}}
54   return SVE_ACLE_FUNC(svsqadd,_u64,_m,)(pg, op1, op2);
55 }
56 
test_svsqadd_n_u8_m(svbool_t pg,svuint8_t op1,int8_t op2)57 svuint8_t test_svsqadd_n_u8_m(svbool_t pg, svuint8_t op1, int8_t op2)
58 {
59   // CHECK-LABEL: test_svsqadd_n_u8_m
60   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
61   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
62   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
63   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
64   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u8_m'}}
65   return SVE_ACLE_FUNC(svsqadd,_n_u8,_m,)(pg, op1, op2);
66 }
67 
test_svsqadd_n_u16_m(svbool_t pg,svuint16_t op1,int16_t op2)68 svuint16_t test_svsqadd_n_u16_m(svbool_t pg, svuint16_t op1, int16_t op2)
69 {
70   // CHECK-LABEL: test_svsqadd_n_u16_m
71   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
72   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
73   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
74   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
75   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
76   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u16_m'}}
77   return SVE_ACLE_FUNC(svsqadd,_n_u16,_m,)(pg, op1, op2);
78 }
79 
test_svsqadd_n_u32_m(svbool_t pg,svuint32_t op1,int32_t op2)80 svuint32_t test_svsqadd_n_u32_m(svbool_t pg, svuint32_t op1, int32_t op2)
81 {
82   // CHECK-LABEL: test_svsqadd_n_u32_m
83   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
84   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
85   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
86   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
87   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
88   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u32_m'}}
89   return SVE_ACLE_FUNC(svsqadd,_n_u32,_m,)(pg, op1, op2);
90 }
91 
test_svsqadd_n_u64_m(svbool_t pg,svuint64_t op1,int64_t op2)92 svuint64_t test_svsqadd_n_u64_m(svbool_t pg, svuint64_t op1, int64_t op2)
93 {
94   // CHECK-LABEL: test_svsqadd_n_u64_m
95   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
96   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
97   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
98   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
99   // overload-warning@+2 {{implicit declaration of function 'svsqadd_m'}}
100   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u64_m'}}
101   return SVE_ACLE_FUNC(svsqadd,_n_u64,_m,)(pg, op1, op2);
102 }
103 
test_svsqadd_u8_z(svbool_t pg,svuint8_t op1,svint8_t op2)104 svuint8_t test_svsqadd_u8_z(svbool_t pg, svuint8_t op1, svint8_t op2)
105 {
106   // CHECK-LABEL: test_svsqadd_u8_z
107   // 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)
108   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %op2)
109   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
110   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
111   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u8_z'}}
112   return SVE_ACLE_FUNC(svsqadd,_u8,_z,)(pg, op1, op2);
113 }
114 
test_svsqadd_u16_z(svbool_t pg,svuint16_t op1,svint16_t op2)115 svuint16_t test_svsqadd_u16_z(svbool_t pg, svuint16_t op1, svint16_t op2)
116 {
117   // CHECK-LABEL: test_svsqadd_u16_z
118   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
119   // CHECK: %[[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)
120   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %op2)
121   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
122   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
123   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u16_z'}}
124   return SVE_ACLE_FUNC(svsqadd,_u16,_z,)(pg, op1, op2);
125 }
126 
test_svsqadd_u32_z(svbool_t pg,svuint32_t op1,svint32_t op2)127 svuint32_t test_svsqadd_u32_z(svbool_t pg, svuint32_t op1, svint32_t op2)
128 {
129   // CHECK-LABEL: test_svsqadd_u32_z
130   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
131   // CHECK: %[[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)
132   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %op2)
133   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
134   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
135   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u32_z'}}
136   return SVE_ACLE_FUNC(svsqadd,_u32,_z,)(pg, op1, op2);
137 }
138 
test_svsqadd_u64_z(svbool_t pg,svuint64_t op1,svint64_t op2)139 svuint64_t test_svsqadd_u64_z(svbool_t pg, svuint64_t op1, svint64_t op2)
140 {
141   // CHECK-LABEL: test_svsqadd_u64_z
142   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
143   // CHECK: %[[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)
144   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %op2)
145   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
146   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
147   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u64_z'}}
148   return SVE_ACLE_FUNC(svsqadd,_u64,_z,)(pg, op1, op2);
149 }
150 
test_svsqadd_n_u8_z(svbool_t pg,svuint8_t op1,int8_t op2)151 svuint8_t test_svsqadd_n_u8_z(svbool_t pg, svuint8_t op1, int8_t op2)
152 {
153   // CHECK-LABEL: test_svsqadd_n_u8_z
154   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
155   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[SEL]], <vscale x 16 x i8> %[[DUP]])
156   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
157   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
158   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u8_z'}}
159   return SVE_ACLE_FUNC(svsqadd,_n_u8,_z,)(pg, op1, op2);
160 }
161 
test_svsqadd_n_u16_z(svbool_t pg,svuint16_t op1,int16_t op2)162 svuint16_t test_svsqadd_n_u16_z(svbool_t pg, svuint16_t op1, int16_t op2)
163 {
164   // CHECK-LABEL: test_svsqadd_n_u16_z
165   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
166   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
167   // 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)
168   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[SEL]], <vscale x 8 x i16> %[[DUP]])
169   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
170   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
171   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u16_z'}}
172   return SVE_ACLE_FUNC(svsqadd,_n_u16,_z,)(pg, op1, op2);
173 }
174 
test_svsqadd_n_u32_z(svbool_t pg,svuint32_t op1,int32_t op2)175 svuint32_t test_svsqadd_n_u32_z(svbool_t pg, svuint32_t op1, int32_t op2)
176 {
177   // CHECK-LABEL: test_svsqadd_n_u32_z
178   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
179   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
180   // 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)
181   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[SEL]], <vscale x 4 x i32> %[[DUP]])
182   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
183   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
184   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u32_z'}}
185   return SVE_ACLE_FUNC(svsqadd,_n_u32,_z,)(pg, op1, op2);
186 }
187 
test_svsqadd_n_u64_z(svbool_t pg,svuint64_t op1,int64_t op2)188 svuint64_t test_svsqadd_n_u64_z(svbool_t pg, svuint64_t op1, int64_t op2)
189 {
190   // CHECK-LABEL: test_svsqadd_n_u64_z
191   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
192   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
193   // 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)
194   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[SEL]], <vscale x 2 x i64> %[[DUP]])
195   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
196   // overload-warning@+2 {{implicit declaration of function 'svsqadd_z'}}
197   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u64_z'}}
198   return SVE_ACLE_FUNC(svsqadd,_n_u64,_z,)(pg, op1, op2);
199 }
200 
test_svsqadd_u8_x(svbool_t pg,svuint8_t op1,svint8_t op2)201 svuint8_t test_svsqadd_u8_x(svbool_t pg, svuint8_t op1, svint8_t op2)
202 {
203   // CHECK-LABEL: test_svsqadd_u8_x
204   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
205   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
206   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
207   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u8_x'}}
208   return SVE_ACLE_FUNC(svsqadd,_u8,_x,)(pg, op1, op2);
209 }
210 
test_svsqadd_u16_x(svbool_t pg,svuint16_t op1,svint16_t op2)211 svuint16_t test_svsqadd_u16_x(svbool_t pg, svuint16_t op1, svint16_t op2)
212 {
213   // CHECK-LABEL: test_svsqadd_u16_x
214   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
215   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
216   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
217   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
218   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u16_x'}}
219   return SVE_ACLE_FUNC(svsqadd,_u16,_x,)(pg, op1, op2);
220 }
221 
test_svsqadd_u32_x(svbool_t pg,svuint32_t op1,svint32_t op2)222 svuint32_t test_svsqadd_u32_x(svbool_t pg, svuint32_t op1, svint32_t op2)
223 {
224   // CHECKA-LABEL: test_svsqadd_u32_x
225   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
226   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
227   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
228   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
229   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u32_x'}}
230   return SVE_ACLE_FUNC(svsqadd,_u32,_x,)(pg, op1, op2);
231 }
232 
test_svsqadd_u64_x(svbool_t pg,svuint64_t op1,svint64_t op2)233 svuint64_t test_svsqadd_u64_x(svbool_t pg, svuint64_t op1, svint64_t op2)
234 {
235   // CHECK-LABEL: test_svsqadd_u64_x
236   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
237   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
238   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
239   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
240   // expected-warning@+1 {{implicit declaration of function 'svsqadd_u64_x'}}
241   return SVE_ACLE_FUNC(svsqadd,_u64,_x,)(pg, op1, op2);
242 }
243 
test_svsqadd_n_u8_x(svbool_t pg,svuint8_t op1,int8_t op2)244 svuint8_t test_svsqadd_n_u8_x(svbool_t pg, svuint8_t op1, int8_t op2)
245 {
246   // CHECK-LABEL: test_svsqadd_n_u8_x
247   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
248   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.usqadd.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
249   // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
250   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
251   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u8_x'}}
252   return SVE_ACLE_FUNC(svsqadd,_n_u8,_x,)(pg, op1, op2);
253 }
254 
test_svsqadd_n_u16_x(svbool_t pg,svuint16_t op1,int16_t op2)255 svuint16_t test_svsqadd_n_u16_x(svbool_t pg, svuint16_t op1, int16_t op2)
256 {
257   // CHECK-LABEL: test_svsqadd_n_u16_x
258   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
259   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
260   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.usqadd.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
261   // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
262   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
263   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u16_x'}}
264   return SVE_ACLE_FUNC(svsqadd,_n_u16,_x,)(pg, op1, op2);
265 }
266 
test_svsqadd_n_u32_x(svbool_t pg,svuint32_t op1,int32_t op2)267 svuint32_t test_svsqadd_n_u32_x(svbool_t pg, svuint32_t op1, int32_t op2)
268 {
269   // CHECK-LABEL: test_svsqadd_n_u32_x
270   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
271   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
272   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.usqadd.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
273   // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
274   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
275   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u32_x'}}
276   return SVE_ACLE_FUNC(svsqadd,_n_u32,_x,)(pg, op1, op2);
277 }
278 
test_svsqadd_n_u64_x(svbool_t pg,svuint64_t op1,int64_t op2)279 svuint64_t test_svsqadd_n_u64_x(svbool_t pg, svuint64_t op1, int64_t op2)
280 {
281   // CHECK-LABEL: test_svsqadd_n_u64_x
282   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
283   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
284   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.usqadd.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
285   // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
286   // overload-warning@+2 {{implicit declaration of function 'svsqadd_x'}}
287   // expected-warning@+1 {{implicit declaration of function 'svsqadd_n_u64_x'}}
288   return SVE_ACLE_FUNC(svsqadd,_n_u64,_x,)(pg, op1, op2);
289 }
290