diff configure.in @ 1047:ffaaf7ecf685

Altivec-optimized blitters! Vast majority of this work is compliments of Bob Ippolito. http://www.devolution.com/pipermail/sdl/2005-February/067466.html and many other posts.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 17 Apr 2005 10:19:22 +0000
parents 974ba6ae0fa3
children 3e637850c02b
line wrap: on
line diff
--- a/configure.in	Sun Apr 17 10:16:30 2005 +0000
+++ b/configure.in	Sun Apr 17 10:19:22 2005 +0000
@@ -1839,17 +1839,18 @@
 {
     AC_MSG_CHECKING(for GCC Altivec instruction support)
     have_gcc_altivec=no
+    save_CFLAGS="${CFLAGS}"
+    CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
     AC_TRY_COMPILE([
+    vector unsigned int vzero() {
+        return vec_splat_u32(0);
+    }
     ],[
-        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"
+    if test x$have_gcc_altivec = xno; then
+        CFLAGS="${save_CFLAGS}"
     fi
     AC_MSG_RESULT($have_gcc_altivec)
 }
@@ -2564,6 +2565,7 @@
         CheckMacGL
         CheckPTHREAD
         CheckSIGACTION
+        CheckAltivec
         # If either the audio or CD driver is used, add the AudioUnit framework
         if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
             SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"