1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s --mattr=+sve -o - | FileCheck %s
4 target triple = "aarch64"
6 ; Expected to not transform
7 define <vscale x 4 x half> @complex_add_v4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
8 ; CHECK-LABEL: complex_add_v4f16:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: uunpkhi z2.d, z0.s
11 ; CHECK-NEXT: uunpklo z0.d, z0.s
12 ; CHECK-NEXT: uunpkhi z3.d, z1.s
13 ; CHECK-NEXT: uunpklo z1.d, z1.s
14 ; CHECK-NEXT: ptrue p0.d
15 ; CHECK-NEXT: uzp1 z4.d, z0.d, z2.d
16 ; CHECK-NEXT: uzp2 z0.d, z0.d, z2.d
17 ; CHECK-NEXT: uzp2 z2.d, z1.d, z3.d
18 ; CHECK-NEXT: uzp1 z1.d, z1.d, z3.d
19 ; CHECK-NEXT: fsubr z0.h, p0/m, z0.h, z1.h
20 ; CHECK-NEXT: movprfx z1, z2
21 ; CHECK-NEXT: fadd z1.h, p0/m, z1.h, z4.h
22 ; CHECK-NEXT: zip2 z2.d, z0.d, z1.d
23 ; CHECK-NEXT: zip1 z0.d, z0.d, z1.d
24 ; CHECK-NEXT: uzp1 z0.s, z0.s, z2.s
27 %a.deinterleaved = tail call { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.experimental.vector.deinterleave2.nxv4f16(<vscale x 4 x half> %a)
28 %a.real = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %a.deinterleaved, 0
29 %a.imag = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %a.deinterleaved, 1
30 %b.deinterleaved = tail call { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.experimental.vector.deinterleave2.nxv4f16(<vscale x 4 x half> %b)
31 %b.real = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %b.deinterleaved, 0
32 %b.imag = extractvalue { <vscale x 2 x half>, <vscale x 2 x half> } %b.deinterleaved, 1
33 %0 = fsub fast <vscale x 2 x half> %b.real, %a.imag
34 %1 = fadd fast <vscale x 2 x half> %b.imag, %a.real
35 %interleaved.vec = tail call <vscale x 4 x half> @llvm.experimental.vector.interleave2.nxv4f16(<vscale x 2 x half> %0, <vscale x 2 x half> %1)
36 ret <vscale x 4 x half> %interleaved.vec
39 ; Expected to transform
40 define <vscale x 8 x half> @complex_add_v8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %b) {
41 ; CHECK-LABEL: complex_add_v8f16:
42 ; CHECK: // %bb.0: // %entry
43 ; CHECK-NEXT: ptrue p0.h
44 ; CHECK-NEXT: fcadd z1.h, p0/m, z1.h, z0.h, #90
45 ; CHECK-NEXT: mov z0.d, z1.d
48 %a.deinterleaved = tail call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.experimental.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %a)
49 %a.real = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %a.deinterleaved, 0
50 %a.imag = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %a.deinterleaved, 1
51 %b.deinterleaved = tail call { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.experimental.vector.deinterleave2.nxv8f16(<vscale x 8 x half> %b)
52 %b.real = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %b.deinterleaved, 0
53 %b.imag = extractvalue { <vscale x 4 x half>, <vscale x 4 x half> } %b.deinterleaved, 1
54 %0 = fsub fast <vscale x 4 x half> %b.real, %a.imag
55 %1 = fadd fast <vscale x 4 x half> %b.imag, %a.real
56 %interleaved.vec = tail call <vscale x 8 x half> @llvm.experimental.vector.interleave2.nxv8f16(<vscale x 4 x half> %0, <vscale x 4 x half> %1)
57 ret <vscale x 8 x half> %interleaved.vec
60 ; Expected to transform
61 define <vscale x 16 x half> @complex_add_v16f16(<vscale x 16 x half> %a, <vscale x 16 x half> %b) {
62 ; CHECK-LABEL: complex_add_v16f16:
63 ; CHECK: // %bb.0: // %entry
64 ; CHECK-NEXT: ptrue p0.h
65 ; CHECK-NEXT: fcadd z2.h, p0/m, z2.h, z0.h, #90
66 ; CHECK-NEXT: fcadd z3.h, p0/m, z3.h, z1.h, #90
67 ; CHECK-NEXT: mov z0.d, z2.d
68 ; CHECK-NEXT: mov z1.d, z3.d
71 %a.deinterleaved = tail call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.experimental.vector.deinterleave2.nxv16f16(<vscale x 16 x half> %a)
72 %a.real = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %a.deinterleaved, 0
73 %a.imag = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %a.deinterleaved, 1
74 %b.deinterleaved = tail call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.experimental.vector.deinterleave2.nxv16f16(<vscale x 16 x half> %b)
75 %b.real = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %b.deinterleaved, 0
76 %b.imag = extractvalue { <vscale x 8 x half>, <vscale x 8 x half> } %b.deinterleaved, 1
77 %0 = fsub fast <vscale x 8 x half> %b.real, %a.imag
78 %1 = fadd fast <vscale x 8 x half> %b.imag, %a.real
79 %interleaved.vec = tail call <vscale x 16 x half> @llvm.experimental.vector.interleave2.nxv16f16(<vscale x 8 x half> %0, <vscale x 8 x half> %1)
80 ret <vscale x 16 x half> %interleaved.vec
83 ; Expected to transform
84 define <vscale x 32 x half> @complex_add_v32f16(<vscale x 32 x half> %a, <vscale x 32 x half> %b) {
85 ; CHECK-LABEL: complex_add_v32f16:
86 ; CHECK: // %bb.0: // %entry
87 ; CHECK-NEXT: ptrue p0.h
88 ; CHECK-NEXT: fcadd z4.h, p0/m, z4.h, z0.h, #90
89 ; CHECK-NEXT: fcadd z5.h, p0/m, z5.h, z1.h, #90
90 ; CHECK-NEXT: fcadd z6.h, p0/m, z6.h, z2.h, #90
91 ; CHECK-NEXT: fcadd z7.h, p0/m, z7.h, z3.h, #90
92 ; CHECK-NEXT: mov z0.d, z4.d
93 ; CHECK-NEXT: mov z1.d, z5.d
94 ; CHECK-NEXT: mov z2.d, z6.d
95 ; CHECK-NEXT: mov z3.d, z7.d
98 %a.deinterleaved = tail call { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.experimental.vector.deinterleave2.nxv32f16(<vscale x 32 x half> %a)
99 %a.real = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %a.deinterleaved, 0
100 %a.imag = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %a.deinterleaved, 1
101 %b.deinterleaved = tail call { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.experimental.vector.deinterleave2.nxv32f16(<vscale x 32 x half> %b)
102 %b.real = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %b.deinterleaved, 0
103 %b.imag = extractvalue { <vscale x 16 x half>, <vscale x 16 x half> } %b.deinterleaved, 1
104 %0 = fsub fast <vscale x 16 x half> %b.real, %a.imag
105 %1 = fadd fast <vscale x 16 x half> %b.imag, %a.real
106 %interleaved.vec = tail call <vscale x 32 x half> @llvm.experimental.vector.interleave2.nxv32f16(<vscale x 16 x half> %0, <vscale x 16 x half> %1)
107 ret <vscale x 32 x half> %interleaved.vec
110 declare { <vscale x 2 x half>, <vscale x 2 x half> } @llvm.experimental.vector.deinterleave2.nxv4f16(<vscale x 4 x half>)
111 declare <vscale x 4 x half> @llvm.experimental.vector.interleave2.nxv4f16(<vscale x 2 x half>, <vscale x 2 x half>)
113 declare { <vscale x 4 x half>, <vscale x 4 x half> } @llvm.experimental.vector.deinterleave2.nxv8f16(<vscale x 8 x half>)
114 declare <vscale x 8 x half> @llvm.experimental.vector.interleave2.nxv8f16(<vscale x 4 x half>, <vscale x 4 x half>)
116 declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.experimental.vector.deinterleave2.nxv16f16(<vscale x 16 x half>)
117 declare <vscale x 16 x half> @llvm.experimental.vector.interleave2.nxv16f16(<vscale x 8 x half>, <vscale x 8 x half>)
119 declare { <vscale x 16 x half>, <vscale x 16 x half> } @llvm.experimental.vector.deinterleave2.nxv32f16(<vscale x 32 x half>)
120 declare <vscale x 32 x half> @llvm.experimental.vector.interleave2.nxv32f16(<vscale x 16 x half>, <vscale x 16 x half>)