Re: Implementation of pop count instruction
- From: "Dan Koren" <dankoren@xxxxxxxxx>
- Date: Tue, 27 Sep 2005 12:23:55 -0400
"Nick Maclaren" <nmm1@xxxxxxxxxxxxx> wrote in message
news:dhb5u7$8oh$1@xxxxxxxxxxxxxxxxxxxxxxx
>
> In article <43391010@xxxxxxxxxxxxx>,
> "Dan Koren" <dankoren@xxxxxxxxx> writes:
> |> > "Laurent Desnogues" <l-desnogues_delme@xxxxxx> wrote in message
> |> > news:dhav2r$lrf$1@xxxxxxxxxxxxxxxxxx
> |> >>
> |> >> You really should take results measured in tight loops with
> |> >> a grain of salt when using table lookups. It often happens
> |> >> that when your code is put in real code (as opposed to benchmark
> |> >> loop code) the result is very different due to cache trashing,
> |> >> even when the table is small.
> |> >
> |> > Hhmmm.... Do you realize the
> |> > entire table is 256 bytes and
> |> > fits completely in one or two
> |> > cache lines?
> |>
> |> Not to mention that this code is
> |> executed so frequently by the
> |> library routines that rely on
> |> it that it stays in the cache.
>
> Sigh. I can confirm Laurent's comment from actual measurements.
"Actual measurements" of my code ?!?
> You have missed the point.
Not any more than you did.
> The effect of introducing such a table is effectively to reduce
> the associativity by one for the range of lines covered by the
> table. This can be harmless, or can cause meltdown. It will
> fairly rarely cause major problems with 4-way associativity, but
> will quite commonly do so with 2-way and very commonly with
> direct mapped.
>
> And God help you if you have similar problems with the TLB :-(
God help HP ;-)
dk
.
- References:
- Implementation of pop count instruction
- From: Stephen Fuld
- Re: Implementation of pop count instruction
- From: Laurent Desnogues
- Re: Implementation of pop count instruction
- From: Dan Koren
- Re: Implementation of pop count instruction
- From: Dan Koren
- Re: Implementation of pop count instruction
- From: Nick Maclaren
- Implementation of pop count instruction
- Prev by Date: Re: Implementation of pop count instruction
- Next by Date: Re: Implementation of pop count instruction
- Previous by thread: Re: Implementation of pop count instruction
- Next by thread: Re: Implementation of pop count instruction
- Index(es):
Relevant Pages
|
|