Skip to content

Commit 4160084

Browse files
authored
Merge pull request #5793 from martin-frbg/issue5775
Reduce the default list of DYNAMIC_ARCH targets for ARM64-based Apple systems
2 parents 8e57c86 + bd3cd91 commit 4160084

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

Makefile.system

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,20 @@ DYNAMIC_CORE += THUNDERX2T99
738738
DYNAMIC_CORE += TSV110
739739
DYNAMIC_CORE += EMAG8180
740740
DYNAMIC_CORE += THUNDERX3T110
741+
742+
ifeq ($(OSNAME), Darwin)
743+
DYNAMIC_CORE = ARMV8
744+
DYNAMIC_CORE += NEOVERSEN1
745+
ifneq ($(NO_SME), 1)
746+
DYNAMIC_CORE += ARMV9SME
747+
ifeq ($(OSNAME), Darwin)
748+
ifneq ($(C_COMPILER), GCC)
749+
DYNAMIC_CORE += VORTEXM4
750+
endif
751+
endif
752+
endif
753+
endif
754+
741755
ifdef DYNAMIC_LIST
742756
override DYNAMIC_CORE = ARMV8 $(DYNAMIC_LIST)
743757
XCCOMMON_OPT = -DDYNAMIC_LIST -DDYN_ARMV8

cmake/arch.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ if (DYNAMIC_ARCH)
5454
endif()
5555
endif()
5656
endif ()
57+
58+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
59+
set(DYNAMIC_CORE ARMV8 NEOVERSEN1)
60+
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 19 OR (${CMAKE_C_COMPILER_ID} MATCHES AppleClang AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) ) # SME ACLE supported in LLVM >= 19 and AppleClang >= 17
61+
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME VORTEXM4)
62+
endif()
63+
endif()
64+
5765
if (DYNAMIC_LIST)
5866
set(DYNAMIC_CORE ARMV8 ${DYNAMIC_LIST})
5967
endif ()

driver/others/dynamic_arm64.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,39 @@ extern gotoblas_t gotoblas_A64FX;
151151
#else
152152
#define gotoblas_A64FX gotoblas_ARMV8
153153
#endif
154+
154155
#else //not a user-specified dynamic_list
156+
157+
#ifdef OS_DARWIN
158+
#define gotoblas_CORTEXA53 gotoblas_ARMV8
159+
#else
155160
extern gotoblas_t gotoblas_CORTEXA53;
161+
#endif
156162
#define gotoblas_CORTEXA55 gotoblas_CORTEXA53
163+
#ifdef OS_DARWIN
164+
#define gotoblas_CORTEXA57 gotoblas_ARMV8
165+
#else
157166
extern gotoblas_t gotoblas_CORTEXA57;
167+
#endif
158168
#define gotoblas_CORTEXA72 gotoblas_CORTEXA57
159169
#define gotoblas_CORTEXA73 gotoblas_CORTEXA57
160170
#define gotoblas_FALKOR gotoblas_CORTEXA57
171+
#ifdef OS_DARWIN
172+
#define gotoblas_THUNDERX gotoblas_ARMV8
173+
#define gotoblas_THUNDERX2T99 gotoblas_ARMV8
174+
#define gotoblas_THUNDERX3T110 gotoblas_ARMV8
175+
#define gotoblas_TSV110 gotoblas_ARMV8
176+
#define gotoblas_EMAG8180 gotoblas_ARMV8
177+
#else
161178
extern gotoblas_t gotoblas_THUNDERX;
162179
extern gotoblas_t gotoblas_THUNDERX2T99;
180+
extern gotoblas_t gotoblas_THUNDERX3T110;
163181
extern gotoblas_t gotoblas_TSV110;
164182
extern gotoblas_t gotoblas_EMAG8180;
183+
#endif
165184
extern gotoblas_t gotoblas_NEOVERSEN1;
166185
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
186+
#ifndef OS_DARWIN
167187
#ifndef NO_SVE
168188
extern gotoblas_t gotoblas_NEOVERSEV1;
169189
extern gotoblas_t gotoblas_NEOVERSEN2;
@@ -175,6 +195,12 @@ extern gotoblas_t gotoblas_A64FX;
175195
#define gotoblas_ARMV8SVE gotoblas_ARMV8
176196
#define gotoblas_A64FX gotoblas_ARMV8
177197
#endif
198+
#else
199+
#define gotoblas_NEOVERSEV1 gotoblas_ARMV8
200+
#define gotoblas_NEOVERSEN2 gotoblas_ARMV8
201+
#define gotoblas_ARMV8SVE gotoblas_ARMV8
202+
#define gotoblas_A64FX gotoblas_ARMV8
203+
#endif
178204
#ifndef NO_SME
179205
extern gotoblas_t gotoblas_ARMV9SME;
180206
#if defined (__clang__) && defined(OS_DARWIN)
@@ -191,7 +217,6 @@ extern gotoblas_t gotoblas_VORTEXM4;
191217
#define gotoblas_VORTEXM4 gotoblas_NEOVERSEN1
192218
#endif
193219

194-
extern gotoblas_t gotoblas_THUNDERX3T110;
195220
#endif
196221
#define gotoblas_NEOVERSEV2 gotoblas_NEOVERSEN2
197222

0 commit comments

Comments
 (0)