1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s --check-prefixes=CHECK,SVE
3 ; RUN: llc -mattr=+sve2 -force-streaming-compatible-sve < %s | FileCheck %s --check-prefixes=CHECK,SVE2
4 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s --check-prefixes=CHECK,SVE2
6 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
8 target triple = "aarch64-unknown-linux-gnu"
12 define void @test_copysign_v4f16_v4f16(ptr %ap, ptr %bp) {
13 ; SVE-LABEL: test_copysign_v4f16_v4f16:
15 ; SVE-NEXT: ldr d0, [x0]
16 ; SVE-NEXT: ldr d1, [x1]
17 ; SVE-NEXT: and z1.h, z1.h, #0x8000
18 ; SVE-NEXT: and z0.h, z0.h, #0x7fff
19 ; SVE-NEXT: orr z0.d, z0.d, z1.d
20 ; SVE-NEXT: str d0, [x0]
23 ; SVE2-LABEL: test_copysign_v4f16_v4f16:
25 ; SVE2-NEXT: mov z0.h, #32767 // =0x7fff
26 ; SVE2-NEXT: ldr d1, [x0]
27 ; SVE2-NEXT: ldr d2, [x1]
28 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z0.d
29 ; SVE2-NEXT: str d1, [x0]
31 %a = load <4 x half>, ptr %ap
32 %b = load <4 x half>, ptr %bp
33 %r = call <4 x half> @llvm.copysign.v4f16(<4 x half> %a, <4 x half> %b)
34 store <4 x half> %r, ptr %ap
38 define void @test_copysign_v8f16_v8f16(ptr %ap, ptr %bp) {
39 ; SVE-LABEL: test_copysign_v8f16_v8f16:
41 ; SVE-NEXT: ldr q0, [x0]
42 ; SVE-NEXT: ldr q1, [x1]
43 ; SVE-NEXT: and z1.h, z1.h, #0x8000
44 ; SVE-NEXT: and z0.h, z0.h, #0x7fff
45 ; SVE-NEXT: orr z0.d, z0.d, z1.d
46 ; SVE-NEXT: str q0, [x0]
49 ; SVE2-LABEL: test_copysign_v8f16_v8f16:
51 ; SVE2-NEXT: mov z0.h, #32767 // =0x7fff
52 ; SVE2-NEXT: ldr q1, [x0]
53 ; SVE2-NEXT: ldr q2, [x1]
54 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z0.d
55 ; SVE2-NEXT: str q1, [x0]
57 %a = load <8 x half>, ptr %ap
58 %b = load <8 x half>, ptr %bp
59 %r = call <8 x half> @llvm.copysign.v8f16(<8 x half> %a, <8 x half> %b)
60 store <8 x half> %r, ptr %ap
64 define void @test_copysign_v16f16_v16f16(ptr %ap, ptr %bp) {
65 ; SVE-LABEL: test_copysign_v16f16_v16f16:
67 ; SVE-NEXT: ldp q0, q3, [x1]
68 ; SVE-NEXT: ldp q1, q2, [x0]
69 ; SVE-NEXT: and z0.h, z0.h, #0x8000
70 ; SVE-NEXT: and z3.h, z3.h, #0x8000
71 ; SVE-NEXT: and z1.h, z1.h, #0x7fff
72 ; SVE-NEXT: and z2.h, z2.h, #0x7fff
73 ; SVE-NEXT: orr z0.d, z1.d, z0.d
74 ; SVE-NEXT: orr z1.d, z2.d, z3.d
75 ; SVE-NEXT: stp q0, q1, [x0]
78 ; SVE2-LABEL: test_copysign_v16f16_v16f16:
80 ; SVE2-NEXT: mov z0.h, #32767 // =0x7fff
81 ; SVE2-NEXT: ldp q1, q4, [x1]
82 ; SVE2-NEXT: ldp q2, q3, [x0]
83 ; SVE2-NEXT: bsl z2.d, z2.d, z1.d, z0.d
84 ; SVE2-NEXT: bsl z3.d, z3.d, z4.d, z0.d
85 ; SVE2-NEXT: stp q2, q3, [x0]
87 %a = load <16 x half>, ptr %ap
88 %b = load <16 x half>, ptr %bp
89 %r = call <16 x half> @llvm.copysign.v16f16(<16 x half> %a, <16 x half> %b)
90 store <16 x half> %r, ptr %ap
96 define void @test_copysign_v2f32_v2f32(ptr %ap, ptr %bp) {
97 ; SVE-LABEL: test_copysign_v2f32_v2f32:
99 ; SVE-NEXT: ldr d0, [x0]
100 ; SVE-NEXT: ldr d1, [x1]
101 ; SVE-NEXT: and z1.s, z1.s, #0x80000000
102 ; SVE-NEXT: and z0.s, z0.s, #0x7fffffff
103 ; SVE-NEXT: orr z0.d, z0.d, z1.d
104 ; SVE-NEXT: str d0, [x0]
107 ; SVE2-LABEL: test_copysign_v2f32_v2f32:
109 ; SVE2-NEXT: mov z0.s, #0x7fffffff
110 ; SVE2-NEXT: ldr d1, [x0]
111 ; SVE2-NEXT: ldr d2, [x1]
112 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z0.d
113 ; SVE2-NEXT: str d1, [x0]
115 %a = load <2 x float>, ptr %ap
116 %b = load <2 x float>, ptr %bp
117 %r = call <2 x float> @llvm.copysign.v2f32(<2 x float> %a, <2 x float> %b)
118 store <2 x float> %r, ptr %ap
122 define void @test_copysign_v4f32_v4f32(ptr %ap, ptr %bp) {
123 ; SVE-LABEL: test_copysign_v4f32_v4f32:
125 ; SVE-NEXT: ldr q0, [x0]
126 ; SVE-NEXT: ldr q1, [x1]
127 ; SVE-NEXT: and z1.s, z1.s, #0x80000000
128 ; SVE-NEXT: and z0.s, z0.s, #0x7fffffff
129 ; SVE-NEXT: orr z0.d, z0.d, z1.d
130 ; SVE-NEXT: str q0, [x0]
133 ; SVE2-LABEL: test_copysign_v4f32_v4f32:
135 ; SVE2-NEXT: mov z0.s, #0x7fffffff
136 ; SVE2-NEXT: ldr q1, [x0]
137 ; SVE2-NEXT: ldr q2, [x1]
138 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z0.d
139 ; SVE2-NEXT: str q1, [x0]
141 %a = load <4 x float>, ptr %ap
142 %b = load <4 x float>, ptr %bp
143 %r = call <4 x float> @llvm.copysign.v4f32(<4 x float> %a, <4 x float> %b)
144 store <4 x float> %r, ptr %ap
148 define void @test_copysign_v8f32_v8f32(ptr %ap, ptr %bp) {
149 ; SVE-LABEL: test_copysign_v8f32_v8f32:
151 ; SVE-NEXT: ldp q0, q3, [x1]
152 ; SVE-NEXT: ldp q1, q2, [x0]
153 ; SVE-NEXT: and z0.s, z0.s, #0x80000000
154 ; SVE-NEXT: and z3.s, z3.s, #0x80000000
155 ; SVE-NEXT: and z1.s, z1.s, #0x7fffffff
156 ; SVE-NEXT: and z2.s, z2.s, #0x7fffffff
157 ; SVE-NEXT: orr z0.d, z1.d, z0.d
158 ; SVE-NEXT: orr z1.d, z2.d, z3.d
159 ; SVE-NEXT: stp q0, q1, [x0]
162 ; SVE2-LABEL: test_copysign_v8f32_v8f32:
164 ; SVE2-NEXT: mov z0.s, #0x7fffffff
165 ; SVE2-NEXT: ldp q1, q4, [x1]
166 ; SVE2-NEXT: ldp q2, q3, [x0]
167 ; SVE2-NEXT: bsl z2.d, z2.d, z1.d, z0.d
168 ; SVE2-NEXT: bsl z3.d, z3.d, z4.d, z0.d
169 ; SVE2-NEXT: stp q2, q3, [x0]
171 %a = load <8 x float>, ptr %ap
172 %b = load <8 x float>, ptr %bp
173 %r = call <8 x float> @llvm.copysign.v8f32(<8 x float> %a, <8 x float> %b)
174 store <8 x float> %r, ptr %ap
180 define void @test_copysign_v2f64_v2f64(ptr %ap, ptr %bp) {
181 ; SVE-LABEL: test_copysign_v2f64_v2f64:
183 ; SVE-NEXT: ldr q0, [x0]
184 ; SVE-NEXT: ldr q1, [x1]
185 ; SVE-NEXT: and z1.d, z1.d, #0x8000000000000000
186 ; SVE-NEXT: and z0.d, z0.d, #0x7fffffffffffffff
187 ; SVE-NEXT: orr z0.d, z0.d, z1.d
188 ; SVE-NEXT: str q0, [x0]
191 ; SVE2-LABEL: test_copysign_v2f64_v2f64:
193 ; SVE2-NEXT: mov z0.d, #0x7fffffffffffffff
194 ; SVE2-NEXT: ldr q1, [x0]
195 ; SVE2-NEXT: ldr q2, [x1]
196 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z0.d
197 ; SVE2-NEXT: str q1, [x0]
199 %a = load <2 x double>, ptr %ap
200 %b = load <2 x double>, ptr %bp
201 %r = call <2 x double> @llvm.copysign.v2f64(<2 x double> %a, <2 x double> %b)
202 store <2 x double> %r, ptr %ap
206 define void @test_copysign_v4f64_v4f64(ptr %ap, ptr %bp) {
207 ; SVE-LABEL: test_copysign_v4f64_v4f64:
209 ; SVE-NEXT: ldp q0, q3, [x1]
210 ; SVE-NEXT: ldp q1, q2, [x0]
211 ; SVE-NEXT: and z0.d, z0.d, #0x8000000000000000
212 ; SVE-NEXT: and z3.d, z3.d, #0x8000000000000000
213 ; SVE-NEXT: and z1.d, z1.d, #0x7fffffffffffffff
214 ; SVE-NEXT: and z2.d, z2.d, #0x7fffffffffffffff
215 ; SVE-NEXT: orr z0.d, z1.d, z0.d
216 ; SVE-NEXT: orr z1.d, z2.d, z3.d
217 ; SVE-NEXT: stp q0, q1, [x0]
220 ; SVE2-LABEL: test_copysign_v4f64_v4f64:
222 ; SVE2-NEXT: mov z0.d, #0x7fffffffffffffff
223 ; SVE2-NEXT: ldp q1, q4, [x1]
224 ; SVE2-NEXT: ldp q2, q3, [x0]
225 ; SVE2-NEXT: bsl z2.d, z2.d, z1.d, z0.d
226 ; SVE2-NEXT: bsl z3.d, z3.d, z4.d, z0.d
227 ; SVE2-NEXT: stp q2, q3, [x0]
229 %a = load <4 x double>, ptr %ap
230 %b = load <4 x double>, ptr %bp
231 %r = call <4 x double> @llvm.copysign.v4f64(<4 x double> %a, <4 x double> %b)
232 store <4 x double> %r, ptr %ap
238 define void @test_copysign_v2f32_v2f64(ptr %ap, ptr %bp) {
239 ; SVE-LABEL: test_copysign_v2f32_v2f64:
241 ; SVE-NEXT: ptrue p0.d
242 ; SVE-NEXT: ldr q0, [x1]
243 ; SVE-NEXT: ldr d1, [x0]
244 ; SVE-NEXT: and z1.s, z1.s, #0x7fffffff
245 ; SVE-NEXT: fcvt z0.s, p0/m, z0.d
246 ; SVE-NEXT: uzp1 z0.s, z0.s, z0.s
247 ; SVE-NEXT: and z0.s, z0.s, #0x80000000
248 ; SVE-NEXT: orr z0.d, z1.d, z0.d
249 ; SVE-NEXT: str d0, [x0]
252 ; SVE2-LABEL: test_copysign_v2f32_v2f64:
254 ; SVE2-NEXT: ptrue p0.d
255 ; SVE2-NEXT: ldr q0, [x1]
256 ; SVE2-NEXT: mov z1.s, #0x7fffffff
257 ; SVE2-NEXT: ldr d2, [x0]
258 ; SVE2-NEXT: fcvt z0.s, p0/m, z0.d
259 ; SVE2-NEXT: uzp1 z0.s, z0.s, z0.s
260 ; SVE2-NEXT: bsl z2.d, z2.d, z0.d, z1.d
261 ; SVE2-NEXT: str d2, [x0]
263 %a = load <2 x float>, ptr %ap
264 %b = load <2 x double>, ptr %bp
265 %tmp0 = fptrunc <2 x double> %b to <2 x float>
266 %r = call <2 x float> @llvm.copysign.v2f32(<2 x float> %a, <2 x float> %tmp0)
267 store <2 x float> %r, ptr %ap
274 define void @test_copysign_v4f32_v4f64(ptr %ap, ptr %bp) {
275 ; SVE-LABEL: test_copysign_v4f32_v4f64:
277 ; SVE-NEXT: ptrue p0.d
278 ; SVE-NEXT: ldp q0, q1, [x1]
279 ; SVE-NEXT: fcvt z1.s, p0/m, z1.d
280 ; SVE-NEXT: fcvt z0.s, p0/m, z0.d
281 ; SVE-NEXT: ptrue p0.s, vl2
282 ; SVE-NEXT: uzp1 z1.s, z1.s, z1.s
283 ; SVE-NEXT: uzp1 z0.s, z0.s, z0.s
284 ; SVE-NEXT: splice z0.s, p0, z0.s, z1.s
285 ; SVE-NEXT: ldr q1, [x0]
286 ; SVE-NEXT: and z1.s, z1.s, #0x7fffffff
287 ; SVE-NEXT: and z0.s, z0.s, #0x80000000
288 ; SVE-NEXT: orr z0.d, z1.d, z0.d
289 ; SVE-NEXT: str q0, [x0]
292 ; SVE2-LABEL: test_copysign_v4f32_v4f64:
294 ; SVE2-NEXT: ptrue p0.d
295 ; SVE2-NEXT: ldp q0, q1, [x1]
296 ; SVE2-NEXT: ldr q2, [x0]
297 ; SVE2-NEXT: fcvt z1.s, p0/m, z1.d
298 ; SVE2-NEXT: fcvt z0.s, p0/m, z0.d
299 ; SVE2-NEXT: ptrue p0.s, vl2
300 ; SVE2-NEXT: uzp1 z1.s, z1.s, z1.s
301 ; SVE2-NEXT: uzp1 z0.s, z0.s, z0.s
302 ; SVE2-NEXT: splice z0.s, p0, z0.s, z1.s
303 ; SVE2-NEXT: mov z1.s, #0x7fffffff
304 ; SVE2-NEXT: bsl z2.d, z2.d, z0.d, z1.d
305 ; SVE2-NEXT: str q2, [x0]
307 %a = load <4 x float>, ptr %ap
308 %b = load <4 x double>, ptr %bp
309 %tmp0 = fptrunc <4 x double> %b to <4 x float>
310 %r = call <4 x float> @llvm.copysign.v4f32(<4 x float> %a, <4 x float> %tmp0)
311 store <4 x float> %r, ptr %ap
317 define void @test_copysign_v2f64_v2f32(ptr %ap, ptr %bp) {
318 ; SVE-LABEL: test_copysign_v2f64_v2f32:
320 ; SVE-NEXT: ptrue p0.d, vl2
321 ; SVE-NEXT: ldr q0, [x0]
322 ; SVE-NEXT: and z0.d, z0.d, #0x7fffffffffffffff
323 ; SVE-NEXT: ld1w { z1.d }, p0/z, [x1]
324 ; SVE-NEXT: fcvt z1.d, p0/m, z1.s
325 ; SVE-NEXT: and z1.d, z1.d, #0x8000000000000000
326 ; SVE-NEXT: orr z0.d, z0.d, z1.d
327 ; SVE-NEXT: str q0, [x0]
330 ; SVE2-LABEL: test_copysign_v2f64_v2f32:
332 ; SVE2-NEXT: ptrue p0.d, vl2
333 ; SVE2-NEXT: ldr q0, [x0]
334 ; SVE2-NEXT: mov z2.d, #0x7fffffffffffffff
335 ; SVE2-NEXT: ld1w { z1.d }, p0/z, [x1]
336 ; SVE2-NEXT: fcvt z1.d, p0/m, z1.s
337 ; SVE2-NEXT: bsl z0.d, z0.d, z1.d, z2.d
338 ; SVE2-NEXT: str q0, [x0]
340 %a = load <2 x double>, ptr %ap
341 %b = load < 2 x float>, ptr %bp
342 %tmp0 = fpext <2 x float> %b to <2 x double>
343 %r = call <2 x double> @llvm.copysign.v2f64(<2 x double> %a, <2 x double> %tmp0)
344 store <2 x double> %r, ptr %ap
350 ; SplitVecRes mismatched
351 define void @test_copysign_v4f64_v4f32(ptr %ap, ptr %bp) {
352 ; SVE-LABEL: test_copysign_v4f64_v4f32:
354 ; SVE-NEXT: ptrue p0.d, vl2
355 ; SVE-NEXT: mov x8, #2 // =0x2
356 ; SVE-NEXT: ldp q0, q1, [x0]
357 ; SVE-NEXT: and z0.d, z0.d, #0x7fffffffffffffff
358 ; SVE-NEXT: and z1.d, z1.d, #0x7fffffffffffffff
359 ; SVE-NEXT: ld1w { z2.d }, p0/z, [x1, x8, lsl #2]
360 ; SVE-NEXT: ld1w { z3.d }, p0/z, [x1]
361 ; SVE-NEXT: fcvt z3.d, p0/m, z3.s
362 ; SVE-NEXT: fcvt z2.d, p0/m, z2.s
363 ; SVE-NEXT: and z3.d, z3.d, #0x8000000000000000
364 ; SVE-NEXT: and z2.d, z2.d, #0x8000000000000000
365 ; SVE-NEXT: orr z0.d, z0.d, z3.d
366 ; SVE-NEXT: orr z1.d, z1.d, z2.d
367 ; SVE-NEXT: stp q0, q1, [x0]
370 ; SVE2-LABEL: test_copysign_v4f64_v4f32:
372 ; SVE2-NEXT: ptrue p0.d, vl2
373 ; SVE2-NEXT: mov x8, #2 // =0x2
374 ; SVE2-NEXT: mov z4.d, #0x7fffffffffffffff
375 ; SVE2-NEXT: ldp q0, q1, [x0]
376 ; SVE2-NEXT: ld1w { z2.d }, p0/z, [x1, x8, lsl #2]
377 ; SVE2-NEXT: ld1w { z3.d }, p0/z, [x1]
378 ; SVE2-NEXT: fcvt z3.d, p0/m, z3.s
379 ; SVE2-NEXT: fcvt z2.d, p0/m, z2.s
380 ; SVE2-NEXT: bsl z0.d, z0.d, z3.d, z4.d
381 ; SVE2-NEXT: bsl z1.d, z1.d, z2.d, z4.d
382 ; SVE2-NEXT: stp q0, q1, [x0]
384 %a = load <4 x double>, ptr %ap
385 %b = load <4 x float>, ptr %bp
386 %tmp0 = fpext <4 x float> %b to <4 x double>
387 %r = call <4 x double> @llvm.copysign.v4f64(<4 x double> %a, <4 x double> %tmp0)
388 store <4 x double> %r, ptr %ap
394 define void @test_copysign_v4f16_v4f32(ptr %ap, ptr %bp) {
395 ; SVE-LABEL: test_copysign_v4f16_v4f32:
397 ; SVE-NEXT: ptrue p0.s
398 ; SVE-NEXT: ldr q0, [x1]
399 ; SVE-NEXT: ldr d1, [x0]
400 ; SVE-NEXT: and z1.h, z1.h, #0x7fff
401 ; SVE-NEXT: fcvt z0.h, p0/m, z0.s
402 ; SVE-NEXT: uzp1 z0.h, z0.h, z0.h
403 ; SVE-NEXT: and z0.h, z0.h, #0x8000
404 ; SVE-NEXT: orr z0.d, z1.d, z0.d
405 ; SVE-NEXT: str d0, [x0]
408 ; SVE2-LABEL: test_copysign_v4f16_v4f32:
410 ; SVE2-NEXT: ptrue p0.s
411 ; SVE2-NEXT: ldr q0, [x1]
412 ; SVE2-NEXT: mov z1.h, #32767 // =0x7fff
413 ; SVE2-NEXT: ldr d2, [x0]
414 ; SVE2-NEXT: fcvt z0.h, p0/m, z0.s
415 ; SVE2-NEXT: uzp1 z0.h, z0.h, z0.h
416 ; SVE2-NEXT: bsl z2.d, z2.d, z0.d, z1.d
417 ; SVE2-NEXT: str d2, [x0]
419 %a = load <4 x half>, ptr %ap
420 %b = load <4 x float>, ptr %bp
421 %tmp0 = fptrunc <4 x float> %b to <4 x half>
422 %r = call <4 x half> @llvm.copysign.v4f16(<4 x half> %a, <4 x half> %tmp0)
423 store <4 x half> %r, ptr %ap
427 define void @test_copysign_v4f16_v4f64(ptr %ap, ptr %bp) {
428 ; SVE-LABEL: test_copysign_v4f16_v4f64:
430 ; SVE-NEXT: sub sp, sp, #16
431 ; SVE-NEXT: .cfi_def_cfa_offset 16
432 ; SVE-NEXT: ldp q1, q0, [x1]
433 ; SVE-NEXT: ldr d4, [x0]
434 ; SVE-NEXT: and z4.h, z4.h, #0x7fff
435 ; SVE-NEXT: mov z2.d, z0.d[1]
436 ; SVE-NEXT: mov z3.d, z1.d[1]
437 ; SVE-NEXT: fcvt h0, d0
438 ; SVE-NEXT: fcvt h1, d1
439 ; SVE-NEXT: fcvt h2, d2
440 ; SVE-NEXT: fcvt h3, d3
441 ; SVE-NEXT: str h0, [sp, #12]
442 ; SVE-NEXT: str h1, [sp, #8]
443 ; SVE-NEXT: str h2, [sp, #14]
444 ; SVE-NEXT: str h3, [sp, #10]
445 ; SVE-NEXT: ldr d0, [sp, #8]
446 ; SVE-NEXT: and z0.h, z0.h, #0x8000
447 ; SVE-NEXT: orr z0.d, z4.d, z0.d
448 ; SVE-NEXT: str d0, [x0]
449 ; SVE-NEXT: add sp, sp, #16
452 ; SVE2-LABEL: test_copysign_v4f16_v4f64:
454 ; SVE2-NEXT: sub sp, sp, #16
455 ; SVE2-NEXT: .cfi_def_cfa_offset 16
456 ; SVE2-NEXT: ldp q2, q1, [x1]
457 ; SVE2-NEXT: mov z0.h, #32767 // =0x7fff
458 ; SVE2-NEXT: ldr d5, [x0]
459 ; SVE2-NEXT: mov z3.d, z1.d[1]
460 ; SVE2-NEXT: mov z4.d, z2.d[1]
461 ; SVE2-NEXT: fcvt h1, d1
462 ; SVE2-NEXT: fcvt h2, d2
463 ; SVE2-NEXT: fcvt h3, d3
464 ; SVE2-NEXT: fcvt h4, d4
465 ; SVE2-NEXT: str h1, [sp, #12]
466 ; SVE2-NEXT: str h2, [sp, #8]
467 ; SVE2-NEXT: str h3, [sp, #14]
468 ; SVE2-NEXT: str h4, [sp, #10]
469 ; SVE2-NEXT: ldr d1, [sp, #8]
470 ; SVE2-NEXT: bsl z5.d, z5.d, z1.d, z0.d
471 ; SVE2-NEXT: str d5, [x0]
472 ; SVE2-NEXT: add sp, sp, #16
474 %a = load <4 x half>, ptr %ap
475 %b = load <4 x double>, ptr %bp
476 %tmp0 = fptrunc <4 x double> %b to <4 x half>
477 %r = call <4 x half> @llvm.copysign.v4f16(<4 x half> %a, <4 x half> %tmp0)
478 store <4 x half> %r, ptr %ap
484 define void @test_copysign_v8f16_v8f32(ptr %ap, ptr %bp) {
485 ; SVE-LABEL: test_copysign_v8f16_v8f32:
487 ; SVE-NEXT: ptrue p0.s
488 ; SVE-NEXT: ldp q0, q1, [x1]
489 ; SVE-NEXT: fcvt z1.h, p0/m, z1.s
490 ; SVE-NEXT: fcvt z0.h, p0/m, z0.s
491 ; SVE-NEXT: ptrue p0.h, vl4
492 ; SVE-NEXT: uzp1 z1.h, z1.h, z1.h
493 ; SVE-NEXT: uzp1 z0.h, z0.h, z0.h
494 ; SVE-NEXT: splice z0.h, p0, z0.h, z1.h
495 ; SVE-NEXT: ldr q1, [x0]
496 ; SVE-NEXT: and z1.h, z1.h, #0x7fff
497 ; SVE-NEXT: and z0.h, z0.h, #0x8000
498 ; SVE-NEXT: orr z0.d, z1.d, z0.d
499 ; SVE-NEXT: str q0, [x0]
502 ; SVE2-LABEL: test_copysign_v8f16_v8f32:
504 ; SVE2-NEXT: ptrue p0.s
505 ; SVE2-NEXT: ldp q0, q1, [x1]
506 ; SVE2-NEXT: ldr q2, [x0]
507 ; SVE2-NEXT: fcvt z1.h, p0/m, z1.s
508 ; SVE2-NEXT: fcvt z0.h, p0/m, z0.s
509 ; SVE2-NEXT: ptrue p0.h, vl4
510 ; SVE2-NEXT: uzp1 z1.h, z1.h, z1.h
511 ; SVE2-NEXT: uzp1 z0.h, z0.h, z0.h
512 ; SVE2-NEXT: splice z0.h, p0, z0.h, z1.h
513 ; SVE2-NEXT: mov z1.h, #32767 // =0x7fff
514 ; SVE2-NEXT: bsl z2.d, z2.d, z0.d, z1.d
515 ; SVE2-NEXT: str q2, [x0]
517 %a = load <8 x half>, ptr %ap
518 %b = load <8 x float>, ptr %bp
519 %tmp0 = fptrunc <8 x float> %b to <8 x half>
520 %r = call <8 x half> @llvm.copysign.v8f16(<8 x half> %a, <8 x half> %tmp0)
521 store <8 x half> %r, ptr %ap
525 declare <4 x half> @llvm.copysign.v4f16(<4 x half> %a, <4 x half> %b) #0
526 declare <8 x half> @llvm.copysign.v8f16(<8 x half> %a, <8 x half> %b) #0
527 declare <16 x half> @llvm.copysign.v16f16(<16 x half> %a, <16 x half> %b) #0
529 declare <2 x float> @llvm.copysign.v2f32(<2 x float> %a, <2 x float> %b) #0
530 declare <4 x float> @llvm.copysign.v4f32(<4 x float> %a, <4 x float> %b) #0
531 declare <8 x float> @llvm.copysign.v8f32(<8 x float> %a, <8 x float> %b) #0
533 declare <2 x double> @llvm.copysign.v2f64(<2 x double> %a, <2 x double> %b) #0
534 declare <4 x double> @llvm.copysign.v4f64(<4 x double> %a, <4 x double> %b) #0
535 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: