summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/0016-sse2-i386.patch32
-rw-r--r--debian/patches/series1
2 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches/0016-sse2-i386.patch b/debian/patches/0016-sse2-i386.patch
new file mode 100644
index 00000000..24d4a065
--- /dev/null
+++ b/debian/patches/0016-sse2-i386.patch
@@ -0,0 +1,32 @@
+Description: Build C and Fortran sources with SSE2 on i386
+ On 32-bit Intel targets the default x87 floating point model keeps
+ intermediate results in 80-bit extended precision. That breaks bit-exact
+ comparisons between equivalent computations in the unit tests, and slows
+ the Q65 LDPC decoders down until test_q65_decode_pipeline times out.
+ Building the C and Fortran sources with SSE2 makes every operation round
+ to 64-bit IEEE double precision, matching the 64-bit build behaviour.
+Author: Christoph Berg <myon@debian.org>
+Last-Update: 2026-09-27
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -88,6 +88,19 @@
+ LANGUAGES C CXX Fortran
+ )
+
++#
++# On 32-bit Intel targets the default x87 floating point model keeps
++# intermediate results in 80-bit extended precision. That breaks bit-exact
++# comparisons between equivalent computations in the unit tests, and slows
++# the Q65 LDPC decoders down until test_q65_decode_pipeline times out.
++# Build the C and Fortran sources with SSE2, where every operation rounds
++# to 64-bit IEEE double precision, matching the 64-bit build behaviour.
++#
++if (UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "i.86")
++ string (APPEND CMAKE_C_FLAGS " -msse2 -mfpmath=sse")
++ string (APPEND CMAKE_Fortran_FLAGS " -msse2 -mfpmath=sse")
++endif (UNIX)
++
+ set (CMAKE_CXX_STANDARD 17)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ set (CMAKE_CXX_EXTENSIONS ON)
diff --git a/debian/patches/series b/debian/patches/series
index 969fd1d9..ad5ef0f2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,4 +5,5 @@
0013-qcustomplot-link.patch
0014-xsltproc-nonet-manpages.patch
0015-typos.patch
+0016-sse2-i386.patch
defuse-expiry