From: Gabriel Paubert <paubert@iram.es>
To: Roman Fietze <roman.fietze@telemotive.de>
Cc: Bill Gatliff <bgat@billgatliff.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: Xorg on Fujitsu "Lime" with MPC5200b?
Date: Fri, 16 Apr 2010 11:25:30 +0200 [thread overview]
Message-ID: <20100416092530.GA26506@iram.es> (raw)
In-Reply-To: <201004151553.53426.roman.fietze@telemotive.de>
On Thu, Apr 15, 2010 at 03:53:53PM +0200, Roman Fietze wrote:
> Hello Bill,
>
> On Thursday 15 April 2010 15:01:59 Bill Gatliff wrote:
>
> > Are you talking about this code here?
> >
> > void
> > shadowUpdatePacked (ScreenPtr pScreen,
> > shadowBufPtr pBuf)
> > {
> > ...
> > while (i--)
> > *win++ = *sha++;
>
> Yes. I added a routine like
>
> /* Swap frame buffer bytes in 32 bit value. */
> static __inline unsigned int
> fbbits_swap32(unsigned int __bsx)
> {
> return ((((__bsx) & 0xff000000) >> 8) | (((__bsx) & 0x00ff0000) << 8) |
> (((__bsx) & 0x0000ff00) >> 8) | (((__bsx) & 0x000000ff) << 8));
> }
I don't see the difference with:
return (((__bsx & 0xff00ff00)>> 8) | ((__bsx & 0x00ff00ff) << 8));
for which the compiler (GCC 4.3.2) generates better code (GCC 4.3.2) as shown.
In the first case:
.L3:
lwzx 9,3,8
rlwinm 0,9,8,0,7
rlwinm 11,9,24,8,15
rlwinm 10,9,24,24,31
or 0,0,11
or 0,0,10
rlwinm 9,9,8,16,23
or 0,0,9
stwx 0,4,8
addi 8,8,4
bdnz .L3
in the second:
.L9:
lwzx 0,3,11
and 9,0,10
and 0,0,8
slwi 0,0,8
srwi 9,9,8
or 0,0,9
stwx 0,4,11
addi 11,11,4
bdnz .L9
saving 2 instructions. AFAIR the MPC5200 is based on a 603e core,
so the integer instructions have to go to the single integer unit that
can handle them (the second IU can only handle add and cmp), so the
mimimum is 5 clocks/iteration versus 7. Even with two IU (or 3), the
second code has better latency.
Gabriel
next prev parent reply other threads:[~2010-04-16 9:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 3:07 Xorg on Fujitsu "Lime" with MPC5200b? Bill Gatliff
2010-04-15 4:53 ` Benjamin Herrenschmidt
2010-04-15 7:21 ` Roman Fietze
2010-04-15 13:01 ` Bill Gatliff
2010-04-15 13:53 ` Roman Fietze
[not found] ` <v2ma0706c7b1004150906p34b853a0r80e2bb751e034b97@mail.gmail.com>
2010-04-15 16:07 ` Bill Gatliff
2010-04-16 6:14 ` Roman Fietze
2010-04-16 8:30 ` Michel Dänzer
2010-04-15 20:14 ` Bill Gatliff
2010-04-16 5:48 ` Roman Fietze
2010-04-16 2:51 ` Bill Gatliff
2010-04-16 8:28 ` Roman Fietze
2010-04-16 9:25 ` Gabriel Paubert [this message]
2010-04-15 7:44 ` Anatolij Gustschin
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=20100416092530.GA26506@iram.es \
--to=paubert@iram.es \
--cc=bgat@billgatliff.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=roman.fietze@telemotive.de \
/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).