Skip to content

Commit bb8331e

Browse files
committed
Port __ARM_NEON changes also to MadtRex makefiles
1 parent 80216cb commit bb8331e

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MadtRex/makefiles/cudacpp_driver.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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]
419420
ifeq ($(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)

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MadtRex/makefiles/cudacpp_runner.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ CXXFLAGS += $(OMPFLAGS)
259259

260260
# Set the build flags appropriate to each BACKEND choice (example: "make BACKEND=cppnone")
261261
# [NB MGONGPU_PVW512 is needed because "-mprefer-vector-width=256" is not exposed in a macro]
262+
# [Use 'g++ <buildflags> -E -dM - < /dev/null' to check which #define's are enabled]
262263
# [See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96476]
263264
ifeq ($(UNAME_P),ppc64le)
264265
ifeq ($(BACKEND),cppsse4)
@@ -270,21 +271,23 @@ ifeq ($(UNAME_P),ppc64le)
270271
else ifeq ($(BACKEND),cpp512z)
271272
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on PowerPC for the moment)
272273
endif
273-
else ifeq ($(UNAME_P),arm)
274-
ifeq ($(BACKEND),cppsse4)
275-
override AVXFLAGS = -D__ARM_NEON__ # ARM NEON with 128 width (Q/quadword registers)
274+
else ifeq ($(UNAME_P),arm) # ARM on Apple silicon
275+
ifeq ($(BACKEND),cppnone) # this internally undefines __ARM_NEON
276+
override AVXFLAGS = -DMGONGPU_NOARMNEON
277+
else ifeq ($(BACKEND),cppsse4) # __ARM_NEON is always defined on Apple silicon
278+
override AVXFLAGS =
276279
else ifeq ($(BACKEND),cppavx2)
277280
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
278281
else ifeq ($(BACKEND),cpp512y)
279282
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
280283
else ifeq ($(BACKEND),cpp512z)
281284
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on ARM for the moment)
282285
endif
283-
else ifeq ($(UNAME_P),aarch64)
284-
ifeq ($(BACKEND),cppnone)
286+
else ifeq ($(UNAME_P),aarch64) # ARM on Linux
287+
ifeq ($(BACKEND),cppnone) # +nosimd ensures __ARM_NEON is absent
285288
override AVXFLAGS = -march=armv8-a+nosimd
286-
else ifeq ($(BACKEND),cppsse4)
287-
override AVXFLAGS = -march=armv8-a+simd -D__ARM_NEON__
289+
else ifeq ($(BACKEND),cppsse4) # +simd ensures __ARM_NEON is present (128 width Q/quadword registers)
290+
override AVXFLAGS = -march=armv8-a+simd
288291
else ifeq ($(BACKEND),cppavx2)
289292
$(error Invalid SIMD BACKEND='$(BACKEND)': only 'cppnone' and 'cppsse4' are supported on aarch64 for the moment)
290293
else ifeq ($(BACKEND),cpp512y)

0 commit comments

Comments
 (0)