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
5 name: sitofp_i32_to_f32
12 ; GFX1150-LABEL: name: sitofp_i32_to_f32
13 ; GFX1150: liveins: $sgpr0
14 ; GFX1150-NEXT: {{ $}}
15 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
16 ; GFX1150-NEXT: [[S_CVT_F32_I32_:%[0-9]+]]:sreg_32 = S_CVT_F32_I32 [[COPY]], implicit $mode
17 ; GFX1150-NEXT: $sgpr0 = COPY [[S_CVT_F32_I32_]]
18 %0:sgpr(s32) = COPY $sgpr0
19 %1:sgpr(s32) = G_SITOFP %0(s32)
24 name: uitofp_u32_to_f32
31 ; GFX1150-LABEL: name: uitofp_u32_to_f32
32 ; GFX1150: liveins: $sgpr0
33 ; GFX1150-NEXT: {{ $}}
34 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
35 ; GFX1150-NEXT: [[S_CVT_F32_U32_:%[0-9]+]]:sreg_32 = S_CVT_F32_U32 [[COPY]], implicit $mode
36 ; GFX1150-NEXT: $sgpr0 = COPY [[S_CVT_F32_U32_]]
37 %0:sgpr(s32) = COPY $sgpr0
38 %1:sgpr(s32) = G_UITOFP %0(s32)
43 name: fptosi_f32_to_i32
50 ; GFX1150-LABEL: name: fptosi_f32_to_i32
51 ; GFX1150: liveins: $sgpr0
52 ; GFX1150-NEXT: {{ $}}
53 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
54 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_CVT_I32_F32 [[COPY]], implicit $mode
55 ; GFX1150-NEXT: $sgpr0 = COPY %1
56 %0:sgpr(s32) = COPY $sgpr0
57 %1:sgpr(s32) = G_FPTOSI %0(s32)
62 name: fptoui_f32_to_u32
69 ; GFX1150-LABEL: name: fptoui_f32_to_u32
70 ; GFX1150: liveins: $sgpr0
71 ; GFX1150-NEXT: {{ $}}
72 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
73 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_CVT_U32_F32 [[COPY]], implicit $mode
74 ; GFX1150-NEXT: $sgpr0 = COPY %1
75 %0:sgpr(s32) = COPY $sgpr0
76 %1:sgpr(s32) = G_FPTOUI %0(s32)
81 name: fpext_f16_to_f32
88 ; GFX1150-LABEL: name: fpext_f16_to_f32
89 ; GFX1150: liveins: $sgpr0
90 ; GFX1150-NEXT: {{ $}}
91 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
92 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_CVT_F32_F16 [[COPY]], implicit $mode
93 ; GFX1150-NEXT: $sgpr0 = COPY %2
94 %0:sgpr(s32) = COPY $sgpr0
95 %1:sgpr(s16) = G_TRUNC %0(s32)
96 %2:sgpr(s32) = G_FPEXT %1(s16)
101 name: fpext_hif16_to_32
103 regBankSelected: true
108 ; GFX1150-LABEL: name: fpext_hif16_to_32
109 ; GFX1150: liveins: $sgpr0
110 ; GFX1150-NEXT: {{ $}}
111 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
112 ; GFX1150-NEXT: [[S_CVT_HI_F32_F16_:%[0-9]+]]:sreg_32 = S_CVT_HI_F32_F16 [[COPY]], implicit $mode
113 ; GFX1150-NEXT: $sgpr0 = COPY [[S_CVT_HI_F32_F16_]]
114 %0:sgpr(<2 x s16>) = COPY $sgpr0
115 %2:sgpr(s32) = G_BITCAST %0(<2 x s16>)
116 %3:sgpr(s32) = G_CONSTANT i32 16
117 %4:sgpr(s32) = G_LSHR %2, %3(s32)
118 %5:sgpr(s16) = G_TRUNC %4(s32)
119 %6:sgpr(s32) = G_FPEXT %5(s16)
120 $sgpr0 = COPY %6(s32)
124 name: fptrunc_f32_to_f16
126 regBankSelected: true
131 ; GFX1150-LABEL: name: fptrunc_f32_to_f16
132 ; GFX1150: liveins: $sgpr0
133 ; GFX1150-NEXT: {{ $}}
134 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
135 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_CVT_F16_F32 [[COPY]], implicit $mode
136 ; GFX1150-NEXT: $sgpr0 = COPY %1
137 %0:sgpr(s32) = COPY $sgpr0
138 %1:sgpr(s16) = G_FPTRUNC %0(s32)
139 %2:sgpr(s32) = G_ANYEXT %1(s16)
140 $sgpr0 = COPY %2(s32)
146 regBankSelected: true
151 ; GFX1150-LABEL: name: fceil_f32
152 ; GFX1150: liveins: $sgpr0
153 ; GFX1150-NEXT: {{ $}}
154 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
155 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_CEIL_F32 [[COPY]], implicit $mode
156 ; GFX1150-NEXT: $sgpr0 = COPY %1
157 %0:sgpr(s32) = COPY $sgpr0
158 %1:sgpr(s32) = G_FCEIL %0
159 $sgpr0 = COPY %1(s32)
165 regBankSelected: true
170 ; GFX1150-LABEL: name: ffloor_f32
171 ; GFX1150: liveins: $sgpr0
172 ; GFX1150-NEXT: {{ $}}
173 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
174 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_FLOOR_F32 [[COPY]], implicit $mode
175 ; GFX1150-NEXT: $sgpr0 = COPY %1
176 %0:sgpr(s32) = COPY $sgpr0
177 %1:sgpr(s32) = G_FFLOOR %0
178 $sgpr0 = COPY %1(s32)
184 regBankSelected: true
189 ; GFX1150-LABEL: name: ftrunc_f32
190 ; GFX1150: liveins: $sgpr0
191 ; GFX1150-NEXT: {{ $}}
192 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
193 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_TRUNC_F32 [[COPY]], implicit $mode
194 ; GFX1150-NEXT: $sgpr0 = COPY %1
195 %0:sgpr(s32) = COPY $sgpr0
196 %1:sgpr(s32) = G_INTRINSIC_TRUNC %0
197 $sgpr0 = COPY %1(s32)
203 regBankSelected: true
208 ; GFX1150-LABEL: name: frint_f32
209 ; GFX1150: liveins: $sgpr0
210 ; GFX1150-NEXT: {{ $}}
211 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
212 ; GFX1150-NEXT: %1:sreg_32 = nofpexcept S_RNDNE_F32 [[COPY]], implicit $mode
213 ; GFX1150-NEXT: $sgpr0 = COPY %1
214 %0:sgpr(s32) = COPY $sgpr0
215 %1:sgpr(s32) = G_INTRINSIC_ROUNDEVEN %0
216 $sgpr0 = COPY %1(s32)
222 regBankSelected: true
227 ; GFX1150-LABEL: name: fceil_f16
228 ; GFX1150: liveins: $sgpr0
229 ; GFX1150-NEXT: {{ $}}
230 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
231 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_CEIL_F16 [[COPY]], implicit $mode
232 ; GFX1150-NEXT: $sgpr0 = COPY %2
233 %0:sgpr(s32) = COPY $sgpr0
234 %1:sgpr(s16) = G_TRUNC %0(s32)
235 %2:sgpr(s16) = G_FCEIL %1
236 %3:sgpr(s32) = G_ANYEXT %2(s16)
237 $sgpr0 = COPY %3(s32)
243 regBankSelected: true
248 ; GFX1150-LABEL: name: ffloor_f16
249 ; GFX1150: liveins: $sgpr0
250 ; GFX1150-NEXT: {{ $}}
251 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
252 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_FLOOR_F16 [[COPY]], implicit $mode
253 ; GFX1150-NEXT: $sgpr0 = COPY %2
254 %0:sgpr(s32) = COPY $sgpr0
255 %1:sgpr(s16) = G_TRUNC %0(s32)
256 %2:sgpr(s16) = G_FFLOOR %1
257 %3:sgpr(s32) = G_ANYEXT %2(s16)
258 $sgpr0 = COPY %3(s32)
264 regBankSelected: true
269 ; GFX1150-LABEL: name: ftrunc_f16
270 ; GFX1150: liveins: $sgpr0
271 ; GFX1150-NEXT: {{ $}}
272 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
273 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_TRUNC_F16 [[COPY]], implicit $mode
274 ; GFX1150-NEXT: $sgpr0 = COPY %2
275 %0:sgpr(s32) = COPY $sgpr0
276 %1:sgpr(s16) = G_TRUNC %0(s32)
277 %2:sgpr(s16) = G_INTRINSIC_TRUNC %1
278 %3:sgpr(s32) = G_ANYEXT %2(s16)
279 $sgpr0 = COPY %3(s32)
285 regBankSelected: true
290 ; GFX1150-LABEL: name: frint_f16
291 ; GFX1150: liveins: $sgpr0
292 ; GFX1150-NEXT: {{ $}}
293 ; GFX1150-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
294 ; GFX1150-NEXT: %2:sreg_32 = nofpexcept S_RNDNE_F16 [[COPY]], implicit $mode
295 ; GFX1150-NEXT: $sgpr0 = COPY %2
296 %0:sgpr(s32) = COPY $sgpr0
297 %1:sgpr(s16) = G_TRUNC %0(s32)
298 %2:sgpr(s16) = G_INTRINSIC_ROUNDEVEN %1
299 %3:sgpr(s32) = G_ANYEXT %2(s16)
300 $sgpr0 = COPY %3(s32)