summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2021-12-05 23:00:47 +0100
committerOneric <oneric@oneric.stub>2021-12-06 19:16:05 +0100
commitc75017b4e7ad686009c0ac14b7d9b22db4811aa1 (patch)
tree0e8043f477c25ced75082d184e8bcab82295c8ff
parent5fede0443b4e1b052ce2cd36c41d2196250ae3bf (diff)
downloadlibass-c75017b4e7ad686009c0ac14b7d9b22db4811aa1.tar.bz2
libass-c75017b4e7ad686009c0ac14b7d9b22db4811aa1.tar.xz
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.
-rw-r--r--libass/ass_utils.c4
1 files changed, 1 insertions, 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)