aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-04-26 16:16:58 -0400
committerMarek Olšák <[email protected]>2019-05-01 21:16:13 -0400
commitbfd3d504875a1f0c73ab1220c4a2a80c13a1703a (patch)
treea61c7318f691ec15e3f87942dd8f85de4a1fc0b7 /src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
parent181dcf0792f021f9118b25505b71b461d8a83549 (diff)
radeonsi: use new atomic LLVM helpers
This depends on "ac,ac/nir: use a better sync scope for shared atomics"
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
index eb90bfb10ff..5e540fc5098 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
@@ -783,6 +783,7 @@ static void atomic_emit_memory(struct si_shader_context *ctx,
LLVMBuilderRef builder = ctx->ac.builder;
const struct tgsi_full_instruction * inst = emit_data->inst;
LLVMValueRef ptr, result, arg;
+ const char *sync_scope = HAVE_LLVM >= 0x0900 ? "workgroup-one-as" : "workgroup";
ptr = get_memory_ptr(ctx, inst, ctx->i32, 1);
@@ -796,11 +797,8 @@ static void atomic_emit_memory(struct si_shader_context *ctx,
new_data = ac_to_integer(&ctx->ac, new_data);
- result = LLVMBuildAtomicCmpXchg(builder, ptr, arg, new_data,
- LLVMAtomicOrderingSequentiallyConsistent,
- LLVMAtomicOrderingSequentiallyConsistent,
- false);
-
+ result = ac_build_atomic_cmp_xchg(&ctx->ac, ptr, arg, new_data,
+ sync_scope);
result = LLVMBuildExtractValue(builder, result, 0, "");
} else {
LLVMAtomicRMWBinOp op;
@@ -837,9 +835,7 @@ static void atomic_emit_memory(struct si_shader_context *ctx,
unreachable("unknown atomic opcode");
}
- result = LLVMBuildAtomicRMW(builder, op, ptr, arg,
- LLVMAtomicOrderingSequentiallyConsistent,
- false);
+ result = ac_build_atomic_rmw(&ctx->ac, op, ptr, arg, sync_scope);
}
emit_data->output[emit_data->chan] =
LLVMBuildBitCast(builder, result, ctx->f32, "");