From b28516769ade43a736fe575902f5557421aab5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20C=C3=A1ceres?= Date: Thu, 21 Nov 2024 23:50:19 +0100 Subject: [PATCH] Re-add accidentally removed method --- src/Lynx/Attacks.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Lynx/Attacks.cs b/src/Lynx/Attacks.cs index af777fef..6c32607e 100644 --- a/src/Lynx/Attacks.cs +++ b/src/Lynx/Attacks.cs @@ -58,6 +58,14 @@ static Attacks() } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static BitBoard BishopAttacks(int squareIndex, BitBoard occupancy) + { + return Bmi2.X64.IsSupported + ? _pextAttacks[_pextBishopOffset[squareIndex] + Bmi2.X64.ParallelBitExtract(occupancy, _bishopOccupancyMasks[squareIndex])] + : MagicNumbersBishopAttacks(squareIndex, occupancy); + } + /// /// Get Bishop attacks assuming current board occupancy ///