From: "Albrecht Dreß" <albrecht.dress@arcor.de>
To: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: tiny memcpy_(to|from)io optimisation
Date: Thu, 28 May 2009 21:50:24 +0200 [thread overview]
Message-ID: <1243540232.3305.0@antares> (raw)
In-Reply-To: <OF508468F5.9BFFC168-ONC12575C4.005846FD-C12575C4.00592585@transmode.se> (from joakim.tjernlund@transmode.se on Thu May 28 18:13:43 2009)
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
Am 28.05.09 18:13 schrieb(en) Joakim Tjernlund:
> hmm, these do look a bit unoptimal anyway. Any reason not to write
> them something like below(written by me for uClibc long time ago).
> You will have to add eieio()/sync
No (and I wasn't aware of the PPC pre-inc vs. post-inc stuff) - I just
stumbled over this while fixing mtd accesses to the MPC5200's Local Bus
in 16-bit mode which doesn't allow byte accesses. And I didn't want to
go too deep into this as the real fix for me is actually somewhat
different...
> /* PPC can do pre increment and load/store, but not post increment
> and load/store.
> Therefore use *++ptr instead of *ptr++. */
[snip]
> copy_chunks:
> do {
> /* make gcc to load all data, then store it */
> tmp1 = *(unsigned long *)(tmp_from+4);
> tmp_from += 8;
> tmp2 = *(unsigned long *)tmp_from;
> *(unsigned long *)(tmp_to+4) = tmp1;
> tmp_to += 8;
> *(unsigned long *)tmp_to = tmp2;
> } while (--chunks);
Is this the same for all PPC cores, i.e. do they all benefit from
loading/storing 8 instead of 4 bytes?
Best, Albrecht.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2009-05-28 19:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 20:00 [PATCH] powerpc: tiny memcpy_(to|from)io optimisation Albrecht Dreß
2009-05-28 16:13 ` Joakim Tjernlund
2009-05-28 19:50 ` Albrecht Dreß [this message]
2009-05-29 6:31 ` Joakim Tjernlund
2009-05-31 10:11 ` Albrecht Dreß
2009-06-01 6:14 ` Joakim Tjernlund
2009-06-02 18:45 ` Albrecht Dreß
2009-06-02 22:51 ` Benjamin Herrenschmidt
2009-06-03 14:36 ` Kenneth Johansson
2009-06-03 18:35 ` Albrecht Dreß
2009-06-11 17:07 ` Wolfram Sang
2009-06-11 17:30 ` Grant Likely
2009-06-19 18:42 ` Lorenz Kolb
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=1243540232.3305.0@antares \
--to=albrecht.dress@arcor.de \
--cc=linuxppc-dev@ozlabs.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).