diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-13 06:24:02 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-13 06:24:02 +0000 |
commit | 33733c0342c91fef596ee6e3a99164c6790ebeca (patch) | |
tree | 730b63c247aa6942afd45608a4ae5423c9d30fc9 | |
parent | f59e9f4288d446432e27f2ccefe320b3e5bfe4f5 (diff) | |
download | llvm-33733c0342c91fef596ee6e3a99164c6790ebeca.zip llvm-33733c0342c91fef596ee6e3a99164c6790ebeca.tar.gz llvm-33733c0342c91fef596ee6e3a99164c6790ebeca.tar.bz2 |
Fix the N>=64 case in the isInt<> and isUint<> templates.
llvm-svn: 78899
-rw-r--r-- | llvm/include/llvm/Support/MathExtras.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index 15a67e4..7ba5d86 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -54,12 +54,12 @@ inline bool isUInt32(int64_t Value) { template<unsigned N> inline bool isInt(int64_t x) { - return -(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)); + return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1))); } template<unsigned N> inline bool isUint(uint64_t x) { - return x < (UINT64_C(1)<<N); + return N >= 64 || x < (UINT64_C(1)<<N); } /// isMask_32 - This function returns true if the argument is a sequence of ones |