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: sext_scc_s1_to_sgpr_s32
13 ; GCN-LABEL: name: sext_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_xm0 = 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_SEXT %1
28 name: sext_scc_s1_to_sgpr_s64
35 ; GCN-LABEL: name: sext_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_SEXT %1
45 $sgpr0_sgpr1 = COPY %2
50 name: sext_sgpr_s1_to_sgpr_s32
57 ; GCN-LABEL: name: sext_sgpr_s1_to_sgpr_s32
58 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
59 ; GCN: [[S_BFE_I32_:%[0-9]+]]:sreg_32_xm0 = S_BFE_I32 [[COPY]], 65536, implicit-def $scc
60 ; GCN: $sgpr0 = COPY [[S_BFE_I32_]]
61 %0:sgpr(s32) = COPY $sgpr0
62 %1:sgpr(s1) = G_TRUNC %0
63 %2:sgpr(s32) = G_SEXT %1
69 name: sext_sgpr_s1_to_sgpr_s64
76 ; GCN-LABEL: name: sext_sgpr_s1_to_sgpr_s64
77 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = 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_I64_:%[0-9]+]]:sreg_64_xexec = S_BFE_I64 [[REG_SEQUENCE]], 65536, implicit-def $scc
81 ; GCN: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]
82 %0:sgpr(s32) = COPY $sgpr0
83 %1:sgpr(s1) = G_TRUNC %0
84 %2:sgpr(s64) = G_SEXT %1
85 $sgpr0_sgpr1 = COPY %2
90 name: sext_sgpr_s8_to_sgpr_s32
97 ; GCN-LABEL: name: sext_sgpr_s8_to_sgpr_s32
98 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
99 ; GCN: [[S_SEXT_I32_I8_:%[0-9]+]]:sreg_32_xm0 = S_SEXT_I32_I8 [[COPY]]
100 ; GCN: $sgpr0 = COPY [[S_SEXT_I32_I8_]]
101 %0:sgpr(s32) = COPY $sgpr0
102 %1:sgpr(s8) = G_TRUNC %0
103 %2:sgpr(s32) = G_SEXT %1
109 name: sext_sgpr_s16_to_sgpr_s32
111 regBankSelected: true
116 ; GCN-LABEL: name: sext_sgpr_s16_to_sgpr_s32
117 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
118 ; GCN: [[S_SEXT_I32_I16_:%[0-9]+]]:sreg_32_xm0 = S_SEXT_I32_I16 [[COPY]]
119 ; GCN: $sgpr0 = COPY [[S_SEXT_I32_I16_]]
120 %0:sgpr(s32) = COPY $sgpr0
121 %1:sgpr(s16) = G_TRUNC %0
122 %2:sgpr(s32) = G_SEXT %1
129 name: sext_sgpr_s16_to_sgpr_s64
131 regBankSelected: true
136 ; GCN-LABEL: name: sext_sgpr_s16_to_sgpr_s64
137 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
138 ; GCN: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
139 ; GCN: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[DEF]], %subreg.sub1
140 ; GCN: [[S_BFE_I64_:%[0-9]+]]:sreg_64_xexec = S_BFE_I64 [[REG_SEQUENCE]], 1048576, implicit-def $scc
141 ; GCN: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]
142 %0:sgpr(s32) = COPY $sgpr0
143 %1:sgpr(s16) = G_TRUNC %0
144 %2:sgpr(s64) = G_SEXT %1
145 $sgpr0_sgpr1 = COPY %2
151 name: sext_vcc_s1_to_vgpr_s32
153 regBankSelected: true
158 ; GCN-LABEL: name: sext_vcc_s1_to_vgpr_s32
159 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
160 ; GCN: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[COPY]], implicit $exec
161 ; GCN: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, -1, [[V_CMP_EQ_U32_e64_]], implicit $exec
162 ; GCN: $vgpr0 = COPY [[V_CNDMASK_B32_e64_]]
163 %0:vgpr(s32) = COPY $vgpr0
164 %1:vcc(s1) = G_ICMP intpred(eq), %0, %0
165 %2:vgpr(s32) = G_SEXT %1
171 name: sext_vgpr_s1_to_vgpr_s32
173 regBankSelected: true
178 ; GCN-LABEL: name: sext_vgpr_s1_to_vgpr_s32
179 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
180 ; GCN: [[V_BFE_I32_:%[0-9]+]]:vgpr_32 = V_BFE_I32 [[COPY]], 0, 1, implicit $exec
181 ; GCN: $vgpr0 = COPY [[V_BFE_I32_]]
182 %0:vgpr(s32) = COPY $vgpr0
183 %1:vgpr(s1) = G_TRUNC %0
184 %2:vgpr(s32) = G_SEXT %1
190 name: sext_vgpr_s8_to_vgpr_s32
192 regBankSelected: true
197 ; GCN-LABEL: name: sext_vgpr_s8_to_vgpr_s32
198 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
199 ; GCN: [[V_BFE_I32_:%[0-9]+]]:vgpr_32 = V_BFE_I32 [[COPY]], 0, 8, implicit $exec
200 ; GCN: $vgpr0 = COPY [[V_BFE_I32_]]
201 %0:vgpr(s32) = COPY $vgpr0
202 %1:vgpr(s8) = G_TRUNC %0
203 %2:vgpr(s32) = G_SEXT %1
210 name: sext_vgpr_s16_to_vgpr_s32
212 regBankSelected: true
217 ; GCN-LABEL: name: sext_vgpr_s16_to_vgpr_s32
218 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
219 ; GCN: [[V_BFE_I32_:%[0-9]+]]:vgpr_32 = V_BFE_I32 [[COPY]], 0, 16, implicit $exec
220 ; GCN: $vgpr0 = COPY [[V_BFE_I32_]]
221 %0:vgpr(s32) = COPY $vgpr0
222 %1:vgpr(s16) = G_TRUNC %0
223 %2:vgpr(s32) = G_SEXT %1