Cached CPU features, added AVX2, and AVX512.
This commit is contained in:
@@ -36,9 +36,9 @@ namespace ehs
|
||||
double Math::Sqrt(const double from)
|
||||
{
|
||||
#if defined(EHS_ARCH_X64)
|
||||
if (CPU::HasAVX())
|
||||
if (CPU::hasAVX)
|
||||
return Sqrt_AVX(from);
|
||||
else if (CPU::HasSSE())
|
||||
else if (CPU::hasSSE)
|
||||
return Sqrt_SSE2(from);
|
||||
|
||||
double temp = 0.0;
|
||||
@@ -59,9 +59,9 @@ namespace ehs
|
||||
float Math::Sqrt(const float from)
|
||||
{
|
||||
#if defined(EHS_ARCH_X64)
|
||||
if (CPU::HasAVX())
|
||||
if (CPU::hasAVX)
|
||||
return Sqrt_AVX(from);
|
||||
else if (CPU::HasSSE())
|
||||
else if (CPU::hasSSE)
|
||||
return Sqrt_SSE(from);
|
||||
|
||||
float temp = 0.0f;
|
||||
|
22
src/Util.cpp
22
src/Util.cpp
@@ -1,5 +1,9 @@
|
||||
#include "ehs/Util.h"
|
||||
|
||||
#include "ehs/system/CPU.h"
|
||||
#include "ehs/system/AVX2.h"
|
||||
#include "ehs/system/AVX512.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
bool Util::Compare(const void* const a, const void* const b, const UInt_64 size)
|
||||
@@ -11,7 +15,21 @@ namespace ehs
|
||||
|
||||
while (i < size)
|
||||
{
|
||||
if (remainder >= sizeof(UInt_64))
|
||||
if (CPU::hasAVX512F && remainder >= 64)
|
||||
{
|
||||
if (!AVX512::CompareUnaligned((UInt_64*)&aBytes[i], (UInt_64*)&bBytes[i]))
|
||||
return false;
|
||||
|
||||
i += 64;
|
||||
}
|
||||
else if (CPU::hasAVX2 && remainder >= 32)
|
||||
{
|
||||
if (!AVX2::CompareUnaligned((UInt_64*)&aBytes[i], (UInt_64*)&bBytes[i]))
|
||||
return false;
|
||||
|
||||
i += 32;
|
||||
}
|
||||
else if (remainder >= sizeof(UInt_64))
|
||||
{
|
||||
if (*(UInt_64*)&aBytes[i] != *(UInt_64*)&bBytes[i])
|
||||
return false;
|
||||
@@ -118,4 +136,4 @@ namespace ehs
|
||||
remainder = size - i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
49
src/system/AVX2_GCC_AMD64.asm
Normal file
49
src/system/AVX2_GCC_AMD64.asm
Normal file
@@ -0,0 +1,49 @@
|
||||
global _ZN3ehs4AVX216CompareUnalignedEPKmS2_
|
||||
global _ZN3ehs4AVX216CompareUnalignedEPKlS2_
|
||||
global _ZN3ehs4AVX214CompareAlignedEPKmS2_
|
||||
global _ZN3ehs4AVX214CompareAlignedEPKlS2_
|
||||
|
||||
section .text
|
||||
_ZN3ehs4AVX216CompareUnalignedEPKmS2_:
|
||||
VMOVDQU YMM0, [RDI]
|
||||
VMOVDQU YMM1, [RSI]
|
||||
VPCMPEQQ YMM2, YMM0, YMM1
|
||||
|
||||
VPMOVMSKB EAX, YMM2
|
||||
CMP EAX, 0xFFFFFFFF
|
||||
SETE AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs4AVX216CompareUnalignedEPKlS2_:
|
||||
VMOVDQU YMM0, [RDI]
|
||||
VMOVDQU YMM1, [RSI]
|
||||
VPCMPEQQ YMM2, YMM0, YMM1
|
||||
|
||||
VPMOVMSKB EAX, YMM2
|
||||
CMP EAX, 0xFFFFFFFF
|
||||
SETE AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs4AVX214CompareAlignedEPKmS2_:
|
||||
VMOVDQA YMM0, [RDI]
|
||||
VMOVDQA YMM1, [RSI]
|
||||
VPCMPEQQ YMM2, YMM0, YMM1
|
||||
|
||||
VPMOVMSKB EAX, YMM2
|
||||
CMP EAX, 0xFFFFFFFF
|
||||
SETE AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs4AVX214CompareAlignedEPKlS2_:
|
||||
VMOVDQA YMM0, [RDI]
|
||||
VMOVDQA YMM1, [RSI]
|
||||
VPCMPEQQ YMM2, YMM0, YMM1
|
||||
|
||||
VPMOVMSKB EAX, YMM2
|
||||
CMP EAX, 0xFFFFFFFF
|
||||
SETE AL
|
||||
|
||||
RET
|
49
src/system/AVX512_GCC_AMD64.asm
Normal file
49
src/system/AVX512_GCC_AMD64.asm
Normal file
@@ -0,0 +1,49 @@
|
||||
global _ZN3ehs6AVX51216CompareUnalignedEPKmS2_
|
||||
global _ZN3ehs6AVX51216CompareUnalignedEPKlS2_
|
||||
global _ZN3ehs6AVX51214CompareAlignedEPKmS2_
|
||||
global _ZN3ehs6AVX51214CompareAlignedEPKlS2_
|
||||
|
||||
section .text
|
||||
_ZN3ehs6AVX51216CompareUnalignedEPKmS2_:
|
||||
VMOVDQU64 ZMM0, [RDI]
|
||||
VMOVDQU64 ZMM1, [RSI]
|
||||
|
||||
VPCMPEQQ K1, ZMM0, ZMM1
|
||||
|
||||
KORTESTQ K1, K1
|
||||
SETC AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs6AVX51216CompareUnalignedEPKlS2_:
|
||||
VMOVDQU64 ZMM0, [RDI]
|
||||
VMOVDQU64 ZMM1, [RSI]
|
||||
|
||||
VPCMPEQQ K1, ZMM0, ZMM1
|
||||
|
||||
KORTESTQ K1, K1
|
||||
SETC AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs6AVX51214CompareAlignedEPKmS2_:
|
||||
VMOVDQA64 ZMM0, [RDI]
|
||||
VMOVDQA64 ZMM1, [RSI]
|
||||
|
||||
VPCMPEQQ K1, ZMM0, ZMM1
|
||||
|
||||
KORTESTQ K1, K1
|
||||
SETC AL
|
||||
|
||||
RET
|
||||
|
||||
_ZN3ehs6AVX51214CompareAlignedEPKlS2_:
|
||||
VMOVDQA64 ZMM0, [RDI]
|
||||
VMOVDQA64 ZMM1, [RSI]
|
||||
|
||||
VPCMPEQQ K1, ZMM0, ZMM1
|
||||
|
||||
KORTESTQ K1, K1
|
||||
SETC AL
|
||||
|
||||
RET
|
@@ -10,6 +10,70 @@ namespace ehs
|
||||
UInt_64 CPU::TSC_Freq = 0;
|
||||
#endif
|
||||
|
||||
const bool CPU::hasFPU = RetrieveFPU();
|
||||
const bool CPU::hasVME = RetrieveVME();
|
||||
const bool CPU::hasDE = RetrieveDE();
|
||||
const bool CPU::hasPSE = RetrievePSE();
|
||||
const bool CPU::hasTSC = RetrieveTSC();
|
||||
const bool CPU::hasMSR = RetrieveMSR();
|
||||
const bool CPU::hasPAE = RetrievePAE();
|
||||
const bool CPU::hasMCE = RetrieveMCE();
|
||||
const bool CPU::hasCX8 = RetrieveCX8();
|
||||
const bool CPU::hasAPIC = RetrieveAPIC();
|
||||
const bool CPU::hasSEP = RetrieveSEP();
|
||||
const bool CPU::hasMTRR = RetrieveMTRR();
|
||||
const bool CPU::hasPGE = RetrievePGE();
|
||||
const bool CPU::hasMCA = RetrieveMCA();
|
||||
const bool CPU::hasCMOV = RetrieveCMOV();
|
||||
const bool CPU::hasPSE_36 = RetrievePSE_36();
|
||||
const bool CPU::hasPSN = RetrievePSN();
|
||||
const bool CPU::hasCLFSH = RetrieveCLFSH();
|
||||
const bool CPU::hasDS = RetrieveDS();
|
||||
const bool CPU::hasACPI = RetrieveACPI();
|
||||
const bool CPU::hasMMX = RetrieveMMX();
|
||||
const bool CPU::hasFXSR = RetrieveFXSR();
|
||||
const bool CPU::hasSSE = RetrieveSSE();
|
||||
const bool CPU::hasSSE2 = RetrieveSSE2();
|
||||
const bool CPU::hasSS = RetrieveSS();
|
||||
const bool CPU::hasHTT = RetrieveHTT();
|
||||
const bool CPU::hasTM = RetrieveTM();
|
||||
const bool CPU::hasIA64 = RetrieveIA64();
|
||||
const bool CPU::hasPBE = RetrievePBE();
|
||||
const bool CPU::hasSSE3 = RetrieveSSE3();
|
||||
const bool CPU::hasPCLMULQDQ = RetrievePCLMULQDQ();
|
||||
const bool CPU::hasDTES64 = RetrieveDTES64();
|
||||
const bool CPU::hasMONITOR = RetrieveMONITOR();
|
||||
const bool CPU::hasVMX = RetrieveVMX();
|
||||
const bool CPU::hasSMX = RetrieveSMX();
|
||||
const bool CPU::hasEST = RetrieveEST();
|
||||
const bool CPU::hasTM2 = RetrieveTM2();
|
||||
const bool CPU::hasSSSE3 = RetrieveSSSE3();
|
||||
const bool CPU::hasCNXT_ID = RetrieveCNXT_ID();
|
||||
const bool CPU::hasSDBG = RetrieveSDBG();
|
||||
const bool CPU::hasFMA = RetrieveFMA();
|
||||
const bool CPU::hasCX16 = RetrieveCX16();
|
||||
const bool CPU::hasXTPR = RetrieveXTPR();
|
||||
const bool CPU::hasPDCM = RetrievePDCM();
|
||||
const bool CPU::hasPCID = RetrievePCID();
|
||||
const bool CPU::hasDCA = RetrieveDCA();
|
||||
const bool CPU::hasSSE4_1 = RetrieveSSE4_1();
|
||||
const bool CPU::hasSSE4_2 = RetrieveSSE4_2();
|
||||
const bool CPU::hasX2APIC = RetrieveX2APIC();
|
||||
const bool CPU::hasMOVBE = RetrieveMOVBE();
|
||||
const bool CPU::hasPOPCNT = RetrievePOPCNT();
|
||||
const bool CPU::hasTSC_DEADLINE = RetrieveTSC_DEADLINE();
|
||||
const bool CPU::hasAES = RetrieveAES();
|
||||
const bool CPU::hasXSAVE = RetrieveXSAVE();
|
||||
const bool CPU::hasOSXSAVE = RetrieveOSXSAVE();
|
||||
const bool CPU::hasAVX = RetrieveAVX();
|
||||
const bool CPU::hasF16C = RetrieveF16C();
|
||||
const bool CPU::hasRDRND = RetrieveRDRND();
|
||||
const bool CPU::hasHYPERVISOR = RetrieveHYPERVISOR();
|
||||
const bool CPU::hasAVX2 = RetrieveAVX2();
|
||||
const bool CPU::hasAVX512F = RetrieveAVX512F();
|
||||
const bool CPU::hasRDSEED = RetrieveRDSEED();
|
||||
const bool CPU::hasADX = RetrieveADX();
|
||||
|
||||
Architecture CPU::GetArchitecture()
|
||||
{
|
||||
#if defined(EHS_ARCH_X64)
|
||||
@@ -119,324 +183,589 @@ namespace ehs
|
||||
return (UInt_8)(GetInfoBits() >> 20);
|
||||
}
|
||||
|
||||
bool CPU::HasFPU()
|
||||
bool CPU::RetrieveFPU()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000001;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000001;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasVME()
|
||||
bool CPU::RetrieveVME()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000010;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000010;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasDE()
|
||||
bool CPU::RetrieveDE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000100;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000000100;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPSE()
|
||||
bool CPU::RetrievePSE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000001000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000001000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasTSC()
|
||||
bool CPU::RetrieveTSC()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000010000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000010000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMSR()
|
||||
bool CPU::RetrieveMSR()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000100000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000000100000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPAE()
|
||||
bool CPU::RetrievePAE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000001000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000001000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMCE()
|
||||
bool CPU::RetrieveMCE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000010000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000010000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasCX8()
|
||||
bool CPU::RetrieveCX8()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000100000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000000100000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasAPIC()
|
||||
bool CPU::RetrieveAPIC()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000001000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000001000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSEP()
|
||||
bool CPU::RetrieveSEP()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000000100000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000000100000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMTRR()
|
||||
bool CPU::RetrieveMTRR()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000001000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000001000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPGE()
|
||||
bool CPU::RetrievePGE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000010000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000010000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMCA()
|
||||
bool CPU::RetrieveMCA()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000000100000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000000100000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasCMOV()
|
||||
bool CPU::RetrieveCMOV()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000001000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000001000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPAT()
|
||||
bool CPU::RetrievePAT()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000010000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000010000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPSE_36()
|
||||
bool CPU::RetrievePSE_36()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000000100000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000000100000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPSN()
|
||||
bool CPU::RetrievePSN()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000001000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000001000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasCLFSH()
|
||||
bool CPU::RetrieveCLFSH()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000000010000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000000010000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasDS()
|
||||
bool CPU::RetrieveDS()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000001000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000001000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasACPI()
|
||||
bool CPU::RetrieveACPI()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000010000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000010000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMMX()
|
||||
bool CPU::RetrieveMMX()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000000100000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000000100000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasFXSR()
|
||||
bool CPU::RetrieveFXSR()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000001000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000001000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSE()
|
||||
bool CPU::RetrieveSSE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000010000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000010000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSE2()
|
||||
bool CPU::RetrieveSSE2()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00000100000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00000100000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSS()
|
||||
bool CPU::RetrieveSS()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00001000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00001000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasHTT()
|
||||
bool CPU::RetrieveHTT()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00010000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00010000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasTM()
|
||||
bool CPU::RetrieveTM()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b00100000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b00100000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasIA64()
|
||||
bool CPU::RetrieveIA64()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b01000000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b01000000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPBE()
|
||||
bool CPU::RetrievePBE()
|
||||
{
|
||||
return GetFeatureBits_1() & 0b10000000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_1() & 0b10000000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSE3()
|
||||
bool CPU::RetrieveSSE3()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000001;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000001;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPCLMULQDQ()
|
||||
bool CPU::RetrievePCLMULQDQ()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000010;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000010;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasDTES64()
|
||||
bool CPU::RetrieveDTES64()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000100;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000000100;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMONITOR()
|
||||
bool CPU::RetrieveMONITOR()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000001000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000001000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasDS_CPL()
|
||||
bool CPU::RetrieveDS_CPL()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000010000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000010000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasVMX()
|
||||
bool CPU::RetrieveVMX()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000100000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000000100000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSMX()
|
||||
bool CPU::RetrieveSMX()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000001000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000001000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasEST()
|
||||
bool CPU::RetrieveEST()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000010000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000010000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasTM2()
|
||||
bool CPU::RetrieveTM2()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000100000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000000100000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSSE3()
|
||||
bool CPU::RetrieveSSSE3()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000001000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000001000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasCNXT_ID()
|
||||
bool CPU::RetrieveCNXT_ID()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000010000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000010000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSDBG()
|
||||
bool CPU::RetrieveSDBG()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000000100000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000000100000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasFMA()
|
||||
bool CPU::RetrieveFMA()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000001000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000001000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasCX16()
|
||||
bool CPU::RetrieveCX16()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000010000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000010000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasXTPR()
|
||||
bool CPU::RetrieveXTPR()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000000100000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000000100000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPDCM()
|
||||
bool CPU::RetrievePDCM()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000001000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000001000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPCID()
|
||||
bool CPU::RetrievePCID()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000000100000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000000100000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasDCA()
|
||||
bool CPU::RetrieveDCA()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000001000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000001000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSE4_1()
|
||||
bool CPU::RetrieveSSE4_1()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000010000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000010000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasSSE4_2()
|
||||
bool CPU::RetrieveSSE4_2()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000000100000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000000100000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasX2APIC()
|
||||
bool CPU::RetrieveX2APIC()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000001000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000001000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasMOVBE()
|
||||
bool CPU::RetrieveMOVBE()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000010000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000010000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasPOPCNT()
|
||||
bool CPU::RetrievePOPCNT()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000000100000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000000100000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasTSC_DEADLINE()
|
||||
bool CPU::RetrieveTSC_DEADLINE()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000001000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000001000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasAES()
|
||||
bool CPU::RetrieveAES()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000010000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000010000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasXSAVE()
|
||||
bool CPU::RetrieveXSAVE()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00000100000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00000100000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasOSXSAVE()
|
||||
bool CPU::RetrieveOSXSAVE()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00001000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00001000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasAVX()
|
||||
bool CPU::RetrieveAVX()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00010000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00010000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasF16C()
|
||||
bool CPU::RetrieveF16C()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b00100000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b00100000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasRDRND()
|
||||
bool CPU::RetrieveRDRND()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b01000000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b01000000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasHYPERVISOR()
|
||||
bool CPU::RetrieveHYPERVISOR()
|
||||
{
|
||||
return GetFeatureBits_2() & 0b10000000000000000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetFeatureBits_2() & 0b10000000000000000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasAVX2()
|
||||
bool CPU::RetrieveAVX2()
|
||||
{
|
||||
return GetExtFeatureBits_1() & 0b00000000000000000000000000100000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetExtFeatureBits_1() & 0b00000000000000000000000000100000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasRDSEED()
|
||||
bool CPU::RetrieveAVX512F()
|
||||
{
|
||||
return GetExtFeatureBits_1() & 0b00000000000001000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetExtFeatureBits_1() & 0b00000000000000001000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::HasADX()
|
||||
bool CPU::RetrieveRDSEED()
|
||||
{
|
||||
return GetExtFeatureBits_1() & 0b00000000000010000000000000000000;
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetExtFeatureBits_1() & 0b00000000000001000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPU::RetrieveADX()
|
||||
{
|
||||
#ifdef EHS_ARCH_X64
|
||||
return GetExtFeatureBits_1() & 0b00000000000010000000000000000000;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user