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