mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
add rbit fallback
GCC 12.2 added `__rbitll` intrinsic to `arm_acle.h`, so we can add a fallback for older versions Clang 10 (our new minimum supported version) is unaffected by all this closes https://github.com/official-stockfish/Stockfish/pull/6949 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
22548cb0c0
commit
4436524a3e
@@ -43,13 +43,25 @@ void init();
|
||||
#ifdef USE_HYPERBOLA_QUINT
|
||||
|
||||
inline Bitboard reverse_bb(Bitboard bb) {
|
||||
#if __has_builtin(__builtin_bitreverse64)
|
||||
return __builtin_bitreverse64(bb);
|
||||
#else
|
||||
#ifdef __aarch64__
|
||||
#if defined(__GNUC__) && !defined(__clang__) \
|
||||
&& (__GNUC__ < 12 || (__GNUC__ == 12 && __GNUC_MINOR__ < 2))
|
||||
// no rbit in arm_acle.h
|
||||
Bitboard out;
|
||||
asm("rbit %0, %1" : "=r"(out) : "r"(bb));
|
||||
return out;
|
||||
#else
|
||||
return __rbitll(bb);
|
||||
#endif
|
||||
#else // loongarch
|
||||
Bitboard out;
|
||||
asm("bitrev.d %0, %1" : "=r"(out) : "r"(bb));
|
||||
return out;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// Hyperbola quintessence implementation for ARM, thanks to the availability of an
|
||||
|
||||
@@ -561,6 +561,10 @@ void move_to_front(std::vector<T>& vec, Predicate pred) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define sf_always_inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
Reference in New Issue
Block a user