1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
5 name: test_zext_s32_to_s64
10 ; CHECK-LABEL: name: test_zext_s32_to_s64
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s32)
13 ; CHECK: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
14 %0:_(s32) = COPY $vgpr0
16 $vgpr0_vgpr1 = COPY %1
20 name: test_zext_s16_to_s64
25 ; CHECK-LABEL: name: test_zext_s16_to_s64
26 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
27 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
28 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
29 ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C]]
30 ; CHECK: $vgpr0_vgpr1 = COPY [[AND]](s64)
31 %0:_(s32) = COPY $vgpr0
32 %1:_(s16) = G_TRUNC %0
34 $vgpr0_vgpr1 = COPY %2
38 name: test_zext_s16_to_s32
43 ; CHECK-LABEL: name: test_zext_s16_to_s32
44 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
45 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
46 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
47 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
48 ; CHECK: $vgpr0 = COPY [[AND]](s32)
49 %0:_(s32) = COPY $vgpr0
50 %1:_(s16) = G_TRUNC %0
56 name: test_zext_i1_to_s32
60 ; CHECK-LABEL: name: test_zext_i1_to_s32
61 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
62 ; CHECK: $vgpr0 = COPY [[C]](s32)
63 %0:_(s1) = G_CONSTANT i1 0
69 name: test_zext_i1_to_i64
73 ; CHECK-LABEL: name: test_zext_i1_to_i64
74 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
75 ; CHECK: $vgpr0_vgpr1 = COPY [[C]](s64)
76 %0:_(s1) = G_CONSTANT i1 0
78 $vgpr0_vgpr1 = COPY %1
82 name: test_zext_v2s16_to_v2s32
87 ; CHECK-LABEL: name: test_zext_v2s16_to_v2s32
88 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
89 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
90 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
91 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
92 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
93 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
94 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
95 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
96 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
97 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
98 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
99 %0:_(<2 x s16>) = COPY $vgpr0
100 %1:_(<2 x s32>) = G_ZEXT %0
101 $vgpr0_vgpr1 = COPY %1
105 name: test_zext_v3s16_to_v3s32
108 liveins: $vgpr0_vgpr1
110 ; CHECK-LABEL: name: test_zext_v3s16_to_v3s32
111 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
112 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[COPY]](<4 x s16>), 0
113 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
114 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF]], [[EXTRACT]](<3 x s16>), 0
115 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[INSERT]](<4 x s16>)
116 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
117 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
118 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
119 ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
120 ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
121 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
122 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
123 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
124 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
125 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
126 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
127 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]]
128 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32)
129 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
130 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
131 %1:_(<3 x s16>) = G_EXTRACT %0, 0
132 %2:_(<3 x s32>) = G_ZEXT %1
133 $vgpr0_vgpr1_vgpr2 = COPY %2
137 name: test_zext_v4s16_to_v4s32
140 liveins: $vgpr0_vgpr1
142 ; CHECK-LABEL: name: test_zext_v4s16_to_v4s32
143 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
144 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
145 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
146 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
147 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
148 ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
149 ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
150 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
151 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
152 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
153 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
154 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
155 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
156 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]]
157 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32)
158 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]]
159 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32), [[AND2]](s32), [[AND3]](s32)
160 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<4 x s32>)
161 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
162 %1:_(<4 x s32>) = G_ZEXT %0
163 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
167 name: test_zext_v2s32_to_v2s64
170 liveins: $vgpr0_vgpr1
172 ; CHECK-LABEL: name: test_zext_v2s32_to_v2s64
173 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
174 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
175 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
176 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
177 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[ZEXT]](s64), [[ZEXT1]](s64)
178 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
179 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
180 %1:_(<2 x s64>) = G_ZEXT %0
181 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
185 name: test_zext_v3s32_to_v3s64
188 liveins: $vgpr0_vgpr1_vgpr2
190 ; CHECK-LABEL: name: test_zext_v3s32_to_v3s64
191 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
192 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
193 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
194 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
195 ; CHECK: [[ZEXT2:%[0-9]+]]:_(s64) = G_ZEXT [[UV2]](s32)
196 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s64>) = G_BUILD_VECTOR [[ZEXT]](s64), [[ZEXT1]](s64), [[ZEXT2]](s64)
197 ; CHECK: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s64>)
198 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
199 %1:_(<3 x s64>) = G_ZEXT %0
205 name: test_zext_v4s32_to_v4s64
208 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
210 ; CHECK-LABEL: name: test_zext_v4s32_to_v4s64
211 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
212 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
213 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
214 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
215 ; CHECK: [[ZEXT2:%[0-9]+]]:_(s64) = G_ZEXT [[UV2]](s32)
216 ; CHECK: [[ZEXT3:%[0-9]+]]:_(s64) = G_ZEXT [[UV3]](s32)
217 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[ZEXT]](s64), [[ZEXT1]](s64), [[ZEXT2]](s64), [[ZEXT3]](s64)
218 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BUILD_VECTOR]](<4 x s64>)
219 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
220 %1:_(<4 x s64>) = G_ZEXT %0
221 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1