1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s -check-prefixes=GCN
6 name: zext_sgpr_s1_to_sgpr_s16
13 ; GCN-LABEL: name: zext_sgpr_s1_to_sgpr_s16
14 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
15 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], 1, implicit-def $scc
16 ; GCN-NEXT: [[S_SEXT_I32_I16_:%[0-9]+]]:sreg_32 = S_SEXT_I32_I16 [[S_AND_B32_]]
17 ; GCN-NEXT: $sgpr0 = COPY [[S_SEXT_I32_I16_]]
18 %0:sgpr(s32) = COPY $sgpr0
19 %1:sgpr(s1) = G_TRUNC %0
20 %2:sgpr(s16) = G_ZEXT %1
21 %3:sgpr(s32) = G_SEXT %2
27 name: zext_sgpr_s1_to_sgpr_s32
34 ; GCN-LABEL: name: zext_sgpr_s1_to_sgpr_s32
35 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
36 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], 1, implicit-def $scc
37 ; GCN-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
38 %0:sgpr(s32) = COPY $sgpr0
39 %1:sgpr(s1) = G_TRUNC %0
40 %2:sgpr(s32) = G_ZEXT %1
46 name: zext_sgpr_s1_to_sgpr_s64
53 ; GCN-LABEL: name: zext_sgpr_s1_to_sgpr_s64
54 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
55 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
56 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
57 ; GCN-NEXT: [[S_BFE_U64_:%[0-9]+]]:sreg_64 = S_BFE_U64 [[REG_SEQUENCE]], 65536, implicit-def $scc
58 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_U64_]]
59 %0:sgpr(s32) = COPY $sgpr0
60 %1:sgpr(s1) = G_TRUNC %0
61 %2:sgpr(s64) = G_ZEXT %1
62 $sgpr0_sgpr1 = COPY %2
67 name: zext_sgpr_s16_to_sgpr_s32
74 ; GCN-LABEL: name: zext_sgpr_s16_to_sgpr_s32
75 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
76 ; GCN-NEXT: [[S_BFE_U32_:%[0-9]+]]:sreg_32 = S_BFE_U32 [[COPY]], 1048576, implicit-def $scc
77 ; GCN-NEXT: $sgpr0 = COPY [[S_BFE_U32_]]
78 %0:sgpr(s32) = COPY $sgpr0
79 %1:sgpr(s16) = G_TRUNC %0
80 %2:sgpr(s32) = G_ZEXT %1
87 name: zext_sgpr_s16_to_sgpr_s64
94 ; GCN-LABEL: name: zext_sgpr_s16_to_sgpr_s64
95 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
96 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
97 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
98 ; GCN-NEXT: [[S_BFE_U64_:%[0-9]+]]:sreg_64 = S_BFE_U64 [[REG_SEQUENCE]], 1048576, implicit-def $scc
99 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_U64_]]
100 %0:sgpr(s32) = COPY $sgpr0
101 %1:sgpr(s16) = G_TRUNC %0
102 %2:sgpr(s64) = G_ZEXT %1
103 $sgpr0_sgpr1 = COPY %2
109 name: zext_sgpr_s32_to_sgpr_s64
111 regBankSelected: true
116 ; GCN-LABEL: name: zext_sgpr_s32_to_sgpr_s64
117 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
118 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
119 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
120 ; GCN-NEXT: [[S_BFE_U64_:%[0-9]+]]:sreg_64 = S_BFE_U64 [[REG_SEQUENCE]], 2097152, implicit-def $scc
121 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_U64_]]
122 %0:sgpr(s32) = COPY $sgpr0
123 %1:sgpr(s64) = G_ZEXT %0
124 $sgpr0_sgpr1 = COPY %1
130 # name: zext_vcc_s1_to_vgpr_s32
132 # regBankSelected: true
137 # %0:vgpr(s32) = COPY $vgpr0
138 # %1:vcc(s1) = G_ICMP intpred(eq), %0, %0
139 # %2:vgpr(s32) = G_ZEXT %1
145 name: zext_vgpr_s1_to_vgpr_s16
147 regBankSelected: true
152 ; GCN-LABEL: name: zext_vgpr_s1_to_vgpr_s16
153 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
154 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 1, [[COPY]], implicit $exec
155 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[V_AND_B32_e32_]], 0, 16, implicit $exec
156 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]
157 %0:vgpr(s32) = COPY $vgpr0
158 %1:vgpr(s1) = G_TRUNC %0
159 %2:vgpr(s16) = G_ZEXT %1
160 %3:vgpr(s32) = G_SEXT %2
166 name: zext_vgpr_s1_to_vgpr_s32
168 regBankSelected: true
173 ; GCN-LABEL: name: zext_vgpr_s1_to_vgpr_s32
174 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
175 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 1, [[COPY]], implicit $exec
176 ; GCN-NEXT: $vgpr0 = COPY [[V_AND_B32_e32_]]
177 %0:vgpr(s32) = COPY $vgpr0
178 %1:vgpr(s1) = G_TRUNC %0
179 %2:vgpr(s32) = G_ZEXT %1
185 name: zext_vgpr_s16_to_vgpr_s32
187 regBankSelected: true
192 ; GCN-LABEL: name: zext_vgpr_s16_to_vgpr_s32
193 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
194 ; GCN-NEXT: [[V_BFE_U32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_U32_e64 [[COPY]], 0, 16, implicit $exec
195 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_U32_e64_]]
196 %0:vgpr(s32) = COPY $vgpr0
197 %1:vgpr(s16) = G_TRUNC %0
198 %2:vgpr(s32) = G_ZEXT %1
205 name: zext_sgpr_reg_class_s1_to_sgpr_s32
207 regBankSelected: true
212 ; GCN-LABEL: name: zext_sgpr_reg_class_s1_to_sgpr_s32
213 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
214 ; GCN-NEXT: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], 1, implicit-def $scc
215 ; GCN-NEXT: $sgpr0 = COPY [[S_AND_B32_]]
216 %0:sgpr(s32) = COPY $sgpr0
217 %1:sreg_32(s1) = G_TRUNC %0
218 %2:sgpr(s32) = G_ZEXT %1