From a807a9b215d1a6db7fc51478a6bf8fa873f51f58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Mon, 2 Apr 2018 14:12:50 +0200 Subject: [PATCH] ac/nir: fix atomic compare-and-swap The LLVM instruction returns { i32, i1 }, where the i1 indicates success. We're only interested in the first part, which is the loaded value. Fixes dEQP-GLES31.functional.compute.shared_var.atomic.compswap.* Reviewed-by: Timothy Arceri --- src/amd/common/ac_nir_to_llvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 45405d30fe8..6b519f78e0f 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -2631,6 +2631,7 @@ static LLVMValueRef visit_var_atomic(struct ac_nir_context *ctx, LLVMAtomicOrderingSequentiallyConsistent, LLVMAtomicOrderingSequentiallyConsistent, false); + result = LLVMBuildExtractValue(ctx->ac.builder, result, 0, ""); } else { LLVMAtomicRMWBinOp op; switch (instr->intrinsic) { -- 2.30.2