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_scc_s1_to_sgpr_s32
13 ; GCN-LABEL: name: zext_scc_s1_to_sgpr_s32
14 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
15 ; GCN: S_CMP_EQ_U32 [[COPY]], [[COPY]], implicit-def $scc
16 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
17 ; GCN: $scc = COPY [[COPY1]]
18 ; GCN: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
19 ; GCN: $sgpr0 = COPY [[S_CSELECT_B32_]]
20 %0:sgpr(s32) = COPY $sgpr0
21 %1:scc(s1) = G_ICMP intpred(eq), %0, %0
22 %2:sgpr(s32) = G_ZEXT %1
28 name: zext_scc_s1_to_sgpr_s64
35 ; GCN-LABEL: name: zext_scc_s1_to_sgpr_s64
36 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
37 ; GCN: S_CMP_EQ_U32 [[COPY]], [[COPY]], implicit-def $scc
38 ; GCN: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
39 ; GCN: $scc = COPY [[COPY1]]
40 ; GCN: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 0, 1, implicit $scc
41 ; GCN: $sgpr0_sgpr1 = COPY [[S_CSELECT_B64_]]
42 %0:sgpr(s32) = COPY $sgpr0
43 %1:scc(s1) = G_ICMP intpred(eq), %0, %0
44 %2:sgpr(s64) = G_ZEXT %1
45 $sgpr0_sgpr1 = COPY %2
50 name: zext_sgpr_s1_to_sgpr_s32
57 ; GCN-LABEL: name: zext_sgpr_s1_to_sgpr_s32
58 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
59 ; GCN: [[S_AND_B32_:%[0-9]+]]:sreg_32 = S_AND_B32 [[COPY]], 1, implicit-def $scc
60 ; GCN: $sgpr0 = COPY [[S_AND_B32_]]
61 %0:sgpr(s32) = COPY $sgpr0
62 %1:sgpr(s1) = G_TRUNC %0
63 %2:sgpr(s32) = G_ZEXT %1
69 name: zext_sgpr_s1_to_sgpr_s64
76 ; GCN-LABEL: name: zext_sgpr_s1_to_sgpr_s64
77 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
78 ; GCN: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
79 ; GCN: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
80 ; GCN: [[S_BFE_U64_:%[0-9]+]]:sreg_64_xexec = S_BFE_U64 [[REG_SEQUENCE]], 65536, implicit-def $scc
81 ; GCN: $sgpr0_sgpr1 = COPY [[S_BFE_U64_]]
82 %0:sgpr(s32) = COPY $sgpr0
83 %1:sgpr(s1) = G_TRUNC %0
84 %2:sgpr(s64) = G_ZEXT %1
85 $sgpr0_sgpr1 = COPY %2
90 name: zext_sgpr_s8_to_sgpr_s32
97 ; GCN-LABEL: name: zext_sgpr_s8_to_sgpr_s32
98 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
99 ; GCN: [[S_BFE_U32_:%[0-9]+]]:sreg_32 = S_BFE_U32 [[COPY]], 524288, implicit-def $scc
100 ; GCN: $sgpr0 = COPY [[S_BFE_U32_]]
101 %0:sgpr(s32) = COPY $sgpr0
102 %1:sgpr(s8) = G_TRUNC %0
103 %2:sgpr(s32) = G_ZEXT %1
110 name: zext_sgpr_s16_to_sgpr_s32
112 regBankSelected: true
117 ; GCN-LABEL: name: zext_sgpr_s16_to_sgpr_s32
118 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
119 ; GCN: [[S_BFE_U32_:%[0-9]+]]:sreg_32 = S_BFE_U32 [[COPY]], 1048576, implicit-def $scc
120 ; GCN: $sgpr0 = COPY [[S_BFE_U32_]]
121 %0:sgpr(s32) = COPY $sgpr0
122 %1:sgpr(s16) = G_TRUNC %0
123 %2:sgpr(s32) = G_ZEXT %1
130 name: zext_sgpr_s16_to_sgpr_s64
132 regBankSelected: true
137 ; GCN-LABEL: name: zext_sgpr_s16_to_sgpr_s64
138 ; GCN: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
139 ; GCN: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
140 ; GCN: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
141 ; GCN: [[S_BFE_U64_:%[0-9]+]]:sreg_64_xexec = S_BFE_U64 [[REG_SEQUENCE]], 1048576, implicit-def $scc
142 ; GCN: $sgpr0_sgpr1 = COPY [[S_BFE_U64_]]
143 %0:sgpr(s32) = COPY $sgpr0
144 %1:sgpr(s16) = G_TRUNC %0
145 %2:sgpr(s64) = G_ZEXT %1
146 $sgpr0_sgpr1 = COPY %2
152 name: zext_vcc_s1_to_vgpr_s32
154 regBankSelected: true
159 ; GCN-LABEL: name: zext_vcc_s1_to_vgpr_s32
160 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
161 ; GCN: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[COPY]], implicit $exec
162 ; GCN: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U32_e64_]], implicit $exec
163 ; GCN: $vgpr0 = COPY [[V_CNDMASK_B32_e64_]]
164 %0:vgpr(s32) = COPY $vgpr0
165 %1:vcc(s1) = G_ICMP intpred(eq), %0, %0
166 %2:vgpr(s32) = G_ZEXT %1
172 name: zext_vgpr_s1_to_vgpr_s32
174 regBankSelected: true
179 ; GCN-LABEL: name: zext_vgpr_s1_to_vgpr_s32
180 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
181 ; GCN: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 1, [[COPY]], implicit $exec
182 ; GCN: $vgpr0 = COPY [[V_AND_B32_e32_]]
183 %0:vgpr(s32) = COPY $vgpr0
184 %1:vgpr(s1) = G_TRUNC %0
185 %2:vgpr(s32) = G_ZEXT %1
191 name: zext_vgpr_s8_to_vgpr_s32
193 regBankSelected: true
198 ; GCN-LABEL: name: zext_vgpr_s8_to_vgpr_s32
199 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
200 ; GCN: [[V_BFE_U32_:%[0-9]+]]:vgpr_32 = V_BFE_U32 [[COPY]], 0, 8, implicit $exec
201 ; GCN: $vgpr0 = COPY [[V_BFE_U32_]]
202 %0:vgpr(s32) = COPY $vgpr0
203 %1:vgpr(s8) = G_TRUNC %0
204 %2:vgpr(s32) = G_ZEXT %1
211 name: zext_vgpr_s16_to_vgpr_s32
213 regBankSelected: true
218 ; GCN-LABEL: name: zext_vgpr_s16_to_vgpr_s32
219 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
220 ; GCN: [[V_BFE_U32_:%[0-9]+]]:vgpr_32 = V_BFE_U32 [[COPY]], 0, 16, implicit $exec
221 ; GCN: $vgpr0 = COPY [[V_BFE_U32_]]
222 %0:vgpr(s32) = COPY $vgpr0
223 %1:vgpr(s16) = G_TRUNC %0
224 %2:vgpr(s32) = G_ZEXT %1