[libc-commits] [llvm] [libc] [libc][NFC] Remove __support/bit.h and use __support/CPP/bit.h instead (PR #73939)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Fri Dec 1 08:15:34 PST 2023


================
@@ -152,8 +153,9 @@ class HashState {
     }
   }
   LIBC_INLINE uint64_t finish() {
-    int rot = buffer & 63;
-    uint64_t folded = folded_multiply(buffer, pad);
+    const uint64_t folded = folded_multiply(buffer, pad);
+    // Only keep the bottom bits of buffer that fits in an int.
+    const int rot = buffer & cpp::numeric_limits<int>::digits;
----------------
SchrodingerZhu wrote:

Should it be?
```
const int rot = buffer % cpp::numeric_limits<uint64_t>::digits;
```


https://github.com/llvm/llvm-project/pull/73939


More information about the libc-commits mailing list