Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=7802572aa0f602a0fa098f0d6d8ee19ffa6f43d1

commit 7802572aa0f602a0fa098f0d6d8ee19ffa6f43d1
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Aug 2 16:52:23 2010 +0200

numpy-1.4.1-1-ppc
*fixed ppc build

diff --git a/source/devel/numpy/FrugalBuild b/source/devel/numpy/FrugalBuild
index 1bda532..325062b 100644
--- a/source/devel/numpy/FrugalBuild
+++ b/source/devel/numpy/FrugalBuild
@@ -9,6 +9,10 @@ depends=('python>=2.6')
groups=('devel')
archs=('i686' 'x86_64' 'ppc')
Finclude sourceforge
-sha1sums=('ec6078aa09acbcca3d90f9f36353fc83e7e1daa0')
+source=($source ppc_r8510.diff ppc_r8511.diff ppc_r8526.diff)
+sha1sums=('ec6078aa09acbcca3d90f9f36353fc83e7e1daa0' \
+          'dbfe34ffd49d75eb0dcda430fe45d30d62fefbd3' \
+          'ba3b784e08dc731ce47f54443a132cb2b8d8b502' \
+          'f9a644a14577bf70ca852015ca730eecb4975fbd')

# optimization OK
diff --git a/source/devel/numpy/ppc_r8510.diff 
b/source/devel/numpy/ppc_r8510.diff
new file mode 100644
index 0000000..f1fdf14
--- /dev/null
+++ b/source/devel/numpy/ppc_r8510.diff
@@ -0,0 +1,47 @@
+Index: numpy/core/setup.py
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/setup.py (revision 8455)
++++ python-numpy-1.4.1/numpy/core/setup.py (revision 8510)
+@@ -429,5 +429,6 @@
+                            'INTEL_EXTENDED_16_BYTES_LE',
+                            'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
+-                           'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE']:
++                           'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
++                           'DOUBLE_DOUBLE_BE']:
+                     moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
+                 else:
+Index: numpy/core/src/npymath/npy_math_private.h
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/src/npymath/npy_math_private.h 
(revision 8008)
++++ python-numpy-1.4.1/numpy/core/src/npymath/npy_math_private.h (revision 
8510)
+@@ -364,4 +364,5 @@
+ #endif
+
++#ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
+ /* Get the sign bit of x. x should be of type IEEEl2bitsrep */
+ #define GET_LDOUBLE_SIGN(x) \
+@@ -404,4 +405,6 @@
+      (((IEEEl2bitsrep_part)(v) << LDBL_MANH_SHIFT) & LDBL_MANH_MASK))
+
++#endif /* #ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE */
++
+ /*
+  * Those unions are used to convert a pointer of npy_cdouble to native C99
+Index: numpy/core/setup_common.py
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/setup_common.py (revision 8113)
++++ python-numpy-1.4.1/numpy/core/setup_common.py (revision 8510)
+@@ -220,4 +220,6 @@
+                       '000', '000', '000', '000', '000', '000', '000', '000']
+ _IEEE_QUAD_PREC_LE = _IEEE_QUAD_PREC_BE[::-1]
++_DOUBLE_DOUBLE_BE = ['301', '235', '157', '064', '124', '000', '000', '000'] 
+ \
++                    ['000'] * 8
+
+ def long_double_representation(lines):
+@@ -255,4 +257,6 @@
+                     elif read[8:-8] == _IEEE_QUAD_PREC_LE:
+                         return 'IEEE_QUAD_LE'
++                    elif read[8:-8] == _DOUBLE_DOUBLE_BE:
++                        return 'DOUBLE_DOUBLE_BE'
+                 elif read[:16] == _BEFORE_SEQ:
+                     if read[16:-8] == _IEEE_DOUBLE_LE:
diff --git a/source/devel/numpy/ppc_r8511.diff 
b/source/devel/numpy/ppc_r8511.diff
new file mode 100644
index 0000000..2b578f8
--- /dev/null
+++ b/source/devel/numpy/ppc_r8511.diff
@@ -0,0 +1,150 @@
+Index: numpy/core/src/npymath/ieee754.c.src
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/src/npymath/ieee754.c.src (revision 
8009)
++++ python-numpy-1.4.1/numpy/core/src/npymath/ieee754.c.src (revision 8511)
+@@ -127,4 +127,127 @@
+ }
+
++#ifdef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
++
++/*
++ * FIXME: this is ugly and untested. The asm part only works with gcc, and we
++ * should consolidate the GET_LDOUBLE* / SET_LDOUBLE macros
++ */
++#define math_opt_barrier(x) \
++        ({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; })
++#define math_force_eval(x) __asm __volatile ("" : : "m" (x))
++
++/* only works for big endian */
++typedef union
++{
++    npy_longdouble value;
++    struct
++    {
++        npy_uint64 msw;
++        npy_uint64 lsw;
++    } parts64;
++    struct
++    {
++        npy_uint32 w0, w1, w2, w3;
++    } parts32;
++} ieee854_long_double_shape_type;
++
++/* Get two 64 bit ints from a long double.  */
++
++#define GET_LDOUBLE_WORDS64(ix0,ix1,d)                                \
++do {                                                          \
++  ieee854_long_double_shape_type qw_u;                                \
++  qw_u.value = (d);                                           \
++  (ix0) = qw_u.parts64.msw;                                   \
++  (ix1) = qw_u.parts64.lsw;                                   \
++} while (0)
++
++/* Set a long double from two 64 bit ints.  */
++
++#define SET_LDOUBLE_WORDS64(d,ix0,ix1)                                \
++do {                                                          \
++  ieee854_long_double_shape_type qw_u;                                \
++  qw_u.parts64.msw = (ix0);                                   \
++  qw_u.parts64.lsw = (ix1);                                   \
++  (d) = qw_u.value;                                           \
++} while (0)
++
++npy_longdouble _nextl(npy_longdouble x, int p)
++{
++    npy_int64 hx,ihx,ilx;
++    npy_uint64 lx;
++
++    GET_LDOUBLE_WORDS64(hx, lx, x);
++    ihx = hx & 0x7fffffffffffffffLL;      /* |hx| */
++    ilx = lx & 0x7fffffffffffffffLL;      /* |lx| */
++
++    if(((ihx & 0x7ff0000000000000LL)==0x7ff0000000000000LL)&&
++       ((ihx & 0x000fffffffffffffLL)!=0)) {
++        return x; /* signal the nan */
++    }
++    if(ihx == 0 && ilx == 0) {          /* x == 0 */
++        npy_longdouble u;
++        SET_LDOUBLE_WORDS64(x, p, 0ULL);/* return +-minsubnormal */
++        u = x * x;
++        if (u == x) {
++            return u;
++        } else {
++            return x;           /* raise underflow flag */
++        }
++    }
++
++    npy_longdouble u;
++    if(p < 0) { /* p < 0, x -= ulp */
++        if((hx==0xffefffffffffffffLL)&&(lx==0xfc8ffffffffffffeLL))
++            return x+x; /* overflow, return -inf */
++        if (hx >= 0x7ff0000000000000LL) {
++            SET_LDOUBLE_WORDS64(u,0x7fefffffffffffffLL,0x7c8ffffffffffffeLL);
++            return u;
++        }
++        if(ihx <= 0x0360000000000000LL) {  /* x <= LDBL_MIN */
++            u = math_opt_barrier (x);
++            x -= __LDBL_DENORM_MIN__;
++            if (ihx < 0x0360000000000000LL
++                    || (hx > 0 && (npy_int64) lx <= 0)
++                    || (hx < 0 && (npy_int64) lx > 1)) {
++                u = u * u;
++                math_force_eval (u);        /* raise underflow flag */
++            }
++            return x;
++        }
++        if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
++            SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL);
++            u *= 0x1.0000000000000p-105L;
++        } else
++            
SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL);
++        return x - u;
++    } else {                /* p >= 0, x += ulp */
++        if((hx==0x7fefffffffffffffLL)&&(lx==0x7c8ffffffffffffeLL))
++            return x+x; /* overflow, return +inf */
++        if ((npy_uint64) hx >= 0xfff0000000000000ULL) {
++            SET_LDOUBLE_WORDS64(u,0xffefffffffffffffLL,0xfc8ffffffffffffeLL);
++            return u;
++        }
++        if(ihx <= 0x0360000000000000LL) {  /* x <= LDBL_MIN */
++            u = math_opt_barrier (x);
++            x += __LDBL_DENORM_MIN__;
++            if (ihx < 0x0360000000000000LL
++                    || (hx > 0 && (npy_int64) lx < 0 && lx != 
0x8000000000000001LL)
++                    || (hx < 0 && (npy_int64) lx >= 0)) {
++                u = u * u;
++                math_force_eval (u);        /* raise underflow flag */
++            }
++            if (x == 0.0L)  /* handle negative __LDBL_DENORM_MIN__ case */
++                x = -0.0L;
++            return x;
++        }
++        if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
++            SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL);
++            u *= 0x1.0000000000000p-105L;
++        } else
++            
SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL);
++        return x + u;
++    }
++}
++#else
+ npy_longdouble _nextl(npy_longdouble x, int p)
+ {
+@@ -189,4 +312,5 @@
+     return ux.e;
+ }
++#endif
+
+ /*
+Index: numpy/core/src/private/npy_fpmath.h
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/src/private/npy_fpmath.h (revision 7711)
++++ python-numpy-1.4.1/numpy/core/src/private/npy_fpmath.h (revision 8511)
+@@ -40,5 +40,6 @@
+       defined(HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE) || \
+       defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \
+-      defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE))
++      defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE) || \
++      defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE))
+     #error No long double representation defined
+ #endif
diff --git a/source/devel/numpy/ppc_r8526.diff 
b/source/devel/numpy/ppc_r8526.diff
new file mode 100644
index 0000000..bfb54c5
--- /dev/null
+++ b/source/devel/numpy/ppc_r8526.diff
@@ -0,0 +1,44 @@
+Index: /trunk/numpy/core/src/npymath/npy_math_private.h
+===================================================================
+--- python-numpy-1.4.1.orig/numpy/core/src/npymath/npy_math_private.h 
(revision 8510)
++++ python-numpy-1.4.1/numpy/core/src/npymath/npy_math_private.h (revision 
8526)
+@@ -362,4 +362,39 @@
+     typedef npy_uint64 ldouble_exp_t;
+     typedef npy_uint32 ldouble_sign_t;
++#elif defined(HAVE_LDOUBLE_IEEE_QUAD_LE)
++    /*
++     * IEEE quad precision, Little Endian. Bit representation is
++     *          |  s  |eeeeeeeeeee|mmmmmmmm................mmmmmmm|
++     *          |1 bit|  15 bits  |            112 bits           |
++     *          |          a[1]         |           a[0]          |
++     */
++    typedef npy_uint64 IEEEl2bitsrep_part;
++
++    union IEEEl2bitsrep {
++        npy_longdouble     e;
++        IEEEl2bitsrep_part a[2];
++    };
++
++    #define LDBL_MANL_INDEX     0
++    #define LDBL_MANL_MASK      0xFFFFFFFFFFFFFFFF
++    #define LDBL_MANL_SHIFT     0
++
++    #define LDBL_MANH_INDEX     1
++    #define LDBL_MANH_MASK      0x0000FFFFFFFFFFFF
++    #define LDBL_MANH_SHIFT     0
++
++    #define LDBL_EXP_INDEX      1
++    #define LDBL_EXP_MASK       0x7FFF000000000000
++    #define LDBL_EXP_SHIFT      48
++
++    #define LDBL_SIGN_INDEX     1
++    #define LDBL_SIGN_MASK      0x8000000000000000
++    #define LDBL_SIGN_SHIFT     63
++
++    #define LDBL_NBIT           0
++
++    typedef npy_uint64 ldouble_man_t;
++    typedef npy_uint64 ldouble_exp_t;
++    typedef npy_uint32 ldouble_sign_t;
+ #endif
+
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to