pub mod eval;
pub mod prng;
pub mod tanton_arc;
pub mod tt;
use board::Board;
use core::piece_move::BitMove;
pub trait Searcher {
fn name() -> &'static str
where
Self: Sized;
fn best_move(board: Board, depth: u16) -> BitMove
where
Self: Sized;
}
pub trait PreFetchable {
fn prefetch(&self, key: u64);
fn prefetch2(&self, key: u64) {
self.prefetch(key);
self.prefetch(key + 1);
}
}
#[inline(always)]
pub fn prefetch_write<T>(ptr: *const T) {
__prefetch_write::<T>(ptr);
}
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "sse"
))]
#[inline(always)]
fn __prefetch_write<T>(ptr: *const T) {
#[cfg(target_arch = "x86")]
use std::arch::x86::_mm_prefetch;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::_mm_prefetch;
unsafe {
_mm_prefetch(ptr as *const i8, 3);
}
}
#[cfg(all(any(
all(
any(target_arch = "x86", target_arch = "x86_64"),
not(target_feature = "sse")
),
not(any(target_arch = "x86", target_arch = "x86_64"))
)))]
#[inline(always)]
fn __prefetch_write<T>(ptr: *const T) {
}
pub mod hint {
#[inline(always)]
pub fn unlikely(cond: bool) -> bool {
cond
}
#[inline(always)]
pub fn likely(cond: bool) -> bool {
cond
}
}