From e40987d01bb109cd009e3bbb54e9c358225997d6 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 27 Sep 2026 12:59:53 +0200 Subject: Add 0016-sse2-i386.patch: build C and Fortran with SSE2 on i386 x87 80-bit extended precision breaks bit-exact comparisons between equivalent computations in the unit tests (test_jtty_payload_correlators, test_ft8_mtd_residual, test_jpl_resilience) and slows the Q65 LDPC decoders until test_q65_decode_pipeline times out. SSE2 rounds every operation to 64-bit IEEE double precision, matching the 64-bit build. --- debian/patches/0016-sse2-i386.patch | 32 ++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 debian/patches/0016-sse2-i386.patch 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 +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 -- cgit v1.2.3