diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2015-05-11 18:49:36 +0300 |
---|---|---|
committer | Sv. Lockal <lockalsash@gmail.com> | 2015-05-11 18:49:36 +0300 |
commit | c7bccb30bf03a0ac4d6d135f94658c93be7b7b0f (patch) | |
tree | e5108bbd4bbe5ee893bf6d8d7929ebdbf809c887 /intern/cycles/util/util_system.cpp | |
parent | 1bf685488cf2990da656bd2a2eeea0088f99a4bf (diff) |
Cycles: check for F16C support with __cpuid, as we do for BMI and BMI2
Diffstat (limited to 'intern/cycles/util/util_system.cpp')
-rw-r--r-- | intern/cycles/util/util_system.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 7206455debd..4a88ef6de76 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -127,6 +127,7 @@ struct CPUCapabilities { bool sse42; bool sse4a; bool avx; + bool f16c; bool avx2; bool xop; bool fma3; @@ -202,6 +203,8 @@ static CPUCapabilities& system_cpu_capabilities() caps.avx = (xcr_feature_mask & 0x6) == 0x6; } + caps.f16c = (result[2] & ((int)1 << 29)) != 0; + __cpuid(result, 0x00000007); caps.bmi1 = (result[1] & ((int)1 << 3)) != 0; caps.bmi2 = (result[1] & ((int)1 << 8)) != 0; @@ -242,7 +245,7 @@ bool system_cpu_support_avx() bool system_cpu_support_avx2() { CPUCapabilities& caps = system_cpu_capabilities(); - return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2; + return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.f16c && caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2; } #else |