Commit 3e4fa6b4 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Fixed Altivec support on Mac OS X.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401178
parent ac4bc6a4
...@@ -1922,42 +1922,70 @@ CheckUSBHID() ...@@ -1922,42 +1922,70 @@ CheckUSBHID()
dnl Check for altivec instruction support using gas syntax dnl Check for altivec instruction support using gas syntax
CheckAltivec() CheckAltivec()
{ {
dnl FIXME: Theoretically, you might not have altivec.h, we should check have_altivec_h_hdr=no
dnl FIXME: that seperately, but I think all major platforms have it AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
dnl FIXME: at the moment... --ryan.
save_CFLAGS="${CFLAGS}" save_CFLAGS="${CFLAGS}"
have_gcc_altivec=no have_gcc_altivec=no
AC_MSG_CHECKING(for Altivec with GCC -maltivec option) AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec" CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec"
AC_TRY_COMPILE([
#include <altivec.h> if test x$have_altivec_h_hdr = xyes; then
vector unsigned int vzero() { AC_TRY_COMPILE([
return vec_splat_u32(0); #include <altivec.h>
} vector unsigned int vzero() {
],[ return vec_splat_u32(0);
],[ }
have_gcc_altivec=yes ],[
]) ],[
AC_MSG_RESULT($have_gcc_altivec) have_gcc_altivec=yes
])
AC_MSG_RESULT($have_gcc_altivec)
else
AC_TRY_COMPILE([
vector unsigned int vzero() {
return vec_splat_u32(0);
}
],[
],[
have_gcc_altivec=yes
])
AC_MSG_RESULT($have_gcc_altivec)
fi
if test x$have_gcc_altivec = xno; then if test x$have_gcc_altivec = xno; then
AC_MSG_CHECKING(for Altivec with GCC -faltivec option) AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec" CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
AC_TRY_COMPILE([ if test x$have_altivec_h_hdr = xyes; then
#include <altivec.h> AC_TRY_COMPILE([
vector unsigned int vzero() { #include <altivec.h>
return vec_splat_u32(0); vector unsigned int vzero() {
} return vec_splat_u32(0);
],[ }
],[ ],[
have_gcc_altivec=yes ],[
]) have_gcc_altivec=yes
AC_MSG_RESULT($have_gcc_altivec) ])
AC_MSG_RESULT($have_gcc_altivec)
else
AC_TRY_COMPILE([
vector unsigned int vzero() {
return vec_splat_u32(0);
}
],[
],[
have_gcc_altivec=yes
])
AC_MSG_RESULT($have_gcc_altivec)
fi
fi fi
if test x$have_gcc_altivec = xno; then if test x$have_gcc_altivec = xno; then
CFLAGS="${save_CFLAGS}" CFLAGS="${save_CFLAGS}"
else
if test x$have_altivec_h_hdr = xyes; then
CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H"
fi
fi fi
} }
......
...@@ -422,7 +422,9 @@ static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) ...@@ -422,7 +422,9 @@ static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info)
#endif #endif
#ifdef USE_ALTIVEC_BLITTERS #ifdef USE_ALTIVEC_BLITTERS
#ifdef HAVE_ALTIVEC_H
#include <altivec.h> #include <altivec.h>
#endif
#include <assert.h> #include <assert.h>
#if ((defined MACOSX) && (__GNUC__ < 4)) #if ((defined MACOSX) && (__GNUC__ < 4))
......
...@@ -36,7 +36,9 @@ static char rcsid = ...@@ -36,7 +36,9 @@ static char rcsid =
/* Functions to blit from N-bit surfaces to other surfaces */ /* Functions to blit from N-bit surfaces to other surfaces */
#ifdef USE_ALTIVEC_BLITTERS #ifdef USE_ALTIVEC_BLITTERS
#ifdef HAVE_ALTIVEC_H
#include <altivec.h> #include <altivec.h>
#endif
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef MACOSX #ifdef MACOSX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment