Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bit Scan Timings

Author: Matt Taylor

Date: 09:22:24 12/21/02

Go up one level in this thread


On December 21, 2002 at 08:41:07, Gerd Isenberg wrote:

>On December 21, 2002 at 02:40:42, Matt Taylor wrote:
>
>>OK, after a bit of work cleaning up an undergrad project (the buggy source
>>highlighter that I used to convert the code -> html), I've got the code up.
>>
>>Timings:
>>http://65.186.75.165/~mtaylor/bitscan_athlon.html
>>
>>Code:
>>http://65.186.75.165/~mtaylor/ipcbench.c.html
>>http://65.186.75.165/~mtaylor/bitscan.c.html
>>
>>I'll run results for an original K6 tomorrow just as a matter of curiousity. I
>>don't have access to -ANY- Intel machines right now, so I can't get Intel data.
>>If anyone wants to help out, I can toss the binary up on FTP. Offhand I don't
>>think it will run terribly well on a P4 and possibly not very well on previous
>>Intel processors.
>>
>>-Matt
>
>Hi Matt,
>
>thanks for sharing the results and sources. A few remarks. I missed the last
>pi2fd/mmx-version i posted recently. The one you reported was a bit outdated ;-)
>Anyway, i made my conclusions already.
>
>The implementation of the while-conditions favours the lower half a bit.
>So i would prefere Walter's methode, looking for carry after substaction, or
>this one:
>
>   mov     edx, [bb]
>   or      edx, [bb+4]
>   jnz     ScanAgain
>
>instead of two cmp,jne statements.
>What about mispredicted branches here?
>
>Gerd

It's debatable; I usually favor two branches because it avoids the register
dependency. However, I think you have an excellent point, and it shouldn't take
any more time.

I'll change that, run it again, and post K6 + Athlon results. I forgot to post
the header file with some of the definitions (like the BEGIN_TIME and END_TIME
macros). I'll do that too.

-Matt



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.