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 ; a[i] * b[i] * (11.0 + 3.0.i);
8 define <vscale x 4 x double> @complex_mul_const(<vscale x 4 x double> %a, <vscale x 4 x double> %b) {
9 ; CHECK-LABEL: complex_mul_const:
10 ; CHECK: // %bb.0: // %entry
11 ; CHECK-NEXT: mov z4.d, #0 // =0x0
12 ; CHECK-NEXT: ptrue p0.d
13 ; CHECK-NEXT: fmov z7.d, #3.00000000
14 ; CHECK-NEXT: fmov z24.d, #11.00000000
15 ; CHECK-NEXT: mov z6.d, z4.d
16 ; CHECK-NEXT: mov z5.d, z4.d
17 ; CHECK-NEXT: fcmla z6.d, p0/m, z1.d, z3.d, #0
18 ; CHECK-NEXT: fcmla z5.d, p0/m, z0.d, z2.d, #0
19 ; CHECK-NEXT: fcmla z6.d, p0/m, z1.d, z3.d, #90
20 ; CHECK-NEXT: zip2 z1.d, z24.d, z7.d
21 ; CHECK-NEXT: fcmla z5.d, p0/m, z0.d, z2.d, #90
22 ; CHECK-NEXT: zip1 z2.d, z24.d, z7.d
23 ; CHECK-NEXT: mov z0.d, z4.d
24 ; CHECK-NEXT: fcmla z4.d, p0/m, z6.d, z1.d, #0
25 ; CHECK-NEXT: fcmla z0.d, p0/m, z5.d, z2.d, #0
26 ; CHECK-NEXT: fcmla z4.d, p0/m, z6.d, z1.d, #90
27 ; CHECK-NEXT: fcmla z0.d, p0/m, z5.d, z2.d, #90
28 ; CHECK-NEXT: mov z1.d, z4.d
31 %strided.vec = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %a)
32 %0 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec, 0
33 %1 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec, 1
34 %strided.vec48 = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %b)
35 %2 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec48, 0
36 %3 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec48, 1
37 %4 = fmul fast <vscale x 2 x double> %3, %0
38 %5 = fmul fast <vscale x 2 x double> %2, %1
39 %6 = fadd fast <vscale x 2 x double> %4, %5
40 %7 = fmul fast <vscale x 2 x double> %2, %0
41 %8 = fmul fast <vscale x 2 x double> %3, %1
42 %9 = fsub fast <vscale x 2 x double> %7, %8
43 %10 = fmul fast <vscale x 2 x double> %9, splat (double 3.000000e+00)
44 %11 = fmul fast <vscale x 2 x double> %6, splat (double 1.100000e+01)
45 %12 = fadd fast <vscale x 2 x double> %10, %11
46 %13 = fmul fast <vscale x 2 x double> %9, splat (double 1.100000e+01)
47 %14 = fmul fast <vscale x 2 x double> %6, splat (double 3.000000e+00)
48 %15 = fsub fast <vscale x 2 x double> %13, %14
49 %interleaved.vec = tail call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %15, <vscale x 2 x double> %12)
50 ret <vscale x 4 x double> %interleaved.vec
55 define <vscale x 4 x double> @complex_mul_non_const(<vscale x 4 x double> %a, <vscale x 4 x double> %b, [2 x double] %c) {
56 ; CHECK-LABEL: complex_mul_non_const:
57 ; CHECK: // %bb.0: // %entry
58 ; CHECK-NEXT: mov z6.d, #0 // =0x0
59 ; CHECK-NEXT: ptrue p0.d
60 ; CHECK-NEXT: // kill: def $d5 killed $d5 def $z5
61 ; CHECK-NEXT: // kill: def $d4 killed $d4 def $z4
62 ; CHECK-NEXT: mov z5.d, d5
63 ; CHECK-NEXT: mov z4.d, d4
64 ; CHECK-NEXT: mov z24.d, z6.d
65 ; CHECK-NEXT: mov z7.d, z6.d
66 ; CHECK-NEXT: fcmla z24.d, p0/m, z1.d, z3.d, #0
67 ; CHECK-NEXT: fcmla z7.d, p0/m, z0.d, z2.d, #0
68 ; CHECK-NEXT: fcmla z24.d, p0/m, z1.d, z3.d, #90
69 ; CHECK-NEXT: zip2 z1.d, z4.d, z5.d
70 ; CHECK-NEXT: fcmla z7.d, p0/m, z0.d, z2.d, #90
71 ; CHECK-NEXT: zip1 z2.d, z4.d, z5.d
72 ; CHECK-NEXT: mov z0.d, z6.d
73 ; CHECK-NEXT: fcmla z6.d, p0/m, z24.d, z1.d, #0
74 ; CHECK-NEXT: fcmla z0.d, p0/m, z7.d, z2.d, #0
75 ; CHECK-NEXT: fcmla z6.d, p0/m, z24.d, z1.d, #90
76 ; CHECK-NEXT: fcmla z0.d, p0/m, z7.d, z2.d, #90
77 ; CHECK-NEXT: mov z1.d, z6.d
80 %c.coerce.fca.0.extract = extractvalue [2 x double] %c, 0
81 %c.coerce.fca.1.extract = extractvalue [2 x double] %c, 1
82 %broadcast.splatinsert = insertelement <vscale x 2 x double> poison, double %c.coerce.fca.1.extract, i64 0
83 %broadcast.splat = shufflevector <vscale x 2 x double> %broadcast.splatinsert, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
84 %broadcast.splatinsert49 = insertelement <vscale x 2 x double> poison, double %c.coerce.fca.0.extract, i64 0
85 %broadcast.splat50 = shufflevector <vscale x 2 x double> %broadcast.splatinsert49, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
86 %strided.vec = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %a)
87 %0 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec, 0
88 %1 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec, 1
89 %strided.vec48 = tail call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double> %b)
90 %2 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec48, 0
91 %3 = extractvalue { <vscale x 2 x double>, <vscale x 2 x double> } %strided.vec48, 1
92 %4 = fmul fast <vscale x 2 x double> %3, %0
93 %5 = fmul fast <vscale x 2 x double> %2, %1
94 %6 = fadd fast <vscale x 2 x double> %4, %5
95 %7 = fmul fast <vscale x 2 x double> %2, %0
96 %8 = fmul fast <vscale x 2 x double> %3, %1
97 %9 = fsub fast <vscale x 2 x double> %7, %8
98 %10 = fmul fast <vscale x 2 x double> %9, %broadcast.splat
99 %11 = fmul fast <vscale x 2 x double> %6, %broadcast.splat50
100 %12 = fadd fast <vscale x 2 x double> %10, %11
101 %13 = fmul fast <vscale x 2 x double> %9, %broadcast.splat50
102 %14 = fmul fast <vscale x 2 x double> %6, %broadcast.splat
103 %15 = fsub fast <vscale x 2 x double> %13, %14
104 %interleaved.vec = tail call <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double> %15, <vscale x 2 x double> %12)
105 ret <vscale x 4 x double> %interleaved.vec
108 declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.vector.deinterleave2.nxv4f64(<vscale x 4 x double>)
109 declare <vscale x 4 x double> @llvm.vector.interleave2.nxv4f64(<vscale x 2 x double>, <vscale x 2 x double>)