From a9ce50120b68db3669aaadeac348db8926bc15c4 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 19 Nov 2023 11:19:14 +0100 Subject: Improved architecture detection --- configure.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.sh') diff --git a/configure.sh b/configure.sh index 9a790ca..b9779c2 100755 --- a/configure.sh +++ b/configure.sh @@ -1,8 +1,13 @@ #!/bin/sh -cc -mavx2 utils/detect-immintrin.c && detected="AVX2" && rm a.out +detect() { cc -march=native -dM -E - < /dev/null | grep "$1"; } + +[ -n "$(detect __AVX2__)" ] && detected="AVX2" + TYPE=${TYPE-"$detected"} +echo "Using CUBE_$TYPE" + STD="-std=c99" WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" [ "$TYPE" = "AVX2" ] && AVX="-mavx2" -- cgit v1.3