mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 12:31:10 +00:00
[build] Autoconfiscate simd support
The default is to enable (and autodetect based on lscpu) simd support, or the mode can be specified via --enable-simd=mode. --disable-simd disables the support but ensures gcc will still compile the float vector types.
This commit is contained in:
parent
a3aebc983b
commit
c554dee0f8
3 changed files with 26 additions and 8 deletions
|
@ -81,13 +81,30 @@ AC_ARG_ENABLE(optimize,
|
|||
optimize=yes
|
||||
)
|
||||
|
||||
dnl QF_CC_OPTION(-Wno-psabi)
|
||||
dnl QF_CC_OPTION(-msse2)
|
||||
dnl QF_CC_OPTION(-Wno-psabi)
|
||||
QF_CC_OPTION(-mavx2)
|
||||
dnl fma is not used as it is the equivalent of turning on
|
||||
dnl -funsafe-math-optimizations
|
||||
dnl QF_CC_OPTION(-mfma)
|
||||
AC_ARG_ENABLE(simd,
|
||||
[ --enable-simd[=arg] Enable SIMD support (default auto)],
|
||||
[],
|
||||
[enable_simd=yes]
|
||||
)
|
||||
|
||||
case "$enable_simd" in
|
||||
no)
|
||||
QF_CC_OPTION(-Wno-psabi)
|
||||
simd=no
|
||||
;;
|
||||
sse|sse2|avx|avx2)
|
||||
QF_CC_OPTION(-m$enable_simd)
|
||||
simd=$enable_simd
|
||||
;;
|
||||
yes)
|
||||
for simd in avx2 avx sse2 sse; do
|
||||
if lscpu | grep -q -w $simd; then
|
||||
QF_CC_OPTION(-m$simd)
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(for optimization)
|
||||
if test "x$optimize" = xyes -a "x$leave_cflags_alone" != "xyes"; then
|
||||
|
|
|
@ -12,6 +12,7 @@ AC_MSG_RESULT([
|
|||
HTTP support : ${CURL:-no}
|
||||
Compiler version : $CCVER
|
||||
Compiler flags : $CFLAGS
|
||||
SIMD Support : $simd
|
||||
qfcc cpp invocation: $CPP_NAME
|
||||
|
||||
Shared game data directory : $sharepath
|
||||
|
|
|
@ -74,7 +74,7 @@ dnl Checks for system type
|
|||
dnl ==================================================================
|
||||
|
||||
dnl Checks for which system driver to use
|
||||
echo ${host}
|
||||
|
||||
AC_MSG_CHECKING(for system driver)
|
||||
case "${host}" in
|
||||
i?86-*-mingw32*|x86_64-w64-mingw32*)
|
||||
|
|
Loading…
Reference in a new issue