Why would you worry about that extra table? You don't have to store it by board square, you could square it by piece number in the piece list, which can be smaller than 64 entries.Jan Brouwer wrote:An alternative is to use a lookup table indexed by square:(I think this works, I haven't tried it.)Code: Select all
state &= table[move.from] & table[move.to]
The disadvantage of this approach is the additional lookup table, of which only 6 entries are really used.
And even if not: encoding extra bits in the pieces on the board, forces you to take a board of integers. Two tables of 64 characters would be smaller. And fetching operands from memory is often faster on x86 machines than using tonly operands from registers. (Apparently there is only a limited number of ports to the register file, so reading them can become a bottle-neck, so instructions would have to be postponed, where feeding them into the ALU directly from the load unit would have been possible during the same cycle.