#if !defined(BITCOUNT_H_INCLUDED)
#define BITCOUNT_H_INCLUDED
+// To disable POPCNT support uncomment following line. You should do it only
+// in PGO compiling to exercise the default fallback path. Don't forget to
+// re-comment the line for the final optimized compile though ;-)
+//#define DISABLE_POPCNT_SUPPORT
+
+
#include "bitboard.h"
// Global variable initialized at startup that is set to true if
-// CPU on which application runs support POPCNT intrinsic.
-
+// CPU on which application runs supports POPCNT intrinsic. Unless
+// DISABLE_POPCNT_SUPPORT is defined.
+#if defined(DISABLE_POPCNT_SUPPORT)
+const bool CpuHasPOPCNT = false;
+#else
const bool CpuHasPOPCNT = cpu_has_popcnt();
+#endif
+
+
+// Global variable used to print info about the use of 64 optimized
+// functions to verify that a 64bit compile has been correctly built.
+#if defined(BITCOUNT_SWAR_64)
+const bool CpuHas64BitPath = true;
+#else
+const bool CpuHas64BitPath = false;
+#endif
#endif // !defined(BITCOUNT_H_INCLUDED)
}
// Print copyright notice
- cout << engine_name() << ". Copyright (C) "
+ cout << engine_name() << ". Copyright (C) "
<< "2004-2009 Tord Romstad, Marco Costalba. " << endl;
- // FIXME ONLY FOR DEBUG, REMOVE BEFORE RELEASE
- cout << "Support for POPCNT is " << CpuHasPOPCNT << endl;
+ if (CpuHasPOPCNT)
+ cout << "Good! CPU has hardware POPCNT. We will use it." << endl;
// Enter UCI mode
uci_main_loop();
#include <iostream>
#include <sstream>
+#include "bitcount.h"
#include "misc.h"
using namespace std;
const string engine_name() {
+ const string cpu64(CpuHas64BitPath ? " 64bit" : "");
+
if (!EngineVersion.empty())
- return "Stockfish " + EngineVersion;
+ return AppName+ " " + EngineVersion + cpu64;
string date(__DATE__); // From compiler, format is "Sep 21 2008"
string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec");
string name = AppName + " " + AppTag + " ";
s << name << date.substr(date.length() - 2) << setfill('0')
- << setw(2) << mon << setw(2) << day;
+ << setw(2) << mon << setw(2) << day << cpu64;
return s.str();
}