[libc-commits] [PATCH] D93009: [libc] Add memcmp implementation.

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Dec 14 00:53:27 PST 2020


gchatelet accepted this revision.
gchatelet added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/string/memcmp.cpp:15
+
+int LLVM_LIBC_ENTRYPOINT(memcmp)(const void *lhs, const void *rhs,
+                                 size_t count) {
----------------
cheng.w wrote:
> There is a TODO in strcmp.cpp (reviews.llvm.org/D82134) about speeding up. I did not find out the answer. Should I leave a TODO here too?
Yes please, let's add the `TODO` in the meantime (I have an optimized version to contribute).


================
Comment at: libc/src/string/memcmp.cpp:22
+      return _lhs[i] - _rhs[i];
+  // count is 0. Or _lhs and _rhs are the same.
+  return 0;
----------------
[nit] No need for the dot / Capitalization.
`count is 0 or _lhs and _rhs are the same.`




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93009



More information about the libc-commits mailing list