summaryrefslogtreecommitdiff
path: root/debian/patches/cpu-features.diff
blob: 9328e9dcdb7a571de4e3dfd8167750e1fb8b5926 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
From: Benjamin Barenblat <bbaren@google.com>
Subject: Canonicalize supported CPU feature set
Forwarded: not-needed

Explicitly set supported CPU features.

  - Disable Intel SSE and SSE2 on i386, since Debian supports some i386
    processors without those extensions. Keep them enabled on amd64, since all
    amd64 processors have them.

  - Disable Intel SSSE3 entirely, since no i386 processor supports it and Debian
    supports amd64 processors without it.

  - Disable NEON on armel and armhf, since no armel processor supports NEON and
    Debian supports some armhf processors without it. Keep it enabled on arm64,
    since all arm64 processors have it.

--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -875,7 +875,7 @@
 // which architectures support the various x86 instruction sets.
 #ifdef ABSL_INTERNAL_HAVE_SSE
 #error ABSL_INTERNAL_HAVE_SSE cannot be directly set
-#elif defined(__SSE__)
+#elif defined(__x86_64__)
 #define ABSL_INTERNAL_HAVE_SSE 1
 #elif (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) && \
     !defined(_M_ARM64EC)
@@ -891,7 +891,7 @@
 // which architectures support the various x86 instruction sets.
 #ifdef ABSL_INTERNAL_HAVE_SSE2
 #error ABSL_INTERNAL_HAVE_SSE2 cannot be directly set
-#elif defined(__SSE2__)
+#elif defined(__x86_64__)
 #define ABSL_INTERNAL_HAVE_SSE2 1
 #elif (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && \
     !defined(_M_ARM64EC)
@@ -913,8 +913,6 @@
 // by the CPU.
 #ifdef ABSL_INTERNAL_HAVE_SSSE3
 #error ABSL_INTERNAL_HAVE_SSSE3 cannot be directly set
-#elif defined(__SSSE3__)
-#define ABSL_INTERNAL_HAVE_SSSE3 1
 #endif
 
 // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM
@@ -926,7 +924,7 @@
 // https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code
 #ifdef ABSL_INTERNAL_HAVE_ARM_NEON
 #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set
-#elif defined(__ARM_NEON) && !defined(__CUDA_ARCH__)
+#elif defined(__aarch64__)
 #define ABSL_INTERNAL_HAVE_ARM_NEON 1
 #endif