[libc-commits] [PATCH] D135134: [libc] New version of the mem* framework

Clement Courbet via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Oct 7 00:30:18 PDT 2022


courbet added inline comments.


================
Comment at: libc/src/string/memory_utils/memcmp_implementations.h:77-98
+  if (count == 0)
+    return MemcmpReturnType::ZERO();
+  if (count == 1)
+    return generic::Memcmp<1>::block(p1, p2);
+  if (count == 2)
+    return generic::Memcmp<2>::block(p1, p2);
+  if (count == 3)
----------------
can we maybe implement these 3 functions as a template over the `x86:xxx:MemCmp` function to avoid code duplication ?


================
Comment at: libc/src/string/memory_utils/memcmp_implementations.h:124
+  align_to_next_boundary<32, Arg::P1>(p1, p2, count);
+  return x86::avx2::Memcmp<32>::loop_and_tail(p1, p2, count);
+}
----------------
can you comment on why `32` here ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135134



More information about the libc-commits mailing list