radeonsi: use uint32_t to declare si_shader_key.opt.kill_outputs

the next patch will benefit from this

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák
2017-06-09 17:25:29 +02:00
parent 1621b33d73
commit 7b2240ac9c
3 changed files with 10 additions and 6 deletions
+5 -3
View File
@@ -2276,6 +2276,7 @@ static void si_llvm_export_vs(struct lp_build_tgsi_context *bld_base,
semantic_name = outputs[i].semantic_name;
semantic_index = outputs[i].semantic_index;
bool export_param = true;
unsigned id;
switch (semantic_name) {
case TGSI_SEMANTIC_POSITION: /* ignore these */
@@ -2289,8 +2290,8 @@ static void si_llvm_export_vs(struct lp_build_tgsi_context *bld_base,
break;
/* fall through */
default:
if (shader->key.opt.kill_outputs &
(1ull << si_shader_io_get_unique_index(semantic_name, semantic_index)))
id = si_shader_io_get_unique_index(semantic_name, semantic_index);
if (shader->key.opt.kill_outputs[id / 32] & (1u << (id % 32)))
export_param = false;
}
@@ -5335,7 +5336,8 @@ static void si_dump_shader_key(unsigned processor, const struct si_shader *shade
processor == PIPE_SHADER_TESS_EVAL ||
processor == PIPE_SHADER_VERTEX) &&
!key->as_es && !key->as_ls) {
fprintf(f, " opt.kill_outputs = 0x%"PRIx64"\n", key->opt.kill_outputs);
fprintf(f, " opt.kill_outputs[0] = 0x%x\n", key->opt.kill_outputs[0]);
fprintf(f, " opt.kill_outputs[1] = 0x%x\n", key->opt.kill_outputs[1]);
fprintf(f, " opt.clip_disable = %u\n", key->opt.clip_disable);
}
}
+2 -1
View File
@@ -501,7 +501,8 @@ struct si_shader_key {
/* Optimization flags for asynchronous compilation only. */
struct {
/* For HW VS (it can be VS, TES, GS) */
uint64_t kill_outputs; /* "get_unique_index" bits */
/* Don't use "uint64_t" in order to get 32-bit alignment. */
uint32_t kill_outputs[2]; /* "get_unique_index" bits */
unsigned clip_disable:1;
/* For shaders where monolithic variants have better code.
@@ -1241,9 +1241,10 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
inputs_read = ps->inputs_read;
}
uint64_t linked = outputs_written & inputs_read;
uint64_t kill_outputs = ~(outputs_written & inputs_read) & outputs_written;
key->opt.kill_outputs = ~linked & outputs_written;
key->opt.kill_outputs[0] = kill_outputs;
key->opt.kill_outputs[1] = kill_outputs >> 32;
}
/* Compute the key for the hw shader variant */