Don't build sb-simd if the host doesn't support AVX2.

This commit is contained in:
Stas Boukarev 2022-06-21 16:59:13 +03:00
parent 286a16d6d4
commit 9bf8ab85e6
3 changed files with 13 additions and 4 deletions

1
.gitignore vendored
View file

@ -40,6 +40,7 @@ tests/*.so
tests/run-tests-*
tests/last-random-state.lisp-expr
tests/ansi-test/
tools-for-build/avx2*
tools-for-build/determine-endianness
tools-for-build/determine-endianness.exe
tools-for-build/grovel-headers

View file

@ -45,8 +45,6 @@ for dir in `cd contrib ; echo *`; do
done
SBCL_CONTRIB_BLOCKLIST=${SBCL_CONTRIB_BLOCKLIST:-""}
echo $SBCL_CONTRIB_BLOCKLIST
perform_host_lisp_check=no
fancy=false
some_options=false
@ -498,8 +496,6 @@ case "$sbcl_arch" in
x86-64) ;; *) SBCL_CONTRIB_BLOCKLIST="$SBCL_CONTRIB_BLOCKLIST sb-simd" ;;
esac
echo "SBCL_CONTRIB_BLOCKLIST=\"$SBCL_CONTRIB_BLOCKLIST\"; export SBCL_CONTRIB_BLOCKLIST" >> output/build-config
echo //setting up OS-dependent information
original_dir=`pwd`
@ -658,6 +654,12 @@ case "$sbcl_arch" in
;;
x86-64)
printf ' :sb-simd-pack :sb-simd-pack-256 :avx2' >> $ltf # not mandatory
$GNUMAKE -C tools-for-build avx2
if tools-for-build/avx2; then
SBCL_CONTRIB_BLOCKLIST="$SBCL_CONTRIB_BLOCKLIST sb-simd"
fi
case "$sbcl_os" in
linux | darwin | *bsd)
printf ' :immobile-space' >> $ltf
@ -709,6 +711,8 @@ echo //finishing $ltf
printf " %s" "`cat crossbuild-runner/backends/${sbcl_arch}/features`" >> $ltf
echo ")) (list$WITHOUT_FEATURES)))" >> $ltf
echo "SBCL_CONTRIB_BLOCKLIST=\"$SBCL_CONTRIB_BLOCKLIST\"; export SBCL_CONTRIB_BLOCKLIST" >> output/build-config
# FIXME: The version system should probably be redone along these lines:
#
# echo //setting up version information.

4
tools-for-build/avx2.c Normal file
View file

@ -0,0 +1,4 @@
int main () {
__builtin_cpu_init();
return __builtin_cpu_supports("avx2") != 0;
}