Skip to content

Commit f8a7d80

Browse files
committed
use sse2neon on arm64
1 parent 8365799 commit f8a7d80

File tree

5 files changed

+9438
-5
lines changed

5 files changed

+9438
-5
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ else ()
9393
set (X86 FALSE)
9494
endif ()
9595

96+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64)|(AARCH64)|(arm64)|(ARM64)")
97+
set (ARM64 TRUE)
98+
endif()
99+
96100
check_c_compiler_flag("-mssse3" HAS_SSSE3)
97101
check_c_compiler_flag("-msse4.1" HAS_SSE4_1)
98102

99103
if (HAS_SSSE3 AND HAS_SSE4_1 AND X86)
100104
set(DEFAULT_C_COMP_OPTIONS ${DEFAULT_C_COMP_OPTIONS} -mssse3 -msse4.1)
101105
ADD_COMPILE_DEFINITIONS(N64_HAVE_SSE)
106+
elseif(ARM64)
107+
ADD_COMPILE_DEFINITIONS(N64_HAVE_SSE N64_USE_NEON)
102108
endif()
103109

104110
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${DEFAULT_C_COMP_OPTIONS}>")

src/common/util.h

+4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
#include <stdio.h>
77

88
#ifdef N64_HAVE_SSE
9+
#ifdef N64_USE_NEON
10+
#include <sse2neon.h>
11+
#else
912
#include <emmintrin.h>
1013
#endif
14+
#endif
1115

1216
typedef uint8_t u8;
1317
typedef uint16_t u16;

0 commit comments

Comments
 (0)