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-m3 -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
5 # RUN: llc -run-pass=machine-combiner -o - -mtriple=aarch64-unknown-linux -mcpu=thunderx3t110 -enable-unsafe-fp-math -machine-combiner-verify-pattern-order=true %s | FileCheck --check-prefixes=PROFITABLE,ALL %s
9 - { id: 0, class: fpr64 }
10 - { id: 1, class: fpr64 }
11 - { id: 2, class: fpr64 }
12 - { id: 3, class: fpr64 }
13 - { id: 4, class: fpr64 }
19 %3:fpr64 = FMULv2f32 %0, %1, implicit $fpcr
20 %4:fpr64 = FSUBv2f32 killed %3, %2, implicit $fpcr
22 RET_ReallyLR implicit $d0
25 # UNPROFITABLE-LABEL: name: f1_2s
26 # UNPROFITABLE: [[R1:%[0-9]+]]:fpr64 = FNEGv2f32 %2
27 # UNPROFITABLE-NEXT: FMLAv2f32 killed [[R1]], %0, %1, implicit $fpcr
29 # PROFITABLE-LABEL: name: f1_2s
30 # PROFITABLE: [[R1:%[0-9]+]]:fpr64 = FNEGv2f32 %2
31 # PROFITABLE-NEXT: FMLAv2f32 killed [[R1]], %0, %1, implicit $fpcr
35 - { id: 0, class: fpr128 }
36 - { id: 1, class: fpr128 }
37 - { id: 2, class: fpr128 }
38 - { id: 3, class: fpr128 }
39 - { id: 4, class: fpr128 }
45 %3:fpr128 = FMULv4f32 %0, %1, implicit $fpcr
46 %4:fpr128 = FSUBv4f32 killed %3, %2, implicit $fpcr
48 RET_ReallyLR implicit $q0
51 # UNPROFITABLE-LABEL: name: f1_4s
52 # UNPROFITABLE: [[R1:%[0-9]+]]:fpr128 = FMULv4f32 %0, %1, implicit $fpcr
53 # UNPROFITABLE-NEXT: FSUBv4f32 killed [[R1]], %2, implicit $fpcr
55 # PROFITABLE-LABEL: name: f1_4s
56 # PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv4f32 %2
57 # PROFITABLE-NEXT: FMLAv4f32 killed [[R1]], %0, %1, implicit $fpcr
61 - { id: 0, class: fpr128 }
62 - { id: 1, class: fpr128 }
63 - { id: 2, class: fpr128 }
64 - { id: 3, class: fpr128 }
65 - { id: 4, class: fpr128 }
71 %3:fpr128 = FMULv2f64 %0, %1, implicit $fpcr
72 %4:fpr128 = FSUBv2f64 killed %3, %2, implicit $fpcr
74 RET_ReallyLR implicit $q0
77 # UNPROFITABLE-LABEL: name: f1_2d
78 # UNPROFITABLE: %3:fpr128 = FMULv2f64 %0, %1, implicit $fpcr
79 # UNPROFITABLE-NEXT: FSUBv2f64 killed %3, %2, implicit $fpcr
81 # PROFITABLE-LABEL: name: f1_2d
82 # PROFITABLE: [[R1:%[0-9]+]]:fpr128 = FNEGv2f64 %2
83 # PROFITABLE-NEXT: FMLAv2f64 killed [[R1]], %0, %1, implicit $fpcr
87 - { id: 0, class: fpr64 }
88 - { id: 1, class: fpr64 }
89 - { id: 2, class: fpr64 }
90 - { id: 3, class: fpr64 }
91 - { id: 4, class: fpr64 }
92 - { id: 5, class: fpr64 }
93 - { id: 6, class: fpr64 }
100 %4:fpr64 = FMULv2f32 %0, %1, implicit $fpcr
101 %5:fpr64 = FMULv2f32 %2, %3, implicit $fpcr
102 %6:fpr64 = FSUBv2f32 killed %4, %5, implicit $fpcr
104 RET_ReallyLR implicit $q0
107 # ALL-LABEL: name: f1_both_fmul_2s
108 # ALL: %4:fpr64 = FMULv2f32 %0, %1, implicit $fpcr
109 # ALL-NEXT: FMLSv2f32 killed %4, %2, %3, implicit $fpcr
111 name: f1_both_fmul_4s
113 - { id: 0, class: fpr128 }
114 - { id: 1, class: fpr128 }
115 - { id: 2, class: fpr128 }
116 - { id: 3, class: fpr128 }
117 - { id: 4, class: fpr128 }
118 - { id: 5, class: fpr128 }
119 - { id: 6, class: fpr128 }
126 %4:fpr128 = FMULv4f32 %0, %1, implicit $fpcr
127 %5:fpr128 = FMULv4f32 %2, %3, implicit $fpcr
128 %6:fpr128 = FSUBv4f32 killed %4, %5, implicit $fpcr
130 RET_ReallyLR implicit $q0
133 # ALL-LABEL: name: f1_both_fmul_4s
134 # ALL: %4:fpr128 = FMULv4f32 %0, %1, implicit $fpcr
135 # ALL-NEXT: FMLSv4f32 killed %4, %2, %3, implicit $fpcr
137 name: f1_both_fmul_2d
139 - { id: 0, class: fpr128 }
140 - { id: 1, class: fpr128 }
141 - { id: 2, class: fpr128 }
142 - { id: 3, class: fpr128 }
143 - { id: 4, class: fpr128 }
144 - { id: 5, class: fpr128 }
145 - { id: 6, class: fpr128 }
152 %4:fpr128 = FMULv2f64 %0, %1, implicit $fpcr
153 %5:fpr128 = FMULv2f64 %2, %3, implicit $fpcr
154 %6:fpr128 = FSUBv2f64 killed %4, %5, implicit $fpcr
156 RET_ReallyLR implicit $q0
159 # ALL-LABEL: name: f1_both_fmul_2d
160 # ALL: %4:fpr128 = FMULv2f64 %0, %1, implicit $fpcr
161 # ALL-NEXT: FMLSv2f64 killed %4, %2, %3, implicit $fpcr