From c75017b4e7ad686009c0ac14b7d9b22db4811aa1 Mon Sep 17 00:00:00 2001 From: Oneric Date: Sun, 5 Dec 2021 23:00:47 +0100 Subject: x86: fix AVX detection The removed check compared some bits from the vendor string to the ones from "GenuineIntel". This blocked AVX and AVX2 from being used on AMD- and other non-Intel-CPUs and even on Intel-CPUs if run in a hypervisor or VM which changes the vendor string (eg " KVMKVMKVM "). Drop the vendor check to utilise AVX on all supporting CPUs. --- libass/ass_utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libass/ass_utils.c b/libass/ass_utils.c index 65b6f74..57f6306 100644 --- a/libass/ass_utils.c +++ b/libass/ass_utils.c @@ -52,9 +52,7 @@ int has_avx(void) ass_get_xgetbv(0, &eax, &edx); if ((eax & 0x6) != 0x6) return 0; - eax = 0; - ass_get_cpuid(&eax, &ebx, &ecx, &edx); - return (ecx & 0x6) == 0x6 ? (misc >> 28) & 0x1 : 0; // check high bits are relevant, then AVX support + return (misc >> 28) & 0x1; } int has_avx2(void) -- cgit v1.2.3