diff --git a/configure.ac b/configure.ac index 48ccc38a44..2fb749062c 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,17 @@ AC_C_BIGENDIAN( AC_DEFINE(ENDIAN_LITTLE, 1, [Little endian]), AC_MSG_ERROR([Can't determine endianness]) ) +# If we're compiling with the SSE2 build flag, add that flag to CFLAGS and CXXFLAGS. +# (Handwritten SSE/SSE2 code isn't in the binary, but GCC's heuristics optimize enough +# vector arithmetic in Rage that this produces a noticeable speedup on SSE2 processors.) + +AC_ARG_WITH(sse2, AC_HELP_STRING([--with-sse2], [Enable SSE2 optimization]), with_sse2=$withval, with_sse2=no) + +if test "$with_sse2" = "yes"; then + CFLAGS="$CFLAGS -msse2" + CXXFLAGS="$CXXFLAGS -msse2" +fi + AC_ARG_WITH(prof, AS_HELP_STRING([--with-prof],[Enable profiling]), with_prof=$withval, with_prof=no) if test "$with_prof" = "yes"; then test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -pg"