Skip to content

Commit 197cfd1

Browse files
committed
Fix building fflas, linbox on 32-bit by disabling SSE, AVX
1 parent e5f42fa commit 197cfd1

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
commit 621a3b0825d7f7ad463e8ae175db51b0ec15bcd5 (HEAD -> master)
2+
Author: Volker Braun <vbraun.name@gmail.com>
3+
Date: Sun Jun 2 14:42:31 2024 +0200
4+
5+
Disable sse41, sse42, avx, avx2 on 32-bit
6+
7+
This can potentially be provided by the CPU, but will not compile
8+
since simd128_int64.inl is 64-bit only. Probably also makes not much
9+
sense to try to hardware-accelerate 64-bit on 32-bit OS.
10+
11+
diff --git a/fflas-ffpack/fflas-ffpack-config.h b/fflas-ffpack/fflas-ffpack-config.h
12+
index a8e6cb0d..ff538bc6 100644
13+
--- a/fflas-ffpack/fflas-ffpack-config.h
14+
+++ b/fflas-ffpack/fflas-ffpack-config.h
15+
@@ -121,13 +121,16 @@ namespace std _GLIBCXX_VISIBILITY(default)
16+
#define __FFLASFFPACK_HAVE_SSE3_INSTRUCTIONS 1
17+
#endif
18+
19+
-/* Define if sse4.1 instructions are supported */
20+
-#ifdef __SSE4_1__
21+
+/* Define if sse4.1 instructions are supported
22+
+ * Technically, sse4.1 could be supported on 32-bit but if you want to
23+
+ * accelerate 64-bit simd you should start by installing a 64-bit OS
24+
+ */
25+
+#if defined(__SSE4_1__) && defined(__x86_64__)
26+
#define __FFLASFFPACK_HAVE_SSE4_1_INSTRUCTIONS 1
27+
#endif
28+
29+
/* Define if sse4.2 instructions are supported */
30+
-#ifdef __SSE4_2__
31+
+#if defined(__SSE4_2__) && defined(__x86_64__)
32+
#define __FFLASFFPACK_HAVE_SSE4_2_INSTRUCTIONS 1
33+
#endif
34+
35+
@@ -137,12 +140,12 @@ namespace std _GLIBCXX_VISIBILITY(default)
36+
#if not defined(__CYGWIN__) or not defined(__GNUC__)
37+
38+
/* Define if avx instructions are supported */
39+
-#ifdef __AVX__
40+
+#if defined(__AVX__) && defined(__x86_64__)
41+
#define __FFLASFFPACK_HAVE_AVX_INSTRUCTIONS 1
42+
#endif
43+
44+
/* Define if avx2 instructions are supported */
45+
-#ifdef __AVX2__
46+
+#if defined(__AVX2__) && defined(__x86_64__)
47+
#define __FFLASFFPACK_HAVE_AVX2_INSTRUCTIONS 1
48+
#endif

0 commit comments

Comments
 (0)