Re: [Mesa-dev] [PATCH 2/2] configure/swr: add KNL and SKX architecture targets

2017-07-18 Thread Rowley, Timothy O

On Jul 17, 2017, at 11:51 AM, Emil Velikov 
mailto:emil.l.veli...@gmail.com>> wrote:

On 17 July 2017 at 15:08, Tim Rowley 
mailto:timothy.o.row...@intel.com>> wrote:
Not built by default.
---
configure.ac   | 16 ++
src/gallium/drivers/swr/Makefile.am| 38 ++
src/gallium/drivers/swr/swr_loader.cpp | 20 +-
3 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3a8fa4d7ea..4437c8189d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2518,6 +2518,20 @@ if test -n "$with_gallium_drivers"; then
AC_SUBST([SWR_AVX2_CXXFLAGS])
HAVE_SWR_AVX2=yes
;;
+xknl)
+swr_require_cxx_feature_flags "KNL" "defined(__AVX512F__) 
&& defined(__AVX512ER__)" \
+",-march=knl,-xMIC-AVX512" \
+SWR_KNL_CXXFLAGS
+AC_SUBST([SWR_KNL_CXXFLAGS])
+HAVE_SWR_KNL=yes
+;;
+xskx)
+swr_require_cxx_feature_flags "SKX" "defined(__AVX512F__) 
&& defined(__AVX512BW__)" \
+",-march=skylake-avx512,-xCORE-AVX512" \
+SWR_SKX_CXXFLAGS
+AC_SUBST([SWR_SKX_CXXFLAGS])
+HAVE_SWR_SKX=yes
+;;
Please update of the help string. Otherwise these two are completely
undocumented.


Will do.

Can I bribe you to add a Travis entries for the above? If it doesn't
take too long to build, you can it squash into the existing ones.

I’ll do that in a future patch; the avx512 code in swr as it currently exists 
in mesa-master only works on icc, which isn’t one of the Travis options.  We’re 
working on a patch which enables modern clang and gcc to also build it.


Thanks
Emil

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] configure/swr: add KNL and SKX architecture targets

2017-07-17 Thread Emil Velikov
On 17 July 2017 at 15:08, Tim Rowley  wrote:
> Not built by default.
> ---
>  configure.ac   | 16 ++
>  src/gallium/drivers/swr/Makefile.am| 38 
> ++
>  src/gallium/drivers/swr/swr_loader.cpp | 20 +-
>  3 files changed, 73 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3a8fa4d7ea..4437c8189d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2518,6 +2518,20 @@ if test -n "$with_gallium_drivers"; then
>  AC_SUBST([SWR_AVX2_CXXFLAGS])
>  HAVE_SWR_AVX2=yes
>  ;;
> +xknl)
> +swr_require_cxx_feature_flags "KNL" 
> "defined(__AVX512F__) && defined(__AVX512ER__)" \
> +",-march=knl,-xMIC-AVX512" \
> +SWR_KNL_CXXFLAGS
> +AC_SUBST([SWR_KNL_CXXFLAGS])
> +HAVE_SWR_KNL=yes
> +;;
> +xskx)
> +swr_require_cxx_feature_flags "SKX" 
> "defined(__AVX512F__) && defined(__AVX512BW__)" \
> +",-march=skylake-avx512,-xCORE-AVX512" \
> +SWR_SKX_CXXFLAGS
> +AC_SUBST([SWR_SKX_CXXFLAGS])
> +HAVE_SWR_SKX=yes
> +;;
Please update of the help string. Otherwise these two are completely
undocumented.

Can I bribe you to add a Travis entries for the above? If it doesn't
take too long to build, you can it squash into the existing ones.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] configure/swr: add KNL and SKX architecture targets

2017-07-17 Thread Tim Rowley
Not built by default.
---
 configure.ac   | 16 ++
 src/gallium/drivers/swr/Makefile.am| 38 ++
 src/gallium/drivers/swr/swr_loader.cpp | 20 +-
 3 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3a8fa4d7ea..4437c8189d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2518,6 +2518,20 @@ if test -n "$with_gallium_drivers"; then
 AC_SUBST([SWR_AVX2_CXXFLAGS])
 HAVE_SWR_AVX2=yes
 ;;
+xknl)
+swr_require_cxx_feature_flags "KNL" "defined(__AVX512F__) 
&& defined(__AVX512ER__)" \
+",-march=knl,-xMIC-AVX512" \
+SWR_KNL_CXXFLAGS
+AC_SUBST([SWR_KNL_CXXFLAGS])
+HAVE_SWR_KNL=yes
+;;
+xskx)
+swr_require_cxx_feature_flags "SKX" "defined(__AVX512F__) 
&& defined(__AVX512BW__)" \
+",-march=skylake-avx512,-xCORE-AVX512" \
+SWR_SKX_CXXFLAGS
+AC_SUBST([SWR_SKX_CXXFLAGS])
+HAVE_SWR_SKX=yes
+;;
 *)
 AC_MSG_ERROR([unknown SWR build architecture '$arch'])
 ;;
