build: adding flag for NEON dotprod targets for M1 Macs
-# Copyright (c) 2007 - 2019 Joseph Gaeddert
+# Copyright (c) 2007 - 2021 Joseph Gaeddert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -213,7 +213,7 @@ else
src/dotprod/src/dotprod_rrrf.o \
src/dotprod/src/sumsq.o"
ARCH_OPTION="-ffast-math";;
- armv7*|armv8*)
+ arm|armv7*|armv8*)
# assume neon instructions are available
# TODO: check for Neon availability
@@ -222,9 +222,15 @@ else
src/dotprod/src/dotprod_crcf.neon.o \
src/dotprod/src/dotprod_rrrf.neon.o \
src/dotprod/src/sumsq.o"
+ case $target_os in
+ darwin*)
+ # M1 mac, ARM architecture : use neon extensions
+ ARCH_OPTION="-ffast-math";;
+ *)
# TODO: check these flags
#ARCH_OPTION="-ffast-math -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon";;
ARCH_OPTION="-ffast-math -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4";;
+ esac;;
*)
# unknown architecture : use portable C version
MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.o \
