summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-02-17 17:55:32 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-02-17 17:55:32 +0000
commita5dce35cba1f1fea61b7eebfd5e57886185b9f58 (patch)
tree1f02b2f9ce1134706a28206e34ae97cc784dcb24 /llvm/lib/Target
parent4ad00b46fbb0bfe2530b6cdd8803937166bfa80f (diff)
downloadbcm5719-llvm-a5dce35cba1f1fea61b7eebfd5e57886185b9f58.tar.gz
bcm5719-llvm-a5dce35cba1f1fea61b7eebfd5e57886185b9f58.zip
AArch64: Avoid shifts by 64, that's undefined behavior.
No functionality change. llvm-svn: 175400
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 739ca951dca..cea7f918dfe 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -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,
OpenPOWER on IntegriCloud