return Op0;
break;
}
+ case ISD::ANY_EXTEND_VECTOR_INREG:
+ case ISD::SIGN_EXTEND_VECTOR_INREG:
+ case ISD::ZERO_EXTEND_VECTOR_INREG: {
+ // If we only want the lowest element and none of extended bits, then we can
+ // return the bitcasted source vector.
+ SDValue Src = Op.getOperand(0);
+ EVT SrcVT = Src.getValueType();
+ EVT DstVT = Op.getValueType();
+ if (DemandedElts == 1 && DstVT.getSizeInBits() == SrcVT.getSizeInBits() &&
+ DAG.getDataLayout().isLittleEndian() &&
+ DemandedBits.getActiveBits() <= SrcVT.getScalarSizeInBits()) {
+ return DAG.getBitcast(DstVT, Src);
+ }
+ break;
+ }
case ISD::INSERT_VECTOR_ELT: {
// If we don't demand the inserted element, return the base vector.
SDValue Vec = Op.getOperand(0);
; X86-NEXT: vmovdqa {{.*#+}} xmm2 = [4,0,8,0]
; X86-NEXT: vpxor %xmm2, %xmm0, %xmm0
; X86-NEXT: vpsubq %xmm2, %xmm0, %xmm0
-; X86-NEXT: vpmovsxdq %xmm1, %xmm1
; X86-NEXT: vpand %xmm1, %xmm0, %xmm2
; X86-NEXT: vpor %xmm1, %xmm2, %xmm1
; X86-NEXT: vpxor %xmm0, %xmm1, %xmm0
; X64-AVX1-NEXT: vmovdqa {{.*#+}} xmm2 = [4,8]
; X64-AVX1-NEXT: vpxor %xmm2, %xmm0, %xmm0
; X64-AVX1-NEXT: vpsubq %xmm2, %xmm0, %xmm0
-; X64-AVX1-NEXT: vpmovsxdq %xmm1, %xmm1
; X64-AVX1-NEXT: vpand %xmm1, %xmm0, %xmm2
; X64-AVX1-NEXT: vpor %xmm1, %xmm2, %xmm1
; X64-AVX1-NEXT: vpxor %xmm0, %xmm1, %xmm0
; X64-AVX2-NEXT: vmovdqa {{.*#+}} xmm2 = [4,8]
; X64-AVX2-NEXT: vpxor %xmm2, %xmm0, %xmm0
; X64-AVX2-NEXT: vpsubq %xmm2, %xmm0, %xmm0
-; X64-AVX2-NEXT: vpmovsxdq %xmm1, %xmm1
; X64-AVX2-NEXT: vpand %xmm1, %xmm0, %xmm2
; X64-AVX2-NEXT: vpor %xmm1, %xmm2, %xmm1
; X64-AVX2-NEXT: vpxor %xmm0, %xmm1, %xmm0