From 74baeacafc7c2e9bae0f4db9651b0c664d33f5ac Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 30 Jul 2019 23:35:49 +0200 Subject: gallivm: fix issue with AtomicCmpXchg wrapper on llvm 3.5-3.8 These versions still need wrapper but already have both success and failure ordering. (Compile tested on llvm 3.3, 3.7, 3.8.) v2: don't duplicate whole function (suggested by Brian). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111102 Reviewed-by: Charmaine Lee Reviewed-by: Brian Paul --- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 79d10293e80..5fe697346fe 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -828,9 +828,11 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread) { - /* LLVM 3.8 doesn't have a second ordering and uses old SynchronizationScope enum */ return llvm::wrap(llvm::unwrap(B)->CreateAtomicCmpXchg(llvm::unwrap(Ptr), llvm::unwrap(Cmp), llvm::unwrap(New), mapFromLLVMOrdering(SuccessOrdering), +#if HAVE_LLVM >= 0x305 + mapFromLLVMOrdering(FailureOrdering), +#endif SingleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread)); } #endif -- cgit v1.2.3