llvm.org GIT mirror llvm / aeefee9
AMDGPU/GlobalISel: Fix test failures in release build Apparently the check for legal instructions during instruction select does not happen without an asserts build, so these would successfully select in release, and fail in debug. Make s16 and/or/xor legal. These can just be selected directly to the 32-bit operation, as is already done in SelectionDAG, so just make them legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366210 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 2 months ago
15 changed file(s) with 406 addition(s) and 466 deletion(s). Raw diff Collapse all Expand all
290290 // TODO: Should this allow an SCC bank result, and produce a copy from SCC for
291291 // the result?
292292 if (DstRB->getID() == AMDGPU::SGPRRegBankID) {
293 unsigned InstOpc = getLogicalBitOpcode(I.getOpcode(), Size > 32);
294 I.setDesc(TII.get(InstOpc));
295
293296 const TargetRegisterClass *RC
294297 = TRI.getConstrainedRegClassForOperand(Dst, MRI);
295 unsigned InstOpc = getLogicalBitOpcode(I.getOpcode(), Size > 32);
296 I.setDesc(TII.get(InstOpc));
298 if (!RC)
299 return false;
297300 return RBI.constrainGenericRegister(DstReg, *RC, MRI) &&
298301 RBI.constrainGenericRegister(Src0.getReg(), *RC, MRI) &&
299302 RBI.constrainGenericRegister(Src1.getReg(), *RC, MRI);
212212 // Report legal for any types we can handle anywhere. For the cases only legal
213213 // on the SALU, RegBankSelect will be able to re-legalize.
214214 getActionDefinitionsBuilder({G_AND, G_OR, G_XOR})
215 .legalFor({S32, S1, S64, V2S32, V2S16, V4S16})
215 .legalFor({S32, S1, S64, V2S32, S16, V2S16, V4S16})
216216 .clampScalar(0, S32, S64)
217217 .moreElementsIf(isSmallOddVector(0), oneMoreElement(0))
218218 .fewerElementsIf(vectorWiderThan(0, 32), fewerEltsToSize64Vector(0))
116116 liveins: $sgpr0, $sgpr1
117117 ; WAVE64-LABEL: name: and_s16_sgpr_sgpr_sgpr
118118 ; WAVE64: liveins: $sgpr0, $sgpr1
119 ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
121 ; WAVE64: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
122 ; WAVE64: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
123 ; WAVE64: [[AND:%[0-9]+]]:sgpr(s16) = G_AND [[TRUNC]], [[TRUNC1]]
124 ; WAVE64: S_ENDPGM 0, implicit [[AND]](s16)
119 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
121 ; WAVE64: [[S_AND_B32_:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 [[COPY]], [[COPY1]]
122 ; WAVE64: S_ENDPGM 0, implicit [[S_AND_B32_]]
125123 ; WAVE32-LABEL: name: and_s16_sgpr_sgpr_sgpr
126124 ; WAVE32: liveins: $sgpr0, $sgpr1
127 ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
128 ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
129 ; WAVE32: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
130 ; WAVE32: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
131 ; WAVE32: [[AND:%[0-9]+]]:sgpr(s16) = G_AND [[TRUNC]], [[TRUNC1]]
132 ; WAVE32: S_ENDPGM 0, implicit [[AND]](s16)
125 ; WAVE32: $vcc_hi = IMPLICIT_DEF
126 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
127 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
128 ; WAVE32: [[S_AND_B32_:%[0-9]+]]:sreg_32_xm0 = S_AND_B32 [[COPY]], [[COPY1]]
129 ; WAVE32: S_ENDPGM 0, implicit [[S_AND_B32_]]
133130 %0:sgpr(s32) = COPY $sgpr0
134131 %1:sgpr(s32) = COPY $sgpr1
135132 %2:sgpr(s16) = G_TRUNC %0
116116 liveins: $sgpr0, $sgpr1
117117 ; WAVE64-LABEL: name: or_s16_sgpr_sgpr_sgpr
118118 ; WAVE64: liveins: $sgpr0, $sgpr1
119 ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
121 ; WAVE64: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
122 ; WAVE64: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
123 ; WAVE64: [[OR:%[0-9]+]]:sgpr(s16) = G_OR [[TRUNC]], [[TRUNC1]]
124 ; WAVE64: S_ENDPGM 0, implicit [[OR]](s16)
119 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
121 ; WAVE64: [[S_OR_B32_:%[0-9]+]]:sreg_32_xm0 = S_OR_B32 [[COPY]], [[COPY1]]
122 ; WAVE64: S_ENDPGM 0, implicit [[S_OR_B32_]]
125123 ; WAVE32-LABEL: name: or_s16_sgpr_sgpr_sgpr
126124 ; WAVE32: liveins: $sgpr0, $sgpr1
127 ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
128 ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
129 ; WAVE32: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
130 ; WAVE32: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
131 ; WAVE32: [[OR:%[0-9]+]]:sgpr(s16) = G_OR [[TRUNC]], [[TRUNC1]]
132 ; WAVE32: S_ENDPGM 0, implicit [[OR]](s16)
125 ; WAVE32: $vcc_hi = IMPLICIT_DEF
126 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
127 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
128 ; WAVE32: [[S_OR_B32_:%[0-9]+]]:sreg_32_xm0 = S_OR_B32 [[COPY]], [[COPY1]]
129 ; WAVE32: S_ENDPGM 0, implicit [[S_OR_B32_]]
133130 %0:sgpr(s32) = COPY $sgpr0
134131 %1:sgpr(s32) = COPY $sgpr1
135132 %2:sgpr(s16) = G_TRUNC %0
116116 liveins: $sgpr0, $sgpr1
117117 ; WAVE64-LABEL: name: xor_s16_sgpr_sgpr_sgpr
118118 ; WAVE64: liveins: $sgpr0, $sgpr1
119 ; WAVE64: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
121 ; WAVE64: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
122 ; WAVE64: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
123 ; WAVE64: [[XOR:%[0-9]+]]:sgpr(s16) = G_XOR [[TRUNC]], [[TRUNC1]]
124 ; WAVE64: S_ENDPGM 0, implicit [[XOR]](s16)
119 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
120 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
121 ; WAVE64: [[S_XOR_B32_:%[0-9]+]]:sreg_32_xm0 = S_XOR_B32 [[COPY]], [[COPY1]]
122 ; WAVE64: S_ENDPGM 0, implicit [[S_XOR_B32_]]
125123 ; WAVE32-LABEL: name: xor_s16_sgpr_sgpr_sgpr
126124 ; WAVE32: liveins: $sgpr0, $sgpr1
127 ; WAVE32: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
128 ; WAVE32: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
129 ; WAVE32: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
130 ; WAVE32: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
131 ; WAVE32: [[XOR:%[0-9]+]]:sgpr(s16) = G_XOR [[TRUNC]], [[TRUNC1]]
132 ; WAVE32: S_ENDPGM 0, implicit [[XOR]](s16)
125 ; WAVE32: $vcc_hi = IMPLICIT_DEF
126 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
127 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr1
128 ; WAVE32: [[S_XOR_B32_:%[0-9]+]]:sreg_32_xm0 = S_XOR_B32 [[COPY]], [[COPY1]]
129 ; WAVE32: S_ENDPGM 0, implicit [[S_XOR_B32_]]
133130 %0:sgpr(s32) = COPY $sgpr0
134131 %1:sgpr(s32) = COPY $sgpr1
135132 %2:sgpr(s16) = G_TRUNC %0
155155 ; CHECK-LABEL: name: test_and_s16
156156 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
157157 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
158 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
159 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
160 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
161 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
162 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
158 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
159 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
160 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC1]]
161 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[AND]](s16)
162 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
163163 %0:_(s32) = COPY $vgpr0
164164 %1:_(s32) = COPY $vgpr1
165165 %2:_(s16) = G_TRUNC %0
222222 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
223223 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
224224 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
225 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
226 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
227 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
228 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
229 ; VI: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[TRUNC]], [[TRUNC1]](s16)
225 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
226 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
227 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
228 ; VI: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[TRUNC]], [[AND]](s16)
230229 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR]](s16)
231230 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
232231 ; GFX9-LABEL: name: test_ashr_s16_i8
234233 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
235234 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
236235 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
237 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
238 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
239 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
240 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
241 ; GFX9: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[TRUNC]], [[TRUNC1]](s16)
236 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
237 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
238 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
239 ; GFX9: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[TRUNC]], [[AND]](s16)
242240 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR]](s16)
243241 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
244242 %0:_(s32) = COPY $vgpr0
273271 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
274272 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
275273 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
276 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
277 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
278 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
279 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
274 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
275 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
276 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
280277 ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
281 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
282 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
283 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[TRUNC1]](s16)
284 ; VI: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[TRUNC1]](s16)
285 ; VI: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[ASHR]], [[TRUNC]](s16)
278 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
279 ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
280 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC3]], [[TRUNC2]](s16)
281 ; VI: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[TRUNC2]](s16)
282 ; VI: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[ASHR]], [[AND]](s16)
286283 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR1]](s16)
287284 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
288285 ; GFX9-LABEL: name: test_ashr_i8_i8
289286 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
290287 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
291288 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
292 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
293 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
294 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
295 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
289 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
290 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
291 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
296292 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
297 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
298 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
299 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[TRUNC1]](s16)
300 ; GFX9: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[TRUNC1]](s16)
301 ; GFX9: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[ASHR]], [[TRUNC]](s16)
293 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
294 ; GFX9: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
295 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC3]], [[TRUNC2]](s16)
296 ; GFX9: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[TRUNC2]](s16)
297 ; GFX9: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[ASHR]], [[AND]](s16)
302298 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR1]](s16)
303299 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
304300 %0:_(s32) = COPY $vgpr0
1111 ; SI-LABEL: name: test_copysign_s16_s16
1212 ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
1313 ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
14 ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
1415 ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
16 ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
1517 ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
16 ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
17 ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
18 ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
19 ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
20 ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY4]]
21 ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
22 ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
23 ; SI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
24 ; SI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
25 ; SI: $vgpr0 = COPY [[COPY7]](s32)
18 ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
19 ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
20 ; SI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC1]]
21 ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
22 ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
23 ; SI: $vgpr0 = COPY [[ANYEXT]](s32)
2624 ; VI-LABEL: name: test_copysign_s16_s16
2725 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
2826 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
27 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
2928 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
29 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
3030 ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
31 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
32 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
33 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
34 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
35 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY4]]
36 ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
37 ; VI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
38 ; VI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
39 ; VI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
40 ; VI: $vgpr0 = COPY [[COPY7]](s32)
31 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
32 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
33 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC1]]
34 ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
35 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
36 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
4137 ; GFX9-LABEL: name: test_copysign_s16_s16
4238 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
4339 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
40 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
4441 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
42 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
4543 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
46 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
47 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
48 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
49 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
50 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY4]]
51 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
52 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
53 ; GFX9: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
54 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
55 ; GFX9: $vgpr0 = COPY [[COPY7]](s32)
44 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
45 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
46 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC1]]
47 ; GFX9: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
48 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
49 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
5650 %0:_(s32) = COPY $vgpr0
5751 %1:_(s32) = COPY $vgpr1
5852 %2:_(s16) = G_TRUNC %0
251245 ; SI-LABEL: name: test_copysign_s16_s32
252246 ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
253247 ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
248 ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
254249 ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
250 ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
255251 ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
256 ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
257 ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
258 ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
252 ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
253 ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
259254 ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
260255 ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
261 ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
262 ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
263 ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
264 ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
265 ; SI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
266 ; SI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY6]], [[COPY7]]
267 ; SI: [[COPY8:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
268 ; SI: $vgpr0 = COPY [[COPY8]](s32)
256 ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
257 ; SI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
258 ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
259 ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
260 ; SI: $vgpr0 = COPY [[ANYEXT]](s32)
269261 ; VI-LABEL: name: test_copysign_s16_s32
270262 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
271263 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
264 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
272265 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
266 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
273267 ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
274 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
275 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
276 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
268 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
269 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
277270 ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
278271 ; VI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
279 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
280 ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
281 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
282 ; VI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
283 ; VI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
284 ; VI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY6]], [[COPY7]]
285 ; VI: [[COPY8:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
286 ; VI: $vgpr0 = COPY [[COPY8]](s32)
272 ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
273 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
274 ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
275 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
276 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
287277 ; GFX9-LABEL: name: test_copysign_s16_s32
288278 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
289279 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
280 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
290281 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
282 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
291283 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
292 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
293 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
294 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
284 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
285 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
295286 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
296287 ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
297 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
298 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
299 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
300 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
301 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
302 ; GFX9: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY6]], [[COPY7]]
303 ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
304 ; GFX9: $vgpr0 = COPY [[COPY8]](s32)
288 ; GFX9: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
289 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
290 ; GFX9: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
291 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
292 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
305293 %0:_(s32) = COPY $vgpr0
306294 %1:_(s32) = COPY $vgpr1
307295 %2:_(s16) = G_TRUNC %0
432420 ; SI-LABEL: name: test_copysign_s16_s64
433421 ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
434422 ; SI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
423 ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
435424 ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
425 ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
436426 ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
437 ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
438 ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
439 ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
427 ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
428 ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
440429 ; SI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
441 ; SI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
442 ; SI: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC]](s32)
443 ; SI: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
444 ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
445 ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[COPY4]]
446 ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
447 ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
448 ; SI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
449 ; SI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
450 ; SI: $vgpr0 = COPY [[COPY7]](s32)
430 ; SI: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
431 ; SI: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC3]](s32)
432 ; SI: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s64)
433 ; SI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC4]], [[TRUNC1]]
434 ; SI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
435 ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
436 ; SI: $vgpr0 = COPY [[ANYEXT]](s32)
451437 ; VI-LABEL: name: test_copysign_s16_s64
452438 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
453439 ; VI: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
440 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
454441 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
442 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
455443 ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
456 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
457 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
458 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
444 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
445 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
459446 ; VI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
460 ; VI: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
461 ; VI: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC]](s32)
462 ; VI: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
463 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
464 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[COPY4]]
465 ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
466 ; VI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
467 ; VI: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
468 ; VI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
469 ; VI: $vgpr0 = COPY [[COPY7]](s32)
447 ; VI: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
448 ; VI: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC3]](s32)
449 ; VI: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s64)
450 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC4]], [[TRUNC1]]
451 ; VI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
452 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
453 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
470454 ; GFX9-LABEL: name: test_copysign_s16_s64
471455 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
472456 ; GFX9: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
457 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
473458 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
459 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
474460 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
475 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
476 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
477 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
461 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
462 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
478463 ; GFX9: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
479 ; GFX9: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
480 ; GFX9: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC]](s32)
481 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64)
482 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C]](s32)
483 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[COPY4]]
484 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
485 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
486 ; GFX9: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY5]], [[COPY6]]
487 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
488 ; GFX9: $vgpr0 = COPY [[COPY7]](s32)
464 ; GFX9: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[C2]](s64)
465 ; GFX9: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[TRUNC3]](s32)
466 ; GFX9: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s64)
467 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC4]], [[TRUNC1]]
468 ; GFX9: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[AND1]]
469 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
470 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
489471 %0:_(s32) = COPY $vgpr0
490472 %1:_(s64) = COPY $vgpr1_vgpr2
491473 %2:_(s16) = G_TRUNC %0
905887 ; SI-LABEL: name: test_copysign_s16_s32_flags
906888 ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
907889 ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
890 ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
908891 ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
892 ; SI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
909893 ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
910 ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
911 ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
912 ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
894 ; SI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
895 ; SI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
913896 ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
914897 ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
915 ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
916 ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
917 ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
918 ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
919 ; SI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
920 ; SI: %14:_(s32) = nnan G_OR [[COPY6]], [[COPY7]]
921 ; SI: [[COPY8:%[0-9]+]]:_(s32) = COPY %14(s32)
922 ; SI: $vgpr0 = COPY [[COPY8]](s32)
898 ; SI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
899 ; SI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
900 ; SI: %3:_(s16) = nnan G_OR [[AND]], [[AND1]]
901 ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %3(s16)
902 ; SI: $vgpr0 = COPY [[ANYEXT]](s32)
923903 ; VI-LABEL: name: test_copysign_s16_s32_flags
924904 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
925905 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
906 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
926907 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
908 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
927909 ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
928 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
929 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
930 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
910 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
911 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
931912 ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
932913 ; VI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
933 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
934 ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
935 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
936 ; VI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
937 ; VI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
938 ; VI: %14:_(s32) = nnan G_OR [[COPY6]], [[COPY7]]
939 ; VI: [[COPY8:%[0-9]+]]:_(s32) = COPY %14(s32)
940 ; VI: $vgpr0 = COPY [[COPY8]](s32)
914 ; VI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
915 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
916 ; VI: %3:_(s16) = nnan G_OR [[AND]], [[AND1]]
917 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %3(s16)
918 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
941919 ; GFX9-LABEL: name: test_copysign_s16_s32_flags
942920 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
943921 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
922 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
944923 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
924 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
945925 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
946 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
947 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
948 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
926 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[C1]](s32)
927 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[TRUNC2]]
949928 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
950929 ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32)
951 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
952 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
953 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
954 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
955 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
956 ; GFX9: %14:_(s32) = nnan G_OR [[COPY6]], [[COPY7]]
957 ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY %14(s32)
958 ; GFX9: $vgpr0 = COPY [[COPY8]](s32)
930 ; GFX9: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
931 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC1]]
932 ; GFX9: %3:_(s16) = nnan G_OR [[AND]], [[AND1]]
933 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %3(s16)
934 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
959935 %0:_(s32) = COPY $vgpr0
960936 %1:_(s32) = COPY $vgpr1
961937 %2:_(s16) = G_TRUNC %0
218218 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
219219 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
220220 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
221 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
222 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
223 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
224 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
225 ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
221 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
222 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
223 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
224 ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[AND]](s16)
226225 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
227226 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
228227 ; GFX9-LABEL: name: test_lshr_s16_i8
230229 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
231230 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
232231 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
233 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
234 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
235 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
236 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
237 ; GFX9: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
232 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
233 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
234 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
235 ; GFX9: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[AND]](s16)
238236 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
239237 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
240238 %0:_(s32) = COPY $vgpr0
267265 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
268266 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
269267 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
270 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
271 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
272 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
273 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
274 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
275 ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
276 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
277 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
278 ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC1]], [[TRUNC]](s16)
268 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
269 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
270 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
271 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
272 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
273 ; VI: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[AND1]], [[AND]](s16)
279274 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
280275 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
281276 ; GFX9-LABEL: name: test_lshr_i8_i8
282277 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
283278 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
284279 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
285 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
286 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
287 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
288 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
289 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
290 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
291 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY5]]
292 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
293 ; GFX9: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC1]], [[TRUNC]](s16)
280 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
281 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
282 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
283 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
284 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
285 ; GFX9: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[AND1]], [[AND]](s16)
294286 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16)
295287 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
296288 %0:_(s32) = COPY $vgpr0
1414 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY $vgpr5
1515 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY $vgpr6
1616 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY $vgpr7
17 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
18 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
19 ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[C]](s32)
20 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C1]]
21 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
17 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
18 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
19 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
20 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
21 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
22 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
23 ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
24 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C2]]
25 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
2226 ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
23 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C2]]
24 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[AND]](s32)
25 ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
26 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C2]]
27 ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
28 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[COPY11]]
29 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32)
30 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
31 ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
32 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C1]]
33 ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
34 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C2]]
35 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND4]], [[AND3]](s32)
36 ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
37 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C2]]
38 ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[SHL1]](s32)
39 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND5]], [[COPY15]]
40 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[OR1]](s32)
27 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C3]]
28 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[AND1]](s32)
29 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
30 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
31 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
32 ; CHECK: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC]]
4133 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
42 ; CHECK: [[COPY16:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
43 ; CHECK: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY16]], [[C1]]
44 ; CHECK: [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
45 ; CHECK: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY17]], [[C2]]
46 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[AND6]](s32)
47 ; CHECK: [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY4]](s32)
48 ; CHECK: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY18]], [[C2]]
49 ; CHECK: [[COPY19:%[0-9]+]]:_(s32) = COPY [[SHL2]](s32)
50 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND8]], [[COPY19]]
51 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[OR2]](s32)
34 ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
35 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C2]]
36 ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32)
37 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C3]]
38 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[AND4]](s32)
39 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
40 ; CHECK: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND3]], [[TRUNC4]]
41 ; CHECK: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[COPY4]](s32)
42 ; CHECK: [[AND6:%[0-9]+]]:_(s16) = G_AND [[TRUNC5]], [[TRUNC]]
5243 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
53 ; CHECK: [[COPY20:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
54 ; CHECK: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY20]], [[C1]]
55 ; CHECK: [[COPY21:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
56 ; CHECK: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY21]], [[C2]]
57 ; CHECK: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND10]], [[AND9]](s32)
58 ; CHECK: [[COPY22:%[0-9]+]]:_(s32) = COPY [[COPY6]](s32)
59 ; CHECK: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY22]], [[C2]]
60 ; CHECK: [[COPY23:%[0-9]+]]:_(s32) = COPY [[SHL3]](s32)
61 ; CHECK: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND11]], [[COPY23]]
62 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[OR3]](s32)
63 ; CHECK: [[MV:%[0-9]+]]:_(p1) = G_MERGE_VALUES [[TRUNC]](s16), [[TRUNC1]](s16), [[TRUNC2]](s16), [[TRUNC3]](s16)
44 ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
45 ; CHECK: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C2]]
46 ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY5]](s32)
47 ; CHECK: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C3]]
48 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND8]], [[AND7]](s32)
49 ; CHECK: [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[SHL2]](s32)
50 ; CHECK: [[OR2:%[0-9]+]]:_(s16) = G_OR [[AND6]], [[TRUNC6]]
51 ; CHECK: [[TRUNC7:%[0-9]+]]:_(s16) = G_TRUNC [[COPY6]](s32)
52 ; CHECK: [[AND9:%[0-9]+]]:_(s16) = G_AND [[TRUNC7]], [[TRUNC]]
53 ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
54 ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[C6]](s32)
55 ; CHECK: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C2]]
56 ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY7]](s32)
57 ; CHECK: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY15]], [[C3]]
58 ; CHECK: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND11]], [[AND10]](s32)
59 ; CHECK: [[TRUNC8:%[0-9]+]]:_(s16) = G_TRUNC [[SHL3]](s32)
60 ; CHECK: [[OR3:%[0-9]+]]:_(s16) = G_OR [[AND9]], [[TRUNC8]]
61 ; CHECK: [[MV:%[0-9]+]]:_(p1) = G_MERGE_VALUES [[OR]](s16), [[OR1]](s16), [[OR2]](s16), [[OR3]](s16)
6462 ; CHECK: $vgpr0_vgpr1 = COPY [[MV]](p1)
6563 %0:_(s32) = COPY $vgpr0
6664 %1:_(s32) = COPY $vgpr1
9088 ; CHECK-LABEL: name: test_merge_s16_s8_s8
9189 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
9290 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
93 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
94 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
95 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
96 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C3]]
97 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
91 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
92 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C2]](s32)
93 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
94 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
95 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
96 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
97 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
98 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C4]]
99 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
98100 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
99 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C4]]
100 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[AND]](s32)
101 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C]](s32)
102 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C4]]
103 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
104 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[COPY3]]
105 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
106 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
101 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C5]]
102 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[AND1]](s32)
103 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
104 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
105 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
106 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
107107 %0:_(s8) = G_CONSTANT i8 0
108108 %1:_(s8) = G_CONSTANT i8 1
109109 %2:_(s16) = G_MERGE_VALUES %0, %1
159159 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
160160 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
161161 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
162 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
163 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
164 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
165 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C5]]
166 ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
162 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
163 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C4]](s32)
164 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
165 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
166 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
167 ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
168 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
169 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C6]]
170 ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
167171 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
168 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C6]]
169 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[AND]](s32)
170 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C]](s32)
171 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C6]]
172 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
173 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[COPY3]]
174 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32)
175 ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
176 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C7]](s32)
177 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C5]]
178 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
179 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C6]]
180 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND4]], [[AND3]](s32)
181 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
182 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C6]]
183 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[SHL1]](s32)
184 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND5]], [[COPY7]]
185 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[OR1]](s32)
186 ; CHECK: [[MV:%[0-9]+]]:_(s32) = G_MERGE_VALUES [[TRUNC]](s16), [[TRUNC1]](s16)
172 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C7]]
173 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[AND1]](s32)
174 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
175 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
176 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[C2]](s32)
177 ; CHECK: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC]]
178 ; CHECK: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
179 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C8]](s32)
180 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C6]]
181 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
182 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C7]]
183 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[AND4]](s32)
184 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
185 ; CHECK: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND3]], [[TRUNC4]]
186 ; CHECK: [[MV:%[0-9]+]]:_(s32) = G_MERGE_VALUES [[OR]](s16), [[OR1]](s16)
187187 ; CHECK: $vgpr0 = COPY [[MV]](s32)
188188 %0:_(s8) = G_CONSTANT i8 0
189189 %1:_(s8) = G_CONSTANT i8 1
423423 ; CHECK: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
424424 ; CHECK: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
425425 ; CHECK: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 11
426 ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
427 ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
428 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C12]](s32)
429 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C13]]
430 ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
426 ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
427 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C12]](s32)
428 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
429 ; CHECK: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
430 ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
431 ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
432 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C13]](s32)
433 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C14]]
434 ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
431435 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
432 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C14]]
433 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[AND]](s32)
434 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C]](s32)
435 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C14]]
436 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
437 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[COPY3]]
438 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32)
439 ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
440 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C15]](s32)
441 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C13]]
442 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
443 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C14]]
444 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND4]], [[AND3]](s32)
445 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
446 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C14]]
447 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[SHL1]](s32)
448 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND5]], [[COPY7]]
449 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[OR1]](s32)
436 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C15]]
437 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[AND1]](s32)
438 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
439 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC2]]
440 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[C2]](s32)
441 ; CHECK: [[AND3:%[0-9]+]]:_(s16) = G_AND [[TRUNC3]], [[TRUNC]]
450442 ; CHECK: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
451 ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[C16]](s32)
452 ; CHECK: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C13]]
453 ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
454 ; CHECK: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C14]]
455 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND7]], [[AND6]](s32)
456 ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[C4]](s32)
457 ; CHECK: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C14]]
458 ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[SHL2]](s32)
459 ; CHECK: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND8]], [[COPY11]]
460 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[OR2]](s32)
443 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C16]](s32)
444 ; CHECK: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C14]]
445 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C3]](s32)
446 ; CHECK: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C15]]
447 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND5]], [[AND4]](s32)
448 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
449 ; CHECK: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND3]], [[TRUNC4]]
450 ; CHECK: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[C4]](s32)
451 ; CHECK: [[AND6:%[0-9]+]]:_(s16) = G_AND [[TRUNC5]], [[TRUNC]]
461452 ; CHECK: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
462 ; CHECK: [[COPY12:%[0-9]+]]:_(s32) = COPY [[C17]](s32)
463 ; CHECK: [[AND9:%[0-9]+]]:_(s32) = G_AND [[COPY12]], [[C13]]
464 ; CHECK: [[COPY13:%[0-9]+]]:_(s32) = COPY [[C7]](s32)
465 ; CHECK: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY13]], [[C14]]
466 ; CHECK: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND10]], [[AND9]](s32)
467 ; CHECK: [[COPY14:%[0-9]+]]:_(s32) = COPY [[C6]](s32)
468 ; CHECK: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY14]], [[C14]]
469 ; CHECK: [[COPY15:%[0-9]+]]:_(s32) = COPY [[SHL3]](s32)
470 ; CHECK: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND11]], [[COPY15]]
471 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[OR3]](s32)
453 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[C17]](s32)
454 ; CHECK: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C14]]
455 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
456 ; CHECK: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C15]]
457 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND8]], [[AND7]](s32)
458 ; CHECK: [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[SHL2]](s32)
459 ; CHECK: [[OR2:%[0-9]+]]:_(s16) = G_OR [[AND6]], [[TRUNC6]]
460 ; CHECK: [[TRUNC7:%[0-9]+]]:_(s16) = G_TRUNC [[C6]](s32)
461 ; CHECK: [[AND9:%[0-9]+]]:_(s16) = G_AND [[TRUNC7]], [[TRUNC]]
472462 ; CHECK: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
473 ; CHECK: [[COPY16:%[0-9]+]]:_(s32) = COPY [[C18]](s32)
474 ; CHECK: [[AND12:%[0-9]+]]:_(s32) = G_AND [[COPY16]], [[C13]]
475 ; CHECK: [[COPY17:%[0-9]+]]:_(s32) = COPY [[C9]](s32)
476 ; CHECK: [[AND13:%[0-9]+]]:_(s32) = G_AND [[COPY17]], [[C14]]
477 ; CHECK: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND13]], [[AND12]](s32)
478 ; CHECK: [[COPY18:%[0-9]+]]:_(s32) = COPY [[C8]](s32)
479 ; CHECK: [[AND14:%[0-9]+]]:_(s32) = G_AND [[COPY18]], [[C14]]
480 ; CHECK: [[COPY19:%[0-9]+]]:_(s32) = COPY [[SHL4]](s32)
481 ; CHECK: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND14]], [[COPY19]]
482 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[OR4]](s32)
463 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[C18]](s32)
464 ; CHECK: [[AND10:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C14]]
465 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[C7]](s32)
466 ; CHECK: [[AND11:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C15]]
467 ; CHECK: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND11]], [[AND10]](s32)
468 ; CHECK: [[TRUNC8:%[0-9]+]]:_(s16) = G_TRUNC [[SHL3]](s32)
469 ; CHECK: [[OR3:%[0-9]+]]:_(s16) = G_OR [[AND9]], [[TRUNC8]]
470 ; CHECK: [[TRUNC9:%[0-9]+]]:_(s16) = G_TRUNC [[C8]](s32)
471 ; CHECK: [[AND12:%[0-9]+]]:_(s16) = G_AND [[TRUNC9]], [[TRUNC]]
483472 ; CHECK: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
484 ; CHECK: [[COPY20:%[0-9]+]]:_(s32) = COPY [[C19]](s32)
485 ; CHECK: [[AND15:%[0-9]+]]:_(s32) = G_AND [[COPY20]], [[C13]]
486 ; CHECK: [[COPY21:%[0-9]+]]:_(s32) = COPY [[C11]](s32)
487 ; CHECK: [[AND16:%[0-9]+]]:_(s32) = G_AND [[COPY21]], [[C14]]
488 ; CHECK: [[SHL5:%[0-9]+]]:_(s32) = G_SHL [[AND16]], [[AND15]](s32)
489 ; CHECK: [[COPY22:%[0-9]+]]:_(s32) = COPY [[C10]](s32)
490 ; CHECK: [[AND17:%[0-9]+]]:_(s32) = G_AND [[COPY22]], [[C14]]
491 ; CHECK: [[COPY23:%[0-9]+]]:_(s32) = COPY [[SHL5]](s32)
492 ; CHECK: [[OR5:%[0-9]+]]:_(s32) = G_OR [[AND17]], [[COPY23]]
493 ; CHECK: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[OR5]](s32)
494 ; CHECK: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[TRUNC]](s16), [[TRUNC1]](s16), [[TRUNC2]](s16), [[TRUNC3]](s16), [[TRUNC4]](s16), [[TRUNC5]](s16)
473 ; CHECK: [[COPY8:%[0-9]+]]:_(s32) = COPY [[C19]](s32)
474 ; CHECK: [[AND13:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C14]]
475 ; CHECK: [[COPY9:%[0-9]+]]:_(s32) = COPY [[C9]](s32)
476 ; CHECK: [[AND14:%[0-9]+]]:_(s32) = G_AND [[COPY9]], [[C15]]
477 ; CHECK: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND14]], [[AND13]](s32)
478 ; CHECK: [[TRUNC10:%[0-9]+]]:_(s16) = G_TRUNC [[SHL4]](s32)
479 ; CHECK: [[OR4:%[0-9]+]]:_(s16) = G_OR [[AND12]], [[TRUNC10]]
480 ; CHECK: [[TRUNC11:%[0-9]+]]:_(s16) = G_TRUNC [[C10]](s32)
481 ; CHECK: [[AND15:%[0-9]+]]:_(s16) = G_AND [[TRUNC11]], [[TRUNC]]
482 ; CHECK: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
483 ; CHECK: [[COPY10:%[0-9]+]]:_(s32) = COPY [[C20]](s32)
484 ; CHECK: [[AND16:%[0-9]+]]:_(s32) = G_AND [[COPY10]], [[C14]]
485 ; CHECK: [[COPY11:%[0-9]+]]:_(s32) = COPY [[C11]](s32)
486 ; CHECK: [[AND17:%[0-9]+]]:_(s32) = G_AND [[COPY11]], [[C15]]
487 ; CHECK: [[SHL5:%[0-9]+]]:_(s32) = G_SHL [[AND17]], [[AND16]](s32)
488 ; CHECK: [[TRUNC12:%[0-9]+]]:_(s16) = G_TRUNC [[SHL5]](s32)
489 ; CHECK: [[OR5:%[0-9]+]]:_(s16) = G_OR [[AND15]], [[TRUNC12]]
490 ; CHECK: [[MV:%[0-9]+]]:_(s96) = G_MERGE_VALUES [[OR]](s16), [[OR1]](s16), [[OR2]](s16), [[OR3]](s16), [[OR4]](s16), [[OR5]](s16)
495491 ; CHECK: $vgpr0_vgpr1_vgpr2 = COPY [[MV]](s96)
496492 %0:_(s8) = G_CONSTANT i8 0
497493 %1:_(s8) = G_CONSTANT i8 1
155155 ; CHECK-LABEL: name: test_or_s16
156156 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
157157 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
158 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
159 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
160 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
161 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
162 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
158 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
159 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
160 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[TRUNC]], [[TRUNC1]]
161 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
162 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
163163 %0:_(s32) = COPY $vgpr0
164164 %1:_(s32) = COPY $vgpr1
165165 %2:_(s16) = G_TRUNC %0
178178 ; CHECK-LABEL: name: test_or_s24
179179 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
180180 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
181 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
182 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
183 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
184 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
185 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
181 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
182 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
183 ; CHECK: [[OR:%[0-9]+]]:_(s16) = G_OR [[TRUNC]], [[TRUNC1]]
184 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16)
185 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
186186 %0:_(s32) = COPY $vgpr0
187187 %1:_(s32) = COPY $vgpr1
188188 %2:_(s16) = G_TRUNC %0
213213 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
214214 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
215215 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
216 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
217 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
218 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
219 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
220 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[TRUNC1]](s16)
216 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
217 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
218 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
219 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[AND]](s16)
221220 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
222221 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
223222 ; GFX9-LABEL: name: test_shl_s16_i8
225224 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
226225 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
227226 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
228 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
229 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
230 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
231 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
232 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[TRUNC1]](s16)
227 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
228 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
229 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC1]]
230 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[AND]](s16)
233231 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
234232 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
235233 %0:_(s32) = COPY $vgpr0
261259 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
262260 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
263261 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
264 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
265 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
266 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
267 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
268 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
269 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[TRUNC]](s16)
262 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
263 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
264 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
265 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
266 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[AND]](s16)
270267 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
271268 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
272269 ; GFX9-LABEL: name: test_shl_i8_i8
273270 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
274271 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
275272 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
276 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
277 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
278 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
279 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
280 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
281 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[TRUNC]](s16)
273 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
274 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
275 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
276 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
277 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[AND]](s16)
282278 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
283279 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
284280 %0:_(s32) = COPY $vgpr0
714710 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
715711 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
716712 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
717 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
718 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
719 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
720 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
721 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
722 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[TRUNC]](s16)
713 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
714 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
715 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
716 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
717 ; VI: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[AND]](s16)
723718 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
724719 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
725720 ; GFX9-LABEL: name: test_shl_s7_s7
726721 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
727722 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
728723 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
729 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
730 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
731 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
732 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
733 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
734 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[TRUNC]](s16)
724 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
725 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
726 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
727 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
728 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[AND]](s16)
735729 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SHL]](s16)
736730 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
737731 %0:_(s32) = COPY $vgpr0
9292 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
9393 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
9494 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
95 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
96 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
97 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
98 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
99 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
100 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY3]]
101 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
102 ; VI: [[UMAX:%[0-9]+]]:_(s16) = G_UMAX [[TRUNC]], [[TRUNC1]]
95 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
96 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
97 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
98 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
99 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
100 ; VI: [[UMAX:%[0-9]+]]:_(s16) = G_UMAX [[AND]], [[AND1]]
103101 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UMAX]](s16)
104102 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
105103 ; GFX9-LABEL: name: test_umax_s8
106104 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
107105 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
108106 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
109 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
110 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
111 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
112 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
113 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
114 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY3]]
115 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
116 ; GFX9: [[UMAX:%[0-9]+]]:_(s16) = G_UMAX [[TRUNC]], [[TRUNC1]]
107 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
108 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
109 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
110 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
111 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
112 ; GFX9: [[UMAX:%[0-9]+]]:_(s16) = G_UMAX [[AND]], [[AND1]]
117113 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UMAX]](s16)
118114 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
119115 %0:_(s32) = COPY $vgpr0
9292 ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
9393 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
9494 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
95 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
96 ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
97 ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
98 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
99 ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
100 ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY3]]
101 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
102 ; VI: [[UMIN:%[0-9]+]]:_(s16) = G_UMIN [[TRUNC]], [[TRUNC1]]
95 ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
96 ; VI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
97 ; VI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
98 ; VI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
99 ; VI: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
100 ; VI: [[UMIN:%[0-9]+]]:_(s16) = G_UMIN [[AND]], [[AND1]]
103101 ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UMIN]](s16)
104102 ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
105103 ; GFX9-LABEL: name: test_umin_s8
106104 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
107105 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
108106 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
109 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
110 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
111 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
112 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32)
113 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
114 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[COPY3]]
115 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[AND1]](s32)
116 ; GFX9: [[UMIN:%[0-9]+]]:_(s16) = G_UMIN [[TRUNC]], [[TRUNC1]]
107 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32)
108 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
109 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC1]], [[TRUNC]]
110 ; GFX9: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
111 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[TRUNC]]
112 ; GFX9: [[UMIN:%[0-9]+]]:_(s16) = G_UMIN [[AND]], [[AND1]]
117113 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UMIN]](s16)
118114 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
119115 %0:_(s32) = COPY $vgpr0
155155 ; CHECK-LABEL: name: test_xor_s16
156156 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
157157 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
158 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
159 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
160 ; CHECK: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY3]]
161 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[XOR]](s32)
162 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
158 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
159 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
160 ; CHECK: [[XOR:%[0-9]+]]:_(s16) = G_XOR [[TRUNC]], [[TRUNC1]]
161 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[XOR]](s16)
162 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
163163 %0:_(s32) = COPY $vgpr0
164164 %1:_(s32) = COPY $vgpr1
165165 %2:_(s16) = G_TRUNC %0
178178 ; CHECK-LABEL: name: test_xor_s24
179179 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
180180 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
181 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
182 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
183 ; CHECK: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY3]]
184 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[XOR]](s32)
185 ; CHECK: $vgpr0 = COPY [[COPY4]](s32)
181 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
182 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
183 ; CHECK: [[XOR:%[0-9]+]]:_(s16) = G_XOR [[TRUNC]], [[TRUNC1]]
184 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[XOR]](s16)
185 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
186186 %0:_(s32) = COPY $vgpr0
187187 %1:_(s32) = COPY $vgpr1
188188 %2:_(s16) = G_TRUNC %0