Enable POPCNT at runtime

Runtime detect POPCNT instruction support and
use it.

Also if POPCNT is not supported we don't add _any_ overhead so
that we don't lose any speed in standard case.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-05-21 16:41:31 +02:00
parent 3376c68f4b
commit e7d3a006cd
2 changed files with 33 additions and 16 deletions

View File

@@ -159,4 +159,9 @@ inline int count_1s_max_15(Bitboard b) {
}
// Global variable initialized at startup that is set to true if
// CPU on which application runs support POPCNT intrinsic.
const bool CpuHasPOPCNT = cpu_has_popcnt();
#endif // !defined(BITCOUNT_H_INCLUDED)