@@ -2563,6 +2577,8 @@ fi
 
 AM_CONDITIONAL(HAVE_SWR_AVX, test "x$HAVE_SWR_AVX" = xyes)
 AM_CONDITIONAL(HAVE_SWR_AVX2, test "x$HAVE_SWR_AVX2" = xyes)
+AM_CONDITIONAL(HAVE_SWR_KNL, test "x$HAVE_SWR_KNL" = xyes)
+AM_CONDITIONAL(HAVE_SWR_SKX, test "x$HAVE_SWR_SKX" = xyes)
 
 dnl We need to validate some needed dependencies for renderonly drivers.
 
diff --git a/src/gallium/drivers/swr/Makefile.am 
b/src/gallium/drivers/swr/Makefile.am
index f38ce7b1d9..6495021457 100644
--- a/src/gallium/drivers/swr/Makefile.am
+++ b/src/gallium/drivers/swr/Makefile.am
@@ -63,6 +63,14 @@ if HAVE_SWR_AVX2
 libmesaswr_la_CXXFLAGS += -DHAVE_SWR_AVX2
 endif
 
+if HAVE_SWR_KNL
+libmesaswr_la_CXXFLAGS += -DHAVE_SWR_KNL
+endif
+
+if HAVE_SWR_SKX
+libmesaswr_la_CXXFLAGS += -DHAVE_SWR_SKX
+endif
+
 COMMON_SOURCES = \
$(ARCHRAST_CXX_SOURCES) \
$(COMMON_CXX_SOURCES) \
@@ -263,6 +271,36 @@ libswrAVX2_la_LDFLAGS = \
$(COMMON_LDFLAGS)
 endif
 
+if HAVE_SWR_KNL
+lib_LTLIBRARIES += libswrKNL.la
+
+libswrKNL_la_CXXFLAGS = \
+   $(SWR_KNL_CXXFLAGS) \
+   -DKNOB_ARCH=KNOB_ARCH_AVX512 -DAVX512F_STRICT \
+   $(COMMON_CXXFLAGS)
+
+libswrKNL_la_SOURCES = \
+   $(COMMON_SOURCES)
+
+libswrKNL_la_LDFLAGS = \
+   $(COMMON_LDFLAGS)
+endif
+
+if HAVE_SWR_SKX
+lib_LTLIBRARIES += libswrSKX.la
+
+libswrSKX_la_CXXFLAGS = \
+   $(SWR_SKX_CXXFLAGS) \
+   -DKNOB_ARCH=KNOB_ARCH_AVX512 \
+   $(COMMON_CXXFLAGS)
+
+libswrSKX_la_SOURCES = \
+   $(COMMON_SOURCES)
+
+libswrSKX_la_LDFLAGS = \
+   $(COMMON_LDFLAGS)
+endif
+
 include $(top_srcdir)/install-gallium-links.mk
 
 # Generated gen_builder.hpp is not backwards compatible. So ship only one
diff --git a/src/gallium/drivers/swr/swr_loader.cpp 
b/src/gallium/drivers/swr/swr_loader.cpp
index 57ab4e4f66..bf57a13aed 100644
--- a/src/gallium/drivers/swr/swr_loader.cpp
+++ b/src/gallium/drivers/swr/swr_loader.cpp
@@ -37,7 +37,25 @@ swr_create_screen(struct sw_winsys *winsys)
util_dl_library *pLibrary = nullptr;
 
util_cpu_detect();
-   if (util_cpu_caps.has_avx2) {
+   if (util_cpu_caps.has_avx512f && util_cpu_caps.has_avx512bw) {
+  fprintf(stderr, "SKX");
+#if HAVE_SWR_SKX
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrSKX", UTIL_DL_EXT);
+#elif HAVE_SWR_AVX2
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrAVX2", UTIL_DL_EXT);
+#elif HAVE_SWR_AVX
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrAVX", UTIL_DL_EXT);
+#endif
+   } else if (util_cpu_caps.has_avx512f && util_cpu_caps.has_avx512er) {
+  fprintf(stderr, "KNL");
+#if HAVE_SWR_KNL
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrKNL", UTIL_DL_EXT);
+#elif HAVE_SWR_AVX2
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrAVX2", UTIL_DL_EXT);
+#elif HAVE_SWR_AVX
+  sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrAVX", UTIL_DL_EXT);
+#endif
+   } else if (util_cpu_caps.has_avx2) {
   fprintf(stderr, "AVX2");
 #if HAVE_SWR_AVX2
   sprintf(filename, "%s%s%s", UTIL_DL_PREFIX, "swrAVX2", UTIL_DL_EXT);
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev