1 # RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=cortex-a57 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=UNPROFITABLE,ALL %s
2 # RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=falkor -enable-unsafe-fp-math %s -machine-combiner-verify-pattern-order=true | FileCheck --check-prefixes=PROFITABLE,ALL %s
3 # RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=exynos-m1 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=PROFITABLE,ALL %s
4 # RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=thunderx2t99 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=PROFITABLE,ALL %s
8 - { id: 0, class: fpr64 }
9 - { id: 1, class: fpr64 }
10 - { id: 2, class: fpr64 }
11 - { id: 3, class: fpr64 }
12 - { id: 4, class: fpr64 }
18 %3:fpr64 = FMULv2f32 %0, %1
19 %4:fpr64 = FSUBv2f32 killed %3, %2
21 RET_ReallyLR implicit $d0
24 # UNPROFITABLE-LABEL: name: f1_2s
25 # UNPROFITABLE: %3:fpr64 = FMULv2f32 %0, %1
26 # UNPROFITABLE-NEXT: FSUBv2f32 killed %3, %2
28 # PROFITABLE-LABEL: name: f1_2s
29 # PROFITABLE: [[R1:%[0-9]+]]:fpr64 = FNEGv2f32 %2
30 # PROFITABLE-NEXT: FMLAv2f32 killed [[R1]], %0, %1
34 - { id: 0, class: fpr128 }
35 - { id: 1, class: fpr128 }
36 - { id: 2, class: fpr128 }
37 - { id: 3, class: fpr128 }
38 - { id: 4, class: fpr128 }
44 %3:fpr128 = FMULv4f32 %0, %1
45 %4:fpr128 = FSUBv4f32 killed %3, %2
47 RET_ReallyLR implicit $q0
50 # UNPROFITABLE-LABEL: name: f1_4s
51 # UNPROFITABLE: %3:fpr128 = FMULv4f32 %0, %1
52 # UNPROFITABLE-NEXT: FSUBv4f32 killed %3, %2
54 # PROFITABLE-LABEL: name: f1_4s
55 # PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv4f32 %2
56 # PROFITABLE-NEXT: FMLAv4f32 killed [[R1]], %0, %1
60 - { id: 0, class: fpr128 }
61 - { id: 1, class: fpr128 }
62 - { id: 2, class: fpr128 }
63 - { id: 3, class: fpr128 }
64 - { id: 4, class: fpr128 }
70 %3:fpr128 = FMULv2f64 %0, %1
71 %4:fpr128 = FSUBv2f64 killed %3, %2
73 RET_ReallyLR implicit $q0
76 # UNPROFITABLE-LABEL: name: f1_2d
77 # UNPROFITABLE: %3:fpr128 = FMULv2f64 %0, %1
78 # UNPROFITABLE-NEXT: FSUBv2f64 killed %3, %2
80 # PROFITABLE-LABEL: name: f1_2d
81 # PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv2f64 %2
82 # PROFITABLE-NEXT: FMLAv2f64 killed [[R1]], %0, %1
86 - { id: 0, class: fpr64 }
87 - { id: 1, class: fpr64 }
88 - { id: 2, class: fpr64 }
89 - { id: 3, class: fpr64 }
90 - { id: 4, class: fpr64 }
91 - { id: 5, class: fpr64 }
92 - { id: 6, class: fpr64 }
99 %4:fpr64 = FMULv2f32 %0, %1
100 %5:fpr64 = FMULv2f32 %2, %3
101 %6:fpr64 = FSUBv2f32 killed %4, %5
103 RET_ReallyLR implicit $q0
106 # ALL-LABEL: name: f1_both_fmul_2s
107 # ALL: %4:fpr64 = FMULv2f32 %0, %1
108 # ALL-NEXT: FMLSv2f32 killed %4, %2, %3
110 name: f1_both_fmul_4s
112 - { id: 0, class: fpr128 }
113 - { id: 1, class: fpr128 }
114 - { id: 2, class: fpr128 }
115 - { id: 3, class: fpr128 }
116 - { id: 4, class: fpr128 }
117 - { id: 5, class: fpr128 }
118 - { id: 6, class: fpr128 }
125 %4:fpr128 = FMULv4f32 %0, %1
126 %5:fpr128 = FMULv4f32 %2, %3
127 %6:fpr128 = FSUBv4f32 killed %4, %5
129 RET_ReallyLR implicit $q0
132 # ALL-LABEL: name: f1_both_fmul_4s
133 # ALL: %4:fpr128 = FMULv4f32 %0, %1
134 # ALL-NEXT: FMLSv4f32 killed %4, %2, %3
136 name: f1_both_fmul_2d
138 - { id: 0, class: fpr128 }
139 - { id: 1, class: fpr128 }
140 - { id: 2, class: fpr128 }
141 - { id: 3, class: fpr128 }
142 - { id: 4, class: fpr128 }
143 - { id: 5, class: fpr128 }
144 - { id: 6, class: fpr128 }
151 %4:fpr128 = FMULv2f64 %0, %1
152 %5:fpr128 = FMULv2f64 %2, %3
153 %6:fpr128 = FSUBv2f64 killed %4, %5
155 RET_ReallyLR implicit $q0
158 # ALL-LABEL: name: f1_both_fmul_2d
159 # ALL: %4:fpr128 = FMULv2f64 %0, %1
160 # ALL-NEXT: FMLSv2f64 killed %4, %2, %3