1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck -check-prefix=GFX8 %s
6 name: test_sitofp_s32_to_s32
11 ; GFX6-LABEL: name: test_sitofp_s32_to_s32
12 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
13 ; GFX6: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
14 ; GFX6: $vgpr0 = COPY [[SITOFP]](s32)
15 ; GFX8-LABEL: name: test_sitofp_s32_to_s32
16 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
17 ; GFX8: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s32)
18 ; GFX8: $vgpr0 = COPY [[SITOFP]](s32)
19 %0:_(s32) = COPY $vgpr0
20 %1:_(s32) = G_SITOFP %0
25 name: test_sitofp_s32_to_s64
30 ; GFX6-LABEL: name: test_sitofp_s32_to_s64
31 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
32 ; GFX6: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
33 ; GFX6: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
34 ; GFX8-LABEL: name: test_sitofp_s32_to_s64
35 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
36 ; GFX8: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s32)
37 ; GFX8: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
38 %0:_(s32) = COPY $vgpr0
39 %1:_(s64) = G_SITOFP %0
40 $vgpr0_vgpr1 = COPY %1
44 name: test_sitofp_v2s32_to_v2s32
49 ; GFX6-LABEL: name: test_sitofp_v2s32_to_v2s32
50 ; GFX6: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
51 ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
52 ; GFX6: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[UV]](s32)
53 ; GFX6: [[SITOFP1:%[0-9]+]]:_(s32) = G_SITOFP [[UV1]](s32)
54 ; GFX6: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SITOFP]](s32), [[SITOFP1]](s32)
55 ; GFX6: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
56 ; GFX8-LABEL: name: test_sitofp_v2s32_to_v2s32
57 ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
58 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
59 ; GFX8: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[UV]](s32)
60 ; GFX8: [[SITOFP1:%[0-9]+]]:_(s32) = G_SITOFP [[UV1]](s32)
61 ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SITOFP]](s32), [[SITOFP1]](s32)
62 ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
63 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
64 %1:_(<2 x s32>) = G_SITOFP %0
65 $vgpr0_vgpr1 = COPY %1
69 name: test_sitofp_v2s32_to_v2s64
74 ; GFX6-LABEL: name: test_sitofp_v2s32_to_v2s64
75 ; GFX6: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
76 ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
77 ; GFX6: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[UV]](s32)
78 ; GFX6: [[SITOFP1:%[0-9]+]]:_(s64) = G_SITOFP [[UV1]](s32)
79 ; GFX6: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[SITOFP]](s64), [[SITOFP1]](s64)
80 ; GFX6: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
81 ; GFX8-LABEL: name: test_sitofp_v2s32_to_v2s64
82 ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
83 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
84 ; GFX8: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[UV]](s32)
85 ; GFX8: [[SITOFP1:%[0-9]+]]:_(s64) = G_SITOFP [[UV1]](s32)
86 ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[SITOFP]](s64), [[SITOFP1]](s64)
87 ; GFX8: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
88 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
89 %1:_(<2 x s64>) = G_SITOFP %0
90 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
94 name: test_sitofp_s64_to_s32
99 ; GFX6-LABEL: name: test_sitofp_s64_to_s32
100 ; GFX6: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
101 ; GFX6: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
102 ; GFX6: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
103 ; GFX6: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[TRUNC]](s32)
104 ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
105 ; GFX6: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[ASHR]](s64)
106 ; GFX6: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV2]]
107 ; GFX6: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDO1]]
108 ; GFX6: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32)
109 ; GFX6: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[MV]], [[ASHR]]
110 ; GFX6: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
111 ; GFX6: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
112 ; GFX6: [[CTLZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTLZ_ZERO_UNDEF [[XOR]](s64)
113 ; GFX6: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 190
114 ; GFX6: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C3]], [[CTLZ_ZERO_UNDEF]]
115 ; GFX6: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[XOR]](s64), [[C2]]
116 ; GFX6: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[SUB]], [[C1]]
117 ; GFX6: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 9223372036854775807
118 ; GFX6: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[XOR]], [[CTLZ_ZERO_UNDEF]](s32)
119 ; GFX6: [[AND:%[0-9]+]]:_(s64) = G_AND [[SHL]], [[C4]]
120 ; GFX6: [[C5:%[0-9]+]]:_(s64) = G_CONSTANT i64 1099511627775
121 ; GFX6: [[AND1:%[0-9]+]]:_(s64) = G_AND [[AND]], [[C5]]
122 ; GFX6: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 40
123 ; GFX6: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[C6]](s64)
124 ; GFX6: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[AND]], [[TRUNC1]](s32)
125 ; GFX6: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
126 ; GFX6: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[SELECT]], [[C7]](s32)
127 ; GFX6: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
128 ; GFX6: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL1]], [[TRUNC2]]
129 ; GFX6: [[C8:%[0-9]+]]:_(s64) = G_CONSTANT i64 549755813888
130 ; GFX6: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[AND1]](s64), [[C8]]
131 ; GFX6: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[AND1]](s64), [[C8]]
132 ; GFX6: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
133 ; GFX6: [[AND2:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C9]]
134 ; GFX6: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s1), [[AND2]], [[C1]]
135 ; GFX6: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[C9]], [[SELECT1]]
136 ; GFX6: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[OR]], [[SELECT2]]
137 ; GFX6: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[XOR]](s64)
138 ; GFX6: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[UITOFP]]
139 ; GFX6: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[ASHR]](s64), [[C2]]
140 ; GFX6: [[SELECT3:%[0-9]+]]:_(s32) = G_SELECT [[ICMP3]](s1), [[FNEG]], [[UITOFP]]
141 ; GFX6: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
142 ; GFX6: $vgpr0 = COPY [[SITOFP]](s32)
143 ; GFX8-LABEL: name: test_sitofp_s64_to_s32
144 ; GFX8: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
145 ; GFX8: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
146 ; GFX8: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
147 ; GFX8: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[TRUNC]](s32)
148 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
149 ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[ASHR]](s64)
150 ; GFX8: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[UV]], [[UV2]]
151 ; GFX8: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDO1]]
152 ; GFX8: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDO]](s32), [[UADDE]](s32)
153 ; GFX8: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[MV]], [[ASHR]]
154 ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
155 ; GFX8: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
156 ; GFX8: [[CTLZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTLZ_ZERO_UNDEF [[XOR]](s64)
157 ; GFX8: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 190
158 ; GFX8: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C3]], [[CTLZ_ZERO_UNDEF]]
159 ; GFX8: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[XOR]](s64), [[C2]]
160 ; GFX8: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s1), [[SUB]], [[C1]]
161 ; GFX8: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 9223372036854775807
162 ; GFX8: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[XOR]], [[CTLZ_ZERO_UNDEF]](s32)
163 ; GFX8: [[AND:%[0-9]+]]:_(s64) = G_AND [[SHL]], [[C4]]
164 ; GFX8: [[C5:%[0-9]+]]:_(s64) = G_CONSTANT i64 1099511627775
165 ; GFX8: [[AND1:%[0-9]+]]:_(s64) = G_AND [[AND]], [[C5]]
166 ; GFX8: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 40
167 ; GFX8: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[C6]](s64)
168 ; GFX8: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[AND]], [[TRUNC1]](s32)
169 ; GFX8: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
170 ; GFX8: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[SELECT]], [[C7]](s32)
171 ; GFX8: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
172 ; GFX8: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL1]], [[TRUNC2]]
173 ; GFX8: [[C8:%[0-9]+]]:_(s64) = G_CONSTANT i64 549755813888
174 ; GFX8: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[AND1]](s64), [[C8]]
175 ; GFX8: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[AND1]](s64), [[C8]]
176 ; GFX8: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
177 ; GFX8: [[AND2:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C9]]
178 ; GFX8: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[ICMP2]](s1), [[AND2]], [[C1]]
179 ; GFX8: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s1), [[C9]], [[SELECT1]]
180 ; GFX8: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[OR]], [[SELECT2]]
181 ; GFX8: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[XOR]](s64)
182 ; GFX8: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[UITOFP]]
183 ; GFX8: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[ASHR]](s64), [[C2]]
184 ; GFX8: [[SELECT3:%[0-9]+]]:_(s32) = G_SELECT [[ICMP3]](s1), [[FNEG]], [[UITOFP]]
185 ; GFX8: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
186 ; GFX8: $vgpr0 = COPY [[SITOFP]](s32)
187 %0:_(s64) = COPY $vgpr0_vgpr1
188 %1:_(s32) = G_SITOFP %0
193 name: test_sitofp_s64_to_s64
196 liveins: $vgpr0_vgpr1
198 ; GFX6-LABEL: name: test_sitofp_s64_to_s64
199 ; GFX6: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
200 ; GFX6: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
201 ; GFX6: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[UV1]](s32)
202 ; GFX6: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[UV]](s32)
203 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
204 ; GFX6: [[INT:%[0-9]+]]:_(s64) = G_INTRINSIC intrinsic(@llvm.amdgcn.ldexp), [[SITOFP]](s64), [[C]](s32)
205 ; GFX6: [[FADD:%[0-9]+]]:_(s64) = G_FADD [[INT]], [[UITOFP]]
206 ; GFX6: $vgpr0_vgpr1 = COPY [[FADD]](s64)
207 ; GFX8-LABEL: name: test_sitofp_s64_to_s64
208 ; GFX8: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
209 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
210 ; GFX8: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[UV1]](s32)
211 ; GFX8: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[UV]](s32)
212 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
213 ; GFX8: [[INT:%[0-9]+]]:_(s64) = G_INTRINSIC intrinsic(@llvm.amdgcn.ldexp), [[SITOFP]](s64), [[C]](s32)
214 ; GFX8: [[FADD:%[0-9]+]]:_(s64) = G_FADD [[INT]], [[UITOFP]]
215 ; GFX8: $vgpr0_vgpr1 = COPY [[FADD]](s64)
216 %0:_(s64) = COPY $vgpr0_vgpr1
217 %1:_(s64) = G_SITOFP %0
218 $vgpr0_vgpr1 = COPY %1
222 name: test_sitofp_s16_to_s16
227 ; GFX6-LABEL: name: test_sitofp_s16_to_s16
228 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
229 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
230 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
231 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
232 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
233 ; GFX6: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
234 ; GFX6: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SITOFP]](s16)
235 ; GFX6: $vgpr0 = COPY [[ANYEXT]](s32)
236 ; GFX8-LABEL: name: test_sitofp_s16_to_s16
237 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
238 ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
239 ; GFX8: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[TRUNC]](s16)
240 ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SITOFP]](s16)
241 ; GFX8: $vgpr0 = COPY [[ANYEXT]](s32)
242 %0:_(s32) = COPY $vgpr0
243 %1:_(s16) = G_TRUNC %0
244 %2:_(s16) = G_SITOFP %1
245 %3:_(s32) = G_ANYEXT %2
250 name: test_sitofp_s16_to_s32
255 ; GFX6-LABEL: name: test_sitofp_s16_to_s32
256 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
257 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
258 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
259 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
260 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
261 ; GFX6: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
262 ; GFX6: $vgpr0 = COPY [[SITOFP]](s32)
263 ; GFX8-LABEL: name: test_sitofp_s16_to_s32
264 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
265 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
266 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
267 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
268 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
269 ; GFX8: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
270 ; GFX8: $vgpr0 = COPY [[SITOFP]](s32)
271 %0:_(s32) = COPY $vgpr0
272 %1:_(s16) = G_TRUNC %0
273 %2:_(s32) = G_SITOFP %1
278 name: test_sitofp_s16_to_s64
283 ; GFX6-LABEL: name: test_sitofp_s16_to_s64
284 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
285 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
286 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
287 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
288 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
289 ; GFX6: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
290 ; GFX6: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
291 ; GFX8-LABEL: name: test_sitofp_s16_to_s64
292 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
293 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
294 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
295 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
296 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
297 ; GFX8: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
298 ; GFX8: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
299 %0:_(s32) = COPY $vgpr0
300 %1:_(s16) = G_TRUNC %0
301 %2:_(s64) = G_SITOFP %1
302 $vgpr0_vgpr1 = COPY %2
306 name: test_sitofp_s8_to_s16
311 ; GFX6-LABEL: name: test_sitofp_s8_to_s16
312 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
313 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
314 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
315 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
316 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
317 ; GFX6: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
318 ; GFX6: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SITOFP]](s16)
319 ; GFX6: $vgpr0 = COPY [[ANYEXT]](s32)
320 ; GFX8-LABEL: name: test_sitofp_s8_to_s16
321 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
322 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
323 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
324 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
325 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
326 ; GFX8: [[SITOFP:%[0-9]+]]:_(s16) = G_SITOFP [[ASHR]](s32)
327 ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SITOFP]](s16)
328 ; GFX8: $vgpr0 = COPY [[ANYEXT]](s32)
329 %0:_(s32) = COPY $vgpr0
330 %1:_(s8) = G_TRUNC %0
331 %2:_(s16) = G_SITOFP %1
332 %3:_(s32) = G_ANYEXT %2
337 name: test_sitofp_s8_to_s32
342 ; GFX6-LABEL: name: test_sitofp_s8_to_s32
343 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
344 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
345 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
346 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
347 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
348 ; GFX6: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
349 ; GFX6: $vgpr0 = COPY [[SITOFP]](s32)
350 ; GFX8-LABEL: name: test_sitofp_s8_to_s32
351 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
352 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
353 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
354 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
355 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
356 ; GFX8: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s32)
357 ; GFX8: $vgpr0 = COPY [[SITOFP]](s32)
358 %0:_(s32) = COPY $vgpr0
359 %1:_(s8) = G_TRUNC %0
360 %2:_(s32) = G_SITOFP %1
365 name: test_sitofp_s8_to_s64
370 ; GFX6-LABEL: name: test_sitofp_s8_to_s64
371 ; GFX6: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
372 ; GFX6: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
373 ; GFX6: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
374 ; GFX6: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
375 ; GFX6: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
376 ; GFX6: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
377 ; GFX6: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
378 ; GFX8-LABEL: name: test_sitofp_s8_to_s64
379 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
380 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
381 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
382 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
383 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
384 ; GFX8: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s32)
385 ; GFX8: $vgpr0_vgpr1 = COPY [[SITOFP]](s64)
386 %0:_(s32) = COPY $vgpr0
387 %1:_(s8) = G_TRUNC %0
388 %2:_(s64) = G_SITOFP %1
389 $vgpr0_vgpr1 = COPY %2