diff options
author | Samuel Pitoiset <[email protected]> | 2017-12-12 18:10:23 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-12-14 22:24:44 +0100 |
commit | 225b19880204024a805cc54b1001d09ef3b58054 (patch) | |
tree | 0eeb2c977d1f6fa7337a29512b73d4982c7e0f55 /src/gallium/drivers/radeonsi | |
parent | 24601810e9ea2847898e17a1b97323af89727585 (diff) |
amd/common: add ac_build_waitcnt()
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 13 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_internal.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c | 4 |
3 files changed, 4 insertions, 15 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 5e49d655fc6..02e24f0c748 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -3681,15 +3681,6 @@ static void si_llvm_return_fs_outputs(struct ac_shader_abi *abi, ctx->return_value = ret; } -void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16) -{ - LLVMValueRef args[1] = { - LLVMConstInt(ctx->i32, simm16, 0) - }; - lp_build_intrinsic(ctx->ac.builder, "llvm.amdgcn.s.waitcnt", - ctx->voidt, args, 1, 0); -} - static void membar_emit( const struct lp_build_tgsi_action *action, struct lp_build_tgsi_context *bld_base, @@ -3712,7 +3703,7 @@ static void membar_emit( waitcnt &= LGKM_CNT; if (waitcnt != NOOP_WAITCNT) - si_emit_waitcnt(ctx, waitcnt); + ac_build_waitcnt(&ctx->ac, waitcnt); } static void clock_emit( @@ -4198,7 +4189,7 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action, */ if (ctx->screen->info.chip_class == SI && ctx->type == PIPE_SHADER_TESS_CTRL) { - si_emit_waitcnt(ctx, LGKM_CNT & VM_CNT); + ac_build_waitcnt(&ctx->ac, LGKM_CNT & VM_CNT); return; } diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index f50a022db85..e05927c7fd9 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -294,8 +294,6 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base, #define LGKM_CNT 0x07f #define VM_CNT 0xf70 -void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16); - LLVMValueRef si_get_indirect_index(struct si_shader_context *ctx, const struct tgsi_ind_register *ind, unsigned addr_mul, int rel_index); diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c index 35ada5f93c8..099f86bd222 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c @@ -567,7 +567,7 @@ static void load_emit( } if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) - si_emit_waitcnt(ctx, VM_CNT); + ac_build_waitcnt(&ctx->ac, VM_CNT); can_speculate = !(inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) && is_oneway_access_only(inst, info, @@ -780,7 +780,7 @@ static void store_emit( } if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) - si_emit_waitcnt(ctx, VM_CNT); + ac_build_waitcnt(&ctx->ac, VM_CNT); writeonly_memory = is_oneway_access_only(inst, info, info->shader_buffers_load | |