diff options
author | David Cournapeau <cournape@gmail.com> | 2009-11-09 04:40:37 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-11-09 04:40:37 +0000 |
commit | 5b3f51c5fd86aae9674e3399d7a0b091311c1cd2 (patch) | |
tree | 1eacab8cde1cddec5ea6b291a5c5904e606f2a03 /numpy | |
parent | 289f90ba1cd743c61536dd2d082f9f8bccc3c668 (diff) | |
download | numpy-5b3f51c5fd86aae9674e3399d7a0b091311c1cd2.tar.gz |
BUG: ppc on darwin has long double aligned on 16 bytes - adjust IEEEl2bits accordingly.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/npymath/npy_math_private.h | 16 | ||||
-rw-r--r-- | numpy/core/src/private/npy_fpmath.h | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/numpy/core/src/npymath/npy_math_private.h b/numpy/core/src/npymath/npy_math_private.h index 3f3ed6bcd..5e309a30b 100644 --- a/numpy/core/src/npymath/npy_math_private.h +++ b/numpy/core/src/npymath/npy_math_private.h @@ -203,6 +203,22 @@ do { \ }; #define LDBL_NBIT 0x80000000 #define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) +#elif defined(HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE) + /* 64 bits IEEE double precision aligned on 16 bytes: used by ppc arch on + * Mac OS X */ + union IEEEl2bits { + npy_longdouble e; + struct { + npy_uint32 sign :1; + npy_uint32 exp :11; + npy_uint32 manh :20; + npy_uint32 manl :32; + npy_uint32 junkh :32; + npy_uint32 junkl :32; + } bits; + }; + #define LDBL_NBIT 0 + #define mask_nbit_l(u) ((void)0) #elif defined(HAVE_LDOUBLE_IEEE_QUAD_BE) /* Quad precision IEEE format */ union IEEEl2bits { diff --git a/numpy/core/src/private/npy_fpmath.h b/numpy/core/src/private/npy_fpmath.h index 8b0253dce..4b45a12dc 100644 --- a/numpy/core/src/private/npy_fpmath.h +++ b/numpy/core/src/private/npy_fpmath.h @@ -28,7 +28,7 @@ #elif defined(NPY_CPU_AMD64) #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64) - #define HAVE_LDOUBLE_IEEE_QUAD_BE + #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE #endif #endif #endif @@ -37,6 +37,7 @@ defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || \ defined(HAVE_LDOUBLE_IEEE_DOUBLE_LE) || \ defined(HAVE_LDOUBLE_IEEE_DOUBLE_BE) || \ + defined(HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE) || \ defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \ defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE)) #error No long double representation defined |