forked from OSchip/llvm-project
Fix incorrect check for sign-extended constant BUILD_VECTOR.
<rdar://problem/10298332> llvm-svn: 142371
This commit is contained in:
parent
681561901d
commit
9258b76d8d
|
@ -4527,7 +4527,7 @@ static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG,
|
|||
unsigned HalfSize = EltSize / 2;
|
||||
if (isSigned) {
|
||||
int64_t SExtVal = C->getSExtValue();
|
||||
if ((SExtVal >> HalfSize) != (SExtVal >> EltSize))
|
||||
if (SExtVal != SExtVal << (64 - HalfSize) >> (64 - HalfSize))
|
||||
return false;
|
||||
} else {
|
||||
if ((C->getZExtValue() >> HalfSize) != 0)
|
||||
|
|
|
@ -514,3 +514,14 @@ entry:
|
|||
store <8 x i8> %10, <8 x i8>* %11, align 8
|
||||
ret void
|
||||
}
|
||||
|
||||
; If one operand has a zero-extend and the other a sign-extend, vmull
|
||||
; cannot be used.
|
||||
define i16 @vmullWithInconsistentExtensions(<8 x i8> %vec) {
|
||||
; CHECK: vmullWithInconsistentExtensions
|
||||
; CHECK-NOT: vmull.s8
|
||||
%1 = sext <8 x i8> %vec to <8 x i16>
|
||||
%2 = mul <8 x i16> %1, <i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255>
|
||||
%3 = extractelement <8 x i16> %2, i32 0
|
||||
ret i16 %3
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue