eal/x86: tune memcpy for platforms without AVX512

For prior platforms, add condition for unalignment handling, to keep this
operation from interrupting the batch copy loop for aligned cases.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
This commit is contained in:
Zhihong Wang 2016-01-17 22:05:14 -05:00 committed by Thomas Monjalon
parent 9484092baa
commit 1ae817f9f8

View File

@ -513,10 +513,12 @@ rte_memcpy(void *dst, const void *src, size_t n)
* Make store aligned when copy size exceeds 512 bytes
*/
dstofss = 32 - ((uintptr_t)dst & 0x1F);
n -= dstofss;
rte_mov32((uint8_t *)dst, (const uint8_t *)src);
src = (const uint8_t *)src + dstofss;
dst = (uint8_t *)dst + dstofss;
if (dstofss > 0) {
n -= dstofss;
rte_mov32((uint8_t *)dst, (const uint8_t *)src);
src = (const uint8_t *)src + dstofss;
dst = (uint8_t *)dst + dstofss;
}
/**
* Copy 256-byte blocks.
@ -833,11 +835,13 @@ rte_memcpy(void *dst, const void *src, size_t n)
* backwards access.
*/
dstofss = 16 - ((uintptr_t)dst & 0x0F) + 16;
n -= dstofss;
rte_mov32((uint8_t *)dst, (const uint8_t *)src);
src = (const uint8_t *)src + dstofss;
dst = (uint8_t *)dst + dstofss;
srcofs = ((uintptr_t)src & 0x0F);
if (dstofss > 0) {
n -= dstofss;
rte_mov32((uint8_t *)dst, (const uint8_t *)src);
src = (const uint8_t *)src + dstofss;
dst = (uint8_t *)dst + dstofss;
srcofs = ((uintptr_t)src & 0x0F);
}
/**
* For aligned copy