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:
parent
9484092baa
commit
1ae817f9f8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user