Add TSX Extension

Add logic for TSX Check
This commit is contained in:
Vũ Minh Quân 2018-09-08 22:27:40 +07:00 committed by Henrik Rydgard
parent 2c92ad5888
commit 49e2a2db6e
2 changed files with 9 additions and 0 deletions

View File

@ -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 File

@ -52,6 +52,7 @@ struct CPUInfo {
bool bBMI1;
bool bBMI2;
bool bXOP;
bool bRTM;
// x86 : SIMD 128 bit
bool bSSE;