Check for altivec assembly support before trying to use it. :)
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40796
This commit is contained in:
parent
ac5cdde4c1
commit
fdf58b5852
2 changed files with 28 additions and 7 deletions
33
configure.in
33
configure.in
|
@ -1723,15 +1723,35 @@ CheckUSBHID()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dnl Check for altivec instruction support using gas syntax
|
||||||
|
CheckAltivec()
|
||||||
|
{
|
||||||
|
AC_MSG_CHECKING(for GCC Altivec instruction support)
|
||||||
|
have_gcc_altivec=no
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
],[
|
||||||
|
asm volatile ("mtspr 256, %0\n\t"
|
||||||
|
"vand %%v0, %%v0, %%v0"
|
||||||
|
:
|
||||||
|
: "r" (-1));
|
||||||
|
],[
|
||||||
|
have_gcc_altivec=yes
|
||||||
|
])
|
||||||
|
if test x$have_gcc_altivec = xyes; then
|
||||||
|
CFLAGS="$CFLAGS -DGCC_ALTIVEC"
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($have_gcc_altivec)
|
||||||
|
}
|
||||||
|
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
|
*-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
|
||||||
case "$target" in
|
case "$target" in
|
||||||
*-*-linux*) ARCH=linux ;;
|
*-*-linux*) ARCH=linux ;;
|
||||||
*-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
|
*-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
|
||||||
*-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
|
*-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
|
||||||
*-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
|
*-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
|
||||||
*-*-gnu*) ARCH=gnu ;; # must be last
|
*-*-gnu*) ARCH=gnu ;; # must be last
|
||||||
esac
|
esac
|
||||||
CheckDummyVideo
|
CheckDummyVideo
|
||||||
CheckDiskAudio
|
CheckDiskAudio
|
||||||
CheckDLOPEN
|
CheckDLOPEN
|
||||||
|
@ -1755,6 +1775,7 @@ case "$target" in
|
||||||
CheckOpenGL
|
CheckOpenGL
|
||||||
CheckInputEvents
|
CheckInputEvents
|
||||||
CheckPTHREAD
|
CheckPTHREAD
|
||||||
|
CheckAltivec
|
||||||
# Set up files for the main() stub
|
# Set up files for the main() stub
|
||||||
if test "x$video_qtopia" = "xyes"; then
|
if test "x$video_qtopia" = "xyes"; then
|
||||||
SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
|
SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
|
||||||
|
|
|
@ -236,7 +236,7 @@ static __inline__ int CPU_haveAltiVec()
|
||||||
int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
|
int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
|
||||||
if( 0 == error )
|
if( 0 == error )
|
||||||
altivec = (hasVectorUnit != 0);
|
altivec = (hasVectorUnit != 0);
|
||||||
#elseif defined(USE_SETJMP) && defined(__GNUC__) && defined(__powerpc__)
|
#elif defined(USE_SETJMP) && defined(GCC_ALTIVEC)
|
||||||
void (*handler)(int sig);
|
void (*handler)(int sig);
|
||||||
handler = signal(SIGILL, illegal_instruction);
|
handler = signal(SIGILL, illegal_instruction);
|
||||||
if ( setjmp(jmpbuf) == 0 ) {
|
if ( setjmp(jmpbuf) == 0 ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue