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

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


================
@@ -48,6 +48,13 @@ using generic_v256 = uint8_t __attribute__((__vector_size__(32)));
 using generic_v512 = uint8_t __attribute__((__vector_size__(64)));
 } // namespace LIBC_NAMESPACE
 
+namespace LIBC_NAMESPACE::sw_prefetch {
+// Size of a cacheline for software prefetching
+static constexpr size_t kCachelineSize = 64;
----------------
gchatelet wrote:

This constant cannot live here, `op_generic` can be used by all architectures but cache line size is architecture dependent. Let's move it to `src/string/memory_utils/x86_64/inline_memset.h`. I'll comment on the implications for `inline_memset_x86_sw_prefetching` below.

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


More information about the llvm-commits mailing list