Skip to content

Commit

Permalink
Re-add accidentally removed method
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Nov 21, 2024
1 parent cbc776a commit b285167
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Lynx/Attacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>
/// Get Bishop attacks assuming current board occupancy
/// </summary>
Expand Down

0 comments on commit b285167

Please sign in to comment.