1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX1150 %s
10 liveins: $sgpr0, $sgpr1
12 ; GFX1150-LABEL: name: fadd_f32
13 ; GFX1150: liveins: $sgpr0, $sgpr1
14 ; GFX1150-NEXT: {{ $}}
15 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
16 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
17 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_ADD_F32 [[COPY]], [[COPY1]], implicit $mode
18 ; GFX1150-NEXT: $sgpr0 = COPY %2
19 %0:sgpr(s32) = COPY $sgpr0
20 %1:sgpr(s32) = COPY $sgpr1
21 %2:sgpr(s32) = G_FADD %0, %1
31 liveins: $sgpr0, $sgpr1
33 ; GFX1150-LABEL: name: fsub_f32
34 ; GFX1150: liveins: $sgpr0, $sgpr1
35 ; GFX1150-NEXT: {{ $}}
36 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
37 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
38 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_SUB_F32 [[COPY]], [[COPY1]], implicit $mode
39 ; GFX1150-NEXT: $sgpr0 = COPY %2
40 %0:sgpr(s32) = COPY $sgpr0
41 %1:sgpr(s32) = COPY $sgpr1
42 %2:sgpr(s32) = G_FSUB %0, %1
52 liveins: $sgpr0, $sgpr1
54 ; GFX1150-LABEL: name: fmul_f32
55 ; GFX1150: liveins: $sgpr0, $sgpr1
56 ; GFX1150-NEXT: {{ $}}
57 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
58 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
59 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_MUL_F32 [[COPY]], [[COPY1]], implicit $mode
60 ; GFX1150-NEXT: $sgpr0 = COPY %2
61 %0:sgpr(s32) = COPY $sgpr0
62 %1:sgpr(s32) = COPY $sgpr1
63 %2:sgpr(s32) = G_FMUL %0, %1
73 liveins: $sgpr0, $sgpr1
75 ; GFX1150-LABEL: name: fmin_f32
76 ; GFX1150: liveins: $sgpr0, $sgpr1
77 ; GFX1150-NEXT: {{ $}}
78 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
79 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
80 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_MIN_F32 [[COPY]], [[COPY1]], implicit $mode
81 ; GFX1150-NEXT: $sgpr0 = COPY %2
82 %0:sgpr(s32) = COPY $sgpr0
83 %1:sgpr(s32) = COPY $sgpr1
84 %2:sgpr(s32) = G_FMINNUM %0, %1
94 liveins: $sgpr0, $sgpr1
96 ; GFX1150-LABEL: name: fmax_f32
97 ; GFX1150: liveins: $sgpr0, $sgpr1
98 ; GFX1150-NEXT: {{ $}}
99 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
100 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
101 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_MAX_F32 [[COPY]], [[COPY1]], implicit $mode
102 ; GFX1150-NEXT: $sgpr0 = COPY %2
103 %0:sgpr(s32) = COPY $sgpr0
104 %1:sgpr(s32) = COPY $sgpr1
105 %2:sgpr(s32) = G_FMAXNUM %0, %1
106 $sgpr0 = COPY %2(s32)
112 regBankSelected: true
115 liveins: $sgpr0, $sgpr1
117 ; GFX1150-LABEL: name: fadd_f16
118 ; GFX1150: liveins: $sgpr0, $sgpr1
119 ; GFX1150-NEXT: {{ $}}
120 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
121 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
122 ; GFX1150-NEXT: %4:sreg_32 = nofpexcept S_ADD_F16 [[COPY]], [[COPY1]], implicit $mode
123 ; GFX1150-NEXT: $sgpr0 = COPY %4
124 %0:sgpr(s32) = COPY $sgpr0
125 %1:sgpr(s16) = G_TRUNC %0(s32)
126 %2:sgpr(s32) = COPY $sgpr1
127 %3:sgpr(s16) = G_TRUNC %2(s32)
128 %4:sgpr(s16) = G_FADD %1, %3
129 %5:sgpr(s32) = G_ANYEXT %4(s16)
130 $sgpr0 = COPY %5(s32)
136 regBankSelected: true
139 liveins: $sgpr0, $sgpr1
141 ; GFX1150-LABEL: name: fsub_f16
142 ; GFX1150: liveins: $sgpr0, $sgpr1
143 ; GFX1150-NEXT: {{ $}}
144 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
145 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
146 ; GFX1150-NEXT: %4:sreg_32 = nofpexcept S_SUB_F16 [[COPY]], [[COPY1]], implicit $mode
147 ; GFX1150-NEXT: $sgpr0 = COPY %4
148 %0:sgpr(s32) = COPY $sgpr0
149 %1:sgpr(s16) = G_TRUNC %0(s32)
150 %2:sgpr(s32) = COPY $sgpr1
151 %3:sgpr(s16) = G_TRUNC %2(s32)
152 %4:sgpr(s16) = G_FSUB %1, %3
153 %5:sgpr(s32) = G_ANYEXT %4(s16)
154 $sgpr0 = COPY %5(s32)
160 regBankSelected: true
163 liveins: $sgpr0, $sgpr1
165 ; GFX1150-LABEL: name: fmul_f16
166 ; GFX1150: liveins: $sgpr0, $sgpr1
167 ; GFX1150-NEXT: {{ $}}
168 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
169 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
170 ; GFX1150-NEXT: %4:sreg_32 = nofpexcept S_MUL_F16 [[COPY]], [[COPY1]], implicit $mode
171 ; GFX1150-NEXT: $sgpr0 = COPY %4
172 %0:sgpr(s32) = COPY $sgpr0
173 %1:sgpr(s16) = G_TRUNC %0(s32)
174 %2:sgpr(s32) = COPY $sgpr1
175 %3:sgpr(s16) = G_TRUNC %2(s32)
176 %4:sgpr(s16) = G_FMUL %1, %3
177 %5:sgpr(s32) = G_ANYEXT %4(s16)
178 $sgpr0 = COPY %5(s32)
184 regBankSelected: true
187 liveins: $sgpr0, $sgpr1
189 ; GFX1150-LABEL: name: fmin_f16
190 ; GFX1150: liveins: $sgpr0, $sgpr1
191 ; GFX1150-NEXT: {{ $}}
192 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
193 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
194 ; GFX1150-NEXT: %4:sreg_32 = nofpexcept S_MIN_F16 [[COPY]], [[COPY1]], implicit $mode
195 ; GFX1150-NEXT: $sgpr0 = COPY %4
196 %0:sgpr(s32) = COPY $sgpr0
197 %1:sgpr(s16) = G_TRUNC %0(s32)
198 %2:sgpr(s32) = COPY $sgpr1
199 %3:sgpr(s16) = G_TRUNC %2(s32)
200 %4:sgpr(s16) = G_FMINNUM %1, %3
201 %5:sgpr(s32) = G_ANYEXT %4(s16)
202 $sgpr0 = COPY %5(s32)
208 regBankSelected: true
211 liveins: $sgpr0, $sgpr1
213 ; GFX1150-LABEL: name: fmax_f16
214 ; GFX1150: liveins: $sgpr0, $sgpr1
215 %0:sgpr(s32) = COPY $sgpr0
216 %1:sgpr(s16) = G_TRUNC %0(s32)
217 %2:sgpr(s32) = COPY $sgpr1
218 %3:sgpr(s16) = G_TRUNC %2(s32)
219 %4:sgpr(s16) = G_FMAXNUM %1, %3
220 %5:sgpr(s32) = G_ANYEXT %4(s16)
224 name: s_cvt_pkrtz_v2f16_f32
226 regBankSelected: true
229 liveins: $sgpr0, $sgpr1
231 ; GFX1150-LABEL: name: s_cvt_pkrtz_v2f16_f32
232 ; GFX1150: liveins: $sgpr0, $sgpr1
233 ; GFX1150-NEXT: {{ $}}
234 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
235 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
236 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_CVT_PK_RTZ_F16_F32 [[COPY]], [[COPY1]], implicit $mode
237 ; GFX1150-NEXT: $sgpr0 = COPY %2
238 %0:sgpr(s32) = COPY $sgpr0
239 %1:sgpr(s32) = COPY $sgpr1
240 %2:sgpr(<2 x s16>) = G_INTRINSIC intrinsic(@llvm.amdgcn.cvt.pkrtz), %0(s32), %1(s32)
241 $sgpr0 = COPY %2(<2 x s16>)
247 regBankSelected: true
250 liveins: $sgpr0, $sgpr1, $sgpr2
252 ; GFX1150-LABEL: name: fmac_f32
253 ; GFX1150: liveins: $sgpr0, $sgpr1, $sgpr2
254 ; GFX1150-NEXT: {{ $}}
255 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
256 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
257 ; GFX1150-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
258 ; GFX1150-NEXT: %3:sreg_32 = nofpexcept S_FMAC_F32 [[COPY1]], [[COPY2]], [[COPY]], implicit $mode
259 ; GFX1150-NEXT: $sgpr0 = COPY %3
260 %0:sgpr(s32) = COPY $sgpr0
261 %1:sgpr(s32) = COPY $sgpr1
262 %2:sgpr(s32) = COPY $sgpr2
263 %3:sgpr(s32) = G_FMA %1, %2, %0
264 $sgpr0 = COPY %3(s32)
270 regBankSelected: true
273 liveins: $sgpr0, $sgpr1, $sgpr2
275 ; GFX1150-LABEL: name: fmac_f16
276 ; GFX1150: liveins: $sgpr0, $sgpr1, $sgpr2
277 ; GFX1150-NEXT: {{ $}}
278 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
279 ; GFX1150-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
280 ; GFX1150-NEXT: [[COPY2:%[0-9]+]]:sreg_32 = COPY $sgpr2
281 ; GFX1150-NEXT: %6:sreg_32 = nofpexcept S_FMAC_F16 [[COPY1]], [[COPY2]], [[COPY]], implicit $mode
282 ; GFX1150-NEXT: $sgpr0 = COPY %6
283 %0:sgpr(s32) = COPY $sgpr0
284 %1:sgpr(s16) = G_TRUNC %0(s32)
285 %2:sgpr(s32) = COPY $sgpr1
286 %3:sgpr(s16) = G_TRUNC %2(s32)
287 %4:sgpr(s32) = COPY $sgpr2
288 %5:sgpr(s16) = G_TRUNC %4(s32)
289 %6:sgpr(s16) = G_FMA %3, %5, %1
290 %7:sgpr(s32) = G_ANYEXT %6(s16)
291 $sgpr0 = COPY %7(s32)