Source: fftw3
Version: 3.3.3-7
Severity: normal
Tags: patch
User: debian-...@lists.debian.org
Usertag: arm64

In version 3.3.3-6 arm64 was added to the --enable-neon arch list. This
is correct in principle but doesn't work because both the enabling
compiler option and the compiler define have changed between the 32-bit
armv7 (for which this code was written) and armv8 (the 64-bit arch,
called 'arm64' in debian and 'aarch64' by ARM and GNU triplets).

neon is always enabled on armv8/arm64 unless explictly disabled so the
-mfpu=neon option is not understood by the arm64/aarch64 compiler. Also
__ARM_NEON__ is not defined by the compiler. So this needs changes in
configure.ac and simd-neon.h

However, applying this doesn't in fact get a working build as it exposes
a compiler ICE in the gcc4.8 we are currently using in unstable. But
that should get fixed soon.

Note that full support for arm64 will include enabling double-precision,
as that is available in armv8 neon, and writing code to support it.

Also note that armv8 has fused multiply-accumulate by default, which
apparently needs to be recorded for this package. I failed to understand
exactly what was going on with that so have not changed anything in this
patch, not least because doing so prduced another failure to build, as
have_fma and --enable-neon are deemed incompatible.

-- System Information:
Debian Release: 7.3
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-kvm-i386-20110111 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -Nru fftw3-3.3.3/debian/changelog fftw3-3.3.3/debian/changelog
--- fftw3-3.3.3/debian/changelog	2013-10-27 13:32:57.000000000 +0000
+++ fftw3-3.3.3/debian/changelog	2014-01-07 18:04:54.000000000 +0000
@@ -1,3 +1,9 @@
+fftw3 (3.3.3-7arm641) unstable; urgency=low
+
+  * Correct neon arm64 support in configurey
+
+ --  <enevill@apm2>  Tue, 07 Jan 2014 18:03:45 +0000
+
 fftw3 (3.3.3-7) unstable; urgency=low
 
   * restrict architectures of long dependency of libfftw3-3 (Closes: #710890)
diff -Nru fftw3-3.3.3/debian/patches/arm64-neon-config.patch fftw3-3.3.3/debian/patches/arm64-neon-config.patch
--- fftw3-3.3.3/debian/patches/arm64-neon-config.patch	1970-01-01 00:00:00.000000000 +0000
+++ fftw3-3.3.3/debian/patches/arm64-neon-config.patch	2014-01-07 18:43:56.000000000 +0000
@@ -0,0 +1,27 @@
+Index: fftw3-3.3.3/configure.ac
+===================================================================
+--- fftw3-3.3.3.orig/configure.ac	2012-11-25 12:33:44.000000000 +0000
++++ fftw3-3.3.3/configure.ac	2014-01-07 18:25:34.890000000 +0000
+@@ -273,7 +273,8 @@
+ 			[AC_MSG_ERROR([Need a version of gcc with -maltivec])])])])
+ 	fi
+ 
+-	if test "$have_neon" = "yes" -a "x$NEON_CFLAGS" = x; then
++	# armhf (no flag needed on arm64)
++	if test "$host_cpu" = "arm" -a "$have_neon" = "yes" -a "x$NEON_CFLAGS" = x; then
+ 	    AX_CHECK_COMPILER_FLAGS(-mfpu=neon, [NEON_CFLAGS="-mfpu=neon"],
+ 		[AC_MSG_ERROR([Need a version of gcc with -mfpu=neon])])
+ 	fi
+Index: fftw3-3.3.3/simd-support/simd-neon.h
+===================================================================
+--- fftw3-3.3.3.orig/simd-support/simd-neon.h	2012-11-25 12:33:44.000000000 +0000
++++ fftw3-3.3.3/simd-support/simd-neon.h	2014-01-07 18:43:48.500000000 +0000
+@@ -29,7 +29,7 @@
+ #define SIMD_VSTRIDE_OKA(x) ((x) == 2)
+ #define SIMD_STRIDE_OKPAIR SIMD_STRIDE_OK
+ 
+-#if defined(__GNUC__) && !defined(__ARM_NEON__)
++#if defined(__GNUC__) && !defined(__ARM_NEON__) && !defined (__aarch64__) 
+ #error "compiling simd-neon.h requires -mfpu=neon or equivalent"
+ #endif
+ 
diff -Nru fftw3-3.3.3/debian/patches/series fftw3-3.3.3/debian/patches/series
--- fftw3-3.3.3/debian/patches/series	2013-10-27 13:32:57.000000000 +0000
+++ fftw3-3.3.3/debian/patches/series	2014-01-07 17:38:41.000000000 +0000
@@ -5,3 +5,4 @@
 texinfo5-compat.patch
 wisdom-manpage.patch
 fix-fftw-wisdom-to-conf.patch
+arm64-neon-config.patch

Reply via email to