Mesa (staging/19.0): gallivm: disable NEON instructions if they are not supported

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 23 18:49:17 UTC 2019


Module: Mesa
Branch: staging/19.0
Commit: 91671ec1f4891eae84c1bd13a77c613962a0cd52
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=91671ec1f4891eae84c1bd13a77c613962a0cd52

Author: Lubomir Rintel <lkundrak at v3.sk>
Date:   Mon Mar 11 21:18:48 2019 +0100

gallivm: disable NEON instructions if they are not supported

The LLVM project made some questionable decisions about defaults for
armv7 (e.g. they enable NEON that is not there on NVIDIA and Marvell
platforms).

On top of that, getHostCPUFeatures() doesn't disable missing machine
attributes. Finally, -neon alone is not sufficient to disable emmision
of NEON instructions.

Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
Cc: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
(cherry picked from commit e983a975c6843c307380d7caa083eee89e02bd3c)

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index f3b5784fce7..f307c26d4f7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -625,6 +625,13 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    MAttrs.push_back("-avx512vl");
 #endif
 #endif
+#if defined(PIPE_ARCH_ARM)
+   if (!util_cpu_caps.has_neon) {
+      MAttrs.push_back("-neon");
+      MAttrs.push_back("-crypto");
+      MAttrs.push_back("-vfp2");
+   }
+#endif
 
 #if defined(PIPE_ARCH_PPC)
    MAttrs.push_back(util_cpu_caps.has_altivec ? "+altivec" : "-altivec");




More information about the mesa-commit mailing list