summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2005-11-12 03:12:15 +0000
committerLuca Barbato <lu_zero@gentoo.org>2005-11-12 03:12:15 +0000
commit2f7584062323d90623c89246818a0d4bf6e8473d (patch)
treee7fa8f6894ae735996af76c1d7956b1246e557c5 /sci-libs/fftw/files
parentSmall optimization. (diff)
downloadhistorical-2f7584062323d90623c89246818a0d4bf6e8473d.tar.gz
historical-2f7584062323d90623c89246818a0d4bf6e8473d.tar.bz2
historical-2f7584062323d90623c89246818a0d4bf6e8473d.zip
altivec fix
Package-Manager: portage-2.0.53_rc6
Diffstat (limited to 'sci-libs/fftw/files')
-rw-r--r--sci-libs/fftw/files/fftw-3.0.1-altivec.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/sci-libs/fftw/files/fftw-3.0.1-altivec.patch b/sci-libs/fftw/files/fftw-3.0.1-altivec.patch
new file mode 100644
index 000000000000..a71fea0c6aee
--- /dev/null
+++ b/sci-libs/fftw/files/fftw-3.0.1-altivec.patch
@@ -0,0 +1,85 @@
+diff -u simd.old/altivec.c simd/altivec.c
+--- simd.old/altivec.c 2005-11-12 00:28:14.000000000 +0100
++++ simd/altivec.c 2005-11-12 00:33:36.000000000 +0100
+@@ -26,15 +26,12 @@
+ #if HAVE_ALTIVEC
+
+ const vector unsigned int X(altivec_ld_selmsk) =
+- (vector unsigned int)VLIT(0, 0, 0xFFFFFFFF, 0xFFFFFFFF);
++ VLIT(0, 0, 0xFFFFFFFF, 0xFFFFFFFF);
+
+ const vector unsigned int X(altivec_flipri_perm) =
+- (vector unsigned int)VLIT(0x04050607, 0x00010203,
+- 0x0c0d0e0f, 0x08090a0b);
++ VLIT(0x04050607, 0x00010203, 0x0c0d0e0f, 0x08090a0b);
+
+-const vector float X(altivec_chsr_sgn) =
+- (vector float)VLIT(-1.0, 1.0, -1.0, 1.0);
+-const vector float X(altivec_chsr_msk) =
+- (vector float)VLIT(-0.0, 0.0, -0.0, 0.0);
++const vector float X(altivec_chsr_sgn) = VLIT(-1.0, 1.0, -1.0, 1.0);
++const vector float X(altivec_chsr_msk) = VLIT(-0.0, 0.0, -0.0, 0.0);
+
+ #endif
+diff -u simd.old/simd-altivec.h simd/simd-altivec.h
+--- simd.old/simd-altivec.h 2005-11-12 00:28:14.000000000 +0100
++++ simd/simd-altivec.h 2005-11-12 01:31:03.000000000 +0100
+@@ -96,8 +96,12 @@
+
+ #else /* !__VEC__ */
+
++#ifdef HAVE_ALTIVEC_H
++#include <altivec.h>
++#define VLIT(x0, x1, x2, x3) {x0, x1, x2, x3}
++#else
+ #define VLIT(x0, x1, x2, x3) (x0, x1, x2, x3)
+-
++#endif
+ #endif
+
+ typedef vector float V;
+--- configure.ac.old 2003-07-04 07:18:48.000000000 +0200
++++ configure.ac 2005-11-12 00:42:11.000000000 +0100
+@@ -167,7 +167,8 @@
+ ACX_CHECK_CC_FLAGS(-faltivec, faltivec,
+ SIMD_CFLAGS="-faltivec",
+ [ACX_CHECK_CC_FLAGS(-maltivec -mabi=altivec, maltivec,
+- SIMD_CFLAGS="-maltivec -mabi=altivec",
++ SIMD_CFLAGS="-maltivec -mabi=altivec";
++ AC_DEFINE(HAVE_ALTIVEC_H,1,[Define if gcc-fsf is in use]),
+ [AC_MSG_ERROR([Need a version of gcc with -maltivec])])])
+ fi
+ fi
+--- ../fftw-3.0.1-double/simd/simd-altivec.h 2005-11-12 01:59:11.000000000 +0100
++++ simd/simd-altivec.h 2005-11-12 03:16:00.000000000 +0100
+@@ -105,12 +105,25 @@
+ #endif
+
+ typedef vector float V;
+-#define VADD(a, b) vec_add(a, b)
+-#define VSUB(a, b) vec_sub(a, b)
+-#define VFMA(a, b, c) vec_madd(a, b, c)
+-#define VFNMS(a, b, c) vec_nmsub(a, b, c)
++static inline V VADD(V a,V b)
++{
++ return vec_add(a, b);
++}
++static inline V VSUB(V a, V b)
++{
++ return vec_sub(a, b);
++}
++static inline V VFMA(V a, V b, V c)
++{
++ return vec_madd(a, b, c);
++}
++static inline V VFNMS(V a, V b, V c)
++{
++ return vec_nmsub(a, b, c);
++}
++
+ #define LDK(x) x
+-#define DVK(var, val) const V var = (vector float)VLIT(val, val, val, val)
++#define DVK(var, val) const V var = VLIT(val, val, val, val)
+
+ static inline V VMUL(V a, V b)
+ {