[libc-commits] [PATCH] D128335: [libc][mem*] Introduce Algorithms for new mem framework

Clement Courbet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 23 07:00:59 PDT 2022


courbet added inline comments.


================
Comment at: libc/src/string/memory_utils/algorithm.h:142
+                                   size_t runtime_size) {
+    if (const auto res = SizedOp::isDifferent(src1, src2))
+      return res;
----------------
courbet wrote:
> Can you comment on using short-circuiting/branching vs `|`.
please use a type.


================
Comment at: libc/src/string/memory_utils/algorithm.h:150
+                                    size_t runtime_size) {
+    if (const auto res = SizedOp::threeWayCmp(src1, src2))
+      return res;
----------------
ditto


================
Comment at: libc/src/string/memory_utils/algorithm.h:169
+template <typename SizedOp> struct Loop {
+  static constexpr size_t SIZE = SizedOp::SIZE;
+
----------------
This is a different concept compared to e.g. `Head::SIZE`: would it make sense to call that `BLOCK_SIZE` ?


================
Comment at: libc/src/string/memory_utils/algorithm.h:250
+    do {
+      if (auto res =
+              SizedOp::isDifferent(offsetAddrMultiplesOf<SIZE>(src1, offset),
----------------
ditto (here and everywhere for `int32_t` and `uint64_t`)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128335



More information about the libc-commits mailing list