1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+zfh,+d -run-pass=legalizer %s -o - \
4 # RUN: llc -mtriple=riscv64 -mattr=+zfh,+d -run-pass=legalizer %s -o - \
11 liveins: $f10_h, $f11_h
13 ; CHECK-LABEL: name: fadd_f16
14 ; CHECK: liveins: $f10_h, $f11_h
16 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
17 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
18 ; CHECK-NEXT: [[FADD:%[0-9]+]]:_(s16) = G_FADD [[COPY]], [[COPY1]]
19 ; CHECK-NEXT: $f10_h = COPY [[FADD]](s16)
20 ; CHECK-NEXT: PseudoRET implicit $f10_h
21 %0:_(s16) = COPY $f10_h
22 %1:_(s16) = COPY $f11_h
23 %2:_(s16) = G_FADD %0, %1
25 PseudoRET implicit $f10_h
32 liveins: $f10_h, $f11_h
34 ; CHECK-LABEL: name: fsub_f16
35 ; CHECK: liveins: $f10_h, $f11_h
37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
38 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
39 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:_(s16) = G_FSUB [[COPY]], [[COPY1]]
40 ; CHECK-NEXT: $f10_h = COPY [[FSUB]](s16)
41 ; CHECK-NEXT: PseudoRET implicit $f10_h
42 %0:_(s16) = COPY $f10_h
43 %1:_(s16) = COPY $f11_h
44 %2:_(s16) = G_FSUB %0, %1
46 PseudoRET implicit $f10_h
53 liveins: $f10_h, $f11_h
55 ; CHECK-LABEL: name: fmul_f16
56 ; CHECK: liveins: $f10_h, $f11_h
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
59 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
60 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:_(s16) = G_FMUL [[COPY]], [[COPY1]]
61 ; CHECK-NEXT: $f10_h = COPY [[FMUL]](s16)
62 ; CHECK-NEXT: PseudoRET implicit $f10_h
63 %0:_(s16) = COPY $f10_h
64 %1:_(s16) = COPY $f11_h
65 %2:_(s16) = G_FMUL %0, %1
67 PseudoRET implicit $f10_h
74 liveins: $f10_h, $f11_h
76 ; CHECK-LABEL: name: fdiv_f16
77 ; CHECK: liveins: $f10_h, $f11_h
79 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
80 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
81 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:_(s16) = G_FDIV [[COPY]], [[COPY1]]
82 ; CHECK-NEXT: $f10_h = COPY [[FDIV]](s16)
83 ; CHECK-NEXT: PseudoRET implicit $f10_h
84 %0:_(s16) = COPY $f10_h
85 %1:_(s16) = COPY $f11_h
86 %2:_(s16) = G_FDIV %0, %1
88 PseudoRET implicit $f10_h
95 liveins: $f10_h, $f11_h, $f12_h
97 ; CHECK-LABEL: name: fma_f16
98 ; CHECK: liveins: $f10_h, $f11_h, $f12_h
100 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
101 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
102 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s16) = COPY $f12_h
103 ; CHECK-NEXT: [[FMA:%[0-9]+]]:_(s16) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
104 ; CHECK-NEXT: $f10_h = COPY [[FMA]](s16)
105 ; CHECK-NEXT: PseudoRET implicit $f10_h
106 %0:_(s16) = COPY $f10_h
107 %1:_(s16) = COPY $f11_h
108 %2:_(s16) = COPY $f12_h
109 %3:_(s16) = G_FMA %0, %1, %2
110 $f10_h = COPY %3(s16)
111 PseudoRET implicit $f10_h
120 ; CHECK-LABEL: name: fneg_f16
121 ; CHECK: liveins: $f10_h
123 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
124 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:_(s16) = G_FNEG [[COPY]]
125 ; CHECK-NEXT: $f10_h = COPY [[FNEG]](s16)
126 ; CHECK-NEXT: PseudoRET implicit $f10_h
127 %0:_(s16) = COPY $f10_h
128 %1:_(s16) = G_FNEG %0
129 $f10_h = COPY %1(s16)
130 PseudoRET implicit $f10_h
139 ; CHECK-LABEL: name: fabs_f16
140 ; CHECK: liveins: $f10_h
142 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
143 ; CHECK-NEXT: [[FABS:%[0-9]+]]:_(s16) = G_FABS [[COPY]]
144 ; CHECK-NEXT: $f10_h = COPY [[FABS]](s16)
145 ; CHECK-NEXT: PseudoRET implicit $f10_h
146 %0:_(s16) = COPY $f10_h
147 %1:_(s16) = G_FABS %0
148 $f10_h = COPY %1(s16)
149 PseudoRET implicit $f10_h
158 ; CHECK-LABEL: name: fsqrt_f16
159 ; CHECK: liveins: $f10_h
161 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
162 ; CHECK-NEXT: [[FSQRT:%[0-9]+]]:_(s16) = G_FSQRT [[COPY]]
163 ; CHECK-NEXT: $f10_h = COPY [[FSQRT]](s16)
164 ; CHECK-NEXT: PseudoRET implicit $f10_h
165 %0:_(s16) = COPY $f10_h
166 %1:_(s16) = G_FSQRT %0
167 $f10_h = COPY %1(s16)
168 PseudoRET implicit $f10_h
175 liveins: $f10_h, $f11_h
177 ; CHECK-LABEL: name: fmaxnum_f16
178 ; CHECK: liveins: $f10_h, $f11_h
180 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
181 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
182 ; CHECK-NEXT: [[FMAXNUM:%[0-9]+]]:_(s16) = G_FMAXNUM [[COPY]], [[COPY1]]
183 ; CHECK-NEXT: $f10_h = COPY [[FMAXNUM]](s16)
184 ; CHECK-NEXT: PseudoRET implicit $f10_h
185 %0:_(s16) = COPY $f10_h
186 %1:_(s16) = COPY $f11_h
187 %2:_(s16) = G_FMAXNUM %0, %1
188 $f10_h = COPY %2(s16)
189 PseudoRET implicit $f10_h
196 liveins: $f10_h, $f11_h
198 ; CHECK-LABEL: name: fminnum_f16
199 ; CHECK: liveins: $f10_h, $f11_h
201 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
202 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
203 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:_(s16) = G_FMINNUM [[COPY]], [[COPY1]]
204 ; CHECK-NEXT: $f10_h = COPY [[FMINNUM]](s16)
205 ; CHECK-NEXT: PseudoRET implicit $f10_h
206 %0:_(s16) = COPY $f10_h
207 %1:_(s16) = COPY $f11_h
208 %2:_(s16) = G_FMINNUM %0, %1
209 $f10_h = COPY %2(s16)
210 PseudoRET implicit $f10_h
214 name: fcopysign_f16_f16
217 liveins: $f10_h, $f11_h
219 ; CHECK-LABEL: name: fcopysign_f16_f16
220 ; CHECK: liveins: $f10_h, $f11_h
222 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
223 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
224 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:_(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
225 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
226 ; CHECK-NEXT: PseudoRET implicit $f10_h
227 %0:_(s16) = COPY $f10_h
228 %1:_(s16) = COPY $f11_h
229 %2:_(s16) = G_FCOPYSIGN %0, %1
230 $f10_h = COPY %2(s16)
231 PseudoRET implicit $f10_h
235 name: fcopysign_f16_f32
238 liveins: $f10_h, $f11_f
240 ; CHECK-LABEL: name: fcopysign_f16_f32
241 ; CHECK: liveins: $f10_h, $f11_f
243 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
244 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $f11_f
245 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:_(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s32)
246 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
247 ; CHECK-NEXT: PseudoRET implicit $f10_h
248 %0:_(s16) = COPY $f10_h
249 %1:_(s32) = COPY $f11_f
250 %2:_(s16) = G_FCOPYSIGN %0, %1
251 $f10_h = COPY %2(s16)
252 PseudoRET implicit $f10_h
256 name: fcopysign_f32_f16
259 liveins: $f10_f, $f11_h
261 ; CHECK-LABEL: name: fcopysign_f32_f16
262 ; CHECK: liveins: $f10_f, $f11_h
264 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
265 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
266 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:_(s32) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
267 ; CHECK-NEXT: $f10_f = COPY [[FCOPYSIGN]](s32)
268 ; CHECK-NEXT: PseudoRET implicit $f10_f
269 %0:_(s32) = COPY $f10_f
270 %1:_(s16) = COPY $f11_h
271 %2:_(s32) = G_FCOPYSIGN %0, %1
272 $f10_f = COPY %2(s32)
273 PseudoRET implicit $f10_f
277 name: fcopysign_f16_f64
280 liveins: $f10_h, $f11_d
282 ; CHECK-LABEL: name: fcopysign_f16_f64
283 ; CHECK: liveins: $f10_h, $f11_d
285 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
286 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $f11_d
287 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:_(s16) = G_FCOPYSIGN [[COPY]], [[COPY1]](s64)
288 ; CHECK-NEXT: $f10_h = COPY [[FCOPYSIGN]](s16)
289 ; CHECK-NEXT: PseudoRET implicit $f10_h
290 %0:_(s16) = COPY $f10_h
291 %1:_(s64) = COPY $f11_d
292 %2:_(s16) = G_FCOPYSIGN %0, %1
293 $f10_h = COPY %2(s16)
294 PseudoRET implicit $f10_h
298 name: fcopysign_f64_f16
301 liveins: $f10_d, $f11_h
303 ; CHECK-LABEL: name: fcopysign_f64_f16
304 ; CHECK: liveins: $f10_d, $f11_h
306 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
307 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s16) = COPY $f11_h
308 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:_(s64) = G_FCOPYSIGN [[COPY]], [[COPY1]](s16)
309 ; CHECK-NEXT: $f10_d = COPY [[FCOPYSIGN]](s64)
310 ; CHECK-NEXT: PseudoRET implicit $f10_d
311 %0:_(s64) = COPY $f10_d
312 %1:_(s16) = COPY $f11_h
313 %2:_(s64) = G_FCOPYSIGN %0, %1
314 $f10_d = COPY %2(s64)
315 PseudoRET implicit $f10_d