Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mirroring a 32bit bitboard

Author: Eugene Nalimov

Date: 16:04:25 04/09/02

Go up one level in this thread


Something like that is more or less portable and does not require any dirty
tricks:

extern unsigned char rgReverseByte[256];

unsigned Reverse32 (unsigned uValue)
{
    return ((rgReverseByte[uValue & 0xFF]) << 24) +
           ((rgReverseByte[(uValue >> 8) & 0xFF]) << 16) +
           ((rgReverseByte[(uValue >> 16) & 0xFF]) << 8) +
           rgReverseByte[uValue >> 24];
}

Eugene

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



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.