poky/meta/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch
Alexander Kanavin 633b403b6d python3-numpy: update 1.21.4 -> 1.22.0
(From OE-Core rev: 6b9f2e078fb5653a1cedd64e90459e2f0780eb7e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-11 10:53:44 +00:00

51 lines
1.8 KiB
Diff

From eb6d6579150bf4684603ce377c51e90ad3bb8109 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Nov 2020 15:32:39 -0800
Subject: [PATCH] numpy/core: Define RISCV-32 support
Helps compile on riscv32
Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
numpy/core/include/numpy/npy_cpu.h | 3 +++
numpy/core/include/numpy/npy_endian.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
index 78d229e..04be511 100644
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -19,6 +19,7 @@
* NPY_CPU_ARCEB
* NPY_CPU_RISCV64
* NPY_CPU_LOONGARCH
+ * NPY_CPU_RISCV32
* NPY_CPU_WASM
*/
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
@@ -104,6 +105,8 @@
#define NPY_CPU_ARCEB
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
#define NPY_CPU_RISCV64
+#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32
+ #define NPY_CPU_RISCV32
#elif defined(__loongarch__)
#define NPY_CPU_LOONGARCH
#elif defined(__EMSCRIPTEN__)
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
index 5e58a7f..0926212 100644
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -49,6 +49,7 @@
|| defined(NPY_CPU_PPC64LE) \
|| defined(NPY_CPU_ARCEL) \
|| defined(NPY_CPU_RISCV64) \
+ || defined(NPY_CPU_RISCV32) \
|| defined(NPY_CPU_LOONGARCH) \
|| defined(NPY_CPU_WASM)
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
--
2.20.1