From 6aba9fc2635ca02ae4e2089bf6bfa7d78fdfc322 Mon Sep 17 00:00:00 2001 From: - Date: Thu, 16 May 2013 21:10:57 +0200 Subject: Fixed sse instruction only set if supported by cpu --- configure.in | 31 +++++++++++++++++++++++++++++++ lv2/Makefile.am | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 32c1c1c..6a68625 100644 --- a/configure.in +++ b/configure.in @@ -45,6 +45,37 @@ if test "x$enable_lv2" = "xyes"; then dnl Check for Xlib dnl ====================== PKG_CHECK_MODULES(X11, x11 >= 1.0) + + dnl =========================== + dnl Check for SSE instructions + dnl =========================== + AC_MSG_CHECKING([for sse3 instructions]) + if grep -q "sse3" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + CXXFLAGS="$CXXFLAGS -msse3" + AC_SUBST(CXXFLAGS) + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([for sse2 instructions]) + if grep -q "sse2" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + CXXFLAGS="$CXXFLAGS -msse2" + AC_SUBST(CXXFLAGS) + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([for sse instructions]) + if grep -q "sse" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + CXXFLAGS="$CXXFLAGS -DSSE -msse" + AC_SUBST(CXXFLAGS) + else + AC_MSG_RESULT([no]) + fi else AC_MSG_RESULT([*** LV2 plugin will not be compiled ***]) enable_lv2=no diff --git a/lv2/Makefile.am b/lv2/Makefile.am index bb7cea1..55db9b9 100644 --- a/lv2/Makefile.am +++ b/lv2/Makefile.am @@ -6,7 +6,7 @@ include $(top_srcdir)/src/Makefile.am.drumgizmo INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/include $(SNDFILE_CXXFLAGS) \ $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) $(LV2_CFLAGS) \ - $(PLUGIN_GUI_CFLAGS) -DX11 -DSSE -msse -msse2 -msse3 \ + $(PLUGIN_GUI_CFLAGS) -DX11 \ -DUSE_THREAD plugindir = $(prefix)/lib/lv2/drumgizmo.lv2 -- cgit v1.2.3 From 565aea03207e93ee8253de9f3d3c36b120b54547 Mon Sep 17 00:00:00 2001 From: - Date: Thu, 16 May 2013 21:33:16 +0200 Subject: Only applying sse-flags in lv2. --- configure.in | 12 ++++++------ lv2/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 6a68625..1b2123c 100644 --- a/configure.in +++ b/configure.in @@ -53,8 +53,8 @@ if test "x$enable_lv2" = "xyes"; then if grep -q "sse3" /proc/cpuinfo then AC_MSG_RESULT([yes]) - CXXFLAGS="$CXXFLAGS -msse3" - AC_SUBST(CXXFLAGS) + LV2FLAGS="-msse3" + AC_SUBST(LV2FLAGS) else AC_MSG_RESULT([no]) fi @@ -62,8 +62,8 @@ if test "x$enable_lv2" = "xyes"; then if grep -q "sse2" /proc/cpuinfo then AC_MSG_RESULT([yes]) - CXXFLAGS="$CXXFLAGS -msse2" - AC_SUBST(CXXFLAGS) + LV2FLAGS="$LV2FLAGS -msse2" + AC_SUBST(LV2FLAGS) else AC_MSG_RESULT([no]) fi @@ -71,8 +71,8 @@ if test "x$enable_lv2" = "xyes"; then if grep -q "sse" /proc/cpuinfo then AC_MSG_RESULT([yes]) - CXXFLAGS="$CXXFLAGS -DSSE -msse" - AC_SUBST(CXXFLAGS) + LV2FLAGS="$LV2FLAGS -DSSE -msse" + AC_SUBST(LV2FLAGS) else AC_MSG_RESULT([no]) fi diff --git a/lv2/Makefile.am b/lv2/Makefile.am index 55db9b9..d875baa 100644 --- a/lv2/Makefile.am +++ b/lv2/Makefile.am @@ -6,7 +6,7 @@ include $(top_srcdir)/src/Makefile.am.drumgizmo INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/include $(SNDFILE_CXXFLAGS) \ $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) $(LV2_CFLAGS) \ - $(PLUGIN_GUI_CFLAGS) -DX11 \ + $(PLUGIN_GUI_CFLAGS) -DX11 $(LV2FLAGS)\ -DUSE_THREAD plugindir = $(prefix)/lib/lv2/drumgizmo.lv2 -- cgit v1.2.3 From 165af82e9b8ecf098357eb4637888fb5f9487e3d Mon Sep 17 00:00:00 2001 From: - Date: Thu, 16 May 2013 21:41:00 +0200 Subject: Moved sse flags to SSEFLAGS variable. --- configure.in | 65 +++++++++++++++++++++++++++------------------------ drumgizmo/Makefile.am | 4 ++-- lv2/Makefile.am | 2 +- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/configure.in b/configure.in index 1b2123c..ca3b751 100644 --- a/configure.in +++ b/configure.in @@ -45,37 +45,6 @@ if test "x$enable_lv2" = "xyes"; then dnl Check for Xlib dnl ====================== PKG_CHECK_MODULES(X11, x11 >= 1.0) - - dnl =========================== - dnl Check for SSE instructions - dnl =========================== - AC_MSG_CHECKING([for sse3 instructions]) - if grep -q "sse3" /proc/cpuinfo - then - AC_MSG_RESULT([yes]) - LV2FLAGS="-msse3" - AC_SUBST(LV2FLAGS) - else - AC_MSG_RESULT([no]) - fi - AC_MSG_CHECKING([for sse2 instructions]) - if grep -q "sse2" /proc/cpuinfo - then - AC_MSG_RESULT([yes]) - LV2FLAGS="$LV2FLAGS -msse2" - AC_SUBST(LV2FLAGS) - else - AC_MSG_RESULT([no]) - fi - AC_MSG_CHECKING([for sse instructions]) - if grep -q "sse" /proc/cpuinfo - then - AC_MSG_RESULT([yes]) - LV2FLAGS="$LV2FLAGS -DSSE -msse" - AC_SUBST(LV2FLAGS) - else - AC_MSG_RESULT([no]) - fi else AC_MSG_RESULT([*** LV2 plugin will not be compiled ***]) enable_lv2=no @@ -353,11 +322,45 @@ LIBS="$tmp_LIBS" AC_SUBST(EXPAT_CFLAGS) AC_SUBST(EXPAT_LIBS) +dnl =========================== +dnl Check for SSE instructions +dnl =========================== +AC_MSG_CHECKING([for sse3 instructions]) +if grep -q "sse3" /proc/cpuinfo +then + AC_MSG_RESULT([yes]) + SSEFLAGS="-msse3" + AC_SUBST(SSEFLAGS) +else + AC_MSG_RESULT([no]) +fi +AC_MSG_CHECKING([for sse2 instructions]) +if grep -q "sse2" /proc/cpuinfo +then + AC_MSG_RESULT([yes]) + SSEFLAGS="$SSEFLAGS -msse2" + AC_SUBST(SSEFLAGS) +else + AC_MSG_RESULT([no]) +fi +AC_MSG_CHECKING([for sse instructions]) +if grep -q "sse" /proc/cpuinfo +then + AC_MSG_RESULT([yes]) + SSEFLAGS="$SSEFLAGS -DSSE -msse" + AC_SUBST(SSEFLAGS) +else + AC_MSG_RESULT([no]) +fi + + AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(LDFLAGS) + + # au/Makefile AC_OUTPUT( diff --git a/drumgizmo/Makefile.am b/drumgizmo/Makefile.am index d1c51ae..f816b62 100644 --- a/drumgizmo/Makefile.am +++ b/drumgizmo/Makefile.am @@ -11,7 +11,7 @@ bin_PROGRAMS = drumgizmo drumgizmo_LDADD = $(DRUMGIZMO_LIBS) $(PTHREAD_LIBS) -ldl drumgizmo_CXXFLAGS = $(SNDFILE_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) \ - -I$(top_srcdir)/include -I$(top_srcdir)/src -DSSE -msse -msse2 -msse3 \ + -I$(top_srcdir)/include -I$(top_srcdir)/src $(SSEFLAGS) \ -I$(top_srcdir)/hugin -DWITH_HUG_MUTEX drumgizmo_SOURCES = \ @@ -25,4 +25,4 @@ EXTRA_DIST = \ audioinputenginedl.h \ audiooutputenginedl.h -endif \ No newline at end of file +endif diff --git a/lv2/Makefile.am b/lv2/Makefile.am index d875baa..6bc32f2 100644 --- a/lv2/Makefile.am +++ b/lv2/Makefile.am @@ -6,7 +6,7 @@ include $(top_srcdir)/src/Makefile.am.drumgizmo INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/include $(SNDFILE_CXXFLAGS) \ $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) $(LV2_CFLAGS) \ - $(PLUGIN_GUI_CFLAGS) -DX11 $(LV2FLAGS)\ + $(PLUGIN_GUI_CFLAGS) -DX11 $(SSEFLAGS)\ -DUSE_THREAD plugindir = $(prefix)/lib/lv2/drumgizmo.lv2 -- cgit v1.2.3 From aa02b204c0e5f92e8b444db52f25bb6b17dd6dc4 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 17 May 2013 10:51:50 +0200 Subject: Disabling of sse and enabling sse with level. --- configure.in | 72 ++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index ca3b751..6fea409 100644 --- a/configure.in +++ b/configure.in @@ -325,34 +325,54 @@ AC_SUBST(EXPAT_LIBS) dnl =========================== dnl Check for SSE instructions dnl =========================== -AC_MSG_CHECKING([for sse3 instructions]) -if grep -q "sse3" /proc/cpuinfo -then - AC_MSG_RESULT([yes]) - SSEFLAGS="-msse3" - AC_SUBST(SSEFLAGS) -else - AC_MSG_RESULT([no]) +AC_ARG_ENABLE([sse], +[ --enable-sse[=level] Enable SSE Level 1, 2, 3 or auto [default=auto]],, + [enable_sse="auto"]) +if test "x$enable_sse" = "xyes"; then + enable_sse="auto" fi -AC_MSG_CHECKING([for sse2 instructions]) -if grep -q "sse2" /proc/cpuinfo -then - AC_MSG_RESULT([yes]) - SSEFLAGS="$SSEFLAGS -msse2" - AC_SUBST(SSEFLAGS) -else - AC_MSG_RESULT([no]) +#AC_MSG_RESULT([SSE: $enable_sse]) +if test "x$enable_sse" = "x3"; then + AC_MSG_RESULT([Setting sse level 3]) + SSE_FLAGS="-DSSE -msse -msse2 -mss3" +elif test "x$enable_sse" = "x2"; then + AC_MSG_RESULT([Setting sse level 2]) + SSE_FLAGS="-DSSE -msse -msse2" +elif test "x$enable_sse" = "x1"; then + AC_MSG_RESULT([Setting sse level 1]) + SSE_FLAGS="-DSSE -msse" +elif test "x$enable_sse" = "xauto"; then + AC_MSG_RESULT([Auto setting sse level]) + AC_MSG_CHECKING([for sse3 instructions]) + if grep -q "sse3" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + SSEFLAGS="-msse3" + AC_SUBST(SSEFLAGS) + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([for sse2 instructions]) + if grep -q "sse2" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + SSEFLAGS="$SSEFLAGS -msse2" + AC_SUBST(SSEFLAGS) + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([for sse instructions]) + if grep -q "sse" /proc/cpuinfo + then + AC_MSG_RESULT([yes]) + SSEFLAGS="$SSEFLAGS -DSSE -msse" + AC_SUBST(SSEFLAGS) + else + AC_MSG_RESULT([no]) + fi +else + AC_MSG_RESULT([*** Disabling SSE ***]) fi -AC_MSG_CHECKING([for sse instructions]) -if grep -q "sse" /proc/cpuinfo -then - AC_MSG_RESULT([yes]) - SSEFLAGS="$SSEFLAGS -DSSE -msse" - AC_SUBST(SSEFLAGS) -else - AC_MSG_RESULT([no]) -fi - AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) -- cgit v1.2.3 From 6d83ffd8de5ee866739d8a3cb7805e40d58276b0 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 17 May 2013 11:01:43 +0200 Subject: Enabling SSEFLAGS. --- drumgizmo/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drumgizmo/Makefile.am b/drumgizmo/Makefile.am index f816b62..79440ff 100644 --- a/drumgizmo/Makefile.am +++ b/drumgizmo/Makefile.am @@ -2,7 +2,7 @@ DISTDIRS = input output if ENABLE_CLI -include $(top_srcdir)/src/Makefile.am.drumgizmo +include $(top_srcdir)/src/Makefile.am.drumgizmo SUBDIRS = input output @@ -11,8 +11,8 @@ bin_PROGRAMS = drumgizmo drumgizmo_LDADD = $(DRUMGIZMO_LIBS) $(PTHREAD_LIBS) -ldl drumgizmo_CXXFLAGS = $(SNDFILE_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) \ - -I$(top_srcdir)/include -I$(top_srcdir)/src $(SSEFLAGS) \ - -I$(top_srcdir)/hugin -DWITH_HUG_MUTEX + -I$(top_srcdir)/include -I$(top_srcdir)/src \ + -I$(top_srcdir)/hugin -DWITH_HUG_MUTEX $(SSEFLAGS) drumgizmo_SOURCES = \ audioinputenginedl.cc \ -- cgit v1.2.3 From 87370e2852b4dc3c6b32d4d82aa14f76648b19d3 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 17 May 2013 11:02:11 +0200 Subject: Consistent naming of SSEFLAGS variable. --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 6fea409..d149ce9 100644 --- a/configure.in +++ b/configure.in @@ -334,13 +334,13 @@ fi #AC_MSG_RESULT([SSE: $enable_sse]) if test "x$enable_sse" = "x3"; then AC_MSG_RESULT([Setting sse level 3]) - SSE_FLAGS="-DSSE -msse -msse2 -mss3" + SSEFLAGS="-DSSE -msse -msse2 -mss3" elif test "x$enable_sse" = "x2"; then AC_MSG_RESULT([Setting sse level 2]) - SSE_FLAGS="-DSSE -msse -msse2" + SSEFLAGS="-DSSE -msse -msse2" elif test "x$enable_sse" = "x1"; then AC_MSG_RESULT([Setting sse level 1]) - SSE_FLAGS="-DSSE -msse" + SSEFLAGS="-DSSE -msse" elif test "x$enable_sse" = "xauto"; then AC_MSG_RESULT([Auto setting sse level]) AC_MSG_CHECKING([for sse3 instructions]) -- cgit v1.2.3