[Mesa-stable] [PATCH] gallivm: disable avx512 features

Jose Fonseca jfonseca at vmware.com
Mon May 9 13:12:44 UTC 2016


On 08/05/16 07:02, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> We don't target this yet, and some llvm versions incorrectly enable it based
> on cpu string, causing crashes.
> (Albeit this is a losing battle, it is pretty much guaranteed when the next
> new feature comes along llvm will mistakenly enable it on some future cpu,
> thus we would have to proactively disable all new features as llvm adds them.)
>
> This should fix https://bugs.freedesktop.org/show_bug.cgi?id=94291 (untested)
>
> CC: <mesa-stable at lists.freedesktop.org>
> ---
>   src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> index e47146a..af473a8 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
> @@ -566,6 +566,18 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
>      MAttrs.push_back(util_cpu_caps.has_avx  ? "+avx"  : "-avx");
>      MAttrs.push_back(util_cpu_caps.has_f16c ? "+f16c" : "-f16c");
>      MAttrs.push_back(util_cpu_caps.has_avx2 ? "+avx2" : "-avx2");
> +   /* disable avx512 and all subvariants */
> +#if HAVE_LLVM >= 0x0304
> +   MAttrs.push_back("-avx512cd");
> +   MAttrs.push_back("-avx512er");
> +   MAttrs.push_back("-avx512f");
> +   MAttrs.push_back("-avx512pf");
> +#endif
> +#if HAVE_LLVM >= 0x0305
> +   MAttrs.push_back("-avx512bw");
> +   MAttrs.push_back("-avx512dq");
> +   MAttrs.push_back("-avx512vl");
> +#endif
>   #endif
>
>   #if defined(PIPE_ARCH_PPC)
>

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-stable mailing list