1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s
4 target triple = "aarch64"
6 ; Expected to transform
7 define <2 x double> @complex_mul_v2f64(<2 x double> %a, <2 x double> %b) {
8 ; CHECK-LABEL: complex_mul_v2f64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: movi v2.2d, #0000000000000000
11 ; CHECK-NEXT: fcmla v2.2d, v1.2d, v0.2d, #0
12 ; CHECK-NEXT: fcmla v2.2d, v1.2d, v0.2d, #90
13 ; CHECK-NEXT: mov v0.16b, v2.16b
16 %a.real = shufflevector <2 x double> %a, <2 x double> poison, <1 x i32> <i32 0>
17 %a.imag = shufflevector <2 x double> %a, <2 x double> poison, <1 x i32> <i32 1>
18 %b.real = shufflevector <2 x double> %b, <2 x double> poison, <1 x i32> <i32 0>
19 %b.imag = shufflevector <2 x double> %b, <2 x double> poison, <1 x i32> <i32 1>
20 %0 = fmul fast <1 x double> %b.imag, %a.real
21 %1 = fmul fast <1 x double> %b.real, %a.imag
22 %2 = fadd fast <1 x double> %1, %0
23 %3 = fmul fast <1 x double> %b.real, %a.real
24 %4 = fmul fast <1 x double> %a.imag, %b.imag
25 %5 = fsub fast <1 x double> %3, %4
26 %interleaved.vec = shufflevector <1 x double> %5, <1 x double> %2, <2 x i32> <i32 0, i32 1>
27 ret <2 x double> %interleaved.vec
30 ; Expected to transform
31 define <4 x double> @complex_mul_v4f64(<4 x double> %a, <4 x double> %b) {
32 ; CHECK-LABEL: complex_mul_v4f64:
33 ; CHECK: // %bb.0: // %entry
34 ; CHECK-NEXT: movi v4.2d, #0000000000000000
35 ; CHECK-NEXT: movi v5.2d, #0000000000000000
36 ; CHECK-NEXT: fcmla v5.2d, v2.2d, v0.2d, #0
37 ; CHECK-NEXT: fcmla v4.2d, v3.2d, v1.2d, #0
38 ; CHECK-NEXT: fcmla v5.2d, v2.2d, v0.2d, #90
39 ; CHECK-NEXT: fcmla v4.2d, v3.2d, v1.2d, #90
40 ; CHECK-NEXT: mov v0.16b, v5.16b
41 ; CHECK-NEXT: mov v1.16b, v4.16b
44 %a.real = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 0, i32 2>
45 %a.imag = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 1, i32 3>
46 %b.real = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 0, i32 2>
47 %b.imag = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 1, i32 3>
48 %0 = fmul fast <2 x double> %b.imag, %a.real
49 %1 = fmul fast <2 x double> %b.real, %a.imag
50 %2 = fadd fast <2 x double> %1, %0
51 %3 = fmul fast <2 x double> %b.real, %a.real
52 %4 = fmul fast <2 x double> %a.imag, %b.imag
53 %5 = fsub fast <2 x double> %3, %4
54 %interleaved.vec = shufflevector <2 x double> %5, <2 x double> %2, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
55 ret <4 x double> %interleaved.vec
58 ; Expected to transform
59 define <8 x double> @complex_mul_v8f64(<8 x double> %a, <8 x double> %b) {
60 ; CHECK-LABEL: complex_mul_v8f64:
61 ; CHECK: // %bb.0: // %entry
62 ; CHECK-NEXT: movi v16.2d, #0000000000000000
63 ; CHECK-NEXT: movi v17.2d, #0000000000000000
64 ; CHECK-NEXT: movi v18.2d, #0000000000000000
65 ; CHECK-NEXT: movi v19.2d, #0000000000000000
66 ; CHECK-NEXT: fcmla v16.2d, v4.2d, v0.2d, #0
67 ; CHECK-NEXT: fcmla v18.2d, v5.2d, v1.2d, #0
68 ; CHECK-NEXT: fcmla v17.2d, v7.2d, v3.2d, #0
69 ; CHECK-NEXT: fcmla v19.2d, v6.2d, v2.2d, #0
70 ; CHECK-NEXT: fcmla v16.2d, v4.2d, v0.2d, #90
71 ; CHECK-NEXT: fcmla v18.2d, v5.2d, v1.2d, #90
72 ; CHECK-NEXT: fcmla v17.2d, v7.2d, v3.2d, #90
73 ; CHECK-NEXT: fcmla v19.2d, v6.2d, v2.2d, #90
74 ; CHECK-NEXT: mov v0.16b, v16.16b
75 ; CHECK-NEXT: mov v1.16b, v18.16b
76 ; CHECK-NEXT: mov v3.16b, v17.16b
77 ; CHECK-NEXT: mov v2.16b, v19.16b
80 %a.real = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
81 %a.imag = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
82 %b.real = shufflevector <8 x double> %b, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
83 %b.imag = shufflevector <8 x double> %b, <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
84 %0 = fmul fast <4 x double> %b.imag, %a.real
85 %1 = fmul fast <4 x double> %b.real, %a.imag
86 %2 = fadd fast <4 x double> %1, %0
87 %3 = fmul fast <4 x double> %b.real, %a.real
88 %4 = fmul fast <4 x double> %a.imag, %b.imag
89 %5 = fsub fast <4 x double> %3, %4
90 %interleaved.vec = shufflevector <4 x double> %5, <4 x double> %2, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
91 ret <8 x double> %interleaved.vec