From 5551d29ba2f8f4c0baec692957d9d96299c87d8f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 19 Feb 2026 00:05:29 -0600 Subject: [PATCH] Use SIMDe for NEON acceleration --- .gitmodules | 3 +++ CMakeLists.txt | 3 ++- nanors/deps/obl/autoshim.h | 3 +-- nanors/deps/obl/oblas_lite.c | 3 ++- nanors/deps/simde | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) create mode 160000 nanors/deps/simde diff --git a/.gitmodules b/.gitmodules index 1cea1f2..a72778d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "enet"] path = enet url = https://github.com/cgutman/enet.git +[submodule "nanors/deps/simde"] + path = nanors/deps/simde + url = https://github.com/simd-everywhere/simde-no-tests.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 54c30c4..31d666b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,8 +105,9 @@ endif() target_include_directories(moonlight-common-c SYSTEM PUBLIC src) -target_include_directories(moonlight-common-c PRIVATE +target_include_directories(moonlight-common-c SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/nanors + ${CMAKE_CURRENT_SOURCE_DIR}/nanors/deps ${CMAKE_CURRENT_SOURCE_DIR}/nanors/deps/obl ) diff --git a/nanors/deps/obl/autoshim.h b/nanors/deps/obl/autoshim.h index be14795..21b1a03 100644 --- a/nanors/deps/obl/autoshim.h +++ b/nanors/deps/obl/autoshim.h @@ -8,8 +8,7 @@ #define OBLAS_SSE3 #else #if defined(__aarch64__) || (defined(_MSC_VER) && defined(_M_ARM64)) -// To be replaced with SIMDe -// #define OBLAS_NEON +#define OBLAS_NEON #endif #endif #endif diff --git a/nanors/deps/obl/oblas_lite.c b/nanors/deps/obl/oblas_lite.c index 3ddd2dd..a29032e 100644 --- a/nanors/deps/obl/oblas_lite.c +++ b/nanors/deps/obl/oblas_lite.c @@ -176,7 +176,8 @@ void obl_axpyb32_ref(u8 *a, u32 *b, u8 u, unsigned k) #else #if defined(OBLAS_SSE3) || defined(OBLAS_NEON) #if defined(OBLAS_NEON) -#include "sse2neon/sse2neon.h" +#define SIMDE_ENABLE_NATIVE_ALIASES +#include #else #include #include diff --git a/nanors/deps/simde b/nanors/deps/simde new file mode 160000 index 0000000..595b743 --- /dev/null +++ b/nanors/deps/simde @@ -0,0 +1 @@ +Subproject commit 595b743dcebc05756244a66dcd78e9d64c07b3b7