kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit 8de4b0fe7e8c96548de8dd62c698399fdd58f8e6
parent 394ac51ae6bd8d2d9ac6ff845043ee0bcec8d3e7
Author: [email protected] <[email protected]>
Date:   Tue,  2 Aug 2016 23:19:30 +0300

Fix cpuid code for old cpus

Diffstat:
Minclude/kfr/base/cpuid.hpp | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/kfr/base/cpuid.hpp b/include/kfr/base/cpuid.hpp @@ -242,15 +242,9 @@ cpu_t detect_cpu() c.has3DNOWEXT = c.isAMD && f_81_EDX >> 30 & 1; c.has3DNOW = c.isAMD && f_81_EDX >> 31 & 1; - const u32 xcr0 = get_xcr0(); + c.hasAVXOSSUPPORT = c.hasAVX && c.hasOSXSAVE && (get_xcr0() & 0x06) == 0x06; + c.hasAVX512OSSUPPORT = c.hasAVXOSSUPPORT && c.hasAVX512F && c.hasOSXSAVE && (get_xcr0() & 0xE0) == 0xE0; - c.hasAVXOSSUPPORT = c.hasAVX && c.hasOSXSAVE && (xcr0 & 0x06) == 0x06; - c.hasAVX512OSSUPPORT = c.hasAVX512F && c.hasOSXSAVE && (xcr0 & 0xE0) == 0xE0; - -#ifdef KFR_AVAIL_AVX512 - if (c.hasAVX512F && c.hasAVX512BW && c.hasAVX512DQ && c.hasAVX512OSSUPPORT) - return cpu_t::avx3; -#endif #ifdef KFR_AVAIL_AVX2 if (c.hasAVX2 && c.hasAVXOSSUPPORT) return cpu_t::avx2;