@@ -415,6 +415,7 @@ CXXFLAGS += $(OMPFLAGS)
415415
416416# Set the build flags appropriate to each BACKEND choice (example: "make BACKEND=cppnone")
417417# [NB MGONGPU_PVW512 is needed because "-mprefer-vector-width=256" is not exposed in a macro]
418+ # [Use 'g++ <buildflags> -E -dM - < /dev/null' to check which #define's are enabled]
418419# [See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96476]
419420ifeq ($(UNAME_P ) ,ppc64le)
420421 ifeq ($(BACKEND),cppsse4)
@@ -426,21 +427,23 @@ ifeq ($(UNAME_P),ppc64le)
426427 else ifeq ($(BACKEND),cpp512z)
427428 $(error Invalid SIMD BACKEND='$(BACKEND ) ' : only 'cppnone' and 'cppsse4' are supported on PowerPC for the moment)
428429 endif
429- else ifeq ($(UNAME_P),arm)
430- ifeq ($(BACKEND),cppsse4)
431- override AVXFLAGS = -D__ARM_NEON__ # ARM NEON with 128 width (Q/quadword registers)
430+ else ifeq ($(UNAME_P),arm) # ARM on Apple silicon
431+ ifeq ($(BACKEND),cppnone) # this internally undefines __ARM_NEON
432+ override AVXFLAGS = -DMGONGPU_NOARMNEON
433+ else ifeq ($(BACKEND),cppsse4) # __ARM_NEON is always defined on Apple silicon
434+ override AVXFLAGS =
432435 else ifeq ($(BACKEND),cppavx2)
433436 $(error Invalid SIMD BACKEND='$(BACKEND ) ' : only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
434437 else ifeq ($(BACKEND),cpp512y)
435438 $(error Invalid SIMD BACKEND='$(BACKEND ) ' : only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
436439 else ifeq ($(BACKEND),cpp512z)
437440 $(error Invalid SIMD BACKEND='$(BACKEND ) ' : only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
438441 endif
439- else ifeq ($(UNAME_P),aarch64)
440- ifeq ($(BACKEND),cppnone)
442+ else ifeq ($(UNAME_P),aarch64) # ARM on Linux
443+ ifeq ($(BACKEND),cppnone) # +nosimd ensures __ARM_NEON is absent
441444 override AVXFLAGS = -march=armv8-a+nosimd
442- else ifeq ($(BACKEND),cppsse4)
443- override AVXFLAGS = -march=armv8-a+simd -D__ARM_NEON__
445+ else ifeq ($(BACKEND),cppsse4) # +simd ensures __ARM_NEON is present (128 width Q/quadword registers)
446+ override AVXFLAGS = -march=armv8-a+simd
444447 else ifeq ($(BACKEND),cppavx2)
445448 $(error Invalid SIMD BACKEND='$(BACKEND ) ' : only 'cppnone' and 'cppsse4' are supported on aarch64 for the moment)
446449 else ifeq ($(BACKEND),cpp512y)
0 commit comments