[fftw3] 01/01: fix-runtime-neon-detection.patch: new patch (Closes: #767138)

Sébastien Villemot sebastien at debian.org
Sun Nov 23 20:03:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository fftw3.

commit d7880e7c4b9af60dae08f486e600a4b3084017cc
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Sun Nov 23 21:02:01 2014 +0100

    fix-runtime-neon-detection.patch: new patch (Closes: #767138)
---
 debian/changelog                                |  10 +++
 debian/patches/fix-runtime-neon-detection.patch | 103 ++++++++++++++++++++++++
 debian/patches/series                           |   1 +
 3 files changed, 114 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5e96e66..bcccc17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+fftw3 (3.3.4-2) unstable; urgency=medium
+
+  * Team upload.
+  * fix-runtime-neon-detection.patch: new patch, fixes runtime NEON
+    detection on armhf (and also arm64, but NEON is currently
+    unconditionnally disabled there). Thanks to Edmund Grimley Evans for
+    the patch. (Closes: #767138)
+
+ -- Sébastien Villemot <sebastien at debian.org>  Sun, 23 Nov 2014 20:49:59 +0100
+
 fftw3 (3.3.4-1.1) unstable; urgency=low
 
   * Add mips64(el), ppc64el and arm64 to the list with long double support.
diff --git a/debian/patches/fix-runtime-neon-detection.patch b/debian/patches/fix-runtime-neon-detection.patch
new file mode 100644
index 0000000..b2bd61b
--- /dev/null
+++ b/debian/patches/fix-runtime-neon-detection.patch
@@ -0,0 +1,103 @@
+Description: Fix runtime detection of NEON support on armhf and arm64
+Author: Edmund Grimley Evans <edmund.grimley.evans at gmail.com>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767138
+Forwarded: no
+Reviewed-by: Sébastien Villemot <sebastien at debian.org>
+Last-Update: 2014-11-23
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/simd-support/neon.c
++++ b/simd-support/neon.c
+@@ -23,56 +23,45 @@
+ 
+ #if HAVE_NEON
+ 
+-/* check for an environment where signals are known to work */
+-#if defined(unix) || defined(linux)
+-  # include <signal.h>
+-  # include <setjmp.h>
+-
+-  static jmp_buf jb;
+-
+-  static void sighandler(int x)
+-  {
+-       UNUSED(x);
+-       longjmp(jb, 1);
+-  }
+-
+-  static int really_have_neon(void)
+-  {
+-       void (*oldsig)(int);
+-       oldsig = signal(SIGILL, sighandler);
+-       if (setjmp(jb)) {
+-	    signal(SIGILL, oldsig);
+-	    return 0;
+-       } else {
+-	    /* paranoia: encode the instruction in binary because the
+-	       assembler may not recognize it without -mfpu=neon */
+-	    /*asm volatile ("vand q0, q0, q0");*/
+-	    asm volatile (".long 0xf2000150");
+-	    signal(SIGILL, oldsig);
+-	    return 1;
+-       }
+-  }
+-
+-  extern void X(check_alignment_of_sse2_pm)(void);
+-
+-  int X(have_simd_neon)(void)
+-  {
+-       static int init = 0, res;
+-
+-       if (!init) {
+-	    res = really_have_neon();
+-	    init = 1;
+-       }
+-       return res;
+-  }
++#ifdef __linux__
+ 
++#ifdef __aarch64__
++
++/* HWCAP_ASIMD is defined in <asm/hwcap.h> but not included by <sys/auxv.h>.
++   Since all current AArch64 implementations have NEON/ASIMD it is probably
++   better to return 1 than include a header file which is not intended for
++   use by user programs. */
++
++int X(have_simd_neon)(void)
++{
++  return 1;
++}
+ 
+ #else
+-/* don't know how to autodetect NEON; assume it is present */
+-  int X(have_simd_neon)(void)
+-  {
+-       return 1;
+-  }
++
++#include <sys/auxv.h>
++
++int X(have_simd_neon)(void)
++{
++  static int cached = 2;
++  int ret;
++
++  /* This should be thread-safe in all reasonable circumstances. */
++  ret = cached;
++  if (ret == 2)
++    {
++      ret = !!(getauxval(AT_HWCAP) & HWCAP_ARM_NEON);
++      cached = ret;
++    }
++  return ret;
++}
++
++#endif
++
++#else
++
++#error Please implement a run-time test for NEON/ASIMD for your platform.
++
+ #endif
+ 
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..81a516c
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-runtime-neon-detection.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/fftw3.git



More information about the debian-science-commits mailing list