From: Roland Scheidegger Date: Tue, 30 Jul 2019 21:35:49 +0000 (+0200) Subject: gallivm: fix issue with AtomicCmpXchg wrapper on llvm 3.5-3.8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74baeacafc7c2e9bae0f4db9651b0c664d33f5ac;p=mesa.git 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 --- 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