457ac0
---
457ac0
 numpy/core/include/numpy/npy_cpu.h        | 3 +++
457ac0
 numpy/core/include/numpy/npy_endian.h     | 3 ++-
457ac0
 numpy/core/setup.py                       | 2 +-
457ac0
 numpy/core/setup_common.py                | 4 ++++
457ac0
 numpy/core/src/npymath/ieee754.c.src      | 3 ++-
457ac0
 numpy/core/src/npymath/npy_math_private.h | 3 ++-
457ac0
 numpy/core/src/private/npy_fpmath.h       | 5 ++++-
457ac0
 7 files changed, 18 insertions(+), 5 deletions(-)
457ac0
457ac0
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
457ac0
index 9707a7a..321cc04 100644
457ac0
--- a/numpy/core/include/numpy/npy_cpu.h
457ac0
+++ b/numpy/core/include/numpy/npy_cpu.h
457ac0
@@ -5,6 +5,7 @@
457ac0
  *              NPY_CPU_AMD64
457ac0
  *              NPY_CPU_PPC
457ac0
  *              NPY_CPU_PPC64
457ac0
+ *              NPY_CPU_PPC64LE
457ac0
  *              NPY_CPU_SPARC
457ac0
  *              NPY_CPU_S390
457ac0
  *              NPY_CPU_IA64
457ac0
@@ -41,6 +42,8 @@
457ac0
      * _ARCH_PPC is used by at least gcc on AIX
457ac0
      */
457ac0
     #define NPY_CPU_PPC
457ac0
+#elif defined(__ppc64le__)
457ac0
+    #define NPY_CPU_PPC64LE
457ac0
 #elif defined(__ppc64__)
457ac0
     #define NPY_CPU_PPC64
457ac0
 #elif defined(__sparc__) || defined(__sparc)
457ac0
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
457ac0
index 4e3349f..d8af8b3 100644
457ac0
--- a/numpy/core/include/numpy/npy_endian.h
457ac0
+++ b/numpy/core/include/numpy/npy_endian.h
457ac0
@@ -27,7 +27,8 @@
457ac0
             || defined(NPY_CPU_ARMEL)   \
457ac0
             || defined(NPY_CPU_AARCH64) \
457ac0
             || defined(NPY_CPU_SH_LE)   \
457ac0
-            || defined(NPY_CPU_MIPSEL)
457ac0
+            || defined(NPY_CPU_MIPSEL)  \
457ac0
+            || defined(NPY_CPU_PPC64LE)
457ac0
         #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
457ac0
     #elif defined(NPY_CPU_PPC)          \
457ac0
             || defined(NPY_CPU_SPARC)   \
457ac0
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
457ac0
index a1000ae..36cec26 100644
457ac0
--- a/numpy/core/setup.py
457ac0
+++ b/numpy/core/setup.py
457ac0
@@ -444,7 +444,7 @@ def configuration(parent_package='',top_path=None):
457ac0
                            'INTEL_EXTENDED_16_BYTES_LE',
457ac0
                            'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
457ac0
                            'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
457ac0
-                           'DOUBLE_DOUBLE_BE']:
457ac0
+                           'DOUBLE_DOUBLE_BE', 'DOUBLE_DOUBLE_LE']:
457ac0
                     moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
457ac0
                 else:
457ac0
                     raise ValueError("Unrecognized long double format: %s" % rep)
457ac0
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
457ac0
index 58876a8..3289afe 100644
457ac0
--- a/numpy/core/setup_common.py
457ac0
+++ b/numpy/core/setup_common.py
457ac0
@@ -221,6 +221,8 @@ _IEEE_QUAD_PREC_BE = ['300', '031', '326', '363', '105', '100', '000', '000',
457ac0
 _IEEE_QUAD_PREC_LE = _IEEE_QUAD_PREC_BE[::-1]
457ac0
 _DOUBLE_DOUBLE_BE = ['301', '235', '157', '064', '124', '000', '000', '000'] + \
457ac0
                     ['000'] * 8
457ac0
+_DOUBLE_DOUBLE_LE = ['000', '000', '000', '124', '064', '157', '235', '301'] + \
457ac0
+                    ['000'] * 8
457ac0
 
457ac0
 def long_double_representation(lines):
457ac0
     """Given a binary dump as given by GNU od -b, look for long double
457ac0
@@ -258,6 +260,8 @@ def long_double_representation(lines):
457ac0
                         return 'IEEE_QUAD_LE'
457ac0
                     elif read[8:-8] == _DOUBLE_DOUBLE_BE:
457ac0
                         return 'DOUBLE_DOUBLE_BE'
457ac0
+                    elif read[8:-8] == _DOUBLE_DOUBLE_LE:
457ac0
+                        return 'DOUBLE_DOUBLE_LE'
457ac0
                 elif read[:16] == _BEFORE_SEQ:
457ac0
                     if read[16:-8] == _IEEE_DOUBLE_LE:
457ac0
                         return 'IEEE_DOUBLE_LE'
457ac0
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
457ac0
index 90bbf5f..bccb3c8 100644
457ac0
--- a/numpy/core/src/npymath/ieee754.c.src
457ac0
+++ b/numpy/core/src/npymath/ieee754.c.src
457ac0
@@ -133,7 +133,8 @@ float _nextf(float x, int p)
457ac0
     return x;
457ac0
 }
457ac0
 
457ac0
-#ifdef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
457ac0
+#if defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || \
457ac0
+    defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
457ac0
 
457ac0
 /*
457ac0
  * FIXME: this is ugly and untested. The asm part only works with gcc, and we
457ac0
diff --git a/numpy/core/src/npymath/npy_math_private.h b/numpy/core/src/npymath/npy_math_private.h
457ac0
index 722d03f..b0ede48 100644
457ac0
--- a/numpy/core/src/npymath/npy_math_private.h
457ac0
+++ b/numpy/core/src/npymath/npy_math_private.h
457ac0
@@ -398,7 +398,8 @@ do {                                                            \
457ac0
     typedef npy_uint32 ldouble_sign_t;
457ac0
 #endif
457ac0
 
457ac0
-#ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
457ac0
+#if !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) && \
457ac0
+    !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
457ac0
 /* Get the sign bit of x. x should be of type IEEEl2bitsrep */
457ac0
 #define GET_LDOUBLE_SIGN(x) \
457ac0
     (((x).a[LDBL_SIGN_INDEX] & LDBL_SIGN_MASK) >> LDBL_SIGN_SHIFT)
457ac0
diff --git a/numpy/core/src/private/npy_fpmath.h b/numpy/core/src/private/npy_fpmath.h
457ac0
index 92338e4..f709d39 100644
457ac0
--- a/numpy/core/src/private/npy_fpmath.h
457ac0
+++ b/numpy/core/src/private/npy_fpmath.h
457ac0
@@ -29,6 +29,8 @@
457ac0
             #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
457ac0
         #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64)
457ac0
             #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE
457ac0
+        #elif defined(NPY_CPU_PPC64LE)
457ac0
+            #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_LE
457ac0
         #endif
457ac0
     #endif
457ac0
 #endif
457ac0
@@ -40,7 +42,8 @@
457ac0
       defined(HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE) || \
457ac0
       defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \
457ac0
       defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE) || \
457ac0
-      defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE))
457ac0
+      defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || \
457ac0
+      defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE))
457ac0
     #error No long double representation defined
457ac0
 #endif
457ac0
 
457ac0
-- 
457ac0
1.9.3
457ac0