acl-plugin: increase the amount of memory for classifier tables used by MACIP ACLs
[vpp.git] / src / vppinfra / memcpy_avx.h
index d95bbad..e987d04 100644 (file)
 #include <stdint.h>
 #include <x86intrin.h>
 
-typedef u8 u8x16u __attribute__ ((vector_size (16), aligned (1)));
-typedef u8 u8x32u __attribute__ ((vector_size (32), aligned (1)));
-
 static inline void
 clib_mov16 (u8 * dst, const u8 * src)
 {
-  *(u8x16u *) dst = *(u8x16u *) src;
+  __m128i xmm0;
+
+  xmm0 = _mm_loadu_si128 ((const __m128i *) src);
+  _mm_storeu_si128 ((__m128i *) dst, xmm0);
 }
 
 static inline void
 clib_mov32 (u8 * dst, const u8 * src)
 {
-  *(u8x32u *) dst = *(u8x32u *) src;
+  __m256i ymm0;
+
+  ymm0 = _mm256_loadu_si256 ((const __m256i *) src);
+  _mm256_storeu_si256 ((__m256i *) dst, ymm0);
 }
 
 static inline void
@@ -185,11 +188,6 @@ clib_memcpy (void *dst, const void *src, size_t n)
        /**
          * Fast way when copy size doesn't exceed 512 bytes
          */
-  if (n == 16)
-    {
-      clib_mov16 ((u8 *) dst, (const u8 *) src);
-      return ret;
-    }
   if (n <= 32)
     {
       clib_mov16 ((u8 *) dst, (const u8 *) src);