File: complex-deinterleaving-f64-mul.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (92 lines) | stat: -rw-r--r-- 4,369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s

target triple = "aarch64"

; Expected to transform
define <2 x double> @complex_mul_v2f64(<2 x double> %a, <2 x double> %b) {
; CHECK-LABEL: complex_mul_v2f64:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v2.2d, #0000000000000000
; CHECK-NEXT:    fcmla v2.2d, v0.2d, v1.2d, #0
; CHECK-NEXT:    fcmla v2.2d, v0.2d, v1.2d, #90
; CHECK-NEXT:    mov v0.16b, v2.16b
; CHECK-NEXT:    ret
entry:
  %a.real   = shufflevector <2 x double> %a, <2 x double> poison, <1 x i32> <i32 0>
  %a.imag = shufflevector <2 x double> %a, <2 x double> poison, <1 x i32> <i32 1>
  %b.real = shufflevector <2 x double> %b, <2 x double> poison, <1 x i32> <i32 0>
  %b.imag = shufflevector <2 x double> %b, <2 x double> poison, <1 x i32> <i32 1>
  %0 = fmul fast <1 x double> %b.imag, %a.real
  %1 = fmul fast <1 x double> %b.real, %a.imag
  %2 = fadd fast <1 x double> %1, %0
  %3 = fmul fast <1 x double> %b.real, %a.real
  %4 = fmul fast <1 x double> %a.imag, %b.imag
  %5 = fsub fast <1 x double> %3, %4
  %interleaved.vec = shufflevector <1 x double> %5, <1 x double> %2, <2 x i32> <i32 0, i32 1>
  ret <2 x double> %interleaved.vec
}

; Expected to transform
define <4 x double> @complex_mul_v4f64(<4 x double> %a, <4 x double> %b) {
; CHECK-LABEL: complex_mul_v4f64:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v4.2d, #0000000000000000
; CHECK-NEXT:    movi v5.2d, #0000000000000000
; CHECK-NEXT:    fcmla v4.2d, v0.2d, v2.2d, #0
; CHECK-NEXT:    fcmla v5.2d, v1.2d, v3.2d, #0
; CHECK-NEXT:    fcmla v4.2d, v0.2d, v2.2d, #90
; CHECK-NEXT:    fcmla v5.2d, v1.2d, v3.2d, #90
; CHECK-NEXT:    mov v0.16b, v4.16b
; CHECK-NEXT:    mov v1.16b, v5.16b
; CHECK-NEXT:    ret
entry:
  %a.real   = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 0, i32 2>
  %a.imag = shufflevector <4 x double> %a, <4 x double> poison, <2 x i32> <i32 1, i32 3>
  %b.real = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 0, i32 2>
  %b.imag = shufflevector <4 x double> %b, <4 x double> poison, <2 x i32> <i32 1, i32 3>
  %0 = fmul fast <2 x double> %b.imag, %a.real
  %1 = fmul fast <2 x double> %b.real, %a.imag
  %2 = fadd fast <2 x double> %1, %0
  %3 = fmul fast <2 x double> %b.real, %a.real
  %4 = fmul fast <2 x double> %a.imag, %b.imag
  %5 = fsub fast <2 x double> %3, %4
  %interleaved.vec = shufflevector <2 x double> %5, <2 x double> %2, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  ret <4 x double> %interleaved.vec
}

; Expected to transform
define <8 x double> @complex_mul_v8f64(<8 x double> %a, <8 x double> %b) {
; CHECK-LABEL: complex_mul_v8f64:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v16.2d, #0000000000000000
; CHECK-NEXT:    movi v17.2d, #0000000000000000
; CHECK-NEXT:    movi v18.2d, #0000000000000000
; CHECK-NEXT:    movi v19.2d, #0000000000000000
; CHECK-NEXT:    fcmla v16.2d, v0.2d, v4.2d, #0
; CHECK-NEXT:    fcmla v17.2d, v1.2d, v5.2d, #0
; CHECK-NEXT:    fcmla v18.2d, v2.2d, v6.2d, #0
; CHECK-NEXT:    fcmla v19.2d, v3.2d, v7.2d, #0
; CHECK-NEXT:    fcmla v16.2d, v0.2d, v4.2d, #90
; CHECK-NEXT:    fcmla v17.2d, v1.2d, v5.2d, #90
; CHECK-NEXT:    fcmla v18.2d, v2.2d, v6.2d, #90
; CHECK-NEXT:    fcmla v19.2d, v3.2d, v7.2d, #90
; CHECK-NEXT:    mov v0.16b, v16.16b
; CHECK-NEXT:    mov v1.16b, v17.16b
; CHECK-NEXT:    mov v2.16b, v18.16b
; CHECK-NEXT:    mov v3.16b, v19.16b
; CHECK-NEXT:    ret
entry:
  %a.real   = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %a.imag = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %b.real = shufflevector <8 x double> %b, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %b.imag = shufflevector <8 x double> %b, <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %0 = fmul fast <4 x double> %b.imag, %a.real
  %1 = fmul fast <4 x double> %b.real, %a.imag
  %2 = fadd fast <4 x double> %1, %0
  %3 = fmul fast <4 x double> %b.real, %a.real
  %4 = fmul fast <4 x double> %a.imag, %b.imag
  %5 = fsub fast <4 x double> %3, %4
  %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>
  ret <8 x double> %interleaved.vec
}