[med-svn] [Git][med-team/libhmsbeagle][master] 2 commits: Fix MASCOT FMA kernel build on non-Intel architectures

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Nov 7 22:00:11 GMT 2026



Andreas Tille pushed to branch master at Debian Med / libhmsbeagle


Commits:
21d50e57 by Andreas Tille at 2026-11-07T22:52:15+01:00
Fix MASCOT FMA kernel build on non-Intel architectures

MascotFma.hpp only defines MASCOT_VMUL_ADD for GCC on x86/amd64, clang
and MSVC.  With GCC on other architectures the FMA build of MASCOT
kernel B fails to compile even though cpuHasFma() never selects it
there.  Add a fallback that rounds the product and the sum separately,
as the strict build does.

Assisted-By: DeepSeek V4.1 Flash Free

- - - - -
05fb5ed1 by Andreas Tille at 2026-11-07T22:58:59+01:00
Upload to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/fix-mascot-vector-fma.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+libhmsbeagle (4.2.0+dfsg-2) unstable; urgency=medium
+
+  * Fix MASCOT FMA kernel build
+
+ -- Andreas Tille <tille at debian.org>  Sat, 07 Nov 2026 22:56:33 +0100
+
 libhmsbeagle (4.2.0+dfsg-1) unstable; urgency=medium
 
   * New upstream version


=====================================
debian/patches/fix-mascot-vector-fma.patch
=====================================
@@ -0,0 +1,33 @@
+From: Andreas Tille <tille at debian.org>
+Date: Sat, 7 Nov 2026 19:00:00 +0100
+Subject: Fix MASCOT FMA kernel build on targets without a vector FMA intrinsic
+
+MascotFma.hpp only defines MASCOT_VMUL_ADD for clang, MSVC, and GCC on
+x86 or aarch64.  With GCC on other architectures (for example armhf and
+loong64) the FMA build of kernel B therefore fails to compile with
+"'MASCOT_VMUL_ADD' was not declared in this scope".
+
+Those targets never select the FMA kernel at run time, because
+cpuHasFma() returns false there, but the translation unit is still
+built.  Add a fallback that evaluates the operation lane by lane with a
+rounded product and a rounded sum, like the strict build.
+
+Forwarded: no
+Assisted-By: DeepSeek V4.1 Flash Free
+
+diff --git a/libhmsbeagle/mascot/MascotFma.hpp b/libhmsbeagle/mascot/MascotFma.hpp
+index 8283218..3a34cea 100644
+--- a/libhmsbeagle/mascot/MascotFma.hpp
++++ b/libhmsbeagle/mascot/MascotFma.hpp
+@@ -46,6 +46,11 @@
+ #include <arm_neon.h>
+ #define MASCOT_VMUL_ADD(a, b, c) \
+     ((__typeof__(a)) vfmaq_f64((float64x2_t) (c), (float64x2_t) (a), (float64x2_t) (b)))
++#else
++/* No vector FMA intrinsic for this target (for example armhf or loong64). The FMA build is never selected there,
++ * because cpuHasFma() is false, but it still has to compile. Round the product and the sum separately, as the
++ * strict build does. */
++#define MASCOT_VMUL_ADD(a, b, c) ((a) * (b) + (c))
+ #endif
+ #endif
+ #else


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ fix-922776.patch
 fix-976567.patch
 no_synthetictest_because_of_sse.patch
 0007-tests-test_resource.sh-Correct-file.patch
+fix-mascot-vector-fma.patch



View it on GitLab: https://salsa.debian.org/med-team/libhmsbeagle/-/compare/6f4b64254a6d0d584c5468c2880da97c8df45bac...05fb5ed1920823e16f9c4dd0671231208e9bcbd4

-- 
View it on GitLab: https://salsa.debian.org/med-team/libhmsbeagle/-/compare/6f4b64254a6d0d584c5468c2880da97c8df45bac...05fb5ed1920823e16f9c4dd0671231208e9bcbd4
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261107/38d24a32/attachment-0001.htm>


More information about the debian-med-commit mailing list