aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-03-01 20:53:59 +0100
committerOle Trøan <otroan@employees.org>2017-03-01 21:38:04 +0000
commitf71ef1dddfc7cf34944c510b85bec074f431bb12 (patch)
treeac8ee980bd9d5ac64d6a914c9637a9d23c330321 /src/vppinfra
parent46c75cf65c56eb9d46c94fb97975e5494f95c69e (diff)
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 <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/memcpy_avx.h5
-rw-r--r--src/vppinfra/memcpy_sse3.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/vppinfra/memcpy_avx.h b/src/vppinfra/memcpy_avx.h
index e3feb76b6b7..d95bbad72b8 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);
diff --git a/src/vppinfra/memcpy_sse3.h b/src/vppinfra/memcpy_sse3.h
index 4fc48c86c8b..49baf5e5d31 100644
--- a/src/vppinfra/memcpy_sse3.h
+++ b/src/vppinfra/memcpy_sse3.h
@@ -224,6 +224,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);