1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=amdgpu-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
5 name: uitofp_char_to_f32
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: uitofp_char_to_f32
12 ; CHECK: liveins: $vgpr0
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
15 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
16 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
17 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
18 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
19 %0:_(s32) = COPY $vgpr0
20 %1:_(s32) = G_CONSTANT i32 255
21 %2:_(s32) = G_AND %0, %1
22 %3:_(s32) = G_UITOFP %2
27 name: uitofp_too_many_bits_to_f32
28 tracksRegLiveness: true
33 ; CHECK-LABEL: name: uitofp_too_many_bits_to_f32
34 ; CHECK: liveins: $vgpr0
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
37 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 256
38 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
39 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s32)
40 ; CHECK-NEXT: $vgpr0 = COPY [[UITOFP]](s32)
41 %0:_(s32) = COPY $vgpr0
42 %1:_(s32) = G_CONSTANT i32 256
43 %2:_(s32) = G_AND %0, %1
44 %3:_(s32) = G_UITOFP %2
49 name: sitofp_char_to_f32
50 tracksRegLiveness: true
55 ; CHECK-LABEL: name: sitofp_char_to_f32
56 ; CHECK: liveins: $vgpr0
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
59 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
60 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
61 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
62 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
63 %0:_(s32) = COPY $vgpr0
64 %1:_(s32) = G_CONSTANT i32 255
65 %2:_(s32) = G_AND %0, %1
66 %3:_(s32) = G_SITOFP %2
71 name: sitofp_bits127_to_f32
72 tracksRegLiveness: true
77 ; CHECK-LABEL: name: sitofp_bits127_to_f32
78 ; CHECK: liveins: $vgpr0
80 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
81 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
82 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
83 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
84 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
85 %0:_(s32) = COPY $vgpr0
86 %1:_(s32) = G_CONSTANT i32 127
87 %2:_(s32) = G_AND %0, %1
88 %3:_(s32) = G_SITOFP %2
93 name: sitofp_bits128_to_f32
94 tracksRegLiveness: true
99 ; CHECK-LABEL: name: sitofp_bits128_to_f32
100 ; CHECK: liveins: $vgpr0
102 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
103 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 128
104 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
105 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
106 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
107 %0:_(s32) = COPY $vgpr0
108 %1:_(s32) = G_CONSTANT i32 128
109 %2:_(s32) = G_AND %0, %1
110 %3:_(s32) = G_SITOFP %2
114 name: sitofp_too_many_bits_to_f32
115 tracksRegLiveness: true
120 ; CHECK-LABEL: name: sitofp_too_many_bits_to_f32
121 ; CHECK: liveins: $vgpr0
123 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
124 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 256
125 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
126 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[AND]](s32)
127 ; CHECK-NEXT: $vgpr0 = COPY [[SITOFP]](s32)
128 %0:_(s32) = COPY $vgpr0
129 %1:_(s32) = G_CONSTANT i32 256
130 %2:_(s32) = G_AND %0, %1
131 %3:_(s32) = G_SITOFP %2
136 name: uitofp_char_to_f16
137 tracksRegLiveness: true
142 ; CHECK-LABEL: name: uitofp_char_to_f16
143 ; CHECK: liveins: $vgpr0
145 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
146 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
147 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
148 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
149 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[AMDGPU_CVT_F32_UBYTE0_]](s32)
150 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
151 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
152 %0:_(s32) = COPY $vgpr0
153 %1:_(s32) = G_CONSTANT i32 255
154 %2:_(s32) = G_AND %0, %1
155 %3:_(s16) = G_UITOFP %2
156 %4:_(s32) = G_ANYEXT %3
161 name: sitofp_char_to_f16
162 tracksRegLiveness: true
167 ; CHECK-LABEL: name: sitofp_char_to_f16
168 ; CHECK: liveins: $vgpr0
170 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
171 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
172 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
173 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[AND]]
174 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[AMDGPU_CVT_F32_UBYTE0_]](s32)
175 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
176 ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
177 %0:_(s32) = COPY $vgpr0
178 %1:_(s32) = G_CONSTANT i32 255
179 %2:_(s32) = G_AND %0, %1
180 %3:_(s16) = G_SITOFP %2
181 %4:_(s32) = G_ANYEXT %3
186 name: uitofp_s64_char_to_f32
187 tracksRegLiveness: true
190 liveins: $vgpr0_vgpr1
192 ; CHECK-LABEL: name: uitofp_s64_char_to_f32
193 ; CHECK: liveins: $vgpr0_vgpr1
195 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
196 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
197 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
198 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[AND]](s64)
199 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[TRUNC]]
200 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
201 %0:_(s64) = COPY $vgpr0_vgpr1
202 %1:_(s64) = G_CONSTANT i64 255
203 %2:_(s64) = G_AND %0, %1
204 %3:_(s32) = G_UITOFP %2
209 name: sitofp_s64_char_to_f32
210 tracksRegLiveness: true
213 liveins: $vgpr0_vgpr1
215 ; CHECK-LABEL: name: sitofp_s64_char_to_f32
216 ; CHECK: liveins: $vgpr0_vgpr1
218 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
219 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
220 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
221 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[AND]](s64)
222 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[TRUNC]]
223 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
224 %0:_(s64) = COPY $vgpr0_vgpr1
225 %1:_(s64) = G_CONSTANT i64 255
226 %2:_(s64) = G_AND %0, %1
227 %3:_(s32) = G_SITOFP %2
232 name: uitofp_s16_char_to_f32
233 tracksRegLiveness: true
238 ; CHECK-LABEL: name: uitofp_s16_char_to_f32
239 ; CHECK: liveins: $vgpr0
241 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
242 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
243 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
244 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
245 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[AND]](s16)
246 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[ANYEXT]]
247 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
248 %0:_(s32) = COPY $vgpr0
249 %1:_(s16) = G_TRUNC %0
250 %2:_(s16) = G_CONSTANT i16 255
251 %3:_(s16) = G_AND %1, %2
252 %4:_(s32) = G_UITOFP %3
257 name: sitofp_s16_char_to_f32
258 tracksRegLiveness: true
263 ; CHECK-LABEL: name: sitofp_s16_char_to_f32
264 ; CHECK: liveins: $vgpr0
266 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
267 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
268 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
269 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C]]
270 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[AND]](s16)
271 ; CHECK-NEXT: [[AMDGPU_CVT_F32_UBYTE0_:%[0-9]+]]:_(s32) = G_AMDGPU_CVT_F32_UBYTE0 [[ANYEXT]]
272 ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CVT_F32_UBYTE0_]](s32)
273 %0:_(s32) = COPY $vgpr0
274 %1:_(s16) = G_TRUNC %0
275 %2:_(s16) = G_CONSTANT i16 255
276 %3:_(s16) = G_AND %1, %2
277 %4:_(s32) = G_SITOFP %3