Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
x64: detect FMA support
  • Loading branch information
Tilka committed Nov 13, 2013
1 parent 2fecb03 commit 6054129
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Core/Common/Src/CPUDetect.h
Expand Up @@ -41,6 +41,7 @@ struct CPUInfo
bool bLZCNT;
bool bSSE4A;
bool bAVX;
bool bFMA;
bool bAES;
bool bLAHFSAHF64;
bool bLongMode;
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Common/Src/x64CPUDetect.cpp
Expand Up @@ -169,7 +169,11 @@ void CPUInfo::Detect()
if (((cpu_id[2] >> 28) & 1) && ((cpu_id[2] >> 27) & 1))
{
if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6)
{
bAVX = true;
if ((cpu_id[2] >> 12) & 1)
bFMA = true;
}
}
}
if (max_ex_fn >= 0x80000004) {
Expand Down Expand Up @@ -225,6 +229,7 @@ std::string CPUInfo::Summarize()
if (bSSE4_2) sum += ", SSE4.2";
if (HTT) sum += ", HTT";
if (bAVX) sum += ", AVX";
if (bFMA) sum += ", FMA";
if (bAES) sum += ", AES";
if (bLongMode) sum += ", 64-bit support";
return sum;
Expand Down

0 comments on commit 6054129

Please sign in to comment.