Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitscan Updated

Author: Matt Taylor

Date: 20:52:09 02/14/03

Go up one level in this thread


On February 14, 2003 at 14:31:42, Gerd Isenberg wrote:

>On February 14, 2003 at 03:40:53, Matt Taylor wrote:
>
>>AFAIK all suggestions are now incorporated:
>>ftp://24.73.126.6/lsb.h
>>ftp://24.73.126.6/lsb.c
>>
>>Somebody (I no longer remember who) asked me to create a version that does not
>>use cmovcc so it will run on older chips. I may get around to this, but it is
>>not high priority. Staying sane is high priority.
>>
>>Popcount was also requested; this may make its way into that file very soon -- I
>>just need to copy code from the K7 optimization manual.
>>
>>All versions (inline C and all 3 asm routines) tested in GCC and VC against a
>>pure-C routine and seem to work for me.
>>
>>Once again, suggestions are always welcome. Bug reports are even more welcome.
>>
>>Happy bit fiddling!
>>
>>-Matt
>
>Hi Matt,
>
>good work - Thanks again. It's really a reference source on this bitscan topic
>and a good lession in using preprocessor directives. For me it's even really
>helpfull to see ms/intel and gcc assembler syntax. With the latter i am not
>familar with.

Haha, very true. I suppose I should indent the preprocessor directives as some
people do.

The AT&T syntax is very similar to Intel. The operands are in reverse order, and
the Integer instructions (not MMX) have suffixes to indicate operand size (i.e.
mov becomes movl or movw or movb).

>I tried two of your routines so far, the cmov/single-bsf one and the
>LSB_32_table lookup one. It's a mess, both without any branches, but IsiChess is
>stil 2-4% slower with these. I guess some chaotic code size dependent side
>effects (Athlon Xp 2000+, 512MB SDRAM).
>
>Regards,
>Gerd

You used the pi2fd routine before, right?

-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.