File: 0043-Disable-avx-detection-with-gcc-6.patch

package info (click to toggle)
php8.4 8.4.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208,108 kB
  • sloc: ansic: 1,060,628; php: 35,345; sh: 11,866; cpp: 7,201; pascal: 4,913; javascript: 3,091; asm: 2,810; yacc: 2,411; makefile: 689; xml: 446; python: 301; awk: 148
file content (43 lines) | stat: -rw-r--r-- 1,313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: =?utf-8?b?T25kxZllaiBTdXLDvQ==?= <ondrej@sury.org>
Date: Sat, 2 Dec 2023 22:09:36 +0100
Subject: Disable avx detection with gcc < 6

---
 Zend/zend_cpuinfo.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h
index 7e53ba6..7e4a076 100644
--- a/Zend/zend_cpuinfo.h
+++ b/Zend/zend_cpuinfo.h
@@ -215,9 +215,14 @@ static inline int zend_cpu_supports_avx512(void) {
 #ifdef PHP_HAVE_BUILTIN_CPU_INIT
 	__builtin_cpu_init();
 #endif
-	return __builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512dq")
-		&& __builtin_cpu_supports("avx512cd") && __builtin_cpu_supports("avx512bw")
-		&& __builtin_cpu_supports("avx512vl");
+	return __builtin_cpu_supports("avx512f")
+#if (__GNUC__ > 5)
+		&& __builtin_cpu_supports("avx512dq")
+		&& __builtin_cpu_supports("avx512cd")
+		&& __builtin_cpu_supports("avx512bw")
+		&& __builtin_cpu_supports("avx512vl")
+#endif
+		;
 }
 #endif
 
@@ -227,7 +232,11 @@ static inline int zend_cpu_supports_avx512_vbmi(void) {
 #ifdef PHP_HAVE_BUILTIN_CPU_INIT
 	__builtin_cpu_init();
 #endif
-	return zend_cpu_supports_avx512() && __builtin_cpu_supports("avx512vbmi");
+	return zend_cpu_supports_avx512()
+#if (__GNUC__ > 5)
+		&& __builtin_cpu_supports("avx512vbmi")
+#endif
+		;
 }
 #endif