[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Aug 2008 20:38:35 -0700
From: "Ulrich Drepper" <drepper@...il.com>
To: "Austin Zhang" <austin_zhang@...ux.intel.com>
Cc: herbert@...dor.apana.org.au, bunk@...nel.org, dwmw2@...radead.org,
davem@...emloft.net, randy.dunlap@...cle.com,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: Re: [PATCH] Using Intel CRC32 instruction to accelerate CRC32c algorithm by new crypto API -V3.
On Tue, Aug 5, 2008 at 10:23 PM, Austin Zhang
<austin_zhang@...ux.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists