From f71ef1dddfc7cf34944c510b85bec074f431bb12 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 1 Mar 2017 20:53:59 +0100 Subject: vppinfra: fix issue when copying 16 bytes with clib_memcpy Current code wos copying same data twice when length is 16. Change-Id: I8d935b32f61672aaea9789c097a5083ae8f78cdd Signed-off-by: Damjan Marion --- src/vppinfra/memcpy_avx.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/vppinfra/memcpy_avx.h') diff --git a/src/vppinfra/memcpy_avx.h b/src/vppinfra/memcpy_avx.h index e3feb76b..d95bbad7 100644 --- a/src/vppinfra/memcpy_avx.h +++ b/src/vppinfra/memcpy_avx.h @@ -185,6 +185,11 @@ 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); -- cgit 1.2.3-korg