Fix the N>=64 case in the isInt<> and isUint<> templates.

llvm-svn: 78899
This commit is contained in:
Jakob Stoklund Olesen 2009-08-13 06:24:02 +00:00
parent f59e9f4288
commit 33733c0342
1 changed files with 2 additions and 2 deletions

View File

@ -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