1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-NOFP16
3 ; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-FP16
4 ; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-GI-NOFP16
5 ; RUN: llc -mtriple=aarch64 -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: fcvtl v1.4s, v0.4h
199 ; CHECK-GI-NOFP16-NEXT: mov v2.h[0], v0.h[4]
200 ; CHECK-GI-NOFP16-NEXT: fsqrt v1.4s, v1.4s
201 ; CHECK-GI-NOFP16-NEXT: mov v2.h[1], v0.h[5]
202 ; CHECK-GI-NOFP16-NEXT: mov v2.h[2], v0.h[6]
203 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v2.4h
204 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v1.4s
205 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v0.4s
206 ; CHECK-GI-NOFP16-NEXT: mov v0.h[0], v1.h[0]
207 ; CHECK-GI-NOFP16-NEXT: mov v0.h[1], v1.h[1]
208 ; CHECK-GI-NOFP16-NEXT: mov v0.h[2], v1.h[2]
209 ; CHECK-GI-NOFP16-NEXT: fcvtn v2.4h, v2.4s
210 ; CHECK-GI-NOFP16-NEXT: mov v0.h[3], v1.h[3]
211 ; CHECK-GI-NOFP16-NEXT: mov v0.h[4], v2.h[0]
212 ; CHECK-GI-NOFP16-NEXT: mov v0.h[5], v2.h[1]
213 ; CHECK-GI-NOFP16-NEXT: mov v0.h[6], v2.h[2]
214 ; CHECK-GI-NOFP16-NEXT: ret
216 ; CHECK-GI-FP16-LABEL: sqrt_v7f16:
217 ; CHECK-GI-FP16: // %bb.0: // %entry
218 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
219 ; CHECK-GI-FP16-NEXT: ret
221 %c = call <7 x half> @llvm.sqrt.v7f16(<7 x half> %a)
225 define <4 x half> @sqrt_v4f16(<4 x half> %a) {
226 ; CHECK-SD-NOFP16-LABEL: sqrt_v4f16:
227 ; CHECK-SD-NOFP16: // %bb.0: // %entry
228 ; CHECK-SD-NOFP16-NEXT: // kill: def $d0 killed $d0 def $q0
229 ; CHECK-SD-NOFP16-NEXT: mov h1, v0.h[1]
230 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h0
231 ; CHECK-SD-NOFP16-NEXT: mov h3, v0.h[2]
232 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[3]
233 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
234 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
235 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h3
236 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
237 ; CHECK-SD-NOFP16-NEXT: fsqrt s1, s1
238 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s1
239 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
240 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s0
241 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s2
242 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v1.h[0]
243 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s3
244 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v1.h[0]
245 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s4
246 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v1.h[0]
247 ; CHECK-SD-NOFP16-NEXT: // kill: def $d0 killed $d0 killed $q0
248 ; CHECK-SD-NOFP16-NEXT: ret
250 ; CHECK-SD-FP16-LABEL: sqrt_v4f16:
251 ; CHECK-SD-FP16: // %bb.0: // %entry
252 ; CHECK-SD-FP16-NEXT: fsqrt v0.4h, v0.4h
253 ; CHECK-SD-FP16-NEXT: ret
255 ; CHECK-GI-NOFP16-LABEL: sqrt_v4f16:
256 ; CHECK-GI-NOFP16: // %bb.0: // %entry
257 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v0.4h
258 ; CHECK-GI-NOFP16-NEXT: fsqrt v0.4s, v0.4s
259 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v0.4s
260 ; CHECK-GI-NOFP16-NEXT: ret
262 ; CHECK-GI-FP16-LABEL: sqrt_v4f16:
263 ; CHECK-GI-FP16: // %bb.0: // %entry
264 ; CHECK-GI-FP16-NEXT: fsqrt v0.4h, v0.4h
265 ; CHECK-GI-FP16-NEXT: ret
267 %c = call <4 x half> @llvm.sqrt.v4f16(<4 x half> %a)
271 define <8 x half> @sqrt_v8f16(<8 x half> %a) {
272 ; CHECK-SD-NOFP16-LABEL: sqrt_v8f16:
273 ; CHECK-SD-NOFP16: // %bb.0: // %entry
274 ; CHECK-SD-NOFP16-NEXT: mov h1, v0.h[1]
275 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h0
276 ; CHECK-SD-NOFP16-NEXT: mov h3, v0.h[2]
277 ; CHECK-SD-NOFP16-NEXT: mov h4, v0.h[3]
278 ; CHECK-SD-NOFP16-NEXT: mov h5, v0.h[4]
279 ; CHECK-SD-NOFP16-NEXT: mov h6, v0.h[5]
280 ; CHECK-SD-NOFP16-NEXT: mov h7, v0.h[6]
281 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[7]
282 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
283 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
284 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h3
285 ; CHECK-SD-NOFP16-NEXT: fcvt s4, h4
286 ; CHECK-SD-NOFP16-NEXT: fcvt s5, h5
287 ; CHECK-SD-NOFP16-NEXT: fcvt s6, h6
288 ; CHECK-SD-NOFP16-NEXT: fcvt s7, h7
289 ; CHECK-SD-NOFP16-NEXT: fcvt s16, h0
290 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s2
291 ; CHECK-SD-NOFP16-NEXT: fsqrt s1, s1
292 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s1
293 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v1.h[0]
294 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
295 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s3
296 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v1.h[0]
297 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s4
298 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s4
299 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v1.h[0]
300 ; CHECK-SD-NOFP16-NEXT: fsqrt s5, s5
301 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s5
302 ; CHECK-SD-NOFP16-NEXT: mov v0.h[4], v1.h[0]
303 ; CHECK-SD-NOFP16-NEXT: fsqrt s6, s6
304 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s6
305 ; CHECK-SD-NOFP16-NEXT: mov v0.h[5], v1.h[0]
306 ; CHECK-SD-NOFP16-NEXT: fsqrt s7, s7
307 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s7
308 ; CHECK-SD-NOFP16-NEXT: mov v0.h[6], v1.h[0]
309 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s16
310 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s2
311 ; CHECK-SD-NOFP16-NEXT: mov v0.h[7], v1.h[0]
312 ; CHECK-SD-NOFP16-NEXT: ret
314 ; CHECK-SD-FP16-LABEL: sqrt_v8f16:
315 ; CHECK-SD-FP16: // %bb.0: // %entry
316 ; CHECK-SD-FP16-NEXT: fsqrt v0.8h, v0.8h
317 ; CHECK-SD-FP16-NEXT: ret
319 ; CHECK-GI-NOFP16-LABEL: sqrt_v8f16:
320 ; CHECK-GI-NOFP16: // %bb.0: // %entry
321 ; CHECK-GI-NOFP16-NEXT: fcvtl v1.4s, v0.4h
322 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
323 ; CHECK-GI-NOFP16-NEXT: fsqrt v1.4s, v1.4s
324 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v0.4s
325 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v1.4s
326 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v2.4s
327 ; CHECK-GI-NOFP16-NEXT: ret
329 ; CHECK-GI-FP16-LABEL: sqrt_v8f16:
330 ; CHECK-GI-FP16: // %bb.0: // %entry
331 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
332 ; CHECK-GI-FP16-NEXT: ret
334 %c = call <8 x half> @llvm.sqrt.v8f16(<8 x half> %a)
338 define <16 x half> @sqrt_v16f16(<16 x half> %a) {
339 ; CHECK-SD-NOFP16-LABEL: sqrt_v16f16:
340 ; CHECK-SD-NOFP16: // %bb.0: // %entry
341 ; CHECK-SD-NOFP16-NEXT: mov h2, v0.h[1]
342 ; CHECK-SD-NOFP16-NEXT: fcvt s3, h0
343 ; CHECK-SD-NOFP16-NEXT: mov h4, v0.h[2]
344 ; CHECK-SD-NOFP16-NEXT: mov h5, v0.h[3]
345 ; CHECK-SD-NOFP16-NEXT: mov h6, v0.h[4]
346 ; CHECK-SD-NOFP16-NEXT: mov h7, v0.h[5]
347 ; CHECK-SD-NOFP16-NEXT: mov h16, v0.h[6]
348 ; CHECK-SD-NOFP16-NEXT: mov h0, v0.h[7]
349 ; CHECK-SD-NOFP16-NEXT: fcvt s2, h2
350 ; CHECK-SD-NOFP16-NEXT: fsqrt s3, s3
351 ; CHECK-SD-NOFP16-NEXT: fcvt s4, h4
352 ; CHECK-SD-NOFP16-NEXT: fcvt s5, h5
353 ; CHECK-SD-NOFP16-NEXT: fcvt s6, h6
354 ; CHECK-SD-NOFP16-NEXT: fcvt s7, h7
355 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
356 ; CHECK-SD-NOFP16-NEXT: fcvt s16, h16
357 ; CHECK-SD-NOFP16-NEXT: fsqrt s17, s0
358 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[1]
359 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
360 ; CHECK-SD-NOFP16-NEXT: fsqrt s18, s0
361 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h1
362 ; CHECK-SD-NOFP16-NEXT: fsqrt s19, s0
363 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[2]
364 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
365 ; CHECK-SD-NOFP16-NEXT: fsqrt s20, s0
366 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[3]
367 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
368 ; CHECK-SD-NOFP16-NEXT: fsqrt s21, s0
369 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[4]
370 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
371 ; CHECK-SD-NOFP16-NEXT: fsqrt s2, s2
372 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s2
373 ; CHECK-SD-NOFP16-NEXT: fsqrt s22, s0
374 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[5]
375 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
376 ; CHECK-SD-NOFP16-NEXT: fsqrt s4, s4
377 ; CHECK-SD-NOFP16-NEXT: fsqrt s5, s5
378 ; CHECK-SD-NOFP16-NEXT: fsqrt s23, s0
379 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[6]
380 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
381 ; CHECK-SD-NOFP16-NEXT: fsqrt s6, s6
382 ; CHECK-SD-NOFP16-NEXT: fsqrt s7, s7
383 ; CHECK-SD-NOFP16-NEXT: fsqrt s24, s0
384 ; CHECK-SD-NOFP16-NEXT: mov h0, v1.h[7]
385 ; CHECK-SD-NOFP16-NEXT: fcvt h1, s19
386 ; CHECK-SD-NOFP16-NEXT: fcvt s25, h0
387 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s3
388 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s18
389 ; CHECK-SD-NOFP16-NEXT: mov v0.h[1], v2.h[0]
390 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s4
391 ; CHECK-SD-NOFP16-NEXT: mov v1.h[1], v3.h[0]
392 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s20
393 ; CHECK-SD-NOFP16-NEXT: mov v0.h[2], v2.h[0]
394 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s5
395 ; CHECK-SD-NOFP16-NEXT: mov v1.h[2], v3.h[0]
396 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s21
397 ; CHECK-SD-NOFP16-NEXT: mov v0.h[3], v2.h[0]
398 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s6
399 ; CHECK-SD-NOFP16-NEXT: mov v1.h[3], v3.h[0]
400 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s22
401 ; CHECK-SD-NOFP16-NEXT: mov v0.h[4], v2.h[0]
402 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s7
403 ; CHECK-SD-NOFP16-NEXT: mov v1.h[4], v3.h[0]
404 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s23
405 ; CHECK-SD-NOFP16-NEXT: mov v0.h[5], v2.h[0]
406 ; CHECK-SD-NOFP16-NEXT: mov v1.h[5], v3.h[0]
407 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s24
408 ; CHECK-SD-NOFP16-NEXT: fsqrt s16, s16
409 ; CHECK-SD-NOFP16-NEXT: mov v1.h[6], v3.h[0]
410 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s16
411 ; CHECK-SD-NOFP16-NEXT: mov v0.h[6], v2.h[0]
412 ; CHECK-SD-NOFP16-NEXT: fcvt h2, s17
413 ; CHECK-SD-NOFP16-NEXT: fsqrt s18, s25
414 ; CHECK-SD-NOFP16-NEXT: mov v0.h[7], v2.h[0]
415 ; CHECK-SD-NOFP16-NEXT: fcvt h3, s18
416 ; CHECK-SD-NOFP16-NEXT: mov v1.h[7], v3.h[0]
417 ; CHECK-SD-NOFP16-NEXT: ret
419 ; CHECK-SD-FP16-LABEL: sqrt_v16f16:
420 ; CHECK-SD-FP16: // %bb.0: // %entry
421 ; CHECK-SD-FP16-NEXT: fsqrt v0.8h, v0.8h
422 ; CHECK-SD-FP16-NEXT: fsqrt v1.8h, v1.8h
423 ; CHECK-SD-FP16-NEXT: ret
425 ; CHECK-GI-NOFP16-LABEL: sqrt_v16f16:
426 ; CHECK-GI-NOFP16: // %bb.0: // %entry
427 ; CHECK-GI-NOFP16-NEXT: fcvtl v2.4s, v0.4h
428 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
429 ; CHECK-GI-NOFP16-NEXT: fsqrt v3.4s, v0.4s
430 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v1.4h
431 ; CHECK-GI-NOFP16-NEXT: fsqrt v2.4s, v2.4s
432 ; CHECK-GI-NOFP16-NEXT: fsqrt v4.4s, v0.4s
433 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v1.8h
434 ; CHECK-GI-NOFP16-NEXT: fsqrt v5.4s, v0.4s
435 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v2.4s
436 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v4.4s
437 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v3.4s
438 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v1.8h, v5.4s
439 ; CHECK-GI-NOFP16-NEXT: ret
441 ; CHECK-GI-FP16-LABEL: sqrt_v16f16:
442 ; CHECK-GI-FP16: // %bb.0: // %entry
443 ; CHECK-GI-FP16-NEXT: fsqrt v0.8h, v0.8h
444 ; CHECK-GI-FP16-NEXT: fsqrt v1.8h, v1.8h
445 ; CHECK-GI-FP16-NEXT: ret
447 %c = call <16 x half> @llvm.sqrt.v16f16(<16 x half> %a)
451 declare <16 x half> @llvm.sqrt.v16f16(<16 x half>)
452 declare <2 x double> @llvm.sqrt.v2f64(<2 x double>)
453 declare <2 x float> @llvm.sqrt.v2f32(<2 x float>)
454 declare <3 x double> @llvm.sqrt.v3f64(<3 x double>)
455 declare <3 x float> @llvm.sqrt.v3f32(<3 x float>)
456 declare <4 x double> @llvm.sqrt.v4f64(<4 x double>)
457 declare <4 x float> @llvm.sqrt.v4f32(<4 x float>)
458 declare <4 x half> @llvm.sqrt.v4f16(<4 x half>)
459 declare <7 x half> @llvm.sqrt.v7f16(<7 x half>)
460 declare <8 x float> @llvm.sqrt.v8f32(<8 x float>)
461 declare <8 x half> @llvm.sqrt.v8f16(<8 x half>)
462 declare double @llvm.sqrt.f64(double)
463 declare float @llvm.sqrt.f32(float)
464 declare half @llvm.sqrt.f16(half)