Permalink
Browse files

Add TSX Extension

Add logic for TSX Check
  • Loading branch information...
zminhquanz authored and Henrik Rydgard committed Sep 8, 2018
1 parent 2c92ad5 commit 49e2a2db6e3e3f929211000aeda3d6947e1e36b6
Showing with 9 additions and 0 deletions.
  1. +8 −0 Common/CPUDetect.cpp
  2. +1 −0 Common/CPUDetect.h
View
@@ -224,6 +224,11 @@ void CPUInfo::Detect() {
}
}
// TSX support require check:
// -- Is the RTM bit set in CPUID? (>>11)
// -- No need to check HLE bit because legacy processors ignore HLE hints
// -- See https://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family
if (max_std_fn >= 7)
{
do_cpuid(cpu_id, 0x00000007);
@@ -236,6 +241,8 @@ void CPUInfo::Detect() {
bBMI2 = true;
if ((cpu_id[1] >> 29) & 1)
bSHA = true;
if ((cpu_id[1] >> 11) & 1)
bRTM = true;
}
}
if (max_ex_fn >= 0x80000004) {
@@ -419,6 +426,7 @@ std::string CPUInfo::Summarize()
if (bAES) sum += ", AES";
if (bSHA) sum += ", SHA";
if (bXOP) sum += ", XOP";
if (bRTM) sum += ", TSX";
if (bLongMode) sum += ", 64-bit support";
return sum;
}
View
@@ -52,6 +52,7 @@ struct CPUInfo {
bool bBMI1;
bool bBMI2;
bool bXOP;
bool bRTM;
// x86 : SIMD 128 bit
bool bSSE;

0 comments on commit 49e2a2d

Please sign in to comment.