mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 07:37:34 +00:00
Use isIntN and isUIntN to check for valid signed/unsigned numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142395 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7f5f0dae33
commit
9d45de252c
@ -4526,11 +4526,10 @@ static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG,
|
||||
unsigned EltSize = VT.getVectorElementType().getSizeInBits();
|
||||
unsigned HalfSize = EltSize / 2;
|
||||
if (isSigned) {
|
||||
int64_t SExtVal = C->getSExtValue();
|
||||
if (SExtVal != SExtVal << (64 - HalfSize) >> (64 - HalfSize))
|
||||
if (!isIntN(HalfSize, C->getSExtValue()))
|
||||
return false;
|
||||
} else {
|
||||
if ((C->getZExtValue() >> HalfSize) != 0)
|
||||
if (!isUIntN(HalfSize, C->getZExtValue()))
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user