1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

AArch64: Avoid shifts by 64, that's undefined behavior.

No functionality change.

llvm-svn: 175400
This commit is contained in:
Benjamin Kramer 2013-02-17 17:55:32 +00:00
parent b50d4cfa0b
commit 3709b75a4d

View File

@ -2512,7 +2512,7 @@ static bool findMaskedBFI(SDValue N, SDValue &BFI, uint64_t &Mask,
N = N.getOperand(0);
} else {
// Mask is the whole width.
Mask = (1ULL << N.getValueType().getSizeInBits()) - 1;
Mask = -1ULL >> (64 - N.getValueType().getSizeInBits());
}
if (N.getOpcode() == AArch64ISD::BFI) {
@ -2590,7 +2590,7 @@ static SDValue tryCombineToBFI(SDNode *N,
DAG.getConstant(Width, MVT::i64));
// Mask is trivial
if ((LHSMask | RHSMask) == (1ULL << VT.getSizeInBits()) - 1)
if ((LHSMask | RHSMask) == (-1ULL >> (64 - VT.getSizeInBits())))
return BFI;
return DAG.getNode(ISD::AND, DL, VT, BFI,
@ -2660,7 +2660,7 @@ static SDValue tryCombineToLargerBFI(SDNode *N,
BFI.getOperand(2), BFI.getOperand(3));
// If the masking is trivial, we don't need to create it.
if ((ExtraMask | ExistingMask) == (1ULL << VT.getSizeInBits()) - 1)
if ((ExtraMask | ExistingMask) == (-1ULL >> (64 - VT.getSizeInBits())))
return BFI;
return DAG.getNode(ISD::AND, DL, VT, BFI,