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_svldnt1sh_gather_u32base_s32(svbool_t pg,svuint32_t bases)15 svint32_t test_svldnt1sh_gather_u32base_s32(svbool_t pg, svuint32_t bases) {
16 // CHECK-LABEL: test_svldnt1sh_gather_u32base_s32
17 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
18 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 0)
19 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
20 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
21 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_s32'}}
22 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_s32'}}
23 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _s32, )(pg, bases);
24 }
25
test_svldnt1sh_gather_u64base_s64(svbool_t pg,svuint64_t bases)26 svint64_t test_svldnt1sh_gather_u64base_s64(svbool_t pg, svuint64_t bases) {
27 // CHECK-LABEL: test_svldnt1sh_gather_u64base_s64
28 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
29 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 0)
30 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
31 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
32 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_s64'}}
33 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_s64'}}
34 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _s64, )(pg, bases);
35 }
36
test_svldnt1sh_gather_u32base_u32(svbool_t pg,svuint32_t bases)37 svuint32_t test_svldnt1sh_gather_u32base_u32(svbool_t pg, svuint32_t bases) {
38 // CHECK-LABEL: test_svldnt1sh_gather_u32base_u32
39 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
40 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 0)
41 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
42 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
43 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_u32'}}
44 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_u32'}}
45 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _u32, )(pg, bases);
46 }
47
test_svldnt1sh_gather_u64base_u64(svbool_t pg,svuint64_t bases)48 svuint64_t test_svldnt1sh_gather_u64base_u64(svbool_t pg, svuint64_t bases) {
49 // CHECK-LABEL: test_svldnt1sh_gather_u64base_u64
50 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
51 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 0)
52 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
53 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
54 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_u64'}}
55 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_u64'}}
56 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _u64, )(pg, bases);
57 }
58
test_svldnt1sh_gather_s64offset_s64(svbool_t pg,const int16_t * base,svint64_t offsets)59 svint64_t test_svldnt1sh_gather_s64offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) {
60 // CHECK-LABEL: test_svldnt1sh_gather_s64offset_s64
61 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
62 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %offsets)
63 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
64 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
65 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_s64'}}
66 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_s64offset_s64'}}
67 return SVE_ACLE_FUNC(svldnt1sh_gather_, s64, offset_s64, )(pg, base, offsets);
68 }
69
test_svldnt1sh_gather_s64offset_u64(svbool_t pg,const int16_t * base,svint64_t offsets)70 svuint64_t test_svldnt1sh_gather_s64offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) {
71 // CHECK-LABEL: test_svldnt1sh_gather_s64offset_u64
72 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
73 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %offsets)
74 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
75 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
76 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_u64'}}
77 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_s64offset_u64'}}
78 return SVE_ACLE_FUNC(svldnt1sh_gather_, s64, offset_u64, )(pg, base, offsets);
79 }
80
test_svldnt1sh_gather_u32offset_s32(svbool_t pg,const int16_t * base,svuint32_t offsets)81 svint32_t test_svldnt1sh_gather_u32offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) {
82 // CHECK-LABEL: test_svldnt1sh_gather_u32offset_s32
83 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
84 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.uxtw.nxv4i16(<vscale x 4 x i1> [[PG]], i16* %base, <vscale x 4 x i32> %offsets)
85 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
86 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
87 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_s32'}}
88 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32offset_s32'}}
89 return SVE_ACLE_FUNC(svldnt1sh_gather_, u32, offset_s32, )(pg, base, offsets);
90 }
91
test_svldnt1sh_gather_u64offset_s64(svbool_t pg,const int16_t * base,svuint64_t offsets)92 svint64_t test_svldnt1sh_gather_u64offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) {
93 // CHECK-LABEL: test_svldnt1sh_gather_u64offset_s64
94 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
95 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %offsets)
96 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
97 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
98 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_s64'}}
99 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64offset_s64'}}
100 return SVE_ACLE_FUNC(svldnt1sh_gather_, u64, offset_s64, )(pg, base, offsets);
101 }
102
test_svldnt1sh_gather_u32offset_u32(svbool_t pg,const int16_t * base,svuint32_t offsets)103 svuint32_t test_svldnt1sh_gather_u32offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) {
104 // CHECK-LABEL: test_svldnt1sh_gather_u32offset_u32
105 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
106 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.uxtw.nxv4i16(<vscale x 4 x i1> [[PG]], i16* %base, <vscale x 4 x i32> %offsets)
107 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
108 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
109 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_u32'}}
110 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32offset_u32'}}
111 return SVE_ACLE_FUNC(svldnt1sh_gather_, u32, offset_u32, )(pg, base, offsets);
112 }
113
test_svldnt1sh_gather_u64offset_u64(svbool_t pg,const int16_t * base,svuint64_t offsets)114 svuint64_t test_svldnt1sh_gather_u64offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) {
115 // CHECK-LABEL: test_svldnt1sh_gather_u64offset_u64
116 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
117 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %offsets)
118 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
119 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
120 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_u64'}}
121 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64offset_u64'}}
122 return SVE_ACLE_FUNC(svldnt1sh_gather_, u64, offset_u64, )(pg, base, offsets);
123 }
124
test_svldnt1sh_gather_u32base_offset_s32(svbool_t pg,svuint32_t bases,int64_t offset)125 svint32_t test_svldnt1sh_gather_u32base_offset_s32(svbool_t pg, svuint32_t bases, int64_t offset) {
126 // CHECK-LABEL: test_svldnt1sh_gather_u32base_offset_s32
127 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
128 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 %offset)
129 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
130 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
131 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_s32'}}
132 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_offset_s32'}}
133 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _offset_s32, )(pg, bases, offset);
134 }
135
test_svldnt1sh_gather_u64base_offset_s64(svbool_t pg,svuint64_t bases,int64_t offset)136 svint64_t test_svldnt1sh_gather_u64base_offset_s64(svbool_t pg, svuint64_t bases, int64_t offset) {
137 // CHECK-LABEL: test_svldnt1sh_gather_u64base_offset_s64
138 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
139 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 %offset)
140 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
141 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
142 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_s64'}}
143 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_offset_s64'}}
144 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _offset_s64, )(pg, bases, offset);
145 }
146
test_svldnt1sh_gather_u32base_offset_u32(svbool_t pg,svuint32_t bases,int64_t offset)147 svuint32_t test_svldnt1sh_gather_u32base_offset_u32(svbool_t pg, svuint32_t bases, int64_t offset) {
148 // CHECK-LABEL: test_svldnt1sh_gather_u32base_offset_u32
149 // CHECK: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
150 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 %offset)
151 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
152 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
153 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_u32'}}
154 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_offset_u32'}}
155 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _offset_u32, )(pg, bases, offset);
156 }
157
test_svldnt1sh_gather_u64base_offset_u64(svbool_t pg,svuint64_t bases,int64_t offset)158 svuint64_t test_svldnt1sh_gather_u64base_offset_u64(svbool_t pg, svuint64_t bases, int64_t offset) {
159 // CHECK-LABEL: test_svldnt1sh_gather_u64base_offset_u64
160 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
161 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 %offset)
162 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
163 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
164 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_offset_u64'}}
165 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_offset_u64'}}
166 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _offset_u64, )(pg, bases, offset);
167 }
168
test_svldnt1sh_gather_s64index_s64(svbool_t pg,const int16_t * base,svint64_t indices)169 svint64_t test_svldnt1sh_gather_s64index_s64(svbool_t pg, const int16_t *base, svint64_t indices) {
170 // CHECK-LABEL: test_svldnt1sh_gather_s64index_s64
171 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
172 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %indices)
173 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
174 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
175 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_s64'}}
176 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_s64index_s64'}}
177 return SVE_ACLE_FUNC(svldnt1sh_gather_, s64, index_s64, )(pg, base, indices);
178 }
179
test_svldnt1sh_gather_s64index_u64(svbool_t pg,const int16_t * base,svint64_t indices)180 svuint64_t test_svldnt1sh_gather_s64index_u64(svbool_t pg, const int16_t *base, svint64_t indices) {
181 // CHECK-LABEL: test_svldnt1sh_gather_s64index_u64
182 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
183 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %indices)
184 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
185 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
186 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_u64'}}
187 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_s64index_u64'}}
188 return SVE_ACLE_FUNC(svldnt1sh_gather_, s64, index_u64, )(pg, base, indices);
189 }
190
test_svldnt1sh_gather_u64index_s64(svbool_t pg,const int16_t * base,svuint64_t indices)191 svint64_t test_svldnt1sh_gather_u64index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) {
192 // CHECK-LABEL: test_svldnt1sh_gather_u64index_s64
193 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
194 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %indices)
195 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
196 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
197 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_s64'}}
198 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64index_s64'}}
199 return SVE_ACLE_FUNC(svldnt1sh_gather_, u64, index_s64, )(pg, base, indices);
200 }
201
test_svldnt1sh_gather_u64index_u64(svbool_t pg,const int16_t * base,svuint64_t indices)202 svuint64_t test_svldnt1sh_gather_u64index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) {
203 // CHECK-LABEL: test_svldnt1sh_gather_u64index_u64
204 // CHECK: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
205 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.index.nxv2i16(<vscale x 2 x i1> [[PG]], i16* %base, <vscale x 2 x i64> %indices)
206 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
207 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
208 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_u64'}}
209 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64index_u64'}}
210 return SVE_ACLE_FUNC(svldnt1sh_gather_, u64, index_u64, )(pg, base, indices);
211 }
212
test_svldnt1sh_gather_u32base_index_s32(svbool_t pg,svuint32_t bases,int64_t index)213 svint32_t test_svldnt1sh_gather_u32base_index_s32(svbool_t pg, svuint32_t bases, int64_t index) {
214 // CHECK-LABEL: test_svldnt1sh_gather_u32base_index_s32
215 // CHECK-DAG: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
216 // CHECK-DAG: [[SHL:%.*]] = shl i64 %index, 1
217 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 [[SHL]])
218 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
219 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
220 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_s32'}}
221 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_index_s32'}}
222 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _index_s32, )(pg, bases, index);
223 }
224
test_svldnt1sh_gather_u64base_index_s64(svbool_t pg,svuint64_t bases,int64_t index)225 svint64_t test_svldnt1sh_gather_u64base_index_s64(svbool_t pg, svuint64_t bases, int64_t index) {
226 // CHECK-LABEL: test_svldnt1sh_gather_u64base_index_s64
227 // CHECK-DAG: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
228 // CHECK-DAG: [[SHL:%.*]] = shl i64 %index, 1
229 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 [[SHL]])
230 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
231 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
232 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_s64'}}
233 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_index_s64'}}
234 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _index_s64, )(pg, bases, index);
235 }
236
test_svldnt1sh_gather_u32base_index_u32(svbool_t pg,svuint32_t bases,int64_t index)237 svuint32_t test_svldnt1sh_gather_u32base_index_u32(svbool_t pg, svuint32_t bases, int64_t index) {
238 // CHECK-LABEL: test_svldnt1sh_gather_u32base_index_u32
239 // CHECK-DAG: [[PG:%.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
240 // CHECK-DAG: [[SHL:%.*]] = shl i64 %index, 1
241 // CHECK: [[LOAD:%.*]] = call <vscale x 4 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv4i16.nxv4i32(<vscale x 4 x i1> [[PG]], <vscale x 4 x i32> %bases, i64 [[SHL]])
242 // CHECK: [[SEXT:%.*]] = sext <vscale x 4 x i16> [[LOAD]] to <vscale x 4 x i32>
243 // CHECK: ret <vscale x 4 x i32> [[SEXT]]
244 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_u32'}}
245 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u32base_index_u32'}}
246 return SVE_ACLE_FUNC(svldnt1sh_gather, _u32base, _index_u32, )(pg, bases, index);
247 }
248
test_svldnt1sh_gather_u64base_index_u64(svbool_t pg,svuint64_t bases,int64_t index)249 svuint64_t test_svldnt1sh_gather_u64base_index_u64(svbool_t pg, svuint64_t bases, int64_t index) {
250 // CHECK-LABEL: test_svldnt1sh_gather_u64base_index_u64
251 // CHECK-DAG: [[PG:%.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
252 // CHECK-DAG: [[SHL:%.*]] = shl i64 %index, 1
253 // CHECK: [[LOAD:%.*]] = call <vscale x 2 x i16> @llvm.aarch64.sve.ldnt1.gather.scalar.offset.nxv2i16.nxv2i64(<vscale x 2 x i1> [[PG]], <vscale x 2 x i64> %bases, i64 [[SHL]])
254 // CHECK: [[SEXT:%.*]] = sext <vscale x 2 x i16> [[LOAD]] to <vscale x 2 x i64>
255 // CHECK: ret <vscale x 2 x i64> [[SEXT]]
256 // overload-warning@+2 {{implicit declaration of function 'svldnt1sh_gather_index_u64'}}
257 // expected-warning@+1 {{implicit declaration of function 'svldnt1sh_gather_u64base_index_u64'}}
258 return SVE_ACLE_FUNC(svldnt1sh_gather, _u64base, _index_u64, )(pg, bases, index);
259 }
260