Merge pull request #30 from linuxoidmc/master

Initial support for Apple ARM64
This commit is contained in:
ptitSeb 2021-04-04 21:49:17 +02:00 committed by GitHub
commit 8cafd5f860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 4 deletions

View File

@ -101,13 +101,13 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wall)
add_compile_options(-pipe)
add_compile_options(-fPIC)
if(NOT PANDORA AND NOT PYRA)
if(NOT PANDORA AND NOT PYRA AND NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
add_compile_options(-march=native)
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*")
if(PYRA)
add_compile_options(-mfpu=neon-vfpv4)
else()
elseif(NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
add_compile_options(-mfpu=neon)
endif()
endif()

View File

@ -2106,7 +2106,7 @@ vtxRest:
vtxEnd:
pop ebx
}
#elif defined(__ARM_NEON__)
#elif defined(__ARM_NEON__) && !defined (PLATFORM_MACOSX)
register float tc_u __asm__("s0") = fTexCorrU;
register float tc_v __asm__("s1") = fTexCorrV;
const void *tc_src = pvTexCoord->vector;

View File

@ -512,7 +512,7 @@ void CCastRay::TestBrushSector(CBrushSector *pbscSector)
continue;
}
}
#ifdef __ARM_NEON__
#if defined __ARM_NEON__ && !defined PLATFORM_MACOSX
// get distances of ray points from the polygon plane
register FLOAT fDistance0 __asm__("s0") = bpoPolygon.bpo_pbplPlane->bpl_plAbsolute.PointDistance(cr_vOrigin);
register FLOAT fDistance1 __asm__("s2") = bpoPolygon.bpo_pbplPlane->bpl_plAbsolute.PointDistance(cr_vTarget);

14
Sources/build-macarm.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
NCPU=`sysctl -n hw.ncpu`
echo "Will build with 'make -j$NCPU' ... please edit this script if incorrect."
set -e
set -x
rm -rf cmake-build
mkdir $_
cd $_
cmake -DCMAKE_BUILD_TYPE=RelWithDbgInfo -DCMAKE_OSX_ARCHITECTURES=arm64 .. $1
make -j$NCPU