public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis•se>
To: "Tim Seufert" <tas@mindspring•com>
Cc: <linuxppc-dev@lists•linuxppc.org>
Subject: Re: csum_partial() and csum_partial_copy_generic() in badly optimized?
Date: Mon, 18 Nov 2002 00:32:06 +0100	[thread overview]
Message-ID: <001701c28e91$8ab64b80$0200a8c0@telia.com> (raw)
In-Reply-To: FA8676EA-FA77-11D6-AE66-003065F22EAA@mindspring.com


> On Sunday, November 17, 2002, at 07:17  AM, Joakim Tjernlund wrote:
>
> >> CTR and the instructions which operate on it
> >> (such as bdnz) were put into the PPC architecture mainly as an
> >> optimization opportunity for loops where the loop variable is not used
> >> inside the loop body.
> >
> > loop variable not USED or loop variable not MODIFIED?
>
> Not used.  CTR cannot be specified as the source or destination of most
> instructions.  In order to access its contents you have to use special
> instructions that move between it and a normal general purpose register.

OK, so how about if I modify the crc32 loop:

unsigned char * end = data +len;
while(data < end) {
        result = (result << 8 | *data++) ^ crctab[result >> 24];
}

will that be possible to optimze in with something similar as bdnz also?

>
> >> Here's a summary of when gcc will compile
> >> that crc32 loop with use of CTR and bdnz (note that -O3 or above
> >> automatically turn on -funroll-loops, so I saw no point in testing
> >> those levels):
> >>
> >>            -O1    -O2    -O1 -funroll-loops    -O2 -funroll-loops
> >> 2.95.4    no     no     no                    no
> >> 3.1       no     yes    yes                   yes
> >
> > hmm, looks like I should upgrade gcc to 3.1 or possibly 3.2. However
> > I think that gcc >=3.0 has changed the ABI for C++, which is bad for
> > me.
>
> Sooner or later you're going to want to, though.  :)

Yes, but upgrading our customers will be a pain :-(

       Jocke

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-11-17 23:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-15 23:01 csum_partial() and csum_partial_copy_generic() in badly optimized? Joakim Tjernlund
2002-11-16  2:39 ` Tim Seufert
2002-11-16 10:16   ` Joakim Tjernlund
2002-11-17  5:58     ` Tim Seufert
2002-11-17 15:17       ` Joakim Tjernlund
2002-11-17 22:00         ` Tim Seufert
2002-11-17 23:32           ` Joakim Tjernlund [this message]
2002-11-18  1:27             ` Tim Seufert
2002-11-18  4:12             ` Gabriel Paubert
2002-11-18 13:49               ` Joakim Tjernlund
2002-11-18 18:05                 ` Gabriel Paubert
2002-11-18 18:43                   ` Joakim Tjernlund
2002-11-19  1:24                     ` Gabriel Paubert
2002-11-19  3:31                   ` Paul Mackerras
2002-11-19  5:35                     ` Gabriel Paubert

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='001701c28e91$8ab64b80$0200a8c0@telia.com' \
    --to=joakim.tjernlund@lumentis$(echo .)se \
    --cc=linuxppc-dev@lists$(echo .)linuxppc.org \
    --cc=tas@mindspring$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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