Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mixing 0x88 and bitboards

Author: Robert Hyatt

Date: 08:38:44 06/27/02

Go up one level in this thread


On June 27, 2002 at 00:43:59, Eugene Nalimov wrote:

>SHLD/SHRD x86 instuctions shift pair of 32-bit registers left/right and return
>high/low 32 bits.
>
>So for shift by constant amount you need exactly 2 instructions -- for left
>shift, shld+shl. For right shift, shrd+shr. Shift by variable amount is more
>complicated if you don't know that shift amount is less than 32, but those
>instructions still help.
>

OK for the PC.  But not all 32 bit machines do a double-register shift.
Which causes an extra instruction or two to be tossed into the mix...



>Eugene
>
>On June 27, 2002 at 00:03:06, Robert Hyatt wrote:
>
>>On June 25, 2002 at 20:00:47, Dieter Buerssner wrote:
>>
>>>On June 25, 2002 at 19:46:20, Robert Hyatt wrote:
>>>
>>>>The issue is this:  how many instructions to do task x?  For bitboards, the
>>>>instruction count on a 32 bit machine jumps by a factor of two unless shifts
>>>>are being done where it goes up even further.
>>>
>>>Why should it go up further for shifts?
>>>
>>>Dieter
>>
>>
>>You can't just do two 32 bit operations.  You shift one end.  You have to
>>save the part you shift out.  You shift the other end.  Then fold in the
>>part you saved from the first shift...



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.