diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-02-17 17:55:32 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-02-17 17:55:32 +0000 |
commit | 9831bf06e8747206d27d480f06dedbf4a8605145 (patch) | |
tree | 8b0ba15563d40b0b4f2ec1ecb639f665e38578c5 /lib/Target/AArch64 | |
parent | 906727dcfeb359acec4caca3ba8c756c4308ff6b (diff) | |
download | llvm-9831bf06e8747206d27d480f06dedbf4a8605145.tar.gz llvm-9831bf06e8747206d27d480f06dedbf4a8605145.tar.bz2 llvm-9831bf06e8747206d27d480f06dedbf4a8605145.tar.xz |
AArch64: Avoid shifts by 64, that's undefined behavior.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AArch64')
-rw-r--r-- | lib/Target/AArch64/AArch64ISelLowering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp index 739ca951dc..cea7f918df 100644 --- a/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/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, |