[libc-commits] [libc] [llvm] [libc] Adding a version of memset with software prefetching (PR #70857)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Tue Nov 7 04:17:42 PST 2023


================
@@ -163,6 +170,24 @@ template <typename T> struct Memset {
     } while (offset < count - SIZE);
     tail(dst, value, count);
   }
+
+  template <size_t prefetch_distance, size_t prefetch_degree>
+  LIBC_INLINE static void loop_and_tail_prefetch(Ptr dst, uint8_t value,
----------------
gchatelet wrote:

This code is quite tied to x86 implementation, the `offset` value for instance is completely ad-hoc.
I'd rather have this code moved to `src/string/memory_utils/x86_64/inline_memset.h` in the same way it's been done for `src/string/memory_utils/x86_64/inline_memcpy.h`.

https://github.com/llvm/llvm-project/pull/70857


More information about the libc-commits mailing list