[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / inst-select-sext.mir
blobac7da5f0f3c995407bcdf031d5a4af753e4c5413
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
4 ---
6 name: sext_scc_s1_to_sgpr_s32
7 legalized:       true
8 regBankSelected: true
9 body: |
10   bb.0:
11     liveins: $sgpr0
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
23     $sgpr0 = COPY %2
24 ...
26 ---
28 name: sext_scc_s1_to_sgpr_s64
29 legalized:       true
30 regBankSelected: true
31 body: |
32   bb.0:
33     liveins: $sgpr0
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
46 ...
48 ---
50 name: sext_sgpr_s1_to_sgpr_s32
51 legalized:       true
52 regBankSelected: true
53 body: |
54   bb.0:
55     liveins: $sgpr0
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
64     $sgpr0 = COPY %2
65 ...
67 ---
69 name: sext_sgpr_s1_to_sgpr_s64
70 legalized:       true
71 regBankSelected: true
72 body: |
73   bb.0:
74     liveins: $sgpr0
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
86 ...
88 ---
90 name: sext_sgpr_s8_to_sgpr_s32
91 legalized:       true
92 regBankSelected: true
93 body: |
94   bb.0:
95     liveins: $sgpr0
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
104     $sgpr0 = COPY %2
109 name: sext_sgpr_s16_to_sgpr_s32
110 legalized:       true
111 regBankSelected: true
112 body: |
113   bb.0:
114     liveins: $sgpr0
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
123     $sgpr0 = COPY %2
129 name: sext_sgpr_s16_to_sgpr_s64
130 legalized:       true
131 regBankSelected: true
132 body: |
133   bb.0:
134     liveins: $sgpr0
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
152 legalized:       true
153 regBankSelected: true
154 body: |
155   bb.0:
156     liveins: $vgpr0
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
166     $vgpr0 = COPY %2
171 name: sext_vgpr_s1_to_vgpr_s32
172 legalized:       true
173 regBankSelected: true
174 body: |
175   bb.0:
176     liveins: $vgpr0
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
185     $vgpr0 = COPY %2
190 name: sext_vgpr_s8_to_vgpr_s32
191 legalized:       true
192 regBankSelected: true
193 body: |
194   bb.0:
195     liveins: $vgpr0
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
204     $vgpr0 = COPY %2
210 name: sext_vgpr_s16_to_vgpr_s32
211 legalized:       true
212 regBankSelected: true
213 body: |
214   bb.0:
215     liveins: $vgpr0
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
224     $vgpr0 = COPY %2