Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: About MacCrafty's Code

Author: Robert Hyatt

Date: 20:00:00 01/10/00

Go up one level in this thread


On January 10, 2000 at 21:24:01, Michael Neish wrote:

>
>Hi,
>
>I have the source code for the latest Crafty versions which, of
>course, will not compile on a Mac.  There is a Mac version
>available which I suppose must have been modified in order to
>make it compilable.  My question concerns two functions which I
>think must have been changed.
>
>Specifically, there are a couple of intrinsic C functions, _leadz
>and _trailz on the original source (which count the leading and
>trailing bits of a word, I think) which are not available on Macs,
>as far as I know.  The equivalent to _leadz (on CodeWarrior) is
>_cntlzw, but as far as I know there is no equivalent to _trailz.
>Since Crafty's routines depend quite heavily on these two intrinsic
>functions, I wonder how Bob Hyatt modified the source for the Mac.
>
>Does anyone know?
>
>Thanks,
>
>Mike.

Yes...  although I didn't do it... but the trick is this:

last_one(x) == first_one(x ^ (x-1))

however, I think that boolean.c has macintosh functions to do this
already.

only glitch is the mac functions need 32 bit values, so the above has to
be tweaked a bit...  but boolean.c works for a mac so far as I know..




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.