Skip to content

Commit 4df56d7

Browse files
authored
Merge branch 'master' into dxc-2025-08-1
2 parents 3227ff8 + 261f90a commit 4df56d7

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

WickedEngine/Utility/cpuinfo.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

8288
CPUInfo::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;

WickedEngine/wiInitializer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ namespace wi::initializer
7575
{
7676
cpustring.push_back("AVX; ");
7777
}
78+
if (cpuinfo.haveFMA3())
79+
{
80+
cpustring.push_back("FMA3; ");
81+
}
82+
if (cpuinfo.haveF16C())
83+
{
84+
cpustring.push_back("F16C; ");
85+
}
7886
if (cpuinfo.haveAVX2())
7987
{
8088
cpustring.push_back("AVX 2; ");
@@ -98,6 +106,12 @@ namespace wi::initializer
98106
#ifdef _XM_AVX_INTRINSICS_
99107
cpustring.push_back("AVX; ");
100108
#endif // _XM_AVX_INTRINSICS_
109+
#ifdef _XM_FMA3_INTRINSICS_
110+
cpustring.push_back("FMA3; ");
111+
#endif // _XM_FMA3_INTRINSICS_
112+
#ifdef _XM_F16C_INTRINSICS_
113+
cpustring.push_back("F16C; ");
114+
#endif // _XM_F16C_INTRINSICS_
101115
#ifdef _XM_AVX2_INTRINSICS_
102116
cpustring.push_back("AVX 2; ");
103117
#endif // _XM_AVX2_INTRINSICS_

0 commit comments

Comments
 (0)