[Apple Arm] introduce sse2neon
This commit is contained in:
21
external/sse2neon/LICENSE
vendored
Normal file
21
external/sse2neon/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-2025 SSE2NEON Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
9434
external/sse2neon/sse2neon.h
vendored
Normal file
9434
external/sse2neon/sse2neon.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
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,12 +51,23 @@ 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)
|
||||
if(ARM_APPLE)
|
||||
add_compile_options(-mfpu=neon)
|
||||
else()
|
||||
add_compile_options(-msse3 -msse4.1)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
add_compile_definitions(VULKAN_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