diff options
author | Ray Kinsella <ray.kinsella@intel.com> | 2017-04-21 11:08:43 +0100 |
---|---|---|
committer | Ray Kinsella <ray.kinsella@intel.com> | 2017-04-21 11:26:39 +0100 |
commit | 658efd2fc986bca88336569b2e6fa8b537a660d8 (patch) | |
tree | 281381215b1d9870b7963521baf17f870025ba36 | |
parent | 2f2db1c2021c5aae564d2783a33366527afb5fce (diff) |
vppinfra: clib_memcpy improvement
In the case where n is a constant 16 bytes, the second load/store is
ignored by the load/store unit - it has neglible/zero cost. In the case
where n is variable and greater than 512 bytes, the extra if (n == 16)
branch has a very small performance impact.
Change-Id: I04b313cf022c18fee31b1d9bcf6a128414659a99
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
-rw-r--r-- | src/vppinfra/memcpy_avx.h | 5 | ||||
-rw-r--r-- | src/vppinfra/memcpy_sse3.h | 5 |
2 files changed, 0 insertions, 10 deletions
diff --git a/src/vppinfra/memcpy_avx.h b/src/vppinfra/memcpy_avx.h index d95bbad7..e3feb76b 100644 --- a/src/vppinfra/memcpy_avx.h +++ b/src/vppinfra/memcpy_avx.h @@ -185,11 +185,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); diff --git a/src/vppinfra/memcpy_sse3.h b/src/vppinfra/memcpy_sse3.h index 49baf5e5..4fc48c86 100644 --- a/src/vppinfra/memcpy_sse3.h +++ b/src/vppinfra/memcpy_sse3.h @@ -224,11 +224,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); |