@@ -44,6 +44,8 @@ class CPUInfo {
4444 inline bool haveSSE3 () const { return mIsSSE3 ; }
4545 inline bool haveSSE41 () const { return mIsSSE41 ; }
4646 inline bool haveSSE42 () const { return mIsSSE42 ; }
47+ inline bool haveF16C () const { return mIsF16C ; }
48+ inline bool haveFMA3 () const { return mIsFMA3 ; }
4749 inline bool haveAVX () const { return mIsAVX ; }
4850 inline bool haveAVX2 () const { return mIsAVX2 ; }
4951 inline bool haveAVX512F () const { return mIsAVX512F ; }
@@ -57,7 +59,9 @@ class CPUInfo {
5759 static constexpr uint32_t SSE42_POS = 0x00100000 ;
5860 static constexpr uint32_t AVX_POS = 0x10000000 ;
5961 static constexpr uint32_t AVX2_POS = 0x00000020 ;
62+ static constexpr uint32_t FMA3_POS = 1u << 12 ;
6063 static constexpr uint32_t AVX512F_POS = 1u << 15 ; // Bit 16
64+ static constexpr uint32_t F16C_POS = 1u << 29 ;
6165 static constexpr uint32_t LVL_NUM = 0x000000FF ;
6266 static constexpr uint32_t LVL_TYPE = 0x0000FF00 ;
6367 static constexpr uint32_t LVL_CORES = 0x0000FFFF ;
@@ -77,6 +81,8 @@ class CPUInfo {
7781 bool mIsAVX = false ;
7882 bool mIsAVX2 = false ;
7983 bool mIsAVX512F = false ;
84+ bool mIsF16C = false ;
85+ bool mIsFMA3 = false ;
8086};
8187
8288CPUInfo::CPUInfo ()
@@ -97,6 +103,8 @@ CPUInfo::CPUInfo()
97103 mIsSSE41 = cpuID1.ECX () & SSE41_POS ;
98104 mIsSSE42 = cpuID1.ECX () & SSE41_POS ;
99105 mIsAVX = cpuID1.ECX () & AVX_POS ;
106+ mIsF16C = cpuID1.ECX () & F16C_POS ;
107+ mIsFMA3 = cpuID1.ECX () & FMA3_POS ;
100108 // Get AVX2 instructions availability
101109 CPUID cpuID7 (7 , 0 );
102110 mIsAVX2 = cpuID7.EBX () & AVX2_POS ;
0 commit comments