Index: lib/CodeGen/SelectionDAG/TargetLowering.cpp =================================================================== --- lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1248,8 +1248,8 @@ TLO.DAG.getNode(ISD::SHL, dl, VT, Sign, ShAmt)); } } - // If bitcast from a vector and the mask covers entire elements, see if we - // can use SimplifyDemandedVectorElts. + // If bitcast from a vector, see if we can use SimplifyDemandedVectorElts by + // demanding the element if any bits from it are demanded. // TODO - bigendian once we have test coverage. // TODO - bool vectors once SimplifyDemandedVectorElts has SETCC support. if (SrcVT.isVector() && NumSrcEltBits > 1 && @@ -1261,10 +1261,8 @@ for (unsigned i = 0; i != Scale; ++i) { unsigned Offset = i * NumSrcEltBits; APInt Sub = DemandedBits.extractBits(NumSrcEltBits, Offset); - if (Sub.isAllOnesValue()) + if (!Sub.isNullValue()) DemandedSubElts.setBit(i); - else if (!Sub.isNullValue()) - return false; } return true; }; Index: test/CodeGen/AMDGPU/idot8.ll =================================================================== --- test/CodeGen/AMDGPU/idot8.ll +++ test/CodeGen/AMDGPU/idot8.ll @@ -3656,67 +3656,60 @@ ; GFX7: ; %bb.0: ; %entry ; GFX7-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9 ; GFX7-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0xd -; GFX7-NEXT: s_mov_b32 s0, 0 -; GFX7-NEXT: s_mov_b32 s12, s0 -; GFX7-NEXT: s_mov_b32 s14, s0 +; GFX7-NEXT: s_mov_b32 s7, 0xf000 +; GFX7-NEXT: s_mov_b32 s6, -1 ; GFX7-NEXT: s_waitcnt lgkmcnt(0) ; GFX7-NEXT: s_load_dword s1, s[8:9], 0x0 -; GFX7-NEXT: s_load_dword s2, s[10:11], 0x0 -; GFX7-NEXT: s_load_dword s38, s[4:5], 0x0 -; GFX7-NEXT: s_mov_b32 s16, s0 -; GFX7-NEXT: s_mov_b32 s18, s0 +; GFX7-NEXT: s_load_dword s9, s[10:11], 0x0 +; GFX7-NEXT: s_load_dword s2, s[4:5], 0x0 ; GFX7-NEXT: s_waitcnt lgkmcnt(0) -; GFX7-NEXT: s_lshl_b32 s13, s1, 4 -; GFX7-NEXT: s_lshl_b32 s15, s1, 12 -; GFX7-NEXT: s_lshl_b32 s17, s1, 16 -; GFX7-NEXT: s_lshl_b32 s19, s1, 20 -; GFX7-NEXT: s_ashr_i64 s[10:11], s[12:13], 60 +; GFX7-NEXT: s_ashr_i64 s[10:11], s[0:1], 60 +; GFX7-NEXT: s_lshl_b32 s11, s1, 4 +; GFX7-NEXT: s_ashr_i64 s[14:15], s[10:11], 60 +; GFX7-NEXT: s_lshl_b32 s11, s1, 12 +; GFX7-NEXT: s_ashr_i64 s[16:17], s[10:11], 60 +; GFX7-NEXT: s_lshl_b32 s11, s1, 16 +; GFX7-NEXT: s_ashr_i64 s[18:19], s[10:11], 60 +; GFX7-NEXT: s_lshl_b32 s11, s1, 20 ; GFX7-NEXT: s_lshl_b32 s13, s1, 8 -; GFX7-NEXT: s_ashr_i64 s[8:9], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s21, s1, 24 +; GFX7-NEXT: s_ashr_i64 s[20:21], s[10:11], 60 +; GFX7-NEXT: s_lshl_b32 s11, s1, 24 ; GFX7-NEXT: s_lshl_b32 s1, s1, 28 -; GFX7-NEXT: s_ashr_i64 s[22:23], s[0:1], 60 -; GFX7-NEXT: s_mov_b32 s1, s2 -; GFX7-NEXT: s_ashr_i64 s[24:25], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 4 +; GFX7-NEXT: s_ashr_i64 s[0:1], s[0:1], 60 +; GFX7-NEXT: s_lshl_b32 s1, s9, 4 ; GFX7-NEXT: s_ashr_i64 s[26:27], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 8 +; GFX7-NEXT: s_lshl_b32 s1, s9, 8 ; GFX7-NEXT: s_ashr_i64 s[28:29], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 12 +; GFX7-NEXT: s_lshl_b32 s1, s9, 12 ; GFX7-NEXT: s_ashr_i64 s[30:31], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 16 +; GFX7-NEXT: s_lshl_b32 s1, s9, 16 ; GFX7-NEXT: s_ashr_i64 s[32:33], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 20 +; GFX7-NEXT: s_lshl_b32 s1, s9, 20 ; GFX7-NEXT: s_ashr_i64 s[34:35], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 24 +; GFX7-NEXT: s_lshl_b32 s1, s9, 24 ; GFX7-NEXT: s_ashr_i64 s[36:37], s[0:1], 60 -; GFX7-NEXT: s_lshl_b32 s1, s2, 28 -; GFX7-NEXT: s_mov_b32 s20, s0 -; GFX7-NEXT: s_ashr_i64 s[0:1], s[0:1], 60 -; GFX7-NEXT: v_mov_b32_e32 v0, s0 -; GFX7-NEXT: v_mov_b32_e32 v1, s38 -; GFX7-NEXT: v_mad_i32_i24 v0, s22, v0, v1 -; GFX7-NEXT: s_ashr_i64 s[20:21], s[20:21], 60 +; GFX7-NEXT: s_lshl_b32 s1, s9, 28 +; GFX7-NEXT: s_ashr_i64 s[24:25], s[8:9], 60 +; GFX7-NEXT: s_ashr_i64 s[8:9], s[0:1], 60 +; GFX7-NEXT: v_mov_b32_e32 v0, s8 +; GFX7-NEXT: v_mov_b32_e32 v1, s2 +; GFX7-NEXT: v_mad_i32_i24 v0, s0, v0, v1 +; GFX7-NEXT: s_ashr_i64 s[22:23], s[10:11], 60 ; GFX7-NEXT: v_mov_b32_e32 v1, s36 -; GFX7-NEXT: v_mad_i32_i24 v0, s20, v1, v0 -; GFX7-NEXT: s_ashr_i64 s[18:19], s[18:19], 60 +; GFX7-NEXT: v_mad_i32_i24 v0, s22, v1, v0 ; GFX7-NEXT: v_mov_b32_e32 v1, s34 -; GFX7-NEXT: v_mad_i32_i24 v0, s18, v1, v0 -; GFX7-NEXT: s_ashr_i64 s[16:17], s[16:17], 60 +; GFX7-NEXT: v_mad_i32_i24 v0, s20, v1, v0 ; GFX7-NEXT: v_mov_b32_e32 v1, s32 -; GFX7-NEXT: v_mad_i32_i24 v0, s16, v1, v0 -; GFX7-NEXT: s_ashr_i64 s[14:15], s[14:15], 60 +; GFX7-NEXT: v_mad_i32_i24 v0, s18, v1, v0 ; GFX7-NEXT: v_mov_b32_e32 v1, s30 -; GFX7-NEXT: v_mad_i32_i24 v0, s14, v1, v0 +; GFX7-NEXT: v_mad_i32_i24 v0, s16, v1, v0 ; GFX7-NEXT: s_ashr_i64 s[12:13], s[12:13], 60 ; GFX7-NEXT: v_mov_b32_e32 v1, s28 ; GFX7-NEXT: v_mad_i32_i24 v0, s12, v1, v0 ; GFX7-NEXT: v_mov_b32_e32 v1, s26 -; GFX7-NEXT: v_mad_i32_i24 v0, s10, v1, v0 +; GFX7-NEXT: v_mad_i32_i24 v0, s14, v1, v0 ; GFX7-NEXT: v_mov_b32_e32 v1, s24 -; GFX7-NEXT: s_mov_b32 s7, 0xf000 -; GFX7-NEXT: s_mov_b32 s6, -1 -; GFX7-NEXT: v_mad_i32_i24 v0, s8, v1, v0 +; GFX7-NEXT: v_mad_i32_i24 v0, s10, v1, v0 ; GFX7-NEXT: buffer_store_dword v0, off, s[4:7], 0 ; GFX7-NEXT: s_endpgm ; @@ -3724,67 +3717,60 @@ ; GFX8: ; %bb.0: ; %entry ; GFX8-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24 ; GFX8-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34 -; GFX8-NEXT: s_mov_b32 s8, 0 -; GFX8-NEXT: s_mov_b32 s10, s8 -; GFX8-NEXT: s_mov_b32 s12, s8 ; GFX8-NEXT: s_waitcnt lgkmcnt(0) -; GFX8-NEXT: s_load_dword s9, s[4:5], 0x0 -; GFX8-NEXT: s_load_dword s2, s[6:7], 0x0 -; GFX8-NEXT: s_load_dword s36, s[0:1], 0x0 -; GFX8-NEXT: s_mov_b32 s14, s8 -; GFX8-NEXT: s_mov_b32 s16, s8 -; GFX8-NEXT: s_waitcnt lgkmcnt(0) -; GFX8-NEXT: s_lshl_b32 s11, s9, 4 -; GFX8-NEXT: s_lshl_b32 s13, s9, 8 -; GFX8-NEXT: s_lshl_b32 s15, s9, 16 -; GFX8-NEXT: s_lshl_b32 s17, s9, 20 -; GFX8-NEXT: s_ashr_i64 s[6:7], s[10:11], 60 -; GFX8-NEXT: s_ashr_i64 s[10:11], s[12:13], 60 -; GFX8-NEXT: s_lshl_b32 s13, s9, 12 -; GFX8-NEXT: s_ashr_i64 s[4:5], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s19, s9, 24 -; GFX8-NEXT: s_lshl_b32 s9, s9, 28 -; GFX8-NEXT: s_ashr_i64 s[20:21], s[8:9], 60 -; GFX8-NEXT: s_mov_b32 s9, s2 -; GFX8-NEXT: s_ashr_i64 s[22:23], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 4 -; GFX8-NEXT: s_ashr_i64 s[24:25], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 8 -; GFX8-NEXT: s_ashr_i64 s[26:27], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 12 -; GFX8-NEXT: s_ashr_i64 s[28:29], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 16 -; GFX8-NEXT: s_ashr_i64 s[30:31], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 20 -; GFX8-NEXT: s_ashr_i64 s[32:33], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 24 -; GFX8-NEXT: s_ashr_i64 s[34:35], s[8:9], 60 -; GFX8-NEXT: s_lshl_b32 s9, s2, 28 -; GFX8-NEXT: s_mov_b32 s18, s8 -; GFX8-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 -; GFX8-NEXT: v_mov_b32_e32 v0, s8 -; GFX8-NEXT: v_mov_b32_e32 v1, s36 -; GFX8-NEXT: v_mad_i32_i24 v0, s20, v0, v1 -; GFX8-NEXT: s_ashr_i64 s[18:19], s[18:19], 60 -; GFX8-NEXT: v_mov_b32_e32 v1, s34 -; GFX8-NEXT: v_mad_i32_i24 v0, s18, v1, v0 -; GFX8-NEXT: s_ashr_i64 s[16:17], s[16:17], 60 -; GFX8-NEXT: v_mov_b32_e32 v1, s32 -; GFX8-NEXT: v_mad_i32_i24 v0, s16, v1, v0 -; GFX8-NEXT: s_ashr_i64 s[14:15], s[14:15], 60 -; GFX8-NEXT: v_mov_b32_e32 v1, s30 -; GFX8-NEXT: v_mad_i32_i24 v0, s14, v1, v0 -; GFX8-NEXT: s_ashr_i64 s[12:13], s[12:13], 60 -; GFX8-NEXT: v_mov_b32_e32 v1, s28 -; GFX8-NEXT: v_mad_i32_i24 v0, s12, v1, v0 -; GFX8-NEXT: v_mov_b32_e32 v1, s26 -; GFX8-NEXT: v_mad_i32_i24 v0, s10, v1, v0 -; GFX8-NEXT: v_mov_b32_e32 v1, s24 -; GFX8-NEXT: v_mad_i32_i24 v0, s6, v1, v0 -; GFX8-NEXT: v_mov_b32_e32 v1, s22 -; GFX8-NEXT: v_mad_i32_i24 v2, s4, v1, v0 +; GFX8-NEXT: s_load_dword s5, s[4:5], 0x0 +; GFX8-NEXT: s_load_dword s7, s[6:7], 0x0 +; GFX8-NEXT: s_load_dword s2, s[0:1], 0x0 ; GFX8-NEXT: v_mov_b32_e32 v0, s0 ; GFX8-NEXT: v_mov_b32_e32 v1, s1 +; GFX8-NEXT: s_waitcnt lgkmcnt(0) +; GFX8-NEXT: s_ashr_i64 s[0:1], s[4:5], 60 +; GFX8-NEXT: s_lshl_b32 s1, s5, 4 +; GFX8-NEXT: s_ashr_i64 s[12:13], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s5, 16 +; GFX8-NEXT: s_ashr_i64 s[14:15], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s5, 20 +; GFX8-NEXT: s_ashr_i64 s[16:17], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s5, 24 +; GFX8-NEXT: s_ashr_i64 s[18:19], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s5, 28 +; GFX8-NEXT: s_lshl_b32 s9, s5, 8 +; GFX8-NEXT: s_lshl_b32 s11, s5, 12 +; GFX8-NEXT: s_ashr_i64 s[4:5], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 4 +; GFX8-NEXT: s_ashr_i64 s[22:23], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 8 +; GFX8-NEXT: s_ashr_i64 s[24:25], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 12 +; GFX8-NEXT: s_ashr_i64 s[26:27], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 16 +; GFX8-NEXT: s_ashr_i64 s[28:29], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 20 +; GFX8-NEXT: s_ashr_i64 s[30:31], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 24 +; GFX8-NEXT: s_ashr_i64 s[32:33], s[0:1], 60 +; GFX8-NEXT: s_lshl_b32 s1, s7, 28 +; GFX8-NEXT: s_ashr_i64 s[20:21], s[6:7], 60 +; GFX8-NEXT: s_ashr_i64 s[6:7], s[0:1], 60 +; GFX8-NEXT: v_mov_b32_e32 v2, s6 +; GFX8-NEXT: v_mov_b32_e32 v3, s2 +; GFX8-NEXT: v_mad_i32_i24 v2, s4, v2, v3 +; GFX8-NEXT: v_mov_b32_e32 v3, s32 +; GFX8-NEXT: v_mad_i32_i24 v2, s18, v3, v2 +; GFX8-NEXT: v_mov_b32_e32 v3, s30 +; GFX8-NEXT: v_mad_i32_i24 v2, s16, v3, v2 +; GFX8-NEXT: v_mov_b32_e32 v3, s28 +; GFX8-NEXT: v_mad_i32_i24 v2, s14, v3, v2 +; GFX8-NEXT: s_ashr_i64 s[10:11], s[10:11], 60 +; GFX8-NEXT: v_mov_b32_e32 v3, s26 +; GFX8-NEXT: v_mad_i32_i24 v2, s10, v3, v2 +; GFX8-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 +; GFX8-NEXT: v_mov_b32_e32 v3, s24 +; GFX8-NEXT: v_mad_i32_i24 v2, s8, v3, v2 +; GFX8-NEXT: v_mov_b32_e32 v3, s22 +; GFX8-NEXT: v_mad_i32_i24 v2, s12, v3, v2 +; GFX8-NEXT: v_mov_b32_e32 v3, s20 +; GFX8-NEXT: v_mad_i32_i24 v2, s0, v3, v2 ; GFX8-NEXT: flat_store_dword v[0:1], v2 ; GFX8-NEXT: s_endpgm ; @@ -3792,67 +3778,60 @@ ; GFX9: ; %bb.0: ; %entry ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34 -; GFX9-NEXT: s_mov_b32 s8, 0 -; GFX9-NEXT: s_mov_b32 s10, s8 -; GFX9-NEXT: s_mov_b32 s12, s8 -; GFX9-NEXT: s_waitcnt lgkmcnt(0) -; GFX9-NEXT: s_load_dword s9, s[4:5], 0x0 -; GFX9-NEXT: s_load_dword s2, s[6:7], 0x0 -; GFX9-NEXT: s_load_dword s36, s[0:1], 0x0 -; GFX9-NEXT: s_mov_b32 s14, s8 -; GFX9-NEXT: s_mov_b32 s16, s8 ; GFX9-NEXT: s_waitcnt lgkmcnt(0) -; GFX9-NEXT: s_lshl_b32 s11, s9, 4 -; GFX9-NEXT: s_lshl_b32 s13, s9, 8 -; GFX9-NEXT: s_lshl_b32 s15, s9, 16 -; GFX9-NEXT: s_lshl_b32 s17, s9, 20 -; GFX9-NEXT: s_ashr_i64 s[6:7], s[10:11], 60 -; GFX9-NEXT: s_ashr_i64 s[10:11], s[12:13], 60 -; GFX9-NEXT: s_lshl_b32 s13, s9, 12 -; GFX9-NEXT: s_ashr_i64 s[4:5], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s19, s9, 24 -; GFX9-NEXT: s_lshl_b32 s9, s9, 28 -; GFX9-NEXT: s_ashr_i64 s[20:21], s[8:9], 60 -; GFX9-NEXT: s_mov_b32 s9, s2 -; GFX9-NEXT: s_ashr_i64 s[22:23], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 4 -; GFX9-NEXT: s_ashr_i64 s[24:25], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 8 -; GFX9-NEXT: s_ashr_i64 s[26:27], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 12 -; GFX9-NEXT: s_ashr_i64 s[28:29], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 16 -; GFX9-NEXT: s_ashr_i64 s[30:31], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 20 -; GFX9-NEXT: s_ashr_i64 s[32:33], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 24 -; GFX9-NEXT: s_ashr_i64 s[34:35], s[8:9], 60 -; GFX9-NEXT: s_lshl_b32 s9, s2, 28 -; GFX9-NEXT: s_mov_b32 s18, s8 -; GFX9-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 -; GFX9-NEXT: v_mov_b32_e32 v0, s8 -; GFX9-NEXT: v_mov_b32_e32 v1, s36 -; GFX9-NEXT: v_mad_i32_i24 v0, s20, v0, v1 -; GFX9-NEXT: s_ashr_i64 s[18:19], s[18:19], 60 -; GFX9-NEXT: v_mov_b32_e32 v1, s34 -; GFX9-NEXT: v_mad_i32_i24 v0, s18, v1, v0 -; GFX9-NEXT: s_ashr_i64 s[16:17], s[16:17], 60 -; GFX9-NEXT: v_mov_b32_e32 v1, s32 -; GFX9-NEXT: v_mad_i32_i24 v0, s16, v1, v0 -; GFX9-NEXT: s_ashr_i64 s[14:15], s[14:15], 60 -; GFX9-NEXT: v_mov_b32_e32 v1, s30 -; GFX9-NEXT: v_mad_i32_i24 v0, s14, v1, v0 -; GFX9-NEXT: s_ashr_i64 s[12:13], s[12:13], 60 -; GFX9-NEXT: v_mov_b32_e32 v1, s28 -; GFX9-NEXT: v_mad_i32_i24 v0, s12, v1, v0 -; GFX9-NEXT: v_mov_b32_e32 v1, s26 -; GFX9-NEXT: v_mad_i32_i24 v0, s10, v1, v0 -; GFX9-NEXT: v_mov_b32_e32 v1, s24 -; GFX9-NEXT: v_mad_i32_i24 v0, s6, v1, v0 -; GFX9-NEXT: v_mov_b32_e32 v1, s22 -; GFX9-NEXT: v_mad_i32_i24 v2, s4, v1, v0 +; GFX9-NEXT: s_load_dword s5, s[4:5], 0x0 +; GFX9-NEXT: s_load_dword s7, s[6:7], 0x0 +; GFX9-NEXT: s_load_dword s2, s[0:1], 0x0 ; GFX9-NEXT: v_mov_b32_e32 v0, s0 ; GFX9-NEXT: v_mov_b32_e32 v1, s1 +; GFX9-NEXT: s_waitcnt lgkmcnt(0) +; GFX9-NEXT: s_ashr_i64 s[0:1], s[4:5], 60 +; GFX9-NEXT: s_lshl_b32 s1, s5, 4 +; GFX9-NEXT: s_ashr_i64 s[12:13], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s5, 16 +; GFX9-NEXT: s_ashr_i64 s[14:15], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s5, 20 +; GFX9-NEXT: s_ashr_i64 s[16:17], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s5, 24 +; GFX9-NEXT: s_ashr_i64 s[18:19], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s5, 28 +; GFX9-NEXT: s_lshl_b32 s9, s5, 8 +; GFX9-NEXT: s_lshl_b32 s11, s5, 12 +; GFX9-NEXT: s_ashr_i64 s[4:5], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 4 +; GFX9-NEXT: s_ashr_i64 s[22:23], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 8 +; GFX9-NEXT: s_ashr_i64 s[24:25], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 12 +; GFX9-NEXT: s_ashr_i64 s[26:27], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 16 +; GFX9-NEXT: s_ashr_i64 s[28:29], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 20 +; GFX9-NEXT: s_ashr_i64 s[30:31], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 24 +; GFX9-NEXT: s_ashr_i64 s[32:33], s[0:1], 60 +; GFX9-NEXT: s_lshl_b32 s1, s7, 28 +; GFX9-NEXT: s_ashr_i64 s[20:21], s[6:7], 60 +; GFX9-NEXT: s_ashr_i64 s[6:7], s[0:1], 60 +; GFX9-NEXT: v_mov_b32_e32 v2, s6 +; GFX9-NEXT: v_mov_b32_e32 v3, s2 +; GFX9-NEXT: v_mad_i32_i24 v2, s4, v2, v3 +; GFX9-NEXT: v_mov_b32_e32 v3, s32 +; GFX9-NEXT: v_mad_i32_i24 v2, s18, v3, v2 +; GFX9-NEXT: v_mov_b32_e32 v3, s30 +; GFX9-NEXT: v_mad_i32_i24 v2, s16, v3, v2 +; GFX9-NEXT: v_mov_b32_e32 v3, s28 +; GFX9-NEXT: v_mad_i32_i24 v2, s14, v3, v2 +; GFX9-NEXT: s_ashr_i64 s[10:11], s[10:11], 60 +; GFX9-NEXT: v_mov_b32_e32 v3, s26 +; GFX9-NEXT: v_mad_i32_i24 v2, s10, v3, v2 +; GFX9-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 +; GFX9-NEXT: v_mov_b32_e32 v3, s24 +; GFX9-NEXT: v_mad_i32_i24 v2, s8, v3, v2 +; GFX9-NEXT: v_mov_b32_e32 v3, s22 +; GFX9-NEXT: v_mad_i32_i24 v2, s12, v3, v2 +; GFX9-NEXT: v_mov_b32_e32 v3, s20 +; GFX9-NEXT: v_mad_i32_i24 v2, s0, v3, v2 ; GFX9-NEXT: global_store_dword v[0:1], v2, off ; GFX9-NEXT: s_endpgm ; @@ -3860,67 +3839,60 @@ ; GFX9-DL: ; %bb.0: ; %entry ; GFX9-DL-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24 ; GFX9-DL-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34 -; GFX9-DL-NEXT: s_mov_b32 s8, 0 -; GFX9-DL-NEXT: s_mov_b32 s10, s8 -; GFX9-DL-NEXT: s_mov_b32 s12, s8 -; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0) -; GFX9-DL-NEXT: s_load_dword s9, s[4:5], 0x0 -; GFX9-DL-NEXT: s_load_dword s2, s[6:7], 0x0 -; GFX9-DL-NEXT: s_load_dword s36, s[0:1], 0x0 -; GFX9-DL-NEXT: s_mov_b32 s14, s8 -; GFX9-DL-NEXT: s_mov_b32 s16, s8 ; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0) -; GFX9-DL-NEXT: s_lshl_b32 s11, s9, 4 -; GFX9-DL-NEXT: s_lshl_b32 s13, s9, 8 -; GFX9-DL-NEXT: s_lshl_b32 s15, s9, 16 -; GFX9-DL-NEXT: s_lshl_b32 s17, s9, 20 -; GFX9-DL-NEXT: s_ashr_i64 s[6:7], s[10:11], 60 -; GFX9-DL-NEXT: s_ashr_i64 s[10:11], s[12:13], 60 -; GFX9-DL-NEXT: s_lshl_b32 s13, s9, 12 -; GFX9-DL-NEXT: s_ashr_i64 s[4:5], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s19, s9, 24 -; GFX9-DL-NEXT: s_lshl_b32 s9, s9, 28 -; GFX9-DL-NEXT: s_ashr_i64 s[20:21], s[8:9], 60 -; GFX9-DL-NEXT: s_mov_b32 s9, s2 -; GFX9-DL-NEXT: s_ashr_i64 s[22:23], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 4 -; GFX9-DL-NEXT: s_ashr_i64 s[24:25], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 8 -; GFX9-DL-NEXT: s_ashr_i64 s[26:27], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 12 -; GFX9-DL-NEXT: s_ashr_i64 s[28:29], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 16 -; GFX9-DL-NEXT: s_ashr_i64 s[30:31], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 20 -; GFX9-DL-NEXT: s_ashr_i64 s[32:33], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 24 -; GFX9-DL-NEXT: s_ashr_i64 s[34:35], s[8:9], 60 -; GFX9-DL-NEXT: s_lshl_b32 s9, s2, 28 -; GFX9-DL-NEXT: s_mov_b32 s18, s8 -; GFX9-DL-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 -; GFX9-DL-NEXT: v_mov_b32_e32 v0, s8 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s36 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s20, v0, v1 -; GFX9-DL-NEXT: s_ashr_i64 s[18:19], s[18:19], 60 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s34 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s18, v1, v0 -; GFX9-DL-NEXT: s_ashr_i64 s[16:17], s[16:17], 60 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s32 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s16, v1, v0 -; GFX9-DL-NEXT: s_ashr_i64 s[14:15], s[14:15], 60 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s30 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s14, v1, v0 -; GFX9-DL-NEXT: s_ashr_i64 s[12:13], s[12:13], 60 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s28 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s12, v1, v0 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s26 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s10, v1, v0 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s24 -; GFX9-DL-NEXT: v_mad_i32_i24 v0, s6, v1, v0 -; GFX9-DL-NEXT: v_mov_b32_e32 v1, s22 -; GFX9-DL-NEXT: v_mad_i32_i24 v2, s4, v1, v0 +; GFX9-DL-NEXT: s_load_dword s5, s[4:5], 0x0 +; GFX9-DL-NEXT: s_load_dword s7, s[6:7], 0x0 +; GFX9-DL-NEXT: s_load_dword s2, s[0:1], 0x0 ; GFX9-DL-NEXT: v_mov_b32_e32 v0, s0 ; GFX9-DL-NEXT: v_mov_b32_e32 v1, s1 +; GFX9-DL-NEXT: s_waitcnt lgkmcnt(0) +; GFX9-DL-NEXT: s_ashr_i64 s[0:1], s[4:5], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s5, 4 +; GFX9-DL-NEXT: s_ashr_i64 s[12:13], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s5, 16 +; GFX9-DL-NEXT: s_ashr_i64 s[14:15], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s5, 20 +; GFX9-DL-NEXT: s_ashr_i64 s[16:17], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s5, 24 +; GFX9-DL-NEXT: s_ashr_i64 s[18:19], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s5, 28 +; GFX9-DL-NEXT: s_lshl_b32 s9, s5, 8 +; GFX9-DL-NEXT: s_lshl_b32 s11, s5, 12 +; GFX9-DL-NEXT: s_ashr_i64 s[4:5], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 4 +; GFX9-DL-NEXT: s_ashr_i64 s[22:23], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 8 +; GFX9-DL-NEXT: s_ashr_i64 s[24:25], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 12 +; GFX9-DL-NEXT: s_ashr_i64 s[26:27], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 16 +; GFX9-DL-NEXT: s_ashr_i64 s[28:29], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 20 +; GFX9-DL-NEXT: s_ashr_i64 s[30:31], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 24 +; GFX9-DL-NEXT: s_ashr_i64 s[32:33], s[0:1], 60 +; GFX9-DL-NEXT: s_lshl_b32 s1, s7, 28 +; GFX9-DL-NEXT: s_ashr_i64 s[20:21], s[6:7], 60 +; GFX9-DL-NEXT: s_ashr_i64 s[6:7], s[0:1], 60 +; GFX9-DL-NEXT: v_mov_b32_e32 v2, s6 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s2 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s4, v2, v3 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s32 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s18, v3, v2 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s30 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s16, v3, v2 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s28 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s14, v3, v2 +; GFX9-DL-NEXT: s_ashr_i64 s[10:11], s[10:11], 60 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s26 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s10, v3, v2 +; GFX9-DL-NEXT: s_ashr_i64 s[8:9], s[8:9], 60 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s24 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s8, v3, v2 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s22 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s12, v3, v2 +; GFX9-DL-NEXT: v_mov_b32_e32 v3, s20 +; GFX9-DL-NEXT: v_mad_i32_i24 v2, s0, v3, v2 ; GFX9-DL-NEXT: global_store_dword v[0:1], v2, off ; GFX9-DL-NEXT: s_endpgm <8 x i4> addrspace(1)* %src2, Index: test/CodeGen/AMDGPU/store-weird-sizes.ll =================================================================== --- test/CodeGen/AMDGPU/store-weird-sizes.ll +++ test/CodeGen/AMDGPU/store-weird-sizes.ll @@ -76,20 +76,19 @@ ; GFX9: ; %bb.0: ; GFX9-NEXT: v_mov_b32_e32 v0, s4 ; GFX9-NEXT: v_mov_b32_e32 v1, s5 -; GFX9-NEXT: v_mov_b32_e32 v2, 0 -; GFX9-NEXT: global_load_ubyte_d16_hi v2, v[0:1], off offset:14 +; GFX9-NEXT: global_load_ubyte_d16_hi v0, v[0:1], off offset:14 ; GFX9-NEXT: s_load_dword s0, s[4:5], 0x0 ; GFX9-NEXT: s_load_dword s1, s[4:5], 0x8 ; GFX9-NEXT: s_load_dword s2, s[4:5], 0xc ; GFX9-NEXT: s_waitcnt lgkmcnt(0) -; GFX9-NEXT: v_mov_b32_e32 v0, s0 +; GFX9-NEXT: v_mov_b32_e32 v1, s0 ; GFX9-NEXT: v_mov_b32_e32 v3, s1 -; GFX9-NEXT: v_mov_b32_e32 v1, s2 -; GFX9-NEXT: ds_write_b16 v0, v1 offset:4 +; GFX9-NEXT: v_mov_b32_e32 v2, s2 +; GFX9-NEXT: ds_write_b16 v1, v2 offset:4 ; GFX9-NEXT: s_waitcnt vmcnt(0) -; GFX9-NEXT: v_and_b32_e32 v1, 0x7f0000, v2 -; GFX9-NEXT: ds_write_b8_d16_hi v0, v1 offset:6 -; GFX9-NEXT: ds_write_b32 v0, v3 +; GFX9-NEXT: v_and_b32_e32 v0, 0x7f0000, v0 +; GFX9-NEXT: ds_write_b8_d16_hi v1, v0 offset:6 +; GFX9-NEXT: ds_write_b32 v1, v3 ; GFX9-NEXT: s_endpgm store i55 %arg, i55 addrspace(3)* %ptr, align 8 ret void Index: test/CodeGen/X86/combine-sdiv.ll =================================================================== --- test/CodeGen/X86/combine-sdiv.ll +++ test/CodeGen/X86/combine-sdiv.ll @@ -1559,7 +1559,6 @@ ; SSE2: # %bb.0: ; SSE2-NEXT: movdqa %xmm0, %xmm1 ; SSE2-NEXT: psrad $31, %xmm1 -; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] ; SSE2-NEXT: psrlq $62, %xmm1 ; SSE2-NEXT: pxor %xmm2, %xmm2 ; SSE2-NEXT: punpckhqdq {{.*#+}} xmm2 = xmm2[1],xmm1[1] @@ -1578,7 +1577,6 @@ ; SSE41: # %bb.0: ; SSE41-NEXT: movdqa %xmm0, %xmm1 ; SSE41-NEXT: psrad $31, %xmm1 -; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] ; SSE41-NEXT: psrlq $62, %xmm1 ; SSE41-NEXT: pxor %xmm2, %xmm2 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7] @@ -1667,58 +1665,41 @@ define <4 x i64> @combine_vec_sdiv_by_pow2b_v4i64(<4 x i64> %x) { ; SSE2-LABEL: combine_vec_sdiv_by_pow2b_v4i64: ; SSE2: # %bb.0: -; SSE2-NEXT: movdqa %xmm1, %xmm2 -; SSE2-NEXT: psrad $31, %xmm1 -; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] -; SSE2-NEXT: movdqa %xmm1, %xmm3 -; SSE2-NEXT: psrlq $61, %xmm3 -; SSE2-NEXT: psrlq $60, %xmm1 -; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm3[0],xmm1[1] -; SSE2-NEXT: paddq %xmm2, %xmm1 -; SSE2-NEXT: movdqa %xmm1, %xmm2 -; SSE2-NEXT: psrlq $3, %xmm2 -; SSE2-NEXT: psrlq $4, %xmm1 -; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1] -; SSE2-NEXT: movapd {{.*#+}} xmm2 = [1152921504606846976,576460752303423488] -; SSE2-NEXT: xorpd %xmm2, %xmm1 -; SSE2-NEXT: psubq %xmm2, %xmm1 ; SSE2-NEXT: movdqa %xmm0, %xmm2 +; SSE2-NEXT: psrad $31, %xmm0 +; SSE2-NEXT: psrlq $62, %xmm0 +; SSE2-NEXT: pxor %xmm3, %xmm3 +; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm0[1] +; SSE2-NEXT: paddq %xmm2, %xmm3 +; SSE2-NEXT: movdqa %xmm3, %xmm0 +; SSE2-NEXT: psrlq $2, %xmm0 +; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm3[0],xmm0[1] +; SSE2-NEXT: movapd {{.*#+}} xmm3 = [9223372036854775808,2305843009213693952] +; SSE2-NEXT: xorpd %xmm3, %xmm0 +; SSE2-NEXT: psubq %xmm3, %xmm0 +; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm2[0],xmm0[1] +; SSE2-NEXT: movdqa %xmm1, %xmm2 ; SSE2-NEXT: psrad $31, %xmm2 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] -; SSE2-NEXT: psrlq $62, %xmm2 -; SSE2-NEXT: pxor %xmm3, %xmm3 -; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm2[1] -; SSE2-NEXT: paddq %xmm0, %xmm3 -; SSE2-NEXT: movdqa %xmm3, %xmm2 -; SSE2-NEXT: psrlq $2, %xmm2 +; SSE2-NEXT: movdqa %xmm2, %xmm3 +; SSE2-NEXT: psrlq $61, %xmm3 +; SSE2-NEXT: psrlq $60, %xmm2 ; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm3[0],xmm2[1] -; SSE2-NEXT: movapd {{.*#+}} xmm3 = [9223372036854775808,2305843009213693952] -; SSE2-NEXT: xorpd %xmm3, %xmm2 -; SSE2-NEXT: psubq %xmm3, %xmm2 -; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm0[0],xmm2[1] -; SSE2-NEXT: movapd %xmm2, %xmm0 +; SSE2-NEXT: paddq %xmm1, %xmm2 +; SSE2-NEXT: movdqa %xmm2, %xmm1 +; SSE2-NEXT: psrlq $3, %xmm1 +; SSE2-NEXT: psrlq $4, %xmm2 +; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm1[0],xmm2[1] +; SSE2-NEXT: movapd {{.*#+}} xmm1 = [1152921504606846976,576460752303423488] +; SSE2-NEXT: xorpd %xmm1, %xmm2 +; SSE2-NEXT: psubq %xmm1, %xmm2 +; SSE2-NEXT: movdqa %xmm2, %xmm1 ; SSE2-NEXT: retq ; ; SSE41-LABEL: combine_vec_sdiv_by_pow2b_v4i64: ; SSE41: # %bb.0: -; SSE41-NEXT: movdqa %xmm1, %xmm2 -; SSE41-NEXT: psrad $31, %xmm1 -; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] -; SSE41-NEXT: movdqa %xmm1, %xmm3 -; SSE41-NEXT: psrlq $60, %xmm3 -; SSE41-NEXT: psrlq $61, %xmm1 -; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm3[4,5,6,7] -; SSE41-NEXT: paddq %xmm2, %xmm1 -; SSE41-NEXT: movdqa %xmm1, %xmm2 -; SSE41-NEXT: psrlq $4, %xmm2 -; SSE41-NEXT: psrlq $3, %xmm1 -; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm2[4,5,6,7] -; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [1152921504606846976,576460752303423488] -; SSE41-NEXT: pxor %xmm2, %xmm1 -; SSE41-NEXT: psubq %xmm2, %xmm1 ; SSE41-NEXT: movdqa %xmm0, %xmm2 ; SSE41-NEXT: psrad $31, %xmm2 -; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] ; SSE41-NEXT: psrlq $62, %xmm2 ; SSE41-NEXT: pxor %xmm3, %xmm3 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1,2,3],xmm2[4,5,6,7] @@ -1730,6 +1711,22 @@ ; SSE41-NEXT: pxor %xmm3, %xmm2 ; SSE41-NEXT: psubq %xmm3, %xmm2 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm2[4,5,6,7] +; SSE41-NEXT: movdqa %xmm1, %xmm2 +; SSE41-NEXT: psrad $31, %xmm2 +; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3] +; SSE41-NEXT: movdqa %xmm2, %xmm3 +; SSE41-NEXT: psrlq $60, %xmm3 +; SSE41-NEXT: psrlq $61, %xmm2 +; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm3[4,5,6,7] +; SSE41-NEXT: paddq %xmm1, %xmm2 +; SSE41-NEXT: movdqa %xmm2, %xmm1 +; SSE41-NEXT: psrlq $4, %xmm1 +; SSE41-NEXT: psrlq $3, %xmm2 +; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7] +; SSE41-NEXT: movdqa {{.*#+}} xmm1 = [1152921504606846976,576460752303423488] +; SSE41-NEXT: pxor %xmm1, %xmm2 +; SSE41-NEXT: psubq %xmm1, %xmm2 +; SSE41-NEXT: movdqa %xmm2, %xmm1 ; SSE41-NEXT: retq ; ; AVX1-LABEL: combine_vec_sdiv_by_pow2b_v4i64: @@ -1818,125 +1815,124 @@ define <8 x i64> @combine_vec_sdiv_by_pow2b_v8i64(<8 x i64> %x) { ; SSE2-LABEL: combine_vec_sdiv_by_pow2b_v8i64: ; SSE2: # %bb.0: -; SSE2-NEXT: movdqa %xmm3, %xmm4 -; SSE2-NEXT: movdqa %xmm1, %xmm3 +; SSE2-NEXT: movdqa %xmm1, %xmm4 +; SSE2-NEXT: movdqa %xmm0, %xmm1 +; SSE2-NEXT: psrad $31, %xmm0 +; SSE2-NEXT: psrlq $62, %xmm0 +; SSE2-NEXT: pxor %xmm5, %xmm5 +; SSE2-NEXT: pxor %xmm6, %xmm6 +; SSE2-NEXT: punpckhqdq {{.*#+}} xmm6 = xmm6[1],xmm0[1] +; SSE2-NEXT: paddq %xmm1, %xmm6 +; SSE2-NEXT: movdqa %xmm6, %xmm0 +; SSE2-NEXT: psrlq $2, %xmm0 +; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm6[0],xmm0[1] +; SSE2-NEXT: movapd {{.*#+}} xmm6 = [9223372036854775808,2305843009213693952] +; SSE2-NEXT: xorpd %xmm6, %xmm0 +; SSE2-NEXT: psubq %xmm6, %xmm0 +; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1] +; SSE2-NEXT: movdqa %xmm4, %xmm1 ; SSE2-NEXT: psrad $31, %xmm1 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] -; SSE2-NEXT: movdqa %xmm1, %xmm5 -; SSE2-NEXT: psrlq $61, %xmm5 +; SSE2-NEXT: movdqa %xmm1, %xmm7 +; SSE2-NEXT: psrlq $61, %xmm7 ; SSE2-NEXT: psrlq $60, %xmm1 -; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm5[0],xmm1[1] -; SSE2-NEXT: paddq %xmm3, %xmm1 -; SSE2-NEXT: movdqa %xmm1, %xmm3 -; SSE2-NEXT: psrlq $3, %xmm3 -; SSE2-NEXT: psrlq $4, %xmm1 -; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm3[0],xmm1[1] -; SSE2-NEXT: movapd {{.*#+}} xmm5 = [1152921504606846976,576460752303423488] -; SSE2-NEXT: xorpd %xmm5, %xmm1 -; SSE2-NEXT: psubq %xmm5, %xmm1 -; SSE2-NEXT: movdqa %xmm4, %xmm3 -; SSE2-NEXT: psrad $31, %xmm3 -; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,1,3,3] -; SSE2-NEXT: movdqa %xmm3, %xmm6 -; SSE2-NEXT: psrlq $61, %xmm6 -; SSE2-NEXT: psrlq $60, %xmm3 -; SSE2-NEXT: movsd {{.*#+}} xmm3 = xmm6[0],xmm3[1] -; SSE2-NEXT: paddq %xmm4, %xmm3 -; SSE2-NEXT: movdqa %xmm3, %xmm4 +; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm7[0],xmm1[1] +; SSE2-NEXT: paddq %xmm4, %xmm1 +; SSE2-NEXT: movdqa %xmm1, %xmm4 ; SSE2-NEXT: psrlq $3, %xmm4 -; SSE2-NEXT: psrlq $4, %xmm3 -; SSE2-NEXT: movsd {{.*#+}} xmm3 = xmm4[0],xmm3[1] -; SSE2-NEXT: xorpd %xmm5, %xmm3 -; SSE2-NEXT: psubq %xmm5, %xmm3 -; SSE2-NEXT: movdqa %xmm0, %xmm4 +; SSE2-NEXT: psrlq $4, %xmm1 +; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm4[0],xmm1[1] +; SSE2-NEXT: movapd {{.*#+}} xmm7 = [1152921504606846976,576460752303423488] +; SSE2-NEXT: xorpd %xmm7, %xmm1 +; SSE2-NEXT: psubq %xmm7, %xmm1 +; SSE2-NEXT: movdqa %xmm2, %xmm4 ; SSE2-NEXT: psrad $31, %xmm4 -; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,1,3,3] ; SSE2-NEXT: psrlq $62, %xmm4 -; SSE2-NEXT: pxor %xmm6, %xmm6 -; SSE2-NEXT: pxor %xmm5, %xmm5 ; SSE2-NEXT: punpckhqdq {{.*#+}} xmm5 = xmm5[1],xmm4[1] -; SSE2-NEXT: paddq %xmm0, %xmm5 +; SSE2-NEXT: paddq %xmm2, %xmm5 ; SSE2-NEXT: movdqa %xmm5, %xmm4 ; SSE2-NEXT: psrlq $2, %xmm4 ; SSE2-NEXT: movsd {{.*#+}} xmm4 = xmm5[0],xmm4[1] -; SSE2-NEXT: movapd {{.*#+}} xmm7 = [9223372036854775808,2305843009213693952] -; SSE2-NEXT: xorpd %xmm7, %xmm4 -; SSE2-NEXT: psubq %xmm7, %xmm4 -; SSE2-NEXT: movsd {{.*#+}} xmm4 = xmm0[0],xmm4[1] -; SSE2-NEXT: movdqa %xmm2, %xmm0 -; SSE2-NEXT: psrad $31, %xmm0 -; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3] -; SSE2-NEXT: psrlq $62, %xmm0 -; SSE2-NEXT: punpckhqdq {{.*#+}} xmm6 = xmm6[1],xmm0[1] -; SSE2-NEXT: paddq %xmm2, %xmm6 -; SSE2-NEXT: movdqa %xmm6, %xmm5 -; SSE2-NEXT: psrlq $2, %xmm5 -; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm6[0],xmm5[1] +; SSE2-NEXT: xorpd %xmm6, %xmm4 +; SSE2-NEXT: psubq %xmm6, %xmm4 +; SSE2-NEXT: movsd {{.*#+}} xmm4 = xmm2[0],xmm4[1] +; SSE2-NEXT: movdqa %xmm3, %xmm2 +; SSE2-NEXT: psrad $31, %xmm2 +; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm2[1,1,3,3] +; SSE2-NEXT: movdqa %xmm5, %xmm2 +; SSE2-NEXT: psrlq $61, %xmm2 +; SSE2-NEXT: psrlq $60, %xmm5 +; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm2[0],xmm5[1] +; SSE2-NEXT: paddq %xmm3, %xmm5 +; SSE2-NEXT: movdqa %xmm5, %xmm2 +; SSE2-NEXT: psrlq $3, %xmm2 +; SSE2-NEXT: psrlq $4, %xmm5 +; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm2[0],xmm5[1] ; SSE2-NEXT: xorpd %xmm7, %xmm5 ; SSE2-NEXT: psubq %xmm7, %xmm5 -; SSE2-NEXT: movsd {{.*#+}} xmm5 = xmm2[0],xmm5[1] -; SSE2-NEXT: movapd %xmm4, %xmm0 -; SSE2-NEXT: movapd %xmm5, %xmm2 +; SSE2-NEXT: movapd %xmm4, %xmm2 +; SSE2-NEXT: movdqa %xmm5, %xmm3 ; SSE2-NEXT: retq ; ; SSE41-LABEL: combine_vec_sdiv_by_pow2b_v8i64: ; SSE41: # %bb.0: -; SSE41-NEXT: movdqa %xmm3, %xmm4 -; SSE41-NEXT: movdqa %xmm1, %xmm3 +; SSE41-NEXT: movdqa %xmm1, %xmm4 +; SSE41-NEXT: movdqa %xmm0, %xmm1 +; SSE41-NEXT: movdqa %xmm0, %xmm5 +; SSE41-NEXT: psrad $31, %xmm5 +; SSE41-NEXT: psrlq $62, %xmm5 +; SSE41-NEXT: pxor %xmm6, %xmm6 +; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm6[0,1,2,3],xmm5[4,5,6,7] +; SSE41-NEXT: paddq %xmm0, %xmm5 +; SSE41-NEXT: movdqa %xmm5, %xmm0 +; SSE41-NEXT: psrlq $2, %xmm0 +; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm5[0,1,2,3],xmm0[4,5,6,7] +; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [9223372036854775808,2305843009213693952] +; SSE41-NEXT: pxor %xmm5, %xmm0 +; SSE41-NEXT: psubq %xmm5, %xmm0 +; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7] +; SSE41-NEXT: movdqa %xmm4, %xmm1 ; SSE41-NEXT: psrad $31, %xmm1 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3] -; SSE41-NEXT: movdqa %xmm1, %xmm5 -; SSE41-NEXT: psrlq $60, %xmm5 +; SSE41-NEXT: movdqa %xmm1, %xmm7 +; SSE41-NEXT: psrlq $60, %xmm7 ; SSE41-NEXT: psrlq $61, %xmm1 -; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm5[4,5,6,7] -; SSE41-NEXT: paddq %xmm3, %xmm1 -; SSE41-NEXT: movdqa %xmm1, %xmm3 -; SSE41-NEXT: psrlq $4, %xmm3 -; SSE41-NEXT: psrlq $3, %xmm1 -; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm3[4,5,6,7] -; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [1152921504606846976,576460752303423488] -; SSE41-NEXT: pxor %xmm5, %xmm1 -; SSE41-NEXT: psubq %xmm5, %xmm1 -; SSE41-NEXT: movdqa %xmm4, %xmm3 -; SSE41-NEXT: psrad $31, %xmm3 -; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,1,3,3] -; SSE41-NEXT: movdqa %xmm3, %xmm6 -; SSE41-NEXT: psrlq $60, %xmm6 -; SSE41-NEXT: psrlq $61, %xmm3 -; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1,2,3],xmm6[4,5,6,7] -; SSE41-NEXT: paddq %xmm4, %xmm3 -; SSE41-NEXT: movdqa %xmm3, %xmm4 +; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm7[4,5,6,7] +; SSE41-NEXT: paddq %xmm4, %xmm1 +; SSE41-NEXT: movdqa %xmm1, %xmm4 ; SSE41-NEXT: psrlq $4, %xmm4 -; SSE41-NEXT: psrlq $3, %xmm3 -; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1,2,3],xmm4[4,5,6,7] -; SSE41-NEXT: pxor %xmm5, %xmm3 -; SSE41-NEXT: psubq %xmm5, %xmm3 -; SSE41-NEXT: movdqa %xmm0, %xmm4 +; SSE41-NEXT: psrlq $3, %xmm1 +; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm4[4,5,6,7] +; SSE41-NEXT: movdqa {{.*#+}} xmm7 = [1152921504606846976,576460752303423488] +; SSE41-NEXT: pxor %xmm7, %xmm1 +; SSE41-NEXT: psubq %xmm7, %xmm1 +; SSE41-NEXT: movdqa %xmm2, %xmm4 ; SSE41-NEXT: psrad $31, %xmm4 -; SSE41-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,1,3,3] ; SSE41-NEXT: psrlq $62, %xmm4 -; SSE41-NEXT: pxor %xmm5, %xmm5 -; SSE41-NEXT: pblendw {{.*#+}} xmm4 = xmm5[0,1,2,3],xmm4[4,5,6,7] -; SSE41-NEXT: paddq %xmm0, %xmm4 +; SSE41-NEXT: pblendw {{.*#+}} xmm4 = xmm6[0,1,2,3],xmm4[4,5,6,7] +; SSE41-NEXT: paddq %xmm2, %xmm4 ; SSE41-NEXT: movdqa %xmm4, %xmm6 ; SSE41-NEXT: psrlq $2, %xmm6 ; SSE41-NEXT: pblendw {{.*#+}} xmm6 = xmm4[0,1,2,3],xmm6[4,5,6,7] -; SSE41-NEXT: movdqa {{.*#+}} xmm4 = [9223372036854775808,2305843009213693952] -; SSE41-NEXT: pxor %xmm4, %xmm6 -; SSE41-NEXT: psubq %xmm4, %xmm6 -; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm6[4,5,6,7] -; SSE41-NEXT: movdqa %xmm2, %xmm6 -; SSE41-NEXT: psrad $31, %xmm6 -; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm6[1,1,3,3] -; SSE41-NEXT: psrlq $62, %xmm6 -; SSE41-NEXT: pblendw {{.*#+}} xmm6 = xmm5[0,1,2,3],xmm6[4,5,6,7] -; SSE41-NEXT: paddq %xmm2, %xmm6 -; SSE41-NEXT: movdqa %xmm6, %xmm5 -; SSE41-NEXT: psrlq $2, %xmm5 -; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm6[0,1,2,3],xmm5[4,5,6,7] -; SSE41-NEXT: pxor %xmm4, %xmm5 -; SSE41-NEXT: psubq %xmm4, %xmm5 -; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1,2,3],xmm5[4,5,6,7] +; SSE41-NEXT: pxor %xmm5, %xmm6 +; SSE41-NEXT: psubq %xmm5, %xmm6 +; SSE41-NEXT: pblendw {{.*#+}} xmm6 = xmm2[0,1,2,3],xmm6[4,5,6,7] +; SSE41-NEXT: movdqa %xmm3, %xmm2 +; SSE41-NEXT: psrad $31, %xmm2 +; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm2[1,1,3,3] +; SSE41-NEXT: movdqa %xmm5, %xmm2 +; SSE41-NEXT: psrlq $60, %xmm2 +; SSE41-NEXT: psrlq $61, %xmm5 +; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm5[0,1,2,3],xmm2[4,5,6,7] +; SSE41-NEXT: paddq %xmm3, %xmm5 +; SSE41-NEXT: movdqa %xmm5, %xmm2 +; SSE41-NEXT: psrlq $4, %xmm2 +; SSE41-NEXT: psrlq $3, %xmm5 +; SSE41-NEXT: pblendw {{.*#+}} xmm5 = xmm5[0,1,2,3],xmm2[4,5,6,7] +; SSE41-NEXT: pxor %xmm7, %xmm5 +; SSE41-NEXT: psubq %xmm7, %xmm5 +; SSE41-NEXT: movdqa %xmm6, %xmm2 +; SSE41-NEXT: movdqa %xmm5, %xmm3 ; SSE41-NEXT: retq ; ; AVX1-LABEL: combine_vec_sdiv_by_pow2b_v8i64: Index: test/CodeGen/X86/pr35918.ll =================================================================== --- test/CodeGen/X86/pr35918.ll +++ test/CodeGen/X86/pr35918.ll @@ -15,7 +15,6 @@ ; X86-SKYLAKE-NEXT: vpsrad $16, %xmm0, %xmm0 ; X86-SKYLAKE-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; X86-SKYLAKE-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0 -; X86-SKYLAKE-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6],xmm1[7] ; X86-SKYLAKE-NEXT: vpsrld $7, %xmm0, %xmm0 ; X86-SKYLAKE-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4],zero,zero,xmm0[u,u,u,u,u,u,u,u,u,u,u,u] ; X86-SKYLAKE-NEXT: vmovd %xmm0, %ecx @@ -54,7 +53,6 @@ ; X64-SKYLAKE-NEXT: vpsrad $16, %xmm0, %xmm0 ; X64-SKYLAKE-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; X64-SKYLAKE-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0 -; X64-SKYLAKE-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6],xmm1[7] ; X64-SKYLAKE-NEXT: vpsrld $7, %xmm0, %xmm0 ; X64-SKYLAKE-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4],zero,zero,xmm0[u,u,u,u,u,u,u,u,u,u,u,u] ; X64-SKYLAKE-NEXT: vmovd %xmm0, %eax Index: test/CodeGen/X86/rotate-extract-vector.ll =================================================================== --- test/CodeGen/X86/rotate-extract-vector.ll +++ test/CodeGen/X86/rotate-extract-vector.ll @@ -221,12 +221,10 @@ ; X86-NEXT: movl $0, {{[0-9]+}}(%esp) ; X86-NEXT: movl $3, {{[0-9]+}}(%esp) ; X86-NEXT: vmovd %eax, %xmm0 -; X86-NEXT: vpinsrd $1, %edx, %xmm0, %xmm0 ; X86-NEXT: vmovdqu %xmm0, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill ; X86-NEXT: calll __udivdi3 ; X86-NEXT: vmovdqu {{[-0-9]+}}(%e{{[sb]}}p), %xmm0 # 16-byte Reload ; X86-NEXT: vpinsrd $2, %eax, %xmm0, %xmm0 -; X86-NEXT: vpinsrd $3, %edx, %xmm0, %xmm0 ; X86-NEXT: vmovdqu %xmm0, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill ; X86-NEXT: vmovups {{[-0-9]+}}(%e{{[sb]}}p), %xmm0 # 16-byte Reload ; X86-NEXT: vextractps $1, %xmm0, {{[0-9]+}}(%esp) Index: test/CodeGen/X86/vector-rotate-128.ll =================================================================== --- test/CodeGen/X86/vector-rotate-128.ll +++ test/CodeGen/X86/vector-rotate-128.ll @@ -281,16 +281,15 @@ ; ; SSE41-LABEL: var_rotate_v8i16: ; SSE41: # %bb.0: -; SSE41-NEXT: pxor %xmm2, %xmm2 -; SSE41-NEXT: pmovzxwd {{.*#+}} xmm3 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero -; SSE41-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; SSE41-NEXT: pmovzxwd {{.*#+}} xmm2 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero +; SSE41-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] ; SSE41-NEXT: pslld $23, %xmm1 -; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [1065353216,1065353216,1065353216,1065353216] -; SSE41-NEXT: paddd %xmm2, %xmm1 +; SSE41-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216] +; SSE41-NEXT: paddd %xmm3, %xmm1 ; SSE41-NEXT: cvttps2dq %xmm1, %xmm1 -; SSE41-NEXT: pslld $23, %xmm3 -; SSE41-NEXT: paddd %xmm2, %xmm3 -; SSE41-NEXT: cvttps2dq %xmm3, %xmm2 +; SSE41-NEXT: pslld $23, %xmm2 +; SSE41-NEXT: paddd %xmm3, %xmm2 +; SSE41-NEXT: cvttps2dq %xmm2, %xmm2 ; SSE41-NEXT: packusdw %xmm1, %xmm2 ; SSE41-NEXT: movdqa %xmm0, %xmm1 ; SSE41-NEXT: pmulhuw %xmm2, %xmm1 @@ -300,8 +299,7 @@ ; ; AVX1-LABEL: var_rotate_v8i16: ; AVX1: # %bb.0: -; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2 -; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216] ; AVX1-NEXT: vpaddd %xmm3, %xmm2, %xmm2 Index: test/CodeGen/X86/vector-shift-shl-128.ll =================================================================== --- test/CodeGen/X86/vector-shift-shl-128.ll +++ test/CodeGen/X86/vector-shift-shl-128.ll @@ -180,24 +180,22 @@ ; ; SSE41-LABEL: var_shift_v8i16: ; SSE41: # %bb.0: -; SSE41-NEXT: pxor %xmm2, %xmm2 -; SSE41-NEXT: pmovzxwd {{.*#+}} xmm3 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero -; SSE41-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; SSE41-NEXT: pmovzxwd {{.*#+}} xmm2 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero +; SSE41-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] ; SSE41-NEXT: pslld $23, %xmm1 -; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [1065353216,1065353216,1065353216,1065353216] -; SSE41-NEXT: paddd %xmm2, %xmm1 +; SSE41-NEXT: movdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216] +; SSE41-NEXT: paddd %xmm3, %xmm1 ; SSE41-NEXT: cvttps2dq %xmm1, %xmm1 -; SSE41-NEXT: pslld $23, %xmm3 -; SSE41-NEXT: paddd %xmm2, %xmm3 -; SSE41-NEXT: cvttps2dq %xmm3, %xmm2 +; SSE41-NEXT: pslld $23, %xmm2 +; SSE41-NEXT: paddd %xmm3, %xmm2 +; SSE41-NEXT: cvttps2dq %xmm2, %xmm2 ; SSE41-NEXT: packusdw %xmm1, %xmm2 ; SSE41-NEXT: pmullw %xmm2, %xmm0 ; SSE41-NEXT: retq ; ; AVX1-LABEL: var_shift_v8i16: ; AVX1: # %bb.0: -; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2 -; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7] +; AVX1-NEXT: vpunpckhwd {{.*#+}} xmm2 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] ; AVX1-NEXT: vpslld $23, %xmm2, %xmm2 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm3 = [1065353216,1065353216,1065353216,1065353216] ; AVX1-NEXT: vpaddd %xmm3, %xmm2, %xmm2