1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
5 name: zext_trunc_s32_s16_s32
6 tracksRegLiveness: true
11 ; GCN-LABEL: name: zext_trunc_s32_s16_s32
12 ; GCN: liveins: $vgpr0
14 ; GCN-NEXT: %var:_(s32) = COPY $vgpr0
15 ; GCN-NEXT: %c3FFF:_(s32) = G_CONSTANT i32 16383
16 ; GCN-NEXT: %low_bits:_(s32) = G_AND %var, %c3FFF
17 ; GCN-NEXT: $vgpr0 = COPY %low_bits(s32)
18 %var:_(s32) = COPY $vgpr0
19 %c3FFF:_(s32) = G_CONSTANT i32 16383
20 %low_bits:_(s32) = G_AND %var, %c3FFF
21 %trunc:_(s16) = G_TRUNC %low_bits(s32)
22 %zext:_(s32) = G_ZEXT %trunc(s16)
23 $vgpr0 = COPY %zext(s32)
27 name: zext_trunc_s32_s16_s32_unknown_high_bits
28 tracksRegLiveness: true
33 ; GCN-LABEL: name: zext_trunc_s32_s16_s32_unknown_high_bits
34 ; GCN: liveins: $vgpr0
36 ; GCN-NEXT: %var:_(s32) = COPY $vgpr0
37 ; GCN-NEXT: %cFFFFF:_(s32) = G_CONSTANT i32 1048575
38 ; GCN-NEXT: %low_bits:_(s32) = G_AND %var, %cFFFFF
39 ; GCN-NEXT: %trunc:_(s16) = G_TRUNC %low_bits(s32)
40 ; GCN-NEXT: %zext:_(s32) = G_ZEXT %trunc(s16)
41 ; GCN-NEXT: $vgpr0 = COPY %zext(s32)
42 %var:_(s32) = COPY $vgpr0
43 %cFFFFF:_(s32) = G_CONSTANT i32 1048575
44 %low_bits:_(s32) = G_AND %var, %cFFFFF
45 %trunc:_(s16) = G_TRUNC %low_bits(s32)
46 %zext:_(s32) = G_ZEXT %trunc(s16)
47 $vgpr0 = COPY %zext(s32)
51 name: zext_trunc_s64_s16_s32
52 tracksRegLiveness: true
57 ; GCN-LABEL: name: zext_trunc_s64_s16_s32
58 ; GCN: liveins: $vgpr0_vgpr1
60 ; GCN-NEXT: %var:_(s64) = COPY $vgpr0_vgpr1
61 ; GCN-NEXT: %c3FFF:_(s64) = G_CONSTANT i64 16383
62 ; GCN-NEXT: %low_bits:_(s64) = G_AND %var, %c3FFF
63 ; GCN-NEXT: %trunc:_(s16) = G_TRUNC %low_bits(s64)
64 ; GCN-NEXT: %zext:_(s32) = G_ZEXT %trunc(s16)
65 ; GCN-NEXT: $vgpr0 = COPY %zext(s32)
66 %var:_(s64) = COPY $vgpr0_vgpr1
67 %c3FFF:_(s64) = G_CONSTANT i64 16383
68 %low_bits:_(s64) = G_AND %var, %c3FFF
69 %trunc:_(s16) = G_TRUNC %low_bits(s64)
70 %zext:_(s32) = G_ZEXT %trunc(s16)
71 $vgpr0 = COPY %zext(s32)
75 name: zext_trunc_s32_s16_s64
76 tracksRegLiveness: true
81 ; GCN-LABEL: name: zext_trunc_s32_s16_s64
82 ; GCN: liveins: $vgpr0
84 ; GCN-NEXT: %var:_(s32) = COPY $vgpr0
85 ; GCN-NEXT: %c3FFF:_(s32) = G_CONSTANT i32 16383
86 ; GCN-NEXT: %low_bits:_(s32) = G_AND %var, %c3FFF
87 ; GCN-NEXT: %trunc:_(s16) = G_TRUNC %low_bits(s32)
88 ; GCN-NEXT: %zext:_(s64) = G_ZEXT %trunc(s16)
89 ; GCN-NEXT: $vgpr0_vgpr1 = COPY %zext(s64)
90 %var:_(s32) = COPY $vgpr0
91 %c3FFF:_(s32) = G_CONSTANT i32 16383
92 %low_bits:_(s32) = G_AND %var, %c3FFF
93 %trunc:_(s16) = G_TRUNC %low_bits(s32)
94 %zext:_(s64) = G_ZEXT %trunc(s16)
95 $vgpr0_vgpr1 = COPY %zext(s64)
99 name: zext_trunc_v2s32_v2s16_v2s32
100 tracksRegLiveness: true
103 liveins: $vgpr0_vgpr1
105 ; GCN-LABEL: name: zext_trunc_v2s32_v2s16_v2s32
106 ; GCN: liveins: $vgpr0_vgpr1
108 ; GCN-NEXT: %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
109 ; GCN-NEXT: %c3FFF:_(s32) = G_CONSTANT i32 16383
110 ; GCN-NEXT: %c7FFF:_(s32) = G_CONSTANT i32 32767
111 ; GCN-NEXT: %c:_(<2 x s32>) = G_BUILD_VECTOR %c3FFF(s32), %c7FFF(s32)
112 ; GCN-NEXT: %low_bits:_(<2 x s32>) = G_AND %var, %c
113 ; GCN-NEXT: $vgpr0_vgpr1 = COPY %low_bits(<2 x s32>)
114 %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
115 %c3FFF:_(s32) = G_CONSTANT i32 16383
116 %c7FFF:_(s32) = G_CONSTANT i32 32767
117 %c:_(<2 x s32>) = G_BUILD_VECTOR %c3FFF(s32), %c7FFF(s32)
118 %low_bits:_(<2 x s32>) = G_AND %var, %c
119 %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s32>)
120 %zext:_(<2 x s32>) = G_ZEXT %trunc(<2 x s16>)
121 $vgpr0_vgpr1 = COPY %zext(<2 x s32>)
125 name: zext_trunc_v2s32_v2s16_v2s32_unknown_high_bits
126 tracksRegLiveness: true
129 liveins: $vgpr0_vgpr1
131 ; GCN-LABEL: name: zext_trunc_v2s32_v2s16_v2s32_unknown_high_bits
132 ; GCN: liveins: $vgpr0_vgpr1
134 ; GCN-NEXT: %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
135 ; GCN-NEXT: %cFFFFF:_(s32) = G_CONSTANT i32 1048575
136 ; GCN-NEXT: %c7FFF:_(s32) = G_CONSTANT i32 32767
137 ; GCN-NEXT: %c:_(<2 x s32>) = G_BUILD_VECTOR %cFFFFF(s32), %c7FFF(s32)
138 ; GCN-NEXT: %low_bits:_(<2 x s32>) = G_AND %var, %c
139 ; GCN-NEXT: %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s32>)
140 ; GCN-NEXT: %zext:_(<2 x s32>) = G_ZEXT %trunc(<2 x s16>)
141 ; GCN-NEXT: $vgpr0_vgpr1 = COPY %zext(<2 x s32>)
142 %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
143 %cFFFFF:_(s32) = G_CONSTANT i32 1048575
144 %c7FFF:_(s32) = G_CONSTANT i32 32767
145 %c:_(<2 x s32>) = G_BUILD_VECTOR %cFFFFF(s32), %c7FFF(s32)
146 %low_bits:_(<2 x s32>) = G_AND %var, %c
147 %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s32>)
148 %zext:_(<2 x s32>) = G_ZEXT %trunc(<2 x s16>)
149 $vgpr0_vgpr1 = COPY %zext(<2 x s32>)
153 name: zext_trunc_v2s64_v2s16_v2s32
154 tracksRegLiveness: true
157 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
159 ; GCN-LABEL: name: zext_trunc_v2s64_v2s16_v2s32
160 ; GCN: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
162 ; GCN-NEXT: %var:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
163 ; GCN-NEXT: %c3FFF:_(s64) = G_CONSTANT i64 16383
164 ; GCN-NEXT: %c7FFF:_(s64) = G_CONSTANT i64 32767
165 ; GCN-NEXT: %c:_(<2 x s64>) = G_BUILD_VECTOR %c3FFF(s64), %c7FFF(s64)
166 ; GCN-NEXT: %low_bits:_(<2 x s64>) = G_AND %var, %c
167 ; GCN-NEXT: %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s64>)
168 ; GCN-NEXT: %zext:_(<2 x s32>) = G_ZEXT %trunc(<2 x s16>)
169 ; GCN-NEXT: $vgpr0_vgpr1 = COPY %zext(<2 x s32>)
170 %var:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
171 %c3FFF:_(s64) = G_CONSTANT i64 16383
172 %c7FFF:_(s64) = G_CONSTANT i64 32767
173 %c:_(<2 x s64>) = G_BUILD_VECTOR %c3FFF(s64), %c7FFF(s64)
174 %low_bits:_(<2 x s64>) = G_AND %var, %c
175 %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s64>)
176 %zext:_(<2 x s32>) = G_ZEXT %trunc(<2 x s16>)
177 $vgpr0_vgpr1 = COPY %zext(<2 x s32>)
181 name: zext_trunc_v2s32_v2s16_v2s64
182 tracksRegLiveness: true
185 liveins: $vgpr0_vgpr1
187 ; GCN-LABEL: name: zext_trunc_v2s32_v2s16_v2s64
188 ; GCN: liveins: $vgpr0_vgpr1
190 ; GCN-NEXT: %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
191 ; GCN-NEXT: %c3FFF:_(s32) = G_CONSTANT i32 16383
192 ; GCN-NEXT: %c7FFF:_(s32) = G_CONSTANT i32 32767
193 ; GCN-NEXT: %c:_(<2 x s32>) = G_BUILD_VECTOR %c3FFF(s32), %c7FFF(s32)
194 ; GCN-NEXT: %low_bits:_(<2 x s32>) = G_AND %var, %c
195 ; GCN-NEXT: %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s32>)
196 ; GCN-NEXT: %zext:_(<2 x s64>) = G_ZEXT %trunc(<2 x s16>)
197 ; GCN-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %zext(<2 x s64>)
198 %var:_(<2 x s32>) = COPY $vgpr0_vgpr1
199 %c3FFF:_(s32) = G_CONSTANT i32 16383
200 %c7FFF:_(s32) = G_CONSTANT i32 32767
201 %c:_(<2 x s32>) = G_BUILD_VECTOR %c3FFF(s32), %c7FFF(s32)
202 %low_bits:_(<2 x s32>) = G_AND %var, %c
203 %trunc:_(<2 x s16>) = G_TRUNC %low_bits(<2 x s32>)
204 %zext:_(<2 x s64>) = G_ZEXT %trunc(<2 x s16>)
205 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %zext(<2 x s64>)