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_anyext_s32_to_s64
10 ; CHECK-LABEL: name: test_anyext_s32_to_s64
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
13 ; CHECK: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
14 %0:_(s32) = COPY $vgpr0
15 %1:_(s64) = G_ANYEXT %0
16 $vgpr0_vgpr1 = COPY %1
20 name: test_anyext_s16_to_s64
25 ; CHECK-LABEL: name: test_anyext_s16_to_s64
26 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
27 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
28 ; CHECK: $vgpr0_vgpr1 = COPY [[ANYEXT]](s64)
29 %0:_(s32) = COPY $vgpr0
30 %1:_(s16) = G_TRUNC %0
31 %2:_(s64) = G_ANYEXT %1
32 $vgpr0_vgpr1 = COPY %2
36 name: test_anyext_s16_to_s32
41 ; CHECK-LABEL: name: test_anyext_s16_to_s32
42 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
43 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
44 ; CHECK: $vgpr0 = COPY [[COPY1]](s32)
45 %0:_(s32) = COPY $vgpr0
46 %1:_(s16) = G_TRUNC %0
47 %2:_(s32) = G_ANYEXT %1
52 name: test_anyext_s1_to_s32
56 ; CHECK-LABEL: name: test_anyext_s1_to_s32
57 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
58 ; CHECK: $vgpr0 = COPY [[C]](s32)
59 %0:_(s1) = G_CONSTANT i1 0
60 %1:_(s32) = G_ANYEXT %0
65 name: test_anyext_s1_to_s64
69 ; CHECK-LABEL: name: test_anyext_s1_to_s64
70 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
71 ; CHECK: $vgpr0_vgpr1 = COPY [[C]](s64)
72 %0:_(s1) = G_CONSTANT i1 0
73 %1:_(s64) = G_ANYEXT %0
74 $vgpr0_vgpr1 = COPY %1
78 name: test_anyext_v2s16_to_v2s32
83 ; CHECK-LABEL: name: test_anyext_v2s16_to_v2s32
84 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
85 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
86 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
87 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
88 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
89 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
90 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[COPY1]](s32), [[COPY2]](s32)
91 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
92 %0:_(<2 x s16>) = COPY $vgpr0
93 %1:_(<2 x s32>) = G_ANYEXT %0
94 $vgpr0_vgpr1 = COPY %1
98 name: test_anyext_v3s16_to_v3s32
101 liveins: $vgpr0_vgpr1
103 ; CHECK-LABEL: name: test_anyext_v3s16_to_v3s32
104 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
105 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<3 x s16>) = G_EXTRACT [[COPY]](<4 x s16>), 0
106 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
107 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF]], [[EXTRACT]](<3 x s16>), 0
108 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[INSERT]](<4 x s16>)
109 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
110 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
111 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
112 ; CHECK: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
113 ; CHECK: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
114 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
115 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
116 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
117 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
118 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
119 %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
120 %1:_(<3 x s16>) = G_EXTRACT %0, 0
121 %2:_(<3 x s32>) = G_ANYEXT %1
122 $vgpr0_vgpr1_vgpr2 = COPY %2
126 name: test_anyext_v4s16_to_v4s32
131 ; CHECK-LABEL: name: test_anyext_v4s16_to_v4s32
132 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
133 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[DEF]](<4 x s32>)
134 %0:_(<4 x s16>) = G_IMPLICIT_DEF
135 %1:_(<4 x s32>) = G_ANYEXT %0
136 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
140 name: test_anyext_v2s32_to_v2s64
143 liveins: $vgpr0_vgpr1
145 ; CHECK-LABEL: name: test_anyext_v2s32_to_v2s64
146 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
147 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
148 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
149 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
150 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64)
151 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
152 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
153 %1:_(<2 x s64>) = G_ANYEXT %0
154 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
158 name: test_anyext_v3s32_to_v3s64
161 liveins: $vgpr0_vgpr1_vgpr2
163 ; CHECK-LABEL: name: test_anyext_v3s32_to_v3s64
164 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
165 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
166 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
167 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
168 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
169 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64)
170 ; CHECK: S_NOP 0, implicit [[BUILD_VECTOR]](<3 x s64>)
171 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
172 %1:_(<3 x s64>) = G_ANYEXT %0
178 name: test_anyext_v4s32_to_v4s64
181 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
183 ; CHECK-LABEL: name: test_anyext_v4s32_to_v4s64
184 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
185 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>)
186 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[UV]](s32)
187 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[UV1]](s32)
188 ; CHECK: [[ANYEXT2:%[0-9]+]]:_(s64) = G_ANYEXT [[UV2]](s32)
189 ; CHECK: [[ANYEXT3:%[0-9]+]]:_(s64) = G_ANYEXT [[UV3]](s32)
190 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[ANYEXT]](s64), [[ANYEXT1]](s64), [[ANYEXT2]](s64), [[ANYEXT3]](s64)
191 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY [[BUILD_VECTOR]](<4 x s64>)
192 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
193 %1:_(<4 x s64>) = G_ANYEXT %0
194 $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 = COPY %1