mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ulrich Drepper" <drepper@gmail.com>
To: "Austin Zhang" <austin_zhang@linux.intel.com>
Cc: herbert@gondor.apana.org.au, bunk@kernel.org,
	dwmw2@infradead.org, davem@davemloft.net,
	randy.dunlap@oracle.com, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] Using Intel CRC32 instruction to accelerate CRC32c algorithm by new crypto API -V3.
Date: Thu, 7 Aug 2008 20:38:35 -0700	[thread overview]
Message-ID: <a36005b50808072038w3e88658p6769e1e3779b6cab@mail.gmail.com> (raw)
In-Reply-To: <1218000211.4231.23.camel@localhost.localdomain>

On Tue, Aug 5, 2008 at 10:23 PM, Austin Zhang
<austin_zhang@linux.intel.com> wrote:
> +#ifdef CONFIG_X86_64
> +#define REX_PRE "0x48, "
> +#define SCALE_F 8
> +#else
> +#define REX_PRE
> +#define SCALE_F 4
> +#endif
[...]
> +static u32 __pure crc32c_intel_le_hw(u32 crc, unsigned char const *p, size_t len)
> +{
> +       unsigned int iquotient = len / SCALE_F;
> +       unsigned int iremainder = len % SCALE_F;
> +       unsigned long *ptmp = (unsigned long *)p;
> +
> +       while (iquotient--) {
> +               __asm__ __volatile__(
> +                       ".byte 0xf2, " REX_PRE "0xf, 0x38, 0xf1, 0xf1;"
> +                       :"=S"(crc)
> +                       :"0"(crc), "c"(*ptmp)
> +               );
> +               ptmp++;

I think you want to use

  #define SCALE_F sizeof(unsigned long)

Since the loop iteration count etc depends on

   ptmp++

which depends on the type being unsigned long.

  parent reply	other threads:[~2008-08-08  3:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06  5:23 Austin Zhang
2008-08-06  9:42 ` Pavel Machek
2008-08-06 11:03   ` Herbert Xu
2008-08-06 11:05   ` Austin Zhang
2008-08-06 11:17     ` Herbert Xu
2008-08-06 11:20       ` Austin Zhang
2008-08-06 11:22       ` Herbert Xu
2008-08-06 12:14     ` Pavel Machek
2008-08-07  2:00       ` Herbert Xu
2008-08-06 10:09 ` Herbert Xu
2008-08-08  3:38 ` Ulrich Drepper [this message]
2008-08-08 13:35   ` Herbert Xu
2008-08-11 16:10     ` Pavel Machek
2008-08-13  1:14       ` Herbert Xu

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=a36005b50808072038w3e88658p6769e1e3779b6cab@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=austin_zhang@linux.intel.com \
    --cc=bunk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /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

all inboxes | Powered by JetHome®