[PATCH] D114356: [Support] Add isShiftedUIntN to MathExtras.h

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 15:51:13 PST 2021


craig.topper added a comment.

Can you add tests to unittests/Support/MathExtrasTest.cpp ?



================
Comment at: llvm/include/llvm/Support/MathExtras.h:467
+inline bool isShiftedUIntN(unsigned N, unsigned S, uint64_t x) {
+  return isUIntN(N + S, x) && (x % (UINT64_C(1) << S) == 0);
+}
----------------
Assert that `S > 0` like the template version.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114356/new/

https://reviews.llvm.org/D114356



More information about the llvm-commits mailing list