summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-12-02 18:56:21 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-12-14 19:03:12 +0000
commit6f37d3067954a1ed70ea1a0bfe60783ba7b04166 (patch)
treef4d7d5de5b8366533078ba0d9170dbd21466c0f8 /src
parent1e8eb3ef80d07986738a33f599248e08fb78b2cf (diff)
downloadexternal_mesa3d-6f37d3067954a1ed70ea1a0bfe60783ba7b04166.zip
external_mesa3d-6f37d3067954a1ed70ea1a0bfe60783ba7b04166.tar.gz
external_mesa3d-6f37d3067954a1ed70ea1a0bfe60783ba7b04166.tar.bz2
radeonsi: allow specifying simm16 of emit_waitcnt at call sites
The next commit will use this. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 15e96c70b0b668a2626326d3572a247e41885c18)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 447900d..3a691f3 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3317,12 +3317,14 @@ static void emit_optimization_barrier(struct si_shader_context *ctx)
LLVMBuildCall(builder, inlineasm, NULL, 0, "");
}
-static void emit_waitcnt(struct si_shader_context *ctx)
+#define VM_CNT 0xf70
+
+static void emit_waitcnt(struct si_shader_context *ctx, unsigned simm16)
{
struct gallivm_state *gallivm = &ctx->gallivm;
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef args[1] = {
- lp_build_const_int32(gallivm, 0xf70)
+ lp_build_const_int32(gallivm, simm16)
};
lp_build_intrinsic(builder, "llvm.amdgcn.s.waitcnt",
ctx->voidt, args, 1, 0);
@@ -3335,7 +3337,7 @@ static void membar_emit(
{
struct si_shader_context *ctx = si_shader_context(bld_base);
- emit_waitcnt(ctx);
+ emit_waitcnt(ctx, VM_CNT);
}
static LLVMValueRef
@@ -3739,7 +3741,7 @@ static void load_emit(
}
if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE)
- emit_waitcnt(ctx);
+ emit_waitcnt(ctx, VM_CNT);
if (inst->Src[0].Register.File == TGSI_FILE_BUFFER) {
load_emit_buffer(ctx, emit_data);
@@ -3949,7 +3951,7 @@ static void store_emit(
}
if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE)
- emit_waitcnt(ctx);
+ emit_waitcnt(ctx, VM_CNT);
if (inst->Dst[0].Register.File == TGSI_FILE_BUFFER) {
store_emit_buffer(ctx, emit_data);