[libc-commits] [PATCH] D150433: [libc] Add optimized memset for RISCV

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Sun May 14 23:54:27 PDT 2023


sivachandra accepted this revision.
sivachandra added a comment.
This revision is now accepted and ready to land.

Looks like the best case improvement is ~6x and the worst case improvement is ~3x? Am I reading the numbers correctly?



================
Comment at: libc/src/string/memory_utils/memset_implementations.h:36
+  constexpr size_t kAlign = sizeof(uint32_t);
+  if (count <= 2 * kAlign)
+    return inline_memset_byte_per_byte(dst, 0, value, count);
----------------
I missed asking this in the memcpy patch also: how was the factor of 2 times of the alignment value arrived at?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150433



More information about the libc-commits mailing list