We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2a9c4 commit 81cd702Copy full SHA for 81cd702
llvm/include/llvm/Support/MathExtras.h
@@ -225,7 +225,7 @@ inline constexpr int64_t minIntN(int64_t N) {
225
226
if (N == 0)
227
return 0;
228
- return UINT64_C(1) + ~(UINT64_C(1) << (N - 1));
+ return UINT64_MAX << (N - 1);
229
}
230
231
/// Gets the maximum value for a N-bit signed integer.
@@ -241,7 +241,7 @@ inline constexpr int64_t maxIntN(int64_t N) {
241
242
/// Checks if an unsigned integer fits into the given (dynamic) bit width.
243
inline constexpr bool isUIntN(unsigned N, uint64_t x) {
244
- return N >= 64 || x <= maxUIntN(N);
+ return N >= 64 || (x >> N) == 0;
245
246
247
/// Checks if an signed integer fits into the given (dynamic) bit width.
0 commit comments