Add windows arm support (without optimization). To do list: implement Neon

This commit is contained in:
CodeLikeCXK 2022-04-28 18:48:17 +08:00
parent 800cd210f9
commit 8520b23a56
5 changed files with 28 additions and 5 deletions

View file

@ -36,7 +36,7 @@ option(OPENAL
"Use OpenAL soft instead of XAudio2" OFF)
option(FFMPEG
"Use FMPEG to render Bink videos" ON)
"Use FMPEG to render Bink videos" OFF)
option(BINKDEC
"Use included libbinkdec to render Bink videos" OFF)
@ -51,7 +51,7 @@ option(USE_MoltenVK
"Use MoltenVK library directly instead of Vulkan loader on macOS" OFF)
option(ONATIVE
"Optimize for the host CPU" OFF)
"Optimize for the host CPU" ON)
option(WINDOWS10
"Build for Windows 10+" ON)
@ -94,6 +94,12 @@ else()
option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" OFF)
endif()
#trying to add windows arm support
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(x64)")
option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" OFF)
endif()
if(FFMPEG AND BINKDEC)
message(FATAL_ERROR "Only one of FFMPEG and BINKDEC (or neither) can be enabled at a time")
endif()
@ -102,8 +108,9 @@ if(UNIX)
set(OPENAL ON)
# SRS - Disable precompiled headers when cross-compiling on OSX, e.g. when creating universal binaries
if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR
(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64"))
if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR
# (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64") OR (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x64"))
set(USE_PRECOMPILED_HEADERS OFF)
endif()

View file

@ -0,0 +1,6 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A arm64 -D WINDOWS10=ON -D USE_INTRINSICS_SSE=OFF ../neo
pause

View file

@ -39,9 +39,12 @@ If you have questions concerning this license or the applicable additional terms
// Win32
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN64)
#define CPUSTRING "x64"
#elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
#define CPUSTRING "arm64"
#else
#define CPUSTRING "x86"
#endif
@ -185,7 +188,9 @@ Defines and macros usable in all code
#define ALIGN( x, a ) ( ( ( x ) + ((a)-1) ) & ~((a)-1) )
// RB: changed UINT_PTR to uintptr_t
#include <malloc.h>
#define _alloca16( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 16 ) + 16 ), 16 ) )
#define _alloca128( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 128 ) + 128 ), 128 ) )
// RB end

View file

@ -15,6 +15,8 @@
#ifndef RAPIDJSON_RAPIDJSON_H_
#define RAPIDJSON_RAPIDJSON_H_
//#define RAPIDJSON_ENDIAN 0
/*!\file rapidjson.h
\brief common definitions and configuration
@ -209,7 +211,7 @@
// Detect with architecture macros
# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__)
# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
# elif defined(_M_ARM64) || defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
# elif defined(RAPIDJSON_DOXYGEN_RUNNING)
# define RAPIDJSON_ENDIAN

View file

@ -115,6 +115,9 @@ void CinematicAudio_XAudio2::InitAudio( void* audioContext )
bool use_ext = false;
voiceFormatcine.nChannels = binkInfo->nChannels; //fixed
voiceFormatcine.nSamplesPerSec = binkInfo->sampleRate; //fixed
#else
int format_byte = 2;
bool use_ext = false;
#endif
WAVEFORMATEXTENSIBLE exvoice = { 0 };