From d330514856af955faf6fff4a09facf0eb9d3974a Mon Sep 17 00:00:00 2001 From: Mark Cannon Date: Sun, 12 Dec 2010 03:27:16 -0500 Subject: [PATCH] Added --with-sse2 configure flag for SSE2 heuristic optimizations --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"