summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2019-09-12 13:07:05 -0400
committerAdam Jackson <[email protected]>2019-09-12 20:09:12 -0400
commit5a9dec7534c09b7eb1646085517dcce5ff48033c (patch)
tree7145b1bc2967803856d4eb886457cb793ee7794c /src/gallium/auxiliary/gallivm
parent2efc80489274b753b3e89862bc2ad75d7b31f32a (diff)
gallium: Restore VSX for llvm >= 4
Accidentally dropped in 4fdd455eeb7cffadee86f06c685005a3b64ce94b. Fixes: 4fdd455e ("gallium: Require LLVM >= 3.4) Reported-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 3580ea6dd4b..52e9f7bc770 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -410,6 +410,20 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
if (util_cpu_caps.has_altivec) {
MAttrs.push_back("-vsx");
}
+#else
+ /*
+ * 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).
+ * BZ 33531 actually comprises more than one bug, all of
+ * which are fixed in LLVM 4.0.
+ *
+ * With LLVM 4.0 or higher:
+ * Make sure VSX instructions are ENABLED (if supported), unless
+ * VSX instructions are explicitly enabled/disabled via GALLIVM_VSX=1 or 0.
+ */
+ if (util_cpu_caps.has_altivec) {
+ MAttrs.push_back(util_cpu_caps.has_vsx ? "+vsx" : "-vsx");
+ }
#endif
#endif