From: Rich Felker <dalias@libc.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] common checksum code uses post-sh2 instruction
Date: Fri, 04 Sep 2015 15:39:47 +0000 [thread overview]
Message-ID: <20150904153947.GR17773@brightrain.aerifal.cx> (raw)
In-Reply-To: <55E6FB54.9090800@landley.net>
On Wed, Sep 02, 2015 at 08:36:20AM -0500, Rob Landley wrote:
> From: Rob Landley <rob@landley.net>
>
> The common checksum code uses shld which sh2 hasn't got, so unwind it.
>
> Note: http://nommu.org/jcore added SHAD and SHLD, and if anybody's
> building for an actual sh2 they'll either need gcc 4.7 or earlier or
> a fix to https://gcc.gnu.org/bugzilla/show_bug.cgi?idT089 but
> when regression testing against the actual historical hardware,
> you need this.
>
> Signed-off-by: Rob Landley <rob@landley.net>
> ---
>
> arch/sh/lib/checksum.S | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/arch/sh/lib/checksum.S b/arch/sh/lib/checksum.S
> index 356c8ec..7f0fc6b 100644
> --- a/arch/sh/lib/checksum.S
> +++ b/arch/sh/lib/checksum.S
> @@ -88,8 +88,9 @@ ENTRY(csum_partial)
> 2:
> ! buf is 4 byte aligned (len could be 0)
> mov r5, r1
> - mov #-5, r0
> - shld r0, r1
> + shlr2 r1 ! mov #-5, r0
> + shlr2 r1 ! shld r0, r1
> + shlr r1
Is this a performance-critical code path (e.g. for networking)? If
not, I like your current solution best because it's simple and
#ifdef-free. But if it is critical and the shld is faster, perhaps
#ifdef for SH3+ would be appropriate, and we could expand to include
J2 in the #ifdef with the J2 support patches?
Rich
prev parent reply other threads:[~2015-09-04 15:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 13:36 [PATCH] common checksum code uses post-sh2 instruction Rob Landley
2015-09-04 15:39 ` Rich Felker [this message]
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=20150904153947.GR17773@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=linux-sh@vger.kernel.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).