mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 21:17:45 +00:00
Add loongarch support
LSX and LASX are enabled by default if compiler supports them.
This commit is contained in:
127
configure
vendored
127
configure
vendored
@@ -838,6 +838,8 @@ enable_3dnow
|
||||
enable_sse
|
||||
enable_sse2
|
||||
enable_sse3
|
||||
enable_lsx
|
||||
enable_lasx
|
||||
enable_altivec
|
||||
enable_oss
|
||||
enable_alsa
|
||||
@@ -1620,6 +1622,8 @@ Optional Features:
|
||||
--enable-sse use SSE assembly routines [default=yes]
|
||||
--enable-sse2 use SSE2 assembly routines [default=maybe]
|
||||
--enable-sse3 use SSE3 assembly routines [default=maybe]
|
||||
--enable-lsx use LSX assembly routines [default=yes]
|
||||
--enable-lasx use LASX assembly routines [default=yes]
|
||||
--enable-altivec use Altivec assembly routines [default=yes]
|
||||
--enable-oss support the OSS audio API [default=maybe]
|
||||
--enable-alsa support the ALSA audio API [default=yes]
|
||||
@@ -18769,6 +18773,129 @@ $as_echo "#define HAVE_IMMINTRIN_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-lsx was given.
|
||||
if test "${enable_lsx+set}" = set; then :
|
||||
enableval=$enable_lsx;
|
||||
else
|
||||
enable_lsx=yes
|
||||
fi
|
||||
|
||||
if test x$enable_lsx = xyes; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
have_gcc_lsx=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5
|
||||
$as_echo_n "checking for GCC -mlsx option... " >&6; }
|
||||
lsx_CFLAGS="-mlsx"
|
||||
CFLAGS="$save_CFLAGS $lsx_CFLAGS"
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifndef __loongarch_sx
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
have_gcc_lsx=yes
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lsx" >&5
|
||||
$as_echo "$have_gcc_lsx" >&6; }
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
if test x$have_gcc_lsx = xyes; then
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS"
|
||||
SUMMARY_math="${SUMMARY_math} lsx"
|
||||
fi
|
||||
fi
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "lsxintrin.h" "ac_cv_header_lsxintrin_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_lsxintrin_h" = xyes; then :
|
||||
have_lsx_h_hdr=yes
|
||||
else
|
||||
have_lsx_h_hdr=no
|
||||
fi
|
||||
|
||||
|
||||
if test x$have_lsx_h_hdr = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_LSXINTRIN_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-lasx was given.
|
||||
if test "${enable_lasx+set}" = set; then :
|
||||
enableval=$enable_lasx;
|
||||
else
|
||||
enable_LASX=yes
|
||||
fi
|
||||
|
||||
if test x$enable_LASX = xyes; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
have_gcc_lasx=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mlasx option" >&5
|
||||
$as_echo_n "checking for GCC -mlasx option... " >&6; }
|
||||
lasx_CFLAGS="-mlasx"
|
||||
CFLAGS="$save_CFLAGS $lasx_CFLAGS"
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifndef __loongarch_asx
|
||||
#error Assembler CPP flag not enabled
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
have_gcc_lasx=yes
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lasx" >&5
|
||||
$as_echo "$have_gcc_lasx" >&6; }
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
if test x$have_gcc_lasx = xyes; then
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $lasx_CFLAGS"
|
||||
SUMMARY_math="${SUMMARY_math} lasx"
|
||||
fi
|
||||
fi
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "lasxintrin.h" "ac_cv_header_lasxintrin_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_lasxintrin_h" = xyes; then :
|
||||
have_lasx_h_hdr=yes
|
||||
else
|
||||
have_lasx_h_hdr=no
|
||||
fi
|
||||
|
||||
|
||||
if test x$have_lasx_h_hdr = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_LASXINTRIN_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-altivec was given.
|
||||
if test "${enable_altivec+set}" = set; then :
|
||||
enableval=$enable_altivec;
|
||||
|
||||
Reference in New Issue
Block a user