x86/cpu: check for OS support before enabling AVX2
AV_CPU_FLAG_AVX is enabled at this point only if there's OS support.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d9821a208
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
b40ab81d1f
commit
1103aec1df
@@ -143,7 +143,7 @@ int ff_get_cpu_flags_x86(void)
|
|||||||
if (max_std_level >= 7) {
|
if (max_std_level >= 7) {
|
||||||
cpuid(7, eax, ebx, ecx, edx);
|
cpuid(7, eax, ebx, ecx, edx);
|
||||||
#if HAVE_AVX2
|
#if HAVE_AVX2
|
||||||
if (ebx & 0x00000020)
|
if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
|
||||||
rval |= AV_CPU_FLAG_AVX2;
|
rval |= AV_CPU_FLAG_AVX2;
|
||||||
#endif /* HAVE_AVX2 */
|
#endif /* HAVE_AVX2 */
|
||||||
/* BMI1/2 don't need OS support */
|
/* BMI1/2 don't need OS support */
|
||||||
|
Reference in New Issue
Block a user