| View previous topic :: View next topic |
| Author |
Message |
Zong Li
Joined: 12 May 2012 Posts: 13
|
Post subject: Re: [.Net only] - fast bit operations Posted: Fri Jun 22, 2012 5:09 pm |
|
|
I think you mean -bb or ~bb + 1. 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 |
|
 |
|
| 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 |
|
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
|
|