Changes

Jump to: navigation, search

Reverse Bitboards

8 bytes added, 09:02, 11 May 2018
m
no edit summary
The idea of '''Reverse Bitboards''' was proposed by [[Ryan Mack]] in [[Timeline#2000|2000]] while introducing his ''Hyperbola Project''. It was based on the [[Subtracting a Rook from a Blocking Piece#oxoro2r|x XOR (x - 2)]] [[Bit-Twiddling|bit-twiddling]] trick to generate attacks in [[On an empty Board#PositiveRays|positive]] [[Rays#RayDirections|ray-directions]] - and beside the usual [[Occupancy|occupancy]] bitboard, to maintain a [[Flipping Mirroring and Rotating#Rotationby180degrees|reversed or 180 degree rotated]] occupied bitboard to apply the trick for [[On an empty Board#NegativeRays|negative]] ray-directions as well. It was intended to [[Bitboard Serialization|traverse]] reversed sets for move-generation, while re-reversion took place in the scalar, square centric world by [[General Setwise Operations#ExclusiveOr|xor]] 63 after [[BitScan|bitscan]]. Alternatively, for other purposes a [[MMX]]-bitreversal routine was mentioned.
Ryan made an interesting and thought-provoking contribution. He introduced the predecessor of the [[Subtracting a rook Rook from a blocking pieceBlocking Piece#oxoro2r|o^(o-2r)-trick]]. With hindsight, the idea of keeping two reversed sets seemed not that successful as the author initially thought. However, [[Hyperbola Quintessence]], where fast vertical byteswap flipping is used on the fly to reverse diagonals and files, is somehow the resurrection of Ryan's ideas, vastly improved by [[Aleks Peshkov|Aleks Peshkov's]] [[General Setwise Operations#ExclusiveOr|xor]] wizardry. Aleks' [[SSSE3#Peshkov|SSSE3 approach]] even relies on keeping reverse occupancies to further use only nine SIMD operations to generate bishop attacks.
----

Navigation menu