radeonsi: make emit_waitcnt externally accessible

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2017-05-15 23:06:08 +02:00
parent 3811730a37
commit 9252638afa
2 changed files with 12 additions and 10 deletions
+5 -10
View File
@@ -3407,12 +3407,7 @@ static void emit_optimization_barrier(struct si_shader_context *ctx,
}
}
/* Combine these with & instead of |. */
#define NOOP_WAITCNT 0xf7f
#define LGKM_CNT 0x07f
#define VM_CNT 0xf70
static void emit_waitcnt(struct si_shader_context *ctx, unsigned simm16)
void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16)
{
struct gallivm_state *gallivm = &ctx->gallivm;
LLVMBuilderRef builder = gallivm->builder;
@@ -3445,7 +3440,7 @@ static void membar_emit(
waitcnt &= LGKM_CNT;
if (waitcnt != NOOP_WAITCNT)
emit_waitcnt(ctx, waitcnt);
si_emit_waitcnt(ctx, waitcnt);
}
static void clock_emit(
@@ -3955,7 +3950,7 @@ static void load_emit(
}
if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE)
emit_waitcnt(ctx, VM_CNT);
si_emit_waitcnt(ctx, VM_CNT);
readonly_memory = !(inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) &&
is_oneway_access_only(inst, info,
@@ -4172,7 +4167,7 @@ static void store_emit(
}
if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE)
emit_waitcnt(ctx, VM_CNT);
si_emit_waitcnt(ctx, VM_CNT);
writeonly_memory = is_oneway_access_only(inst, info,
info->shader_buffers_load |
@@ -5689,7 +5684,7 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
*/
if (ctx->screen->b.chip_class == SI &&
ctx->type == PIPE_SHADER_TESS_CTRL) {
emit_waitcnt(ctx, LGKM_CNT & VM_CNT);
si_emit_waitcnt(ctx, LGKM_CNT & VM_CNT);
return;
}
@@ -287,6 +287,13 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base,
const struct tgsi_opcode_info *info,
LLVMValueRef dst[4]);
/* Combine these with & instead of |. */
#define NOOP_WAITCNT 0xf7f
#define LGKM_CNT 0x07f
#define VM_CNT 0xf70
void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16);
void si_shader_context_init_alu(struct lp_build_tgsi_context *bld_base);
#endif