eal/x86: remove redundant round to improve performance
PATCH 1/1 eal/x86: remove redundant round to improve performance
In rte_memcpy_aligned(), one redundant round is taken in the 64 bytes block copy loops if the size is a multiple of 64. So, let the catch-up copy the last 64 bytes in this case.
--- lib/eal/x86/include/rte_memcpy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/eal/x86/include/rte_memcpy.h +1 -1
@@ -846,7 +846,7 @@ rte_memcpy_aligned(void *dst, const void *src, size_t n) }/* Copy 64 bytes blocks */ -for (; n >=64 ; n -=64 ) { +for (; n >64 ; n -=64 ) {rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); dst = (uint8_t *)dst +64 ; src = (const uint8_t *)src +64 ;
Signature · 1 line
2.34.1
Quoted 28 lines
From: Leyi Rong [mailto:[email protected]]
Sent: Wednesday, 29 March 2023 11.17In
rte_memcpy_aligned(), one redundant round is taken in the 64 bytes block copy loops if the size is a multiple of 64. So, let the catch-up copy the last 64 bytes in this case.Suggested-by Morten Brørup <[email protected]>Signed-off-by Leyi Rong <[email protected]>--- lib/eal/x86/include/rte_memcpy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/eal/x86/include/rte_memcpy.h +1
-2@@ -846,7 +846,7 @@ rte_memcpy_aligned(void *dst, const void *src, size_t n) }/* Copy 64 bytes blocks */ -for (; n >=64 ; n -=64 ) { +for (; n >64 ; n -=64 ) {rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); dst = (uint8_t *)dst +64 ; src = (const uint8_t *)src +64 ; --
Quoted 2 lines
2.34.1
Quoted 7 lines · Leyi Rong
In
rte_memcpy_aligned(), one redundant round is taken in the 64 bytes block copy loops if the size is a multiple of 64. So, let the catch-up copy the last 64 bytes in this case.Suggested-by Morten Brørup <[email protected]>Signed-off-by Leyi Rong <[email protected]>---
Thanks for doing the fix for this.
Quoted 4 lines · Leyi Rong
In
rte_memcpy_aligned(), one redundant round is taken in the 64 bytes block copy loops if the size is a multiple of 64. So, let the catch-up copy the last 64 bytes in this case.
Quoted 3 lines
Suggested-by Morten Brørup <[email protected]>Signed-off-by Leyi Rong <[email protected]>
Signature · 1 line
David Marchand
David Marchand
AppliedQuoted 11 lines · David Marchand
Quoted 4 lines · Leyi Rong
In
rte_memcpy_aligned(), one redundant round is taken in the 64 bytes block copy loops if the size is a multiple of 64. So, let the catch-up copy the last 64 bytes in this case.Fixes f5472703c0bd ("eal: optimize aligned memcpy on x86")Quoted 3 lines
Suggested-by Morten Brørup <[email protected]>Signed-off-by Leyi Rong <[email protected]>Reviewed-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand