lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] word-at-a-time: provide generic big-endian zero_bytemask implementation
Hi Linus,

On Tue, Dec 10, 2013 at 08:08:20PM +0000, Linus Torvalds wrote:
> Hmm. Did you try to time this?

I took it for a spin on a big-endian ARMv7 platform (32-bit) and the hashing is
around 40% faster.

> Also, I really have #ifdef's in code, and I think we'd be better off
> just exposing a function that does this
>
> +#ifdef __BIG_ENDIAN
> + mask = ~(~0ul >> tcount*8);
> +#else
> mask = ~(~0ul << tcount*8);
> +#endif
>
> thing. I think it would logically go together with zero_bytemask(),
> call it something like "bytemask_from_count()" or something. Hmm? It's
> basically just the reverse of "count_masked_bytes()", which we also
> have an abstraction for.

Yup, that's a good idea, I can probably just add something to dcache.h.
I'll spin a v2.

Cheers,

Will


\
 
 \ /
  Last update: 2013-12-12 18:41    [W:0.062 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site