summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2009-08-09 17:30:22 +0000
committerCharles Harris <charlesr.harris@gmail.com>2009-08-09 17:30:22 +0000
commitf97cb4cd9d14c538dbb581426aa30d9dd96b1d06 (patch)
tree753450e463aaa0073c35ee64c71468f79e1a91da /numpy
parent33ede5110c2250cbd4ee9eb61da1d09f1412460a (diff)
downloadnumpy-f97cb4cd9d14c538dbb581426aa30d9dd96b1d06.tar.gz
Add ARM and SuperH architectures.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/include/numpy/npy_cpu.h12
-rw-r--r--numpy/core/include/numpy/npy_endian.h17
2 files changed, 25 insertions, 4 deletions
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
index 11f647544..4d6579189 100644
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -10,6 +10,10 @@
* NPY_CPU_IA64
* NPY_CPU_HPPA
* NPY_CPU_ALPHA
+ * NPY_CPU_ARMEL
+ * NPY_CPU_ARMEB
+ * NPY_CPU_SH_LE
+ * NPY_CPU_SH_BE
*/
#ifndef _NPY_CPUARCH_H_
#define _NPY_CPUARCH_H_
@@ -47,6 +51,14 @@
#define NPY_CPU_HPPA
#elif defined(__alpha__)
#define NPY_CPU_ALPHA
+#elif defined(__arm__) && defined(__ARMEL__)
+ #define NPY_CPU_ARMEL
+#elif defined(__arm__) && defined(__ARMEB__)
+ #define NPY_CPU_ARMEB
+#elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
+ #define NPY_CPU_SH_LE
+#elif defined(__sh__) && defined(__BIG_ENDIAN__)
+ #define NPY_CPU_SH_BE
#else
#error Unknown CPU, please report this to numpy maintainers with \
information about your platform (OS, CPU and compiler)
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
index 88bce4827..f3ae4dbff 100644
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -20,11 +20,20 @@
#define NPY_LITTLE_ENDIAN 1234
#define NPY_BIG_ENDIAN 4321
- #if defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64)\
- || defined(NPY_CPU_IA64) || defined(NPY_CPU_ALPHA)
+ #if defined(NPY_CPU_X86) \
+ || defined(NPY_CPU_AMD64) \
+ || defined(NPY_CPU_IA64) \
+ || defined(NPY_CPU_ALPHA) \
+ || defined(NPY_CPU_ARMEL) \
+ || defined(NPY_CPU_SH_LE)
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
- #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_SPARC)\
- || defined(NPY_CPU_S390) || defined(NPY_CPU_HPPA) || defined(NPY_CPU_PPC64)
+ #elif defined(NPY_CPU_PPC) \
+ || defined(NPY_CPU_SPARC) \
+ || defined(NPY_CPU_S390) \
+ || defined(NPY_CPU_HPPA) \
+ || defined(NPY_CPU_PPC64) \
+ || defined(NPY_CPU_ARMEB) \
+ || defined(NPY_CPU_SH_BE)
#define NPY_BYTE_ORDER NPY_BIG_ENDIAN
#else
#error Unknown CPU: can not set endianness