1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+zfh,+d -run-pass=regbankselect \
3 # RUN: -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck %s
5 # RUN: llc -mtriple=riscv64 -mattr=+zfh,+d -run-pass=regbankselect \
6 # RUN: -simplify-mir -verify-machineinstrs %s \
7 # RUN: -o - | FileCheck %s
12 tracksRegLiveness: true
15 liveins: $f10_h, $f11_h
17 ; CHECK-LABEL: name: fadd_f16
18 ; CHECK: liveins: $f10_h, $f11_h
20 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
21 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
22 ; CHECK-NEXT: [[FADD:%[0-9]+]]:fprb(s16) = G_FADD [[COPY]], [[COPY1]]
23 ; CHECK-NEXT: $f10_h = COPY [[FADD]](s16)
24 ; CHECK-NEXT: PseudoRET implicit $f10_h
25 %0:_(s16) = COPY $f10_h
26 %1:_(s16) = COPY $f11_h
27 %2:_(s16) = G_FADD %0, %1
29 PseudoRET implicit $f10_h
35 tracksRegLiveness: true
38 liveins: $f10_h, $f11_h
40 ; CHECK-LABEL: name: fsub_f16
41 ; CHECK: liveins: $f10_h, $f11_h
43 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
44 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
45 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:fprb(s16) = G_FSUB [[COPY]], [[COPY1]]
46 ; CHECK-NEXT: $f10_h = COPY [[FSUB]](s16)
47 ; CHECK-NEXT: PseudoRET implicit $f10_h
48 %0:_(s16) = COPY $f10_h
49 %1:_(s16) = COPY $f11_h
50 %2:_(s16) = G_FSUB %0, %1
52 PseudoRET implicit $f10_h
58 tracksRegLiveness: true
61 liveins: $f10_h, $f11_h
63 ; CHECK-LABEL: name: fmul_f16
64 ; CHECK: liveins: $f10_h, $f11_h
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
67 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
68 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:fprb(s16) = G_FMUL [[COPY]], [[COPY1]]
69 ; CHECK-NEXT: $f10_h = COPY [[FMUL]](s16)
70 ; CHECK-NEXT: PseudoRET implicit $f10_h
71 %0:_(s16) = COPY $f10_h
72 %1:_(s16) = COPY $f11_h
73 %2:_(s16) = G_FMUL %0, %1
75 PseudoRET implicit $f10_h
81 tracksRegLiveness: true
84 liveins: $f10_h, $f11_h
86 ; CHECK-LABEL: name: fdiv_f16
87 ; CHECK: liveins: $f10_h, $f11_h
89 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
91 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:fprb(s16) = G_FDIV [[COPY]], [[COPY1]]
92 ; CHECK-NEXT: $f10_h = COPY [[FDIV]](s16)
93 ; CHECK-NEXT: PseudoRET implicit $f10_h
94 %0:_(s16) = COPY $f10_h
95 %1:_(s16) = COPY $f11_h
96 %2:_(s16) = G_FDIV %0, %1
98 PseudoRET implicit $f10_h
104 tracksRegLiveness: true
107 liveins: $f10_h, $f11_h, $f12_h
109 ; CHECK-LABEL: name: fma_f16
110 ; CHECK: liveins: $f10_h, $f11_h, $f12_h
112 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
113 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
114 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fprb(s16) = COPY $f12_h
115 ; CHECK-NEXT: [[FMA:%[0-9]+]]:fprb(s16) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
116 ; CHECK-NEXT: $f10_h = COPY [[FMA]](s16)
117 ; CHECK-NEXT: PseudoRET implicit $f10_h
118 %0:_(s16) = COPY $f10_h
119 %1:_(s16) = COPY $f11_h
120 %2:_(s16) = COPY $f12_h
121 %3:_(s16) = G_FMA %0, %1, %2
122 $f10_h = COPY %3(s16)
123 PseudoRET implicit $f10_h
129 tracksRegLiveness: true
134 ; CHECK-LABEL: name: fneg_f16
135 ; CHECK: liveins: $f10_h
137 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
138 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:fprb(s16) = G_FNEG [[COPY]]
139 ; CHECK-NEXT: $f10_h = COPY [[FNEG]](s16)
140 ; CHECK-NEXT: PseudoRET implicit $f10_h
141 %0:_(s16) = COPY $f10_h
142 %1:_(s16) = G_FNEG %0
143 $f10_h = COPY %1(s16)
144 PseudoRET implicit $f10_h
150 tracksRegLiveness: true
155 ; CHECK-LABEL: name: fabs_f16
156 ; CHECK: liveins: $f10_h
158 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
159 ; CHECK-NEXT: [[FABS:%[0-9]+]]:fprb(s16) = G_FABS [[COPY]]
160 ; CHECK-NEXT: $f10_h = COPY [[FABS]](s16)
161 ; CHECK-NEXT: PseudoRET implicit $f10_h
162 %0:_(s16) = COPY $f10_h
163 %1:_(s16) = G_FABS %0
164 $f10_h = COPY %1(s16)
165 PseudoRET implicit $f10_h
171 tracksRegLiveness: true
176 ; CHECK-LABEL: name: fsqrt_f16
177 ; CHECK: liveins: $f10_h
179 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
180 ; CHECK-NEXT: [[FSQRT:%[0-9]+]]:fprb(s16) = G_FSQRT [[COPY]]
181 ; CHECK-NEXT: $f10_h = COPY [[FSQRT]](s16)
182 ; CHECK-NEXT: PseudoRET implicit $f10_h
183 %0:_(s16) = COPY $f10_h
184 %1:_(s16) = G_FSQRT %0
185 $f10_h = COPY %1(s16)
186 PseudoRET implicit $f10_h
192 tracksRegLiveness: true
195 liveins: $f10_h, $f11_h
197 ; CHECK-LABEL: name: fmaxnum_f16
198 ; CHECK: liveins: $f10_h, $f11_h
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
201 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
202 ; CHECK-NEXT: [[FMAXNUM:%[0-9]+]]:fprb(s16) = G_FMAXNUM [[COPY]], [[COPY1]]
203 ; CHECK-NEXT: $f10_h = COPY [[FMAXNUM]](s16)
204 ; CHECK-NEXT: PseudoRET implicit $f10_h
205 %0:_(s16) = COPY $f10_h
206 %1:_(s16) = COPY $f11_h
207 %2:_(s16) = G_FMAXNUM %0, %1
208 $f10_h = COPY %2(s16)
209 PseudoRET implicit $f10_h
215 tracksRegLiveness: true
218 liveins: $f10_h, $f11_h
220 ; CHECK-LABEL: name: fminnum_f16
221 ; CHECK: liveins: $f10_h, $f11_h
223 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
224 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
225 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:fprb(s16) = G_FMINNUM [[COPY]], [[COPY1]]
226 ; CHECK-NEXT: $f10_h = COPY [[FMINNUM]](s16)
227 ; CHECK-NEXT: PseudoRET implicit $f10_h
228 %0:_(s16) = COPY $f10_h
229 %1:_(s16) = COPY $f11_h
230 %2:_(s16) = G_FMINNUM %0, %1
231 $f10_h = COPY %2(s16)
232 PseudoRET implicit $f10_h
236 name: fcopysign_f16_f16
238 tracksRegLiveness: true
241 liveins: $f10_h, $f11_h
243 ; CHECK-LABEL: name: fcopysign_f16_f16
244 ; CHECK: liveins: $f10_h, $f11_h
246 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
247 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
248 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
249 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
250 ; CHECK-NEXT: PseudoRET implicit $f10_h
251 %0:_(s16) = COPY $f10_h
252 %1:_(s16) = COPY $f11_h
253 %2:_(s16) = G_FCOPYSIGN %0, %1
254 $f10_h = COPY %2(s16)
255 PseudoRET implicit $f10_h
259 name: fcopysign_f16_f32
261 tracksRegLiveness: true
264 liveins: $f10_h, $f11_f
266 ; CHECK-LABEL: name: fcopysign_f16_f32
267 ; CHECK: liveins: $f10_h, $f11_f
269 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
270 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
271 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s32)
272 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
273 ; CHECK-NEXT: PseudoRET implicit $f10_h
274 %0:_(s16) = COPY $f10_h
275 %1:_(s32) = COPY $f11_f
276 %2:_(s16) = G_FCOPYSIGN %0, %1
277 $f10_h = COPY %2(s16)
278 PseudoRET implicit $f10_h
282 name: fcopysign_f32_f16
284 tracksRegLiveness: true
287 liveins: $f10_f, $f11_h
289 ; CHECK-LABEL: name: fcopysign_f32_f16
290 ; CHECK: liveins: $f10_f, $f11_h
292 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
293 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
294 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s32) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
295 ; CHECK-NEXT: $f10_f = COPY [[FCOPYSIGN]](s32)
296 ; CHECK-NEXT: PseudoRET implicit $f10_f
297 %0:_(s32) = COPY $f10_f
298 %1:_(s16) = COPY $f11_h
299 %2:_(s32) = G_FCOPYSIGN %0, %1
300 $f10_f = COPY %2(s32)
301 PseudoRET implicit $f10_f
305 name: fcopysign_f16_f64
307 tracksRegLiveness: true
310 liveins: $f10_h, $f11_d
312 ; CHECK-LABEL: name: fcopysign_f16_f64
313 ; CHECK: liveins: $f10_h, $f11_d
315 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s16) = COPY $f10_h
316 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
317 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s64)
318 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
319 ; CHECK-NEXT: PseudoRET implicit $f10_h
320 %0:_(s16) = COPY $f10_h
321 %1:_(s64) = COPY $f11_d
322 %2:_(s16) = G_FCOPYSIGN %0, %1
323 $f10_h = COPY %2(s16)
324 PseudoRET implicit $f10_h
328 name: fcopysign_f64_f16
330 tracksRegLiveness: true
333 liveins: $f10_d, $f11_h
335 ; CHECK-LABEL: name: fcopysign_f64_f16
336 ; CHECK: liveins: $f10_d, $f11_h
338 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
339 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s16) = COPY $f11_h
340 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s64) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
341 ; CHECK-NEXT: $f10_d = COPY [[FCOPYSIGN]](s64)
342 ; CHECK-NEXT: PseudoRET implicit $f10_d
343 %0:_(s64) = COPY $f10_d
344 %1:_(s16) = COPY $f11_h
345 %2:_(s64) = G_FCOPYSIGN %0, %1
346 $f10_d = COPY %2(s64)
347 PseudoRET implicit $f10_d