[Apple Arm] introduce sse2neon
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <Scheduler.hpp>
|
||||
|
||||
namespace n64 {
|
||||
Core::Core() : cpu(std::make_unique<JIT>(parallel)) {}
|
||||
Core::Core() : cpu(std::make_unique<Interpreter>(parallel)) {}
|
||||
|
||||
void Core::Stop() {
|
||||
render = false;
|
||||
|
||||
@@ -2,11 +2,16 @@ file(GLOB SOURCES *.cpp)
|
||||
file(GLOB HEADERS *.hpp)
|
||||
|
||||
add_subdirectory(interpreter)
|
||||
add_subdirectory(jit)
|
||||
if(NOT ARM_APPLE)
|
||||
add_subdirectory(jit)
|
||||
endif()
|
||||
add_subdirectory(mem)
|
||||
add_subdirectory(mmio)
|
||||
add_subdirectory(registers)
|
||||
add_subdirectory(rsp)
|
||||
|
||||
add_library(core ${SOURCES} ${HEADERS})
|
||||
target_link_libraries(core PRIVATE jit interpreter mem mmio unarr registers rsp)
|
||||
target_link_libraries(core PRIVATE interpreter mem mmio unarr registers rsp)
|
||||
if(NOT ARM_APPLE)
|
||||
target_link_libraries(core PRIVATE jit)
|
||||
endif()
|
||||
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
#include <bitset>
|
||||
#include <cstdint>
|
||||
#ifdef __aarch64__
|
||||
#include <sse2neon.h>
|
||||
#else
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
using u8 = uint8_t;
|
||||
using u16 = uint16_t;
|
||||
|
||||
@@ -9,9 +9,11 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
||||
if (WIN32)
|
||||
add_compile_definitions(NOMINMAX)
|
||||
endif ()
|
||||
|
||||
if(APPLE)
|
||||
enable_language(OBJC)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
.
|
||||
../
|
||||
@@ -38,6 +40,7 @@ include_directories(
|
||||
../../external/parallel-rdp/parallel-rdp-standalone/util
|
||||
../../external/unarr
|
||||
../../external/SDL/include
|
||||
../../external/sse2neon
|
||||
../../external/capstone/include
|
||||
)
|
||||
|
||||
@@ -48,11 +51,22 @@ option(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
check_c_compiler_flag(-msse4.1 HAS_SSE4_1)
|
||||
check_c_compiler_flag(-msse4.1 HAS_SIMD)
|
||||
if(NOT HAS_SIMD)
|
||||
check_c_compiler_flag(-mfpu=neon HAS_SIMD)
|
||||
if(APPLE AND HAS_SIMD)
|
||||
set(ARM_APPLE ON)
|
||||
message("Compiling on ARM MacOS, very experimental and cool!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (HAS_SSE4_1)
|
||||
if (HAS_SIMD)
|
||||
add_compile_definitions(SIMD_SUPPORT)
|
||||
add_compile_options(-msse3 -msse4.1)
|
||||
if(ARM_APPLE)
|
||||
add_compile_options(-mfpu=neon)
|
||||
else()
|
||||
add_compile_options(-msse3 -msse4.1)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
#include <cmath>
|
||||
#include <common.hpp>
|
||||
#include <immintrin.h>
|
||||
|
||||
namespace Util {
|
||||
static FORCE_INLINE auto roundCeil(float f) {
|
||||
|
||||
Reference in New Issue
Block a user