Add tests for SSE3 capability

This commit is contained in:
Vinnie Falco
2013-07-31 07:02:28 -07:00
parent 728ace79c5
commit 4c987d04d6
6 changed files with 55 additions and 62 deletions

View File

@@ -21,12 +21,6 @@
*/
//==============================================================================
const SystemStats::CPUFlags& SystemStats::getCPUFlags()
{
static CPUFlags cpuFlags;
return cpuFlags;
}
String SystemStats::getBeastVersion()
{
// Some basic tests, to keep an eye on things and make sure these types work ok
@@ -62,6 +56,34 @@ String SystemStats::getBeastVersion()
static BeastVersionPrinter beastVersionPrinter;
#endif
//==============================================================================
struct CPUInformation
{
CPUInformation() noexcept
: numCpus (0), hasMMX (false), hasSSE (false),
hasSSE2 (false), hasSSE3 (false), has3DNow (false)
{
initialise();
}
void initialise() noexcept;
int numCpus;
bool hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow;
};
static const CPUInformation& getCPUInformation() noexcept
{
static CPUInformation info;
return info;
}
int SystemStats::getNumCpus() noexcept { return getCPUInformation().numCpus; }
bool SystemStats::hasMMX() noexcept { return getCPUInformation().hasMMX; }
bool SystemStats::hasSSE() noexcept { return getCPUInformation().hasSSE; }
bool SystemStats::hasSSE2() noexcept { return getCPUInformation().hasSSE2; }
bool SystemStats::hasSSE3() noexcept { return getCPUInformation().hasSSE3; }
bool SystemStats::has3DNow() noexcept { return getCPUInformation().has3DNow; }
//==============================================================================
String SystemStats::getStackBacktrace()