Hi again.
Now some days have been passed by and i thought about implentation of
OD (ROD). While doing this just another idea came to my mind, which i like to present. (maybe discuss and work out).
1. So, i am not really able to decide which implementation i should use,
because of so many different architectures. Well, i am interested what
guides some of you are following, making such decisions ?
2. As it turned out, there wasnt a really fast way to get the MSBs aside
from using fast machine instructions. A de bruijn _magic_ calculation
for a _single_ bit wasnt the right way with respect to the Kindergarten
approach...
But we can do a lookup for _both_ MSBs in parallel with the magic
approach.(one magic calculation, result: 2msbs)
Memory Requ. (about):
Code: Select all
a. Index: 4K Content: 4K (1byte / entry) (maybe: pre/post masked)
- shift sq to h8
- magic lookup
- shift result back to sq
the byte is holding the relative shift numbers for corresponding
directions.
byte = (shift_nb_of_files_ww<<3) | (shift_nb_of_ranks_ss) (example for rook)
Code: Select all
b. Index: 16K Content: 16K (1byte / entry)
magic lookup for each square itself (not shared)
byte = (shift_nb_of_files_ww<<3) | (shift_nb_of_ranks_ss) (example for rook)
Of course i have in mind some alternatives, but i hope these 2 are enough to show the basic idea.
Well, i am very interested in point _1._ and some remarks on it.
Thx