1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: sext_inreg_s_s32_1
13 ; CHECK-LABEL: name: sext_inreg_s_s32_1
14 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
15 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[COPY]], 1
16 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
17 %0:_(s32) = COPY $sgpr0
18 %1:_(s32) = G_SEXT_INREG %0, 1
19 S_ENDPGM 0, implicit %1
24 name: sext_inreg_s_s64_1
31 ; CHECK-LABEL: name: sext_inreg_s_s64_1
32 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
33 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s64) = G_SEXT_INREG [[COPY]], 1
34 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s64)
35 %0:_(s64) = COPY $sgpr0_sgpr1
36 %1:_(s64) = G_SEXT_INREG %0, 1
37 S_ENDPGM 0, implicit %1
42 name: sext_inreg_s_s64_31
49 ; CHECK-LABEL: name: sext_inreg_s_s64_31
50 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
51 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s64) = G_SEXT_INREG [[COPY]], 31
52 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s64)
53 %0:_(s64) = COPY $sgpr0_sgpr1
54 %1:_(s64) = G_SEXT_INREG %0, 31
55 S_ENDPGM 0, implicit %1
60 name: sext_inreg_s_s64_32
67 ; CHECK-LABEL: name: sext_inreg_s_s64_32
68 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
69 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s64) = G_SEXT_INREG [[COPY]], 32
70 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s64)
71 %0:_(s64) = COPY $sgpr0_sgpr1
72 %1:_(s64) = G_SEXT_INREG %0, 32
73 S_ENDPGM 0, implicit %1
78 name: sext_inreg_s_s64_33
85 ; CHECK-LABEL: name: sext_inreg_s_s64_33
86 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
87 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s64) = G_SEXT_INREG [[COPY]], 32
88 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s64)
89 %0:_(s64) = COPY $sgpr0_sgpr1
90 %1:_(s64) = G_SEXT_INREG %0, 32
91 S_ENDPGM 0, implicit %1
96 name: sext_inreg_v_s32_1
103 ; CHECK-LABEL: name: sext_inreg_v_s32_1
104 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
105 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[COPY]], 1
106 ; CHECK: S_ENDPGM 0, implicit [[SEXT_INREG]](s32)
107 %0:_(s32) = COPY $vgpr0
108 %1:_(s32) = G_SEXT_INREG %0, 1
109 S_ENDPGM 0, implicit %1
114 name: sext_inreg_v_s64_1
119 liveins: $vgpr0_vgpr1
121 ; CHECK-LABEL: name: sext_inreg_v_s64_1
122 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
123 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
124 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[UV]], 1
125 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
126 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[SEXT_INREG]], [[C]](s32)
127 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SEXT_INREG]](s32), [[ASHR]](s32)
128 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
129 %0:_(s64) = COPY $vgpr0_vgpr1
130 %1:_(s64) = G_SEXT_INREG %0, 1
131 S_ENDPGM 0, implicit %1
136 name: sext_inreg_v_s64_31
141 liveins: $vgpr0_vgpr1
143 ; CHECK-LABEL: name: sext_inreg_v_s64_31
144 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
145 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
146 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[UV]], 31
147 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
148 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[SEXT_INREG]], [[C]](s32)
149 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SEXT_INREG]](s32), [[ASHR]](s32)
150 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
151 %0:_(s64) = COPY $vgpr0_vgpr1
152 %1:_(s64) = G_SEXT_INREG %0, 31
153 S_ENDPGM 0, implicit %1
158 name: sext_inreg_v_s64_32
163 liveins: $vgpr0_vgpr1
165 ; CHECK-LABEL: name: sext_inreg_v_s64_32
166 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
167 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
168 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[UV]](s32)
169 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
170 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY1]], [[C]](s32)
171 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[ASHR]](s32)
172 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
173 %0:_(s64) = COPY $vgpr0_vgpr1
174 %1:_(s64) = G_SEXT_INREG %0, 32
175 S_ENDPGM 0, implicit %1
180 name: sext_inreg_v_s64_33
185 liveins: $vgpr0_vgpr1
187 ; CHECK-LABEL: name: sext_inreg_v_s64_33
188 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
189 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
190 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[UV]](s32)
191 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[COPY1]], 1
192 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[SEXT_INREG]](s32)
193 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
194 %0:_(s64) = COPY $vgpr0_vgpr1
195 %1:_(s64) = G_SEXT_INREG %0, 33
196 S_ENDPGM 0, implicit %1
201 name: sext_inreg_v_s64_35
206 liveins: $vgpr0_vgpr1
208 ; CHECK-LABEL: name: sext_inreg_v_s64_35
209 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
210 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
211 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[UV]](s32)
212 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[COPY1]], 3
213 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[SEXT_INREG]](s32)
214 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
215 %0:_(s64) = COPY $vgpr0_vgpr1
216 %1:_(s64) = G_SEXT_INREG %0, 35
217 S_ENDPGM 0, implicit %1
222 name: sext_inreg_v_s64_63
227 liveins: $vgpr0_vgpr1
229 ; CHECK-LABEL: name: sext_inreg_v_s64_63
230 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
231 ; CHECK: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
232 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[UV]](s32)
233 ; CHECK: [[SEXT_INREG:%[0-9]+]]:vgpr(s32) = G_SEXT_INREG [[COPY1]], 31
234 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[SEXT_INREG]](s32)
235 ; CHECK: S_ENDPGM 0, implicit [[MV]](s64)
236 %0:_(s64) = COPY $vgpr0_vgpr1
237 %1:_(s64) = G_SEXT_INREG %0, 63
238 S_ENDPGM 0, implicit %1