Skip to content

Commit 800eb01

Browse files
jbeulichacmel
authored andcommitted
perf bench: Also allow measuring alternative memcpy implementations
Intended to be able to support the current selection of the preferred memcpy() implementation, this patch adds the ability to also measure the two alternative implementations, again by way of using some pre-processsor replacement. While on my Westmere system this proves that the movsb based variant is worse than the movsq based one (since the ERMS feature isn't there), it also shows that here for the default as well as small sizes the unrolled variant outperforms the movsq one. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/4F16D728020000780006D732@nat28.tlf.novell.com Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 9ea8119 commit 800eb01

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎tools/perf/bench/mem-memcpy-x86-64-asm-def.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@
22
MEMCPY_FN(__memcpy,
33
"x86-64-unrolled",
44
"unrolled memcpy() in arch/x86/lib/memcpy_64.S")
5+
6+
MEMCPY_FN(memcpy_c,
7+
"x86-64-movsq",
8+
"movsq-based memcpy() in arch/x86/lib/memcpy_64.S")
9+
10+
MEMCPY_FN(memcpy_c_e,
11+
"x86-64-movsb",
12+
"movsb-based memcpy() in arch/x86/lib/memcpy_64.S")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
#define memcpy MEMCPY /* don't hide glibc's memcpy() */
2+
#define altinstr_replacement text
3+
#define globl p2align 4; .globl
4+
#define Lmemcpy_c globl memcpy_c; memcpy_c
5+
#define Lmemcpy_c_e globl memcpy_c_e; memcpy_c_e
26
#include "../../../arch/x86/lib/memcpy_64.S"

0 commit comments

Comments
 (0)