1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP32
3 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP64
6 define void @float_add() {entry: ret void}
7 define void @float_sub() {entry: ret void}
8 define void @float_mul() {entry: ret void}
9 define void @float_div() {entry: ret void}
10 define void @double_add() {entry: ret void}
11 define void @double_sub() {entry: ret void}
12 define void @double_mul() {entry: ret void}
13 define void @double_div() {entry: ret void}
21 tracksRegLiveness: true
26 ; FP32-LABEL: name: float_add
27 ; FP32: liveins: $f12, $f14
28 ; FP32: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
29 ; FP32: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
30 ; FP32: [[FADD_S:%[0-9]+]]:fgr32 = FADD_S [[COPY]], [[COPY1]]
31 ; FP32: $f0 = COPY [[FADD_S]]
32 ; FP32: RetRA implicit $f0
33 ; FP64-LABEL: name: float_add
34 ; FP64: liveins: $f12, $f14
35 ; FP64: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
36 ; FP64: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
37 ; FP64: [[FADD_S:%[0-9]+]]:fgr32 = FADD_S [[COPY]], [[COPY1]]
38 ; FP64: $f0 = COPY [[FADD_S]]
39 ; FP64: RetRA implicit $f0
40 %0:fprb(s32) = COPY $f12
41 %1:fprb(s32) = COPY $f14
42 %2:fprb(s32) = G_FADD %0, %1
52 tracksRegLiveness: true
57 ; FP32-LABEL: name: float_sub
58 ; FP32: liveins: $f12, $f14
59 ; FP32: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
60 ; FP32: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
61 ; FP32: [[FSUB_S:%[0-9]+]]:fgr32 = FSUB_S [[COPY]], [[COPY1]]
62 ; FP32: $f0 = COPY [[FSUB_S]]
63 ; FP32: RetRA implicit $f0
64 ; FP64-LABEL: name: float_sub
65 ; FP64: liveins: $f12, $f14
66 ; FP64: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
67 ; FP64: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
68 ; FP64: [[FSUB_S:%[0-9]+]]:fgr32 = FSUB_S [[COPY]], [[COPY1]]
69 ; FP64: $f0 = COPY [[FSUB_S]]
70 ; FP64: RetRA implicit $f0
71 %0:fprb(s32) = COPY $f12
72 %1:fprb(s32) = COPY $f14
73 %2:fprb(s32) = G_FSUB %0, %1
83 tracksRegLiveness: true
88 ; FP32-LABEL: name: float_mul
89 ; FP32: liveins: $f12, $f14
90 ; FP32: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
91 ; FP32: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
92 ; FP32: [[FMUL_S:%[0-9]+]]:fgr32 = FMUL_S [[COPY]], [[COPY1]]
93 ; FP32: $f0 = COPY [[FMUL_S]]
94 ; FP32: RetRA implicit $f0
95 ; FP64-LABEL: name: float_mul
96 ; FP64: liveins: $f12, $f14
97 ; FP64: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
98 ; FP64: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
99 ; FP64: [[FMUL_S:%[0-9]+]]:fgr32 = FMUL_S [[COPY]], [[COPY1]]
100 ; FP64: $f0 = COPY [[FMUL_S]]
101 ; FP64: RetRA implicit $f0
102 %0:fprb(s32) = COPY $f12
103 %1:fprb(s32) = COPY $f14
104 %2:fprb(s32) = G_FMUL %0, %1
113 regBankSelected: true
114 tracksRegLiveness: true
119 ; FP32-LABEL: name: float_div
120 ; FP32: liveins: $f12, $f14
121 ; FP32: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
122 ; FP32: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
123 ; FP32: [[FDIV_S:%[0-9]+]]:fgr32 = FDIV_S [[COPY]], [[COPY1]]
124 ; FP32: $f0 = COPY [[FDIV_S]]
125 ; FP32: RetRA implicit $f0
126 ; FP64-LABEL: name: float_div
127 ; FP64: liveins: $f12, $f14
128 ; FP64: [[COPY:%[0-9]+]]:fgr32 = COPY $f12
129 ; FP64: [[COPY1:%[0-9]+]]:fgr32 = COPY $f14
130 ; FP64: [[FDIV_S:%[0-9]+]]:fgr32 = FDIV_S [[COPY]], [[COPY1]]
131 ; FP64: $f0 = COPY [[FDIV_S]]
132 ; FP64: RetRA implicit $f0
133 %0:fprb(s32) = COPY $f12
134 %1:fprb(s32) = COPY $f14
135 %2:fprb(s32) = G_FDIV %0, %1
144 regBankSelected: true
145 tracksRegLiveness: true
150 ; FP32-LABEL: name: double_add
151 ; FP32: liveins: $d6, $d7
152 ; FP32: [[COPY:%[0-9]+]]:afgr64 = COPY $d6
153 ; FP32: [[COPY1:%[0-9]+]]:afgr64 = COPY $d7
154 ; FP32: [[FADD_D32_:%[0-9]+]]:afgr64 = FADD_D32 [[COPY]], [[COPY1]]
155 ; FP32: $d0 = COPY [[FADD_D32_]]
156 ; FP32: RetRA implicit $d0
157 ; FP64-LABEL: name: double_add
158 ; FP64: liveins: $d6, $d7
159 ; FP64: [[COPY:%[0-9]+]]:fgr64 = COPY $d6
160 ; FP64: [[COPY1:%[0-9]+]]:fgr64 = COPY $d7
161 ; FP64: [[FADD_D64_:%[0-9]+]]:fgr64 = FADD_D64 [[COPY]], [[COPY1]]
162 ; FP64: $d0 = COPY [[FADD_D64_]]
163 ; FP64: RetRA implicit $d0
164 %0:fprb(s64) = COPY $d6
165 %1:fprb(s64) = COPY $d7
166 %2:fprb(s64) = G_FADD %0, %1
175 regBankSelected: true
176 tracksRegLiveness: true
181 ; FP32-LABEL: name: double_sub
182 ; FP32: liveins: $d6, $d7
183 ; FP32: [[COPY:%[0-9]+]]:afgr64 = COPY $d6
184 ; FP32: [[COPY1:%[0-9]+]]:afgr64 = COPY $d7
185 ; FP32: [[FSUB_D32_:%[0-9]+]]:afgr64 = FSUB_D32 [[COPY]], [[COPY1]]
186 ; FP32: $d0 = COPY [[FSUB_D32_]]
187 ; FP32: RetRA implicit $d0
188 ; FP64-LABEL: name: double_sub
189 ; FP64: liveins: $d6, $d7
190 ; FP64: [[COPY:%[0-9]+]]:fgr64 = COPY $d6
191 ; FP64: [[COPY1:%[0-9]+]]:fgr64 = COPY $d7
192 ; FP64: [[FSUB_D64_:%[0-9]+]]:fgr64 = FSUB_D64 [[COPY]], [[COPY1]]
193 ; FP64: $d0 = COPY [[FSUB_D64_]]
194 ; FP64: RetRA implicit $d0
195 %0:fprb(s64) = COPY $d6
196 %1:fprb(s64) = COPY $d7
197 %2:fprb(s64) = G_FSUB %0, %1
206 regBankSelected: true
207 tracksRegLiveness: true
212 ; FP32-LABEL: name: double_mul
213 ; FP32: liveins: $d6, $d7
214 ; FP32: [[COPY:%[0-9]+]]:afgr64 = COPY $d6
215 ; FP32: [[COPY1:%[0-9]+]]:afgr64 = COPY $d7
216 ; FP32: [[FMUL_D32_:%[0-9]+]]:afgr64 = FMUL_D32 [[COPY]], [[COPY1]]
217 ; FP32: $d0 = COPY [[FMUL_D32_]]
218 ; FP32: RetRA implicit $d0
219 ; FP64-LABEL: name: double_mul
220 ; FP64: liveins: $d6, $d7
221 ; FP64: [[COPY:%[0-9]+]]:fgr64 = COPY $d6
222 ; FP64: [[COPY1:%[0-9]+]]:fgr64 = COPY $d7
223 ; FP64: [[FMUL_D64_:%[0-9]+]]:fgr64 = FMUL_D64 [[COPY]], [[COPY1]]
224 ; FP64: $d0 = COPY [[FMUL_D64_]]
225 ; FP64: RetRA implicit $d0
226 %0:fprb(s64) = COPY $d6
227 %1:fprb(s64) = COPY $d7
228 %2:fprb(s64) = G_FMUL %0, %1
237 regBankSelected: true
238 tracksRegLiveness: true
243 ; FP32-LABEL: name: double_div
244 ; FP32: liveins: $d6, $d7
245 ; FP32: [[COPY:%[0-9]+]]:afgr64 = COPY $d6
246 ; FP32: [[COPY1:%[0-9]+]]:afgr64 = COPY $d7
247 ; FP32: [[FDIV_D32_:%[0-9]+]]:afgr64 = FDIV_D32 [[COPY]], [[COPY1]]
248 ; FP32: $d0 = COPY [[FDIV_D32_]]
249 ; FP32: RetRA implicit $d0
250 ; FP64-LABEL: name: double_div
251 ; FP64: liveins: $d6, $d7
252 ; FP64: [[COPY:%[0-9]+]]:fgr64 = COPY $d6
253 ; FP64: [[COPY1:%[0-9]+]]:fgr64 = COPY $d7
254 ; FP64: [[FDIV_D64_:%[0-9]+]]:fgr64 = FDIV_D64 [[COPY]], [[COPY1]]
255 ; FP64: $d0 = COPY [[FDIV_D64_]]
256 ; FP64: RetRA implicit $d0
257 %0:fprb(s64) = COPY $d6
258 %1:fprb(s64) = COPY $d7
259 %2:fprb(s64) = G_FDIV %0, %1