| View previous topic :: View next topic |
| Author |
Message |
Gerd Isenberg
Joined: 08 Mar 2006 Posts: 1785 Location: Hattingen, Germany
|
Post subject: Re: post gone?? Posted: Wed May 02, 2007 6:08 pm |
|
|
| hgm wrote: |
Depending on how you obtain that prior knowledge, you might arrange it such that it is also guaranteed that sq1 and sq2 are not neighboring squares on an anti-diagonal either, as in that case there are no in-between squares anyway. There is thus no reason to treat it differently from cases where sq1 and sq2 are not aligned on a ray. The disambiguation of that and the same-rank case would then no longer be needed.
Also here the 'rotate' instructions could be useful, as you don't rely on bits being clipped off as the tabulated templates are shifted in position. That would save you ordering the squares. You would need twice as large a table, though. |
Sounds great, you mean something like this?
| Code: |
u64 inbetweenBySignedDiff[2*64];
u64 inBetweenWithDistanceGr1(u32 sq1, u32 sq2)
{
return _rotl64(inbetweenBySignedDiff[sq2-sq1+64], sq1);
}
sub rdx, rcx ; sq2-sq1
mov rax, [...+64*8+edx*8]
rol rax, cl
|
But assuming there is no prior knowledge related to sq1, sq2, like a condition if distance(sq1,sq2) > 1 or the ray-type (rank, file, (anti-)diagonal), it becomes hard to use the rotate trick, due to the +-7 ambiguity. For instance to check (pseudo-)legality of queen-moves like Qh4-a4 or Qh4-g5.
The ambiguity disappears with 0x88-coordiates and one more double sized array...
| Code: |
u64 inbetweenBy0x88Diff[2*2*64];
u64 inBetweenWithDistanceGr1(u32 sq1, u32 sq2)
{
return _rotl64(inbetweenBySignedDiff[sq2+(sq2&56)-sq1-(sq1&56)+127], sq1);
}
|
... and it looks like a good compromize, specially if you already have 0x88. |
|
| Back to top |
|
 |
|
| Subject |
Author |
Date/Time |
Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Fri Apr 27, 2007 8:39 am |
Re: Speedup with bitboards on 64-bit CPUs |
Mark Lefler |
Fri Apr 27, 2007 9:34 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Fri Apr 27, 2007 11:04 am |
Re: Speedup with bitboards on 64-bit CPUs |
Pradu Kannan |
Fri Apr 27, 2007 11:15 am |
Re: Speedup with bitboards on 64-bit CPUs |
jswaff |
Sat Apr 28, 2007 12:21 am |
Re: Speedup with bitboards on 64-bit CPUs |
H.G.Muller |
Fri Apr 27, 2007 10:20 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Fri Apr 27, 2007 11:13 am |
Re: Speedup with bitboards on 64-bit CPUs |
Pradu Kannan |
Fri Apr 27, 2007 11:18 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Mon Apr 30, 2007 3:01 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Sun Apr 29, 2007 12:34 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Mon Apr 30, 2007 3:14 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Mon Apr 30, 2007 5:08 pm |
post gone?? |
Guetti |
Tue May 01, 2007 8:26 pm |
Re: post gone?? |
Gerd Isenberg |
Wed May 02, 2007 6:36 am |
Re: post gone?? |
Guetti |
Wed May 02, 2007 7:54 am |
Re: post gone?? |
H.G.Muller |
Wed May 02, 2007 3:47 pm |
Re: post gone?? |
Gerd Isenberg |
Wed May 02, 2007 6:08 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Charles Roberson |
Fri Apr 27, 2007 1:45 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Vincent Diepeveen |
Sat May 19, 2007 5:20 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Mon May 21, 2007 5:34 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Tony Thomas |
Mon May 21, 2007 5:40 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Mon May 21, 2007 9:47 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Vincent Diepeveen |
Sat May 26, 2007 7:21 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Sun May 27, 2007 9:41 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Chan Rasjid |
Mon May 28, 2007 7:29 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tony Thomas |
Mon May 28, 2007 9:04 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Jacob |
Mon May 28, 2007 9:49 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Chan Rasjid |
Tue May 29, 2007 5:58 am |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Tue May 29, 2007 3:18 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Chan Rasjid |
Tue May 29, 2007 4:09 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Tue May 29, 2007 9:23 pm |
Quiescence search width |
Steven Edwards |
Tue May 29, 2007 10:02 pm |
Re: Quiescence search width |
Greg McGlynn |
Wed May 30, 2007 3:36 pm |
Re: Quiescence search width |
Robert Hyatt |
Thu May 31, 2007 1:45 am |
Re: Quiescence search width |
Steven Edwards |
Thu May 31, 2007 2:16 am |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Tue May 29, 2007 3:15 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Jon Dart |
Fri Apr 27, 2007 6:25 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Michael Sherwin |
Fri Apr 27, 2007 11:32 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Sun Apr 29, 2007 12:38 am |
Re: Speedup with bitboards on 64-bit CPUs |
Michael Sherwin |
Sun Apr 29, 2007 2:01 am |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Mon Apr 30, 2007 12:41 am |
Re: Speedup with bitboards on 64-bit CPUs |
frank phillips |
Sat Apr 28, 2007 10:38 am |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Mon Apr 30, 2007 3:22 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Mon Apr 30, 2007 8:59 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Michael Sherwin |
Tue May 01, 2007 9:55 am |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Tue May 01, 2007 9:05 pm |
Re: Speedup with bitboards on 64-bit CPUs |
H.G.Muller |
Tue May 01, 2007 11:38 am |
Re: Speedup with bitboards on 64-bit CPUs |
Robert Hyatt |
Tue May 01, 2007 9:07 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Shaun Brewer |
Tue May 01, 2007 11:20 pm |
Re: Speedup with bitboards on 64-bit CPUs |
Tord Romstad |
Fri May 11, 2007 8:16 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
|
|