Mesa (master): gallivm: Reenable PPC VSX (v3)

Emil Velikov evelikov at kemper.freedesktop.org
Mon Feb 20 18:24:16 UTC 2017


Module: Mesa
Branch: master
Commit: 3f1b6ef2aa9c99bebe539f1de5a5054d90fc5dc3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f1b6ef2aa9c99bebe539f1de5a5054d90fc5dc3

Author: Ben Crocker <bcrocker at redhat.com>
Date:   Wed Jan 18 20:44:09 2017 -0500

gallivm: Reenable PPC VSX (v3)

Reenable the PPC64LE Vector-Scalar Extension for LLVM versions >= 3.8.1,
now that LLVM bug 26775 and its corollary, 25503, are fixed.

Amendment: remove extraneous spaces in macro def & invocations.

We would prefer a runtime check, e.g. via an LLVMQueryString
(analogous to glGetString, eglQueryString) or LLVMGetVersion API,
but no such API exists at this time.

Signed-off-by: Ben Crocker <bcrocker at redhat.com>
[Emil Velikov: remove LLVM_VERSION macro]
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 6c64e4d..e005469 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -607,7 +607,8 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
 
 #if defined(PIPE_ARCH_PPC)
    MAttrs.push_back(util_cpu_caps.has_altivec ? "+altivec" : "-altivec");
-#if HAVE_LLVM >= 0x0304
+#if (HAVE_LLVM >= 0x0304)
+#if (HAVE_LLVM <= 0x0307) || (HAVE_LLVM == 0x0308 && MESA_LLVM_VERSION_PATCH == 0)
    /*
     * Make sure VSX instructions are disabled
     * See LLVM bug https://llvm.org/bugs/show_bug.cgi?id=25503#c7
@@ -615,6 +616,17 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    if (util_cpu_caps.has_altivec) {
       MAttrs.push_back("-vsx");
    }
+#else
+   /*
+    * However, bug 25503 is fixed, by the same fix that fixed
+    * bug 26775, in versions of LLVM later than 3.8 (starting with 3.8.1):
+    * Make sure VSX instructions are ENABLED
+    * See LLVM bug https://llvm.org/bugs/show_bug.cgi?id=26775
+    */
+   if (util_cpu_caps.has_altivec) {
+      MAttrs.push_back("+vsx");
+   }
+#endif
 #endif
 #endif
 




More information about the mesa-commit mailing list