From: zhichang.yuan@linaro.org (zhichang.yuan at linaro.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/6] arm64:lib: the optimized string library routines for armv8 processors
Date: Wed, 11 Dec 2013 14:24:36 +0800 [thread overview]
Message-ID: <1386743082-5231-1-git-send-email-zhichang.yuan@linaro.org> (raw)
From: "zhichang.yuan" <zhichang.yuan@linaro.org>
In current aarch64 kernel,there are a few string library routines
implemented in arm64/lib,such as memcpy,memset, memmove,strchr.
Most string routines frequently used are provided by the
architecture-independent string library.Those routines are not efficient.
This patch focus on improving the sting routines' performance in ARMv8.
It contains eight optimized functions.The work is based on the cortex-string
project in Linaro toolchain.
The cortex-string code can be found in this website:
https://code.launchpad.net/cortex-strings
To obtain better performance,several ideas were utilized:
1) memory burst access;
For the long memory data operation,adopted the armv8 instruction pairs,
ldp/stp,to transfer the bulk data.Try best to use continuous ldp/stp
to trigger the burst access.
2) parallel processing
The current string routines mostly processed per-byte. This patch
processes the data in parallel.Such as strlen, it will process
eight string bytes each time.
3) aligned memory access
Classfy the process into several categories according to the input
memory address parameters.For the non-alignment memory address,firstly
process the begginning short-length data to make the memory address
aligned,then start the remain processing on alignment address.
After the optimization,those routines have better performance than the current ones.
Please refer to this website to get the test results:
https://wiki.linaro.org/WorkingGroups/Kernel/ARMv8/cortex-strings
--
zhichang.yuan (6):
arm64: lib: Implement optimized memcpy routine
arm64: lib: Implement optimized memmove routine
arm64: lib: Implement optimized memset routine
arm64: lib: Implement optimized memcmp routine
arm64: lib: Implement optimized string compare routines
arm64: lib: Implement optimized string length routines
arch/arm64/include/asm/string.h | 15 ++
arch/arm64/kernel/arm64ksyms.c | 5 +
arch/arm64/lib/Makefile | 5 +-
arch/arm64/lib/memcmp.S | 258 +++++++++++++++++++++++++++++
arch/arm64/lib/memcpy.S | 182 ++++++++++++++++++---
arch/arm64/lib/memmove.S | 195 ++++++++++++++++++----
arch/arm64/lib/memset.S | 227 +++++++++++++++++++++++---
arch/arm64/lib/strcmp.S | 256 +++++++++++++++++++++++++++++
arch/arm64/lib/strlen.S | 131 +++++++++++++++
arch/arm64/lib/strncmp.S | 340 +++++++++++++++++++++++++++++++++++++++
arch/arm64/lib/strnlen.S | 179 +++++++++++++++++++++
11 files changed, 1714 insertions(+), 79 deletions(-)
create mode 100644 arch/arm64/lib/memcmp.S
create mode 100644 arch/arm64/lib/strcmp.S
create mode 100644 arch/arm64/lib/strlen.S
create mode 100644 arch/arm64/lib/strncmp.S
create mode 100644 arch/arm64/lib/strnlen.S
--
1.7.9.5
next reply other threads:[~2013-12-11 6:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 6:24 zhichang.yuan at linaro.org [this message]
2013-12-11 6:24 ` [PATCH 1/6] arm64: lib: Implement optimized memcpy routine zhichang.yuan at linaro.org
2013-12-16 16:08 ` Will Deacon
2013-12-18 1:54 ` zhichang.yuan
2013-12-11 6:24 ` [PATCH 2/6] arm64: lib: Implement optimized memmove routine zhichang.yuan at linaro.org
2013-12-11 6:24 ` [PATCH 3/6] arm64: lib: Implement optimized memset routine zhichang.yuan at linaro.org
2013-12-16 16:55 ` Will Deacon
2013-12-18 2:37 ` zhichang.yuan
2013-12-11 6:24 ` [PATCH 4/6] arm64: lib: Implement optimized memcmp routine zhichang.yuan at linaro.org
2013-12-16 16:56 ` Will Deacon
2013-12-19 8:18 ` Deepak Saxena
2013-12-19 16:14 ` Catalin Marinas
2013-12-11 6:24 ` [PATCH 5/6] arm64: lib: Implement optimized string compare routines zhichang.yuan at linaro.org
2013-12-11 6:24 ` [PATCH 6/6] arm64: lib: Implement optimized string length routines zhichang.yuan at linaro.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386743082-5231-1-git-send-email-zhichang.yuan@linaro.org \
--to=zhichang.yuan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).