Line 0
Link Here
|
|
|
1 |
From 99423a825027c862bbfd50e112a1846a013b01a7 Mon Sep 17 00:00:00 2001 |
2 |
From: "Francisco Blas (klondike) Izquierdo Riera" <klondike@klondike.es> |
3 |
Date: Tue, 4 Oct 2022 10:03:44 +0200 |
4 |
Subject: [PATCH] Enable -mpopcnt and -mlzcnt on AVX2 |
5 |
|
6 |
When -mpopcnt or -mlzcnt are explicitly enabled or disabled |
7 |
(when using -march=native for example), kvazaar builds fail |
8 |
on older CPUs without support for these flags (see |
9 |
https://github.com/ultravideo/kvazaar/issues/228 and |
10 |
https://bugs.gentoo.org/739776 ). |
11 |
|
12 |
Ensuring these flags are on as done with the rest of AVX2 flags |
13 |
solves the compilation issues, although it may be a better |
14 |
approach to provide a configuration option so that only the |
15 |
specific version matching the build system supported flags is |
16 |
created in such cases. |
17 |
--- |
18 |
src/Makefile.am | 2 +- |
19 |
1 file changed, 1 insertion(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/src/Makefile.am b/src/Makefile.am |
22 |
index 79880a98..c972c5be 100644 |
23 |
--- a/src/Makefile.am |
24 |
+++ b/src/Makefile.am |
25 |
@@ -226,7 +226,7 @@ endif #HAVE_PPC |
26 |
if HAVE_X86 |
27 |
|
28 |
if HAVE_AVX2_GCC |
29 |
-libavx2_la_CFLAGS = -mavx2 -mbmi -mabm -mbmi2 |
30 |
+libavx2_la_CFLAGS = -mavx2 -mbmi -mabm -mpopcnt -mlzcnt -mbmi2 |
31 |
endif |
32 |
if HAVE_AVX2_CLANG |
33 |
libavx2_la_CFLAGS = -mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2 |