Re: Implementation of pop count instruction
- From: "Dan Koren" <dankoren@xxxxxxxxx>
- Date: Wed, 28 Sep 2005 18:01:06 -0400
"Terje Mathisen" <terje.mathisen@xxxxxxxxxxxxx> wrote in message
news:dheo6l$mmu$1@xxxxxxxxxxxxxxxxxxxxxxxxxx
> Dan Koren wrote:
>> Huh ?!?
>>
>> int n = 1000000000;
>> hrtime_t t0, t1;
>> double dt;
>>
>> t0 = gethrtime ();
>> while (n--) popc (whatever);
>> t1 = gethrtime ();
>>
>> dt = t1 - t0;
>>
>> I don't doubt you could have written
>> this yourself ;-)
>
> The code is fine, please show the
> generated asm!
?!?!?
I am no compiler, and I do not have
access to Sun Studio right now being
on vacation. I'm sure you don't need
my help for such an experimen, or do
you?
>>> There must be opportunities for the
>>> compiler to make things evaporate.
>>
>> Only the procedure call since popc is
>> inlined using #pragma inline or the
>> equivalent compiler directives.
>
> As soon as the compiler have inlined the
> table lookups, it is also free to discover
> any additional optimizations, like the
> possibility that 'whatever' is constant
> across the loop.
>
> I hope/assume this wasn't the case here?
Of course not.
You sound obsessively pedantic if I may
say so. If you're willing to take at
face value my statement that the code
has been extensively measured and tested
in a professional manner, fine. If not,
I'm not going to bother to do an online
design and/or code review. This is an
informal discussion group. Lighten up.
dk
.
- Follow-Ups:
- Re: Implementation of pop count instruction
- From: Christian Bau
- Re: Implementation of pop count instruction
- References:
- Implementation of pop count instruction
- From: Stephen Fuld
- Re: Implementation of pop count instruction
- From: Seongbae Park
- Re: Implementation of pop count instruction
- From: Dan Koren
- Re: Implementation of pop count instruction
- From: Niels Jørgen Kruse
- Re: Implementation of pop count instruction
- From: Dan Koren
- Re: Implementation of pop count instruction
- From: Niels Jørgen Kruse
- Re: Implementation of pop count instruction
- From: Dan Koren
- Re: Implementation of pop count instruction
- From: Dan Koren
- Implementation of pop count instruction
- Prev by Date: Re: Implementation of pop count instruction
- Next by Date: Re: APB bridge
- Previous by thread: Re: Implementation of pop count instruction
- Next by thread: Re: Implementation of pop count instruction
- Index(es):
Relevant Pages
|
|