1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s --mattr=+complxnum -o - | FileCheck %s
4 target triple = "aarch64-arm-none-eabi"
7 ; a[i] * b[i] * (11.0 + 3.0.i);
9 define <4 x double> @complex_mul_const(<4 x double> %a, <4 x double> %b) {
10 ; CHECK-LABEL: complex_mul_const:
11 ; CHECK: // %bb.0: // %entry
12 ; CHECK-NEXT: movi v6.2d, #0000000000000000
13 ; CHECK-NEXT: movi v5.2d, #0000000000000000
14 ; CHECK-NEXT: adrp x8, .LCPI0_0
15 ; CHECK-NEXT: movi v4.2d, #0000000000000000
16 ; CHECK-NEXT: fcmla v6.2d, v3.2d, v1.2d, #0
17 ; CHECK-NEXT: fcmla v5.2d, v2.2d, v0.2d, #0
18 ; CHECK-NEXT: fcmla v6.2d, v3.2d, v1.2d, #90
19 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI0_0]
20 ; CHECK-NEXT: fcmla v5.2d, v2.2d, v0.2d, #90
21 ; CHECK-NEXT: movi v0.2d, #0000000000000000
22 ; CHECK-NEXT: fcmla v4.2d, v1.2d, v6.2d, #0
23 ; CHECK-NEXT: fcmla v0.2d, v1.2d, v5.2d, #0
24 ; CHECK-NEXT: fcmla v4.2d, v1.2d, v6.2d, #90
25 ; CHECK-NEXT: fcmla v0.2d, v1.2d, v5.2d, #90
26 ; CHECK-NEXT: mov v1.16b, v4.16b
29 %strided.vec = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 0, i32 2>
30 %strided.vec47 = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 1, i32 3>
31 %strided.vec49 = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 0, i32 2>
32 %strided.vec50 = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 1, i32 3>
33 %0 = fmul fast <2 x double> %strided.vec50, %strided.vec
34 %1 = fmul fast <2 x double> %strided.vec49, %strided.vec47
35 %2 = fadd fast <2 x double> %0, %1
36 %3 = fmul fast <2 x double> %strided.vec49, %strided.vec
37 %4 = fmul fast <2 x double> %strided.vec50, %strided.vec47
38 %5 = fsub fast <2 x double> %3, %4
39 %6 = fmul fast <2 x double> %5, <double 3.000000e+00, double 3.000000e+00>
40 %7 = fmul fast <2 x double> %2, <double 1.100000e+01, double 1.100000e+01>
41 %8 = fadd fast <2 x double> %6, %7
42 %9 = fmul fast <2 x double> %5, <double 1.100000e+01, double 1.100000e+01>
43 %10 = fmul fast <2 x double> %2, <double 3.000000e+00, double 3.000000e+00>
44 %11 = fsub fast <2 x double> %9, %10
45 %interleaved.vec = shufflevector <2 x double> %11, <2 x double> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
46 ret <4 x double> %interleaved.vec
52 define <4 x double> @complex_mul_non_const(<4 x double> %a, <4 x double> %b, [2 x double] %c) {
53 ; CHECK-LABEL: complex_mul_non_const:
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: movi v7.2d, #0000000000000000
56 ; CHECK-NEXT: movi v6.2d, #0000000000000000
57 ; CHECK-NEXT: // kill: def $d5 killed $d5 def $q5
58 ; CHECK-NEXT: // kill: def $d4 killed $d4 def $q4
59 ; CHECK-NEXT: mov v4.d[1], v5.d[0]
60 ; CHECK-NEXT: movi v5.2d, #0000000000000000
61 ; CHECK-NEXT: fcmla v7.2d, v3.2d, v1.2d, #0
62 ; CHECK-NEXT: fcmla v6.2d, v2.2d, v0.2d, #0
63 ; CHECK-NEXT: fcmla v7.2d, v3.2d, v1.2d, #90
64 ; CHECK-NEXT: fcmla v6.2d, v2.2d, v0.2d, #90
65 ; CHECK-NEXT: movi v0.2d, #0000000000000000
66 ; CHECK-NEXT: fcmla v5.2d, v4.2d, v7.2d, #0
67 ; CHECK-NEXT: fcmla v0.2d, v4.2d, v6.2d, #0
68 ; CHECK-NEXT: fcmla v5.2d, v4.2d, v7.2d, #90
69 ; CHECK-NEXT: fcmla v0.2d, v4.2d, v6.2d, #90
70 ; CHECK-NEXT: mov v1.16b, v5.16b
73 %c.coerce.fca.1.extract = extractvalue [2 x double] %c, 1
74 %c.coerce.fca.0.extract = extractvalue [2 x double] %c, 0
75 %broadcast.splatinsert = insertelement <2 x double> poison, double %c.coerce.fca.1.extract, i64 0
76 %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
77 %broadcast.splatinsert51 = insertelement <2 x double> poison, double %c.coerce.fca.0.extract, i64 0
78 %broadcast.splat52 = shufflevector <2 x double> %broadcast.splatinsert51, <2 x double> poison, <2 x i32> zeroinitializer
79 %strided.vec = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 0, i32 2>
80 %strided.vec47 = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 1, i32 3>
81 %strided.vec49 = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 0, i32 2>
82 %strided.vec50 = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 1, i32 3>
83 %0 = fmul fast <2 x double> %strided.vec50, %strided.vec
84 %1 = fmul fast <2 x double> %strided.vec49, %strided.vec47
85 %2 = fadd fast <2 x double> %0, %1
86 %3 = fmul fast <2 x double> %strided.vec49, %strided.vec
87 %4 = fmul fast <2 x double> %strided.vec50, %strided.vec47
88 %5 = fsub fast <2 x double> %3, %4
89 %6 = fmul fast <2 x double> %5, %broadcast.splat
90 %7 = fmul fast <2 x double> %2, %broadcast.splat52
91 %8 = fadd fast <2 x double> %6, %7
92 %9 = fmul fast <2 x double> %5, %broadcast.splat52
93 %10 = fmul fast <2 x double> %2, %broadcast.splat
94 %11 = fsub fast <2 x double> %9, %10
95 %interleaved.vec = shufflevector <2 x double> %11, <2 x double> %8, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
96 ret <4 x double> %interleaved.vec