Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mirroring a 32bit bitboard

Author: Tony Werten

Date: 00:42:32 04/10/02

Go up one level in this thread


On April 09, 2002 at 17:32:15, Alvaro Jose Povoa Cardoso wrote:

>Does anyone kow how to do a fast 32bit bitboard mirroring?
>bit 0  ->  bit 31
>bit 1  ->  bit 30
>bit 2  ->  bit 29
>...etc
>
>I would like to do it fast.
>
>Best regards,
>Alvaro Cardoso

Something like:

for operator= doublebyte,byte,nibble,doublebit,bit

shl(operator at even index,sizeof(operator));
shr(operator at odd index,sizeof(operator));

next operator

(ie there is 1 even/odd index for doublebyte, 2 for byte,4 for nibble etc. A
logical and will do)

Writing out the loop makes it faster.

Tony



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.