]> git.sesse.net Git - nageru/blobdiff - shared/memcpy_interleaved.cpp
More tweaks to the memcpy_interleaved multiversioning.
[nageru] / shared / memcpy_interleaved.cpp
index 8b70d4cb4d30566da0fdcd67f5cd9a3a9c01a260..4aba3c936a00effd9fb68ae99042db85375b4d24 100644 (file)
@@ -26,12 +26,22 @@ void memcpy_interleaved_slow(uint8_t *dest1, uint8_t *dest2, const uint8_t *src,
 
 #if HAS_MULTIVERSIONING
 
+__attribute__((target("default")))
+size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, const uint8_t *limit);
+
 __attribute__((target("sse2")))
 size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, const uint8_t *limit);
 
 __attribute__((target("avx2")))
 size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, const uint8_t *limit);
 
+__attribute__((target("default")))
+size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, const uint8_t *limit)
+{
+       // No fast path possible unless we have SSE2 or higher.
+       return 0;
+}
+
 __attribute__((target("sse2")))
 size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, const uint8_t *limit)
 {
@@ -100,7 +110,6 @@ size_t memcpy_interleaved_fastpath_core(uint8_t *dest1, uint8_t *dest2, const ui
 }
 
 // Returns the number of bytes consumed.
-__attribute__((target("sse2", "avx2")))
 size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t *src, size_t n)
 {
        const uint8_t *limit = src + n;