Skip to content

Commit f16601d

Browse files
abrodkincharris
authored andcommitted
ENH: Add support of ARC architecture
Synopsys DesignWare ARC Processors are a family of 32-bit CPUs which in some configurations may run Linux kernel and full stack of applications on top of it. Among other things is Python. With that change we allow building and usage of Numpy on ARC.
1 parent 3fa0096 commit f16601d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

numpy/core/include/numpy/npy_cpu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* NPY_CPU_ARMEB
1616
* NPY_CPU_SH_LE
1717
* NPY_CPU_SH_BE
18+
* NPY_CPU_ARCEL
19+
* NPY_CPU_ARCEB
1820
*/
1921
#ifndef _NPY_CPUARCH_H_
2022
#define _NPY_CPUARCH_H_
@@ -76,6 +78,10 @@
7678
#define NPY_CPU_AARCH64
7779
#elif defined(__mc68000__)
7880
#define NPY_CPU_M68K
81+
#elif defined(__arc__) && defined(__LITTLE_ENDIAN__)
82+
#define NPY_CPU_ARCEL
83+
#elif defined(__arc__) && defined(__BIG_ENDIAN__)
84+
#define NPY_CPU_ARCEB
7985
#else
8086
#error Unknown CPU, please report this to numpy maintainers with \
8187
information about your platform (OS, CPU and compiler)

numpy/core/include/numpy/npy_endian.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
|| defined(NPY_CPU_AARCH64) \
4646
|| defined(NPY_CPU_SH_LE) \
4747
|| defined(NPY_CPU_MIPSEL) \
48-
|| defined(NPY_CPU_PPC64LE)
48+
|| defined(NPY_CPU_PPC64LE) \
49+
|| defined(NPY_CPU_ARCEL)
4950
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
5051
#elif defined(NPY_CPU_PPC) \
5152
|| defined(NPY_CPU_SPARC) \
@@ -56,7 +57,8 @@
5657
|| defined(NPY_CPU_SH_BE) \
5758
|| defined(NPY_CPU_MIPSEB) \
5859
|| defined(NPY_CPU_OR1K) \
59-
|| defined(NPY_CPU_M68K)
60+
|| defined(NPY_CPU_M68K) \
61+
|| defined(NPY_CPU_ARCEB)
6062
#define NPY_BYTE_ORDER NPY_BIG_ENDIAN
6163
#else
6264
#error Unknown CPU: can not set endianness

0 commit comments

Comments
 (0)