From 44a20349e3d07af9b1e65f261be2ed150e86b11e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 20 Mar 2022 15:26:07 +0100 Subject: Added M1/Asahi support --- CMakeLists.txt | 7 ++++++- src/custommem.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75ece70a..658f0cff 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ option(ODROIDN2 "Set to ON if targeting an Odroid-N2 device" ${ODROIDN2}) option(TEGRAX1 "Set to ON if targeting an Tegra X1 based device" ${TEGRAX1}) option(PHYTIUM "Set to ON if targeting an Phytium (D2000 or FT2000/4) based device" ${PHYTIUM}) option(SD845 "Set to ON if targeting a Snapragon 845 based device" ${SD845}) +option(M1 "Set to ON if targeting a AppleM1 running on Asahi computer" ${M1}) option(LARCH64 "Set to ON if targeting an Loongarch64 based device" ${LARCH64}) option(RV64 "Set to ON if targeting an RISCV RV64G based device" ${RV64}) option(PPC64LE "Set to ON if targeting an PowerPC 64 LE based device" ${PPC64LE}) @@ -35,7 +36,7 @@ if(PPC64LE) set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC OFF CACHE BOOL "") endif() -if(RK3399 OR ODROIDN2 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A) +if(RK3399 OR ODROIDN2 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A OR M1) set(LD80BITS OFF CACHE BOOL "") set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC ON CACHE BOOL "") @@ -100,6 +101,10 @@ elseif(SD845) add_definitions(-DSD845) add_definitions(-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55) set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55") +elseif(M1) + add_definitions(-DM1) + add_definitions(-pipe -march=armv8.5-a+simd+crypto) + set(CMAKE_ASM_FLAGS "-pipe -march=armv8.5-a+simd+crypto") elseif(LARCH64) add_definitions(-DLA464) add_definitions(-pipe -march=loongarch64) diff --git a/src/custommem.c b/src/custommem.c index 60336ecd..ede78b6f 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -42,7 +42,7 @@ static uintptr_t* box64_jmptbldefault1[1<