1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64-none-eabi -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-NOFP16
3 ; RUN: llc -mtriple=aarch64-none-eabi -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-FP16
4 ; RUN: llc -mtriple=aarch64-none-eabi -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-GI-NOFP16
5 ; RUN: llc -mtriple=aarch64-none-eabi -mattr=+fullfp16 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-GI-FP16
7 define double @sqrt_f64(double %a) {
8 ; CHECK-LABEL: sqrt_f64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: fsqrt d0, d0
13 %c = call double @llvm.sqrt.f64(double %a)
17 define float @sqrt_f32(float %a) {
18 ; CHECK-LABEL: sqrt_f32:
19 ; CHECK: // %bb.0: // %entry
20 ; CHECK-NEXT: fsqrt s0, s0
23 %c = call float @llvm.sqrt.f32(float %a)
27 define half @sqrt_f16(half %a) {
28 ; CHECK-SD-NOFP16-LABEL: sqrt_f16:
29 ; CHECK-SD-NOFP16: // %bb.0: // %entry
30 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
31 ; CHECK-SD-NOFP16-NEXT: fsqrt s0, s0
32 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s0
33 ; CHECK-SD-NOFP16-NEXT: ret
35 ; CHECK-SD-FP16-LABEL: sqrt_f16:
36 ; CHECK-SD-FP16: // %bb.0: // %entry
37 ; CHECK-SD-FP16-NEXT: fsqrt h0, h0
38 ; CHECK-SD-FP16-NEXT: ret
40 ; CHECK-GI-NOFP16-LABEL: sqrt_f16:
41 ; CHECK-GI-NOFP16: // %bb.0: // %entry
42 ; CHECK-GI-NOFP16-NEXT: fcvt s0, h0
43 ; CHECK-GI-NOFP16-NEXT: fsqrt s0, s0
44 ; CHECK-GI-NOFP16-NEXT: fcvt h0, s0
45 ; CHECK-GI-NOFP16-NEXT: ret
47 ; CHECK-GI-FP16-LABEL: sqrt_f16:
48 ; CHECK-GI-FP16: // %bb.0: // %entry
49 ; CHECK-GI-FP16-NEXT: fsqrt h0, h0
50 ; CHECK-GI-FP16-NEXT: ret
52 %c = call half @llvm.sqrt.f16(half %a)
56 define <2 x double> @sqrt_v2f64(<2 x double> %a) {
57 ; CHECK-LABEL: sqrt_v2f64:
58 ; CHECK: // %bb.0: // %entry
59 ; CHECK-NEXT: fsqrt v0.2d, v0.2d
62 %c = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %a)
66 define <3 x double> @sqrt_v3f64(<3 x double> %a) {
67 ; CHECK-SD-LABEL: sqrt_v3f64:
68 ; CHECK-SD: // %bb.0: // %entry
69 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
70 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
71 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
72 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
73 ; CHECK-SD-NEXT: fsqrt v2.2d, v2.2d
74 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
75 ; CHECK-SD-NEXT: fsqrt v0.2d, v0.2d
76 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
77 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
78 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
81 ; CHECK-GI-LABEL: sqrt_v3f64:
82 ; CHECK-GI: // %bb.0: // %entry
83 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
84 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
85 ; CHECK-GI-NEXT: fsqrt d2, d2
86 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
87 ; CHECK-GI-NEXT: fsqrt v0.2d, v0.2d
88 ; CHECK-GI-NEXT: mov d1, v0.d[1]
89 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
92 %c = call <3 x double> @llvm.sqrt.v3f64(<3 x double> %a)
96 define <4 x double> @sqrt_v4f64(<4 x double> %a) {
97 ; CHECK-LABEL: sqrt_v4f64:
98 ; CHECK: // %bb.0: // %entry
99 ; CHECK-NEXT: fsqrt v0.2d, v0.2d
100 ; CHECK-NEXT: fsqrt v1.2d, v1.2d
103 %c = call <4 x double> @llvm.sqrt.v4f64(<4 x double> %a)
107 define <2 x float> @sqrt_v2f32(<2 x float> %a) {
108 ; CHECK-LABEL: sqrt_v2f32:
109 ; CHECK: // %bb.0: // %entry
110 ; CHECK-NEXT: fsqrt v0.2s, v0.2s
113 %c = call <2 x float> @llvm.sqrt.v2f32(<2 x float> %a)
117 define <3 x float> @sqrt_v3f32(<3 x float> %a) {
118 ; CHECK-LABEL: sqrt_v3f32:
119 ; CHECK: // %bb.0: // %entry
120 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
123 %c = call <3 x float> @llvm.sqrt.v3f32(<3 x float> %a)
127 define <4 x float> @sqrt_v4f32(<4 x float> %a) {
128 ; CHECK-LABEL: sqrt_v4f32:
129 ; CHECK: // %bb.0: // %entry
130 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
133 %c = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %a)
137 define <8 x float> @sqrt_v8f32(<8 x float> %a) {
138 ; CHECK-LABEL: sqrt_v8f32:
139 ; CHECK: // %bb.0: // %entry
140 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
141 ; CHECK-NEXT: fsqrt v1.4s, v1.4s
144 %c = call <8 x float> @llvm.sqrt.v8f32(<8 x float> %a)
148 define <7 x half> @sqrt_v7f16(<7 x half> %a) {
149 ; CHECK-SD-NOFP16-LABEL: sqrt_v7f16:
150 ; CHECK-SD-NOFP16: // %bb.0: // %entry
151 ; CHECK-SD-NOFP16-NEXT: mov h1, v0.h[1]
152 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h0
153 ; CHECK-SD-NOFP16-NEXT: mov h3, v0.h[2]
154 ; CHECK-SD-NOFP16-NEXT: mov h4, v0.h[3]
155 ; CHECK-SD-NOFP16-NEXT: mov h5, v0.h[4]
156 ; CHECK-SD-NOFP16-NEXT: mov h6, v0.h[5]
157 ; CHECK-SD-NOFP16-NEXT: mov h7, v0.h[6]
158 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[7]
159 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
160 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
161 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h3
162 ; CHECK-SD-NOFP16-NEXT: fcvt s4, h4
163 ; CHECK-SD-NOFP16-NEXT: fcvt s5, h5
164 ; CHECK-SD-NOFP16-NEXT: fcvt s6, h6
165 ; CHECK-SD-NOFP16-NEXT: fcvt s7, h7
166 ; CHECK-SD-NOFP16-NEXT: fcvt s16, h0
167 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s2
168 ; CHECK-SD-NOFP16-NEXT: fsqrt s1, s1
169 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s1
170 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v1.h[0]
171 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
172 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s3
173 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v1.h[0]
174 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s4
175 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s4
176 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v1.h[0]
177 ; CHECK-SD-NOFP16-NEXT: fsqrt s5, s5
178 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s5
179 ; CHECK-SD-NOFP16-NEXT: mov v0.h[4], v1.h[0]
180 ; CHECK-SD-NOFP16-NEXT: fsqrt s6, s6
181 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s6
182 ; CHECK-SD-NOFP16-NEXT: mov v0.h[5], v1.h[0]
183 ; CHECK-SD-NOFP16-NEXT: fsqrt s7, s7
184 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s7
185 ; CHECK-SD-NOFP16-NEXT: mov v0.h[6], v1.h[0]
186 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s16
187 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s2
188 ; CHECK-SD-NOFP16-NEXT: mov v0.h[7], v1.h[0]
189 ; CHECK-SD-NOFP16-NEXT: ret
191 ; CHECK-SD-FP16-LABEL: sqrt_v7f16:
192 ; CHECK-SD-FP16: // %bb.0: // %entry
193 ; CHECK-SD-FP16-NEXT: fsqrt v0.8h, v0.8h
194 ; CHECK-SD-FP16-NEXT: ret
196 ; CHECK-GI-NOFP16-LABEL: sqrt_v7f16:
197 ; CHECK-GI-NOFP16: // %bb.0: // %entry
198 ; CHECK-GI-NOFP16-NEXT: mov h1, v0.h[4]
199 ; CHECK-GI-NOFP16-NEXT: mov h2, v0.h[5]
200 ; CHECK-GI-NOFP16-NEXT: fcvtl v3.4s, v0.4h
201 ; CHECK-GI-NOFP16-NEXT: mov h0, v0.h[6]
202 ; CHECK-GI-NOFP16-NEXT: mov v1.h[1], v2.h[0]
203 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v3.4s
204 ; CHECK-GI-NOFP16-NEXT: mov v1.h[2], v0.h[0]
205 ; CHECK-GI-NOFP16-NEXT: mov v1.h[3], v0.h[0]
206 ; CHECK-GI-NOFP16-NEXT: fcvtl v1.4s, v1.4h
207 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v2.4s
208 ; CHECK-GI-NOFP16-NEXT: fsqrt v1.4s, v1.4s
209 ; CHECK-GI-NOFP16-NEXT: mov h2, v0.h[1]
210 ; CHECK-GI-NOFP16-NEXT: mov h3, v0.h[2]
211 ; CHECK-GI-NOFP16-NEXT: mov h4, v0.h[3]
212 ; CHECK-GI-NOFP16-NEXT: mov v0.h[1], v2.h[0]
213 ; CHECK-GI-NOFP16-NEXT: mov v0.h[2], v3.h[0]
214 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v1.4s
215 ; CHECK-GI-NOFP16-NEXT: mov v0.h[3], v4.h[0]
216 ; CHECK-GI-NOFP16-NEXT: mov h2, v1.h[1]
217 ; CHECK-GI-NOFP16-NEXT: mov v0.h[4], v1.h[0]
218 ; CHECK-GI-NOFP16-NEXT: mov h1, v1.h[2]
219 ; CHECK-GI-NOFP16-NEXT: mov v0.h[5], v2.h[0]
220 ; CHECK-GI-NOFP16-NEXT: mov v0.h[6], v1.h[0]
221 ; CHECK-GI-NOFP16-NEXT: mov v0.h[7], v0.h[0]
222 ; CHECK-GI-NOFP16-NEXT: ret
224 ; CHECK-GI-FP16-LABEL: sqrt_v7f16:
225 ; CHECK-GI-FP16: // %bb.0: // %entry
226 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
227 ; CHECK-GI-FP16-NEXT: ret
229 %c = call <7 x half> @llvm.sqrt.v7f16(<7 x half> %a)
233 define <4 x half> @sqrt_v4f16(<4 x half> %a) {
234 ; CHECK-SD-NOFP16-LABEL: sqrt_v4f16:
235 ; CHECK-SD-NOFP16: // %bb.0: // %entry
236 ; CHECK-SD-NOFP16-NEXT: // kill: def $d0 killed $d0 def $q0
237 ; CHECK-SD-NOFP16-NEXT: mov h1, v0.h[1]
238 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h0
239 ; CHECK-SD-NOFP16-NEXT: mov h3, v0.h[2]
240 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[3]
241 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
242 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
243 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h3
244 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
245 ; CHECK-SD-NOFP16-NEXT: fsqrt s1, s1
246 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s1
247 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
248 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s0
249 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s2
250 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v1.h[0]
251 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s3
252 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v1.h[0]
253 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s4
254 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v1.h[0]
255 ; CHECK-SD-NOFP16-NEXT: // kill: def $d0 killed $d0 killed $q0
256 ; CHECK-SD-NOFP16-NEXT: ret
258 ; CHECK-SD-FP16-LABEL: sqrt_v4f16:
259 ; CHECK-SD-FP16: // %bb.0: // %entry
260 ; CHECK-SD-FP16-NEXT: fsqrt v0.4h, v0.4h
261 ; CHECK-SD-FP16-NEXT: ret
263 ; CHECK-GI-NOFP16-LABEL: sqrt_v4f16:
264 ; CHECK-GI-NOFP16: // %bb.0: // %entry
265 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v0.4h
266 ; CHECK-GI-NOFP16-NEXT: fsqrt v0.4s, v0.4s
267 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v0.4s
268 ; CHECK-GI-NOFP16-NEXT: ret
270 ; CHECK-GI-FP16-LABEL: sqrt_v4f16:
271 ; CHECK-GI-FP16: // %bb.0: // %entry
272 ; CHECK-GI-FP16-NEXT: fsqrt v0.4h, v0.4h
273 ; CHECK-GI-FP16-NEXT: ret
275 %c = call <4 x half> @llvm.sqrt.v4f16(<4 x half> %a)
279 define <8 x half> @sqrt_v8f16(<8 x half> %a) {
280 ; CHECK-SD-NOFP16-LABEL: sqrt_v8f16:
281 ; CHECK-SD-NOFP16: // %bb.0: // %entry
282 ; CHECK-SD-NOFP16-NEXT: mov h1, v0.h[1]
283 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h0
284 ; CHECK-SD-NOFP16-NEXT: mov h3, v0.h[2]
285 ; CHECK-SD-NOFP16-NEXT: mov h4, v0.h[3]
286 ; CHECK-SD-NOFP16-NEXT: mov h5, v0.h[4]
287 ; CHECK-SD-NOFP16-NEXT: mov h6, v0.h[5]
288 ; CHECK-SD-NOFP16-NEXT: mov h7, v0.h[6]
289 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[7]
290 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
291 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
292 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h3
293 ; CHECK-SD-NOFP16-NEXT: fcvt s4, h4
294 ; CHECK-SD-NOFP16-NEXT: fcvt s5, h5
295 ; CHECK-SD-NOFP16-NEXT: fcvt s6, h6
296 ; CHECK-SD-NOFP16-NEXT: fcvt s7, h7
297 ; CHECK-SD-NOFP16-NEXT: fcvt s16, h0
298 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s2
299 ; CHECK-SD-NOFP16-NEXT: fsqrt s1, s1
300 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s1
301 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v1.h[0]
302 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
303 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s3
304 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v1.h[0]
305 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s4
306 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s4
307 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v1.h[0]
308 ; CHECK-SD-NOFP16-NEXT: fsqrt s5, s5
309 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s5
310 ; CHECK-SD-NOFP16-NEXT: mov v0.h[4], v1.h[0]
311 ; CHECK-SD-NOFP16-NEXT: fsqrt s6, s6
312 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s6
313 ; CHECK-SD-NOFP16-NEXT: mov v0.h[5], v1.h[0]
314 ; CHECK-SD-NOFP16-NEXT: fsqrt s7, s7
315 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s7
316 ; CHECK-SD-NOFP16-NEXT: mov v0.h[6], v1.h[0]
317 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s16
318 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s2
319 ; CHECK-SD-NOFP16-NEXT: mov v0.h[7], v1.h[0]
320 ; CHECK-SD-NOFP16-NEXT: ret
322 ; CHECK-SD-FP16-LABEL: sqrt_v8f16:
323 ; CHECK-SD-FP16: // %bb.0: // %entry
324 ; CHECK-SD-FP16-NEXT: fsqrt v0.8h, v0.8h
325 ; CHECK-SD-FP16-NEXT: ret
327 ; CHECK-GI-NOFP16-LABEL: sqrt_v8f16:
328 ; CHECK-GI-NOFP16: // %bb.0: // %entry
329 ; CHECK-GI-NOFP16-NEXT: fcvtl v1.4s, v0.4h
330 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
331 ; CHECK-GI-NOFP16-NEXT: fsqrt v1.4s, v1.4s
332 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v0.4s
333 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v1.4s
334 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v2.4s
335 ; CHECK-GI-NOFP16-NEXT: ret
337 ; CHECK-GI-FP16-LABEL: sqrt_v8f16:
338 ; CHECK-GI-FP16: // %bb.0: // %entry
339 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
340 ; CHECK-GI-FP16-NEXT: ret
342 %c = call <8 x half> @llvm.sqrt.v8f16(<8 x half> %a)
346 define <16 x half> @sqrt_v16f16(<16 x half> %a) {
347 ; CHECK-SD-NOFP16-LABEL: sqrt_v16f16:
348 ; CHECK-SD-NOFP16: // %bb.0: // %entry
349 ; CHECK-SD-NOFP16-NEXT: mov h2, v0.h[1]
350 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h0
351 ; CHECK-SD-NOFP16-NEXT: mov h4, v0.h[2]
352 ; CHECK-SD-NOFP16-NEXT: mov h5, v0.h[3]
353 ; CHECK-SD-NOFP16-NEXT: mov h6, v0.h[4]
354 ; CHECK-SD-NOFP16-NEXT: mov h7, v0.h[5]
355 ; CHECK-SD-NOFP16-NEXT: mov h16, v0.h[6]
356 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[7]
357 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h2
358 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
359 ; CHECK-SD-NOFP16-NEXT: fcvt s4, h4
360 ; CHECK-SD-NOFP16-NEXT: fcvt s5, h5
361 ; CHECK-SD-NOFP16-NEXT: fcvt s6, h6
362 ; CHECK-SD-NOFP16-NEXT: fcvt s7, h7
363 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
364 ; CHECK-SD-NOFP16-NEXT: fcvt s16, h16
365 ; CHECK-SD-NOFP16-NEXT: fsqrt s17, s0
366 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[1]
367 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
368 ; CHECK-SD-NOFP16-NEXT: fsqrt s18, s0
369 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h1
370 ; CHECK-SD-NOFP16-NEXT: fsqrt s19, s0
371 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[2]
372 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
373 ; CHECK-SD-NOFP16-NEXT: fsqrt s20, s0
374 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[3]
375 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
376 ; CHECK-SD-NOFP16-NEXT: fsqrt s21, s0
377 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[4]
378 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
379 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
380 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s2
381 ; CHECK-SD-NOFP16-NEXT: fsqrt s22, s0
382 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[5]
383 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
384 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s4
385 ; CHECK-SD-NOFP16-NEXT: fsqrt s5, s5
386 ; CHECK-SD-NOFP16-NEXT: fsqrt s23, s0
387 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[6]
388 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
389 ; CHECK-SD-NOFP16-NEXT: fsqrt s6, s6
390 ; CHECK-SD-NOFP16-NEXT: fsqrt s7, s7
391 ; CHECK-SD-NOFP16-NEXT: fsqrt s24, s0
392 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[7]
393 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s19
394 ; CHECK-SD-NOFP16-NEXT: fcvt s25, h0
395 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s3
396 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s18
397 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v2.h[0]
398 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s4
399 ; CHECK-SD-NOFP16-NEXT: mov v1.h[1], v3.h[0]
400 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s20
401 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v2.h[0]
402 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s5
403 ; CHECK-SD-NOFP16-NEXT: mov v1.h[2], v3.h[0]
404 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s21
405 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v2.h[0]
406 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s6
407 ; CHECK-SD-NOFP16-NEXT: mov v1.h[3], v3.h[0]
408 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s22
409 ; CHECK-SD-NOFP16-NEXT: mov v0.h[4], v2.h[0]
410 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s7
411 ; CHECK-SD-NOFP16-NEXT: mov v1.h[4], v3.h[0]
412 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s23
413 ; CHECK-SD-NOFP16-NEXT: mov v0.h[5], v2.h[0]
414 ; CHECK-SD-NOFP16-NEXT: mov v1.h[5], v3.h[0]
415 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s24
416 ; CHECK-SD-NOFP16-NEXT: fsqrt s16, s16
417 ; CHECK-SD-NOFP16-NEXT: mov v1.h[6], v3.h[0]
418 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s16
419 ; CHECK-SD-NOFP16-NEXT: mov v0.h[6], v2.h[0]
420 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s17
421 ; CHECK-SD-NOFP16-NEXT: fsqrt s18, s25
422 ; CHECK-SD-NOFP16-NEXT: mov v0.h[7], v2.h[0]
423 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s18
424 ; CHECK-SD-NOFP16-NEXT: mov v1.h[7], v3.h[0]
425 ; CHECK-SD-NOFP16-NEXT: ret
427 ; CHECK-SD-FP16-LABEL: sqrt_v16f16:
428 ; CHECK-SD-FP16: // %bb.0: // %entry
429 ; CHECK-SD-FP16-NEXT: fsqrt v0.8h, v0.8h
430 ; CHECK-SD-FP16-NEXT: fsqrt v1.8h, v1.8h
431 ; CHECK-SD-FP16-NEXT: ret
433 ; CHECK-GI-NOFP16-LABEL: sqrt_v16f16:
434 ; CHECK-GI-NOFP16: // %bb.0: // %entry
435 ; CHECK-GI-NOFP16-NEXT: fcvtl v2.4s, v0.4h
436 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
437 ; CHECK-GI-NOFP16-NEXT: fsqrt v3.4s, v0.4s
438 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v1.4h
439 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v2.4s
440 ; CHECK-GI-NOFP16-NEXT: fsqrt v4.4s, v0.4s
441 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v1.8h
442 ; CHECK-GI-NOFP16-NEXT: fsqrt v5.4s, v0.4s
443 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v2.4s
444 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v4.4s
445 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v3.4s
446 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v1.8h, v5.4s
447 ; CHECK-GI-NOFP16-NEXT: ret
449 ; CHECK-GI-FP16-LABEL: sqrt_v16f16:
450 ; CHECK-GI-FP16: // %bb.0: // %entry
451 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
452 ; CHECK-GI-FP16-NEXT: fsqrt v1.8h, v1.8h
453 ; CHECK-GI-FP16-NEXT: ret
455 %c = call <16 x half> @llvm.sqrt.v16f16(<16 x half> %a)
459 declare <16 x half> @llvm.sqrt.v16f16(<16 x half>)
460 declare <2 x double> @llvm.sqrt.v2f64(<2 x double>)
461 declare <2 x float> @llvm.sqrt.v2f32(<2 x float>)
462 declare <3 x double> @llvm.sqrt.v3f64(<3 x double>)
463 declare <3 x float> @llvm.sqrt.v3f32(<3 x float>)
464 declare <4 x double> @llvm.sqrt.v4f64(<4 x double>)
465 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>)
466 declare <4 x half> @llvm.sqrt.v4f16(<4 x half>)
467 declare <7 x half> @llvm.sqrt.v7f16(<7 x half>)
468 declare <8 x float> @llvm.sqrt.v8f32(<8 x float>)
469 declare <8 x half> @llvm.sqrt.v8f16(<8 x half>)
470 declare double @llvm.sqrt.f64(double)
471 declare float @llvm.sqrt.f32(float)
472 declare half @llvm.sqrt.f16(half)