1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s --mattr=+sve2 -o - | FileCheck %s
4 target triple = "aarch64"
6 ; Expected to transform
7 define <vscale x 2 x i64> @complex_add_v2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
8 ; CHECK-LABEL: complex_add_v2i64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: cadd z1.d, z1.d, z0.d, #90
11 ; CHECK-NEXT: mov z0.d, z1.d
14 %a.deinterleaved = tail call { <vscale x 1 x i64>, <vscale x 1 x i64> } @llvm.vector.deinterleave2.nxv2i64(<vscale x 2 x i64> %a)
15 %a.real = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i64> } %a.deinterleaved, 0
16 %a.imag = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i64> } %a.deinterleaved, 1
17 %b.deinterleaved = tail call { <vscale x 1 x i64>, <vscale x 1 x i64> } @llvm.vector.deinterleave2.nxv2i64(<vscale x 2 x i64> %b)
18 %b.real = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i64> } %b.deinterleaved, 0
19 %b.imag = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i64> } %b.deinterleaved, 1
20 %0 = sub <vscale x 1 x i64> %b.real, %a.imag
21 %1 = add <vscale x 1 x i64> %b.imag, %a.real
22 %interleaved.vec = tail call <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64> %0, <vscale x 1 x i64> %1)
23 ret <vscale x 2 x i64> %interleaved.vec
26 ; Expected to transform
27 define <vscale x 4 x i64> @complex_add_v4i64(<vscale x 4 x i64> %a, <vscale x 4 x i64> %b) {
28 ; CHECK-LABEL: complex_add_v4i64:
29 ; CHECK: // %bb.0: // %entry
30 ; CHECK-NEXT: cadd z3.d, z3.d, z1.d, #90
31 ; CHECK-NEXT: cadd z2.d, z2.d, z0.d, #90
32 ; CHECK-NEXT: mov z0.d, z2.d
33 ; CHECK-NEXT: mov z1.d, z3.d
36 %a.deinterleaved = tail call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.vector.deinterleave2.nxv4i64(<vscale x 4 x i64> %a)
37 %a.real = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i64> } %a.deinterleaved, 0
38 %a.imag = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i64> } %a.deinterleaved, 1
39 %b.deinterleaved = tail call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.vector.deinterleave2.nxv4i64(<vscale x 4 x i64> %b)
40 %b.real = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i64> } %b.deinterleaved, 0
41 %b.imag = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i64> } %b.deinterleaved, 1
42 %0 = sub <vscale x 2 x i64> %b.real, %a.imag
43 %1 = add <vscale x 2 x i64> %b.imag, %a.real
44 %interleaved.vec = tail call <vscale x 4 x i64> @llvm.vector.interleave2.nxv4i64(<vscale x 2 x i64> %0, <vscale x 2 x i64> %1)
45 ret <vscale x 4 x i64> %interleaved.vec
48 ; Expected to transform
49 define <vscale x 8 x i64> @complex_add_v8i64(<vscale x 8 x i64> %a, <vscale x 8 x i64> %b) {
50 ; CHECK-LABEL: complex_add_v8i64:
51 ; CHECK: // %bb.0: // %entry
52 ; CHECK-NEXT: cadd z6.d, z6.d, z2.d, #90
53 ; CHECK-NEXT: cadd z4.d, z4.d, z0.d, #90
54 ; CHECK-NEXT: cadd z5.d, z5.d, z1.d, #90
55 ; CHECK-NEXT: cadd z7.d, z7.d, z3.d, #90
56 ; CHECK-NEXT: mov z0.d, z4.d
57 ; CHECK-NEXT: mov z1.d, z5.d
58 ; CHECK-NEXT: mov z2.d, z6.d
59 ; CHECK-NEXT: mov z3.d, z7.d
62 %a.deinterleaved = tail call { <vscale x 4 x i64>, <vscale x 4 x i64> } @llvm.vector.deinterleave2.nxv8i64(<vscale x 8 x i64> %a)
63 %a.real = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i64> } %a.deinterleaved, 0
64 %a.imag = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i64> } %a.deinterleaved, 1
65 %b.deinterleaved = tail call { <vscale x 4 x i64>, <vscale x 4 x i64> } @llvm.vector.deinterleave2.nxv8i64(<vscale x 8 x i64> %b)
66 %b.real = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i64> } %b.deinterleaved, 0
67 %b.imag = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i64> } %b.deinterleaved, 1
68 %0 = sub <vscale x 4 x i64> %b.real, %a.imag
69 %1 = add <vscale x 4 x i64> %b.imag, %a.real
70 %interleaved.vec = tail call <vscale x 8 x i64> @llvm.vector.interleave2.nxv8i64(<vscale x 4 x i64> %0, <vscale x 4 x i64> %1)
71 ret <vscale x 8 x i64> %interleaved.vec
74 declare { <vscale x 1 x i64>, <vscale x 1 x i64> } @llvm.vector.deinterleave2.nxv2i64(<vscale x 2 x i64>)
75 declare <vscale x 2 x i64> @llvm.vector.interleave2.nxv2i64(<vscale x 1 x i64>, <vscale x 1 x i64>)
77 declare { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.vector.deinterleave2.nxv4i64(<vscale x 4 x i64>)
78 declare <vscale x 4 x i64> @llvm.vector.interleave2.nxv4i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
80 declare { <vscale x 4 x i64>, <vscale x 4 x i64> } @llvm.vector.deinterleave2.nxv8i64(<vscale x 8 x i64>)
81 declare <vscale x 8 x i64> @llvm.vector.interleave2.nxv8i64(<vscale x 4 x i64>, <vscale x 4 x i64>)