From dd2e97c4d2561d99c009f82371c0694171584537 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Sun, 19 May 2024 21:31:36 -0400 Subject: [PATCH] add sse2neon submodule with header and use it for arm64 --- .gitmodules | 3 +++ CMakeLists.txt | 1 + include/rsp_vu.h | 9 ++++----- lib/sse2neon | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) create mode 160000 lib/sse2neon diff --git a/.gitmodules b/.gitmodules index 25e5d53..34f6676 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "lib/lunasvg"] path = lib/lunasvg url = https://github.com/sammycage/lunasvg +[submodule "lib/sse2neon"] + path = lib/sse2neon + url = https://github.com/DLTcollab/sse2neon.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 18acea6..da0f002 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,7 @@ target_include_directories(Zelda64Recompiled PRIVATE ${CMAKE_SOURCE_DIR}/lib/rt64/src ${CMAKE_SOURCE_DIR}/lib/rt64/src/rhi ${CMAKE_SOURCE_DIR}/lib/rt64/src/render + ${CMAKE_SOURCE_DIR}/lib/sse2neon ${CMAKE_SOURCE_DIR}/lib/freetype-windows-binaries/include ${CMAKE_SOURCE_DIR}/lib/rt64/src/contrib/nativefiledialog-extended/src/include ${CMAKE_BINARY_DIR}/shaders diff --git a/include/rsp_vu.h b/include/rsp_vu.h index 8be1b1c..f98fdc7 100644 --- a/include/rsp_vu.h +++ b/include/rsp_vu.h @@ -20,14 +20,13 @@ // ---------------------------------------------------------------------- #include -#define ARCHITECTURE_AMD64 +#if defined(__x86_64__) || defined(_M_X64) #define ARCHITECTURE_SUPPORTS_SSE4_1 1 - -#if defined(ARCHITECTURE_AMD64) #include using v128 = __m128i; -#elif defined(ARCHITECTURE_ARM64) -#include +#elif defined(__aarch64__) || defined(_M_ARM64) +#define ARCHITECTURE_SUPPORTS_SSE4_1 1 +#include "sse2neon.h" using v128 = __m128i; #endif diff --git a/lib/sse2neon b/lib/sse2neon new file mode 160000 index 0000000..42c7047 --- /dev/null +++ b/lib/sse2neon @@ -0,0 +1 @@ +Subproject commit 42c704755d3ec218ed9126a122f0a667beeb630a