<div dir="ltr"><div>Using these adjusted flags, I can verify SWR running on Intel SandyBridge, Intel Haswell, and AMD Interlagos.<br><br>Acked-by: Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com">chuck.atkins@kitware.com</a>><br></div>Tested-by: Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com">chuck.atkins@kitware.com</a>><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- Chuck<br></div></div></div>
<br><div class="gmail_quote">On Thu, Jun 16, 2016 at 4:07 PM, Tim Rowley <span dir="ltr"><<a href="mailto:timothy.o.rowley@intel.com" target="_blank">timothy.o.rowley@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>                        | 11 +++++++----<br>
 src/gallium/drivers/swr/Makefile.am |  4 ++--<br>
 2 files changed, 9 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index c492e15..cc9bc47 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -2400,8 +2400,8 @@ if test -n "$with_gallium_drivers"; then<br>
             swr_llvm_check "swr"<br>
<br>
             AC_MSG_CHECKING([whether $CXX supports c++11/AVX/AVX2])<br>
-            AVX_CXXFLAGS="-march=core-avx-i"<br>
-            AVX2_CXXFLAGS="-march=core-avx2"<br>
+            SWR_AVX_CXXFLAGS="-mavx"<br>
+            SWR_AVX2_CXXFLAGS="-mavx2 -mfma -mbmi2 -mf16c"<br>
<br>
             AC_LANG_PUSH([C++])<br>
             save_CXXFLAGS="$CXXFLAGS"<br>
@@ -2411,18 +2411,21 @@ if test -n "$with_gallium_drivers"; then<br>
             CXXFLAGS="$save_CXXFLAGS"<br>
<br>
             save_CXXFLAGS="$CXXFLAGS"<br>
-            CXXFLAGS="$AVX_CXXFLAGS $CXXFLAGS"<br>
+            CXXFLAGS="$SWR_AVX_CXXFLAGS $CXXFLAGS"<br>
             AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],[],<br>
                               [AC_MSG_ERROR([AVX compiler support not detected])])<br>
             CXXFLAGS="$save_CXXFLAGS"<br>
<br>
             save_CFLAGS="$CXXFLAGS"<br>
-            CXXFLAGS="$AVX2_CXXFLAGS $CXXFLAGS"<br>
+            CXXFLAGS="$SWR_AVX2_CXXFLAGS $CXXFLAGS"<br>
             AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],[],<br>
                               [AC_MSG_ERROR([AVX2 compiler support not detected])])<br>
             CXXFLAGS="$save_CXXFLAGS"<br>
             AC_LANG_POP([C++])<br>
<br>
+            AC_SUBST([SWR_AVX_CXXFLAGS])<br>
+            AC_SUBST([SWR_AVX2_CXXFLAGS])<br>
+<br>
             HAVE_GALLIUM_SWR=yes<br>
             ;;<br>
         xvc4)<br>
diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am<br>
index 8151e4a..d896154 100644<br>
--- a/src/gallium/drivers/swr/Makefile.am<br>
+++ b/src/gallium/drivers/swr/Makefile.am<br>
@@ -125,7 +125,7 @@ COMMON_LDFLAGS = \<br>
 lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la<br>
<br>
 libswrAVX_la_CXXFLAGS = \<br>
-       -march=core-avx-i \<br>
+       $(SWR_AVX_CXXFLAGS) \<br>
        -DKNOB_ARCH=KNOB_ARCH_AVX \<br>
        $(COMMON_CXXFLAGS)<br>
<br>
@@ -139,7 +139,7 @@ libswrAVX_la_LDFLAGS = \<br>
        $(COMMON_LDFLAGS)<br>
<br>
 libswrAVX2_la_CXXFLAGS = \<br>
-       -march=core-avx2 \<br>
+       $(SWR_AVX2_CXXFLAGS) \<br>
        -DKNOB_ARCH=KNOB_ARCH_AVX2 \<br>
        $(COMMON_CXXFLAGS)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br></div>