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