public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Do CRC 4 bits at a time
Date: Wed, 26 Apr 2017 09:14:00 -0000	[thread overview]
Message-ID: <CAFiYyc3SXXXdLj=djiQwynpE6-zm9cdPeTQpWJTsb8CS0J2Xnw@mail.gmail.com> (raw)
In-Reply-To: <78941ada-34a7-432f-f991-a0002a615797@acm.org>

On Tue, Apr 25, 2017 at 6:47 PM, Nathan Sidwell <nathan@acm.org> wrote:
> Hi,
> our current CRC routine processes 1 bit at a time, and permits arbitrary
> numbers of bits from 1 to 32.  However we only ever feed it multiples of 8
> bits to process.
>
> So part of this patch changes the interface to use a crc32_unsigned_n worker
> function, which crcs a N-byte integer.
>
> The other change is to do 4 bits at a time.  This is possible because the
> feedback syndrome is '0x04c11db7', which has the top 5 bits clear. But 5's
> an awkward number to work with, so just go with nibble at a time.
>
> bootstrapped on x86_64-linux, ok for trunk?

Please use 'inline' rather than 'static inline'.

Did you test the patch produces the same CRCs than before?  Did you do
any performance measurements?

Otherwise looks ok to me.  I wonder why we have this "copy" at all rather
than using libiberties xcrc32?

Thanks,
Richard.

> nathan
>
> --
> Nathan Sidwell

  reply	other threads:[~2017-04-26  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 16:54 Nathan Sidwell
2017-04-26  9:14 ` Richard Biener [this message]
2017-04-26 14:25   ` Nathan Sidwell
2017-04-26 14:33     ` Richard Biener

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='CAFiYyc3SXXXdLj=djiQwynpE6-zm9cdPeTQpWJTsb8CS0J2Xnw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.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 read-only IMAP folder(s) and NNTP newsgroup(s).