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 transform
7 define <vscale x 2 x double> @complex_add_v2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b) {
8 ; CHECK-LABEL: complex_add_v2f64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: ptrue p0.d
11 ; CHECK-NEXT: fcadd z1.d, p0/m, z1.d, z0.d, #90
12 ; CHECK-NEXT: mov z0.d, z1.d
15 %a.deinterleaved = tail call { <vscale x 1 x double>, <vscale x 1 x double> } @llvm.vector.deinterleave2.nxv2f64(<vscale x 2 x double> %a)
16 %a.real = extractvalue { <vscale x 1 x double>, <vscale x 1 x double> } %a.deinterleaved, 0
17 %a.imag = extractvalue { <vscale x 1 x double>, <vscale x 1 x double> } %a.deinterleaved, 1
18 %b.deinterleaved = tail call { <vscale x 1 x double>, <vscale x 1 x double> } @llvm.vector.deinterleave2.nxv2f64(<vscale x 2 x double> %b)
19 %b.real = extractvalue { <vscale x 1 x double>, <vscale x 1 x double> } %b.deinterleaved, 0
20 %b.imag = extractvalue { <vscale x 1 x double>, <vscale x 1 x double> } %b.deinterleaved, 1
21 %0 = fsub fast <vscale x 1 x double> %b.real, %a.imag
22 %1 = fadd fast <vscale x 1 x double> %b.imag, %a.real
23 %interleaved.vec = tail call <vscale x 2 x double> @llvm.vector.interleave2.nxv2f64(<vscale x 1 x double> %0, <vscale x 1 x double> %1)
24 ret <vscale x 2 x double> %interleaved.vec
27 ; Expected to transform
28 define <vscale x 4 x double> @complex_add_v4f64(<vscale x 4 x double> %a, <vscale x 4 x double> %b) {
29 ; CHECK-LABEL: complex_add_v4f64:
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: ptrue p0.d
32 ; CHECK-NEXT: fcadd z2.d, p0/m, z2.d, z0.d, #90
33 ; CHECK-NEXT: fcadd z3.d, p0/m, z3.d, z1.d, #90
34 ; CHECK-NEXT: mov z0.d, z2.d
35 ; CHECK-NEXT: mov z1.d, z3.d
38 %a.deinterleaved = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %a)
39 %a.real = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %a.deinterleaved, 0
40 %a.imag = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %a.deinterleaved, 1
41 %b.deinterleaved = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %b)
42 %b.real = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %b.deinterleaved, 0
43 %b.imag = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %b.deinterleaved, 1
44 %0 = fsub fast <vscale x 2 x double> %b.real, %a.imag
45 %1 = fadd fast <vscale x 2 x double> %b.imag, %a.real
46 %interleaved.vec = tail call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %0, <vscale x 2 x double> %1)
47 ret <vscale x 4 x double> %interleaved.vec
50 ; Expected to transform
51 define <vscale x 8 x double> @complex_add_v8f64(<vscale x 8 x double> %a, <vscale x 8 x double> %b) {
52 ; CHECK-LABEL: complex_add_v8f64:
53 ; CHECK: // %bb.0: // %entry
54 ; CHECK-NEXT: ptrue p0.d
55 ; CHECK-NEXT: fcadd z4.d, p0/m, z4.d, z0.d, #90
56 ; CHECK-NEXT: fcadd z5.d, p0/m, z5.d, z1.d, #90
57 ; CHECK-NEXT: fcadd z6.d, p0/m, z6.d, z2.d, #90
58 ; CHECK-NEXT: fcadd z7.d, p0/m, z7.d, z3.d, #90
59 ; CHECK-NEXT: mov z0.d, z4.d
60 ; CHECK-NEXT: mov z1.d, z5.d
61 ; CHECK-NEXT: mov z2.d, z6.d
62 ; CHECK-NEXT: mov z3.d, z7.d
65 %a.deinterleaved = tail call { <vscale x 4 x double>, <vscale x 4 x double> } @llvm.vector.deinterleave2.nxv8f64(<vscale x 8 x double> %a)
66 %a.real = extractvalue { <vscale x 4 x double>, <vscale x 4 x double> } %a.deinterleaved, 0
67 %a.imag = extractvalue { <vscale x 4 x double>, <vscale x 4 x double> } %a.deinterleaved, 1
68 %b.deinterleaved = tail call { <vscale x 4 x double>, <vscale x 4 x double> } @llvm.vector.deinterleave2.nxv8f64(<vscale x 8 x double> %b)
69 %b.real = extractvalue { <vscale x 4 x double>, <vscale x 4 x double> } %b.deinterleaved, 0
70 %b.imag = extractvalue { <vscale x 4 x double>, <vscale x 4 x double> } %b.deinterleaved, 1
71 %0 = fsub fast <vscale x 4 x double> %b.real, %a.imag
72 %1 = fadd fast <vscale x 4 x double> %b.imag, %a.real
73 %interleaved.vec = tail call <vscale x 8 x double> @llvm.vector.interleave2.nxv8f64(<vscale x 4 x double> %0, <vscale x 4 x double> %1)
74 ret <vscale x 8 x double> %interleaved.vec
77 declare { <vscale x 1 x double>, <vscale x 1 x double> } @llvm.vector.deinterleave2.nxv2f64(<vscale x 2 x double>)
78 declare <vscale x 2 x double> @llvm.vector.interleave2.nxv2f64(<vscale x 1 x double>, <vscale x 1 x double>)
80 declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double>)
81 declare <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double>, <vscale x 2 x double>)
83 declare { <vscale x 4 x double>, <vscale x 4 x double> } @llvm.vector.deinterleave2.nxv8f64(<vscale x 8 x double>)
84 declare <vscale x 8 x double> @llvm.vector.interleave2.nxv8f64(<vscale x 4 x double>, <vscale x 4 x double>)