Commit: 2ad319b13c7fe4d86031fc7bdbe663fca728611e
Parent: 6656eb76d41dbf5cab7eee939c45a05454f13bd6
Author: Randy Palamar
Date: Tue, 10 Dec 2024 05:39:10 -0700
don't over constrain mem_copy
Until this has been profiled to cause problems its better to let
the compiler do the work. The restrict keyword can be used to
ensure the compiler that you won't pass pointers that alias.
Diffstat:
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/util.c b/util.c
@@ -152,17 +152,10 @@ work_queue_insert(Term *t, u32 type, void *ctx)
}
static void
-mem_copy(void *src, void *dest, size len)
+mem_copy(void *restrict src, void *restrict dest, size len)
{
ASSERT(len >= 0);
u8 *s = src, *d = dest;
-#if defined(__AVX512BW__)
- /* TODO: aligned load/store and comparison */
- for (; len >= 64; len -= 64, s += 64, d += 64)
- _mm512_storeu_epi8(d, _mm512_loadu_epi8(s));
-#endif
- for (; len >= 16; len -= 16, s += 16, d += 16)
- _mm_storeu_si128((__m128i *)d, _mm_loadu_si128((__m128i*)s));
for (; len; len--) *d++ = *s++;
}