ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[.Net only] - fast bit operations
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Zong Li



Joined: 12 May 2012
Posts: 13

PostPost subject: Re: [.Net only] - fast bit operations    Posted: Fri Jun 22, 2012 5:09 pm Reply to topic Reply with quote

I think you mean -bb or ~bb + 1. Smile It is indeed annoying that you can't just negate a UInt64 value. For the pop function I found that isolating the LSB first was a bit faster in practice (perft) even though it was slower when testing with random values in a loop:

Code:

public static Int32 pop_first_x64_sw(ref UInt64 b) {
     UInt64 bb = b & (0UL - b);
     b &= b - 1;
     return BitIndex[(bb * 0x218A392CD3D5DBFUL) >> 58];
}
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
[.Net only] - fast bit operations Balint Pfliegel Mon Jun 18, 2012 9:59 pm
      Re: [.Net only] - fast bit operations Balint Pfliegel Mon Jun 18, 2012 10:18 pm
            Re: [.Net only] - fast bit operations Balint Pfliegel Thu Jun 21, 2012 10:35 pm
                  Re: [.Net only] - fast bit operations Gerd Isenberg Fri Jun 22, 2012 6:40 am
                        Re: [.Net only] - fast bit operations Balint Pfliegel Fri Jun 22, 2012 6:47 am
                              Re: [.Net only] - fast bit operations Zong Li Fri Jun 22, 2012 5:09 pm
                                    Re: [.Net only] - fast bit operations Balint Pfliegel Fri Jun 22, 2012 5:49 pm
                                          Re: [.Net only] - fast bit operations Balint Pfliegel Fri Jun 22, 2012 7:20 pm
                                                Re: [.Net only] - fast bit operations Zong Li Sat Jun 23, 2012 4:47 pm
                                                      Re: [.Net only] - fast bit operations Balint Pfliegel Mon Jun 25, 2012 5:40 am
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